Class: Merge::Hris::Employee
- Inherits:
-
Object
- Object
- Merge::Hris::Employee
- Defined in:
- lib/merge_ruby_client/hris/types/employee.rb
Overview
# The Employee Object
### Description
The `Employee` object is used to represent any person who has been employed by a
company.
### Usage Example
Fetch from the `LIST Employee` endpoint and filter by `ID` to show all
employees.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#avatar ⇒ String
readonly
The URL of the employee’s avatar image.
-
#company ⇒ Merge::Hris::EmployeeCompany
readonly
The ID of the employee’s company.
-
#created_at ⇒ DateTime
readonly
The datetime that this object was created by Merge.
-
#custom_fields ⇒ Hash{String => Object}
readonly
Custom fields configured for a given model.
-
#date_of_birth ⇒ DateTime
readonly
The employee’s date of birth.
-
#display_full_name ⇒ String
readonly
The employee’s full name, to use for display purposes.
-
#employee_number ⇒ String
readonly
The employee’s number that appears in the third-party integration’s UI.
-
#employment_status ⇒ Merge::Hris::EmploymentStatusEnum
readonly
The employment status of the employee.
-
#employments ⇒ Array<Merge::Hris::EmployeeEmploymentsItem>
readonly
Array of ‘Employment` IDs for this Employee.
-
#ethnicity ⇒ Merge::Hris::EthnicityEnum
readonly
The employee’s ethnicity.
- #field_mappings ⇒ Hash{String => Object} readonly
-
#first_name ⇒ String
readonly
The employee’s first name.
-
#gender ⇒ Merge::Hris::GenderEnum
readonly
The employee’s gender.
- #groups ⇒ Array<Merge::Hris::EmployeeGroupsItem> readonly
-
#hire_date ⇒ DateTime
readonly
The date that the employee was hired, usually the day that an offer letter is signed.
-
#home_location ⇒ Merge::Hris::EmployeeHomeLocation
readonly
The employee’s home address.
- #id ⇒ String readonly
-
#last_name ⇒ String
readonly
The employee’s last name.
-
#manager ⇒ Merge::Hris::EmployeeManager
readonly
The employee ID of the employee’s manager.
-
#marital_status ⇒ Merge::Hris::MaritalStatusEnum
readonly
The employee’s filing status as related to marital status.
-
#mobile_phone_number ⇒ String
readonly
The employee’s mobile phone number.
-
#modified_at ⇒ DateTime
readonly
The datetime that this object was modified by Merge.
-
#pay_group ⇒ Merge::Hris::EmployeePayGroup
readonly
The employee’s pay group.
-
#personal_email ⇒ String
readonly
The employee’s personal email.
-
#preferred_name ⇒ String
readonly
The employee’s preferred first name.
-
#remote_created_at ⇒ DateTime
readonly
When the third party’s employee was created.
- #remote_data ⇒ Array<Merge::Hris::RemoteData> readonly
-
#remote_id ⇒ String
readonly
The third-party API ID of the matching object.
- #remote_was_deleted ⇒ Boolean readonly
-
#ssn ⇒ String
readonly
The employee’s social security number.
-
#start_date ⇒ DateTime
readonly
The date that the employee started working.
-
#team ⇒ Merge::Hris::EmployeeTeam
readonly
The employee’s team.
-
#termination_date ⇒ DateTime
readonly
The employee’s termination date.
-
#username ⇒ String
readonly
The employee’s username that appears in the remote UI.
-
#work_email ⇒ String
readonly
The employee’s work email.
-
#work_location ⇒ Merge::Hris::EmployeeWorkLocation
readonly
The employee’s work address.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Merge::Hris::Employee
Deserialize a JSON object to an instance of Employee.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(id: OMIT, remote_id: OMIT, created_at: OMIT, modified_at: OMIT, employee_number: OMIT, company: OMIT, first_name: OMIT, last_name: OMIT, preferred_name: OMIT, display_full_name: OMIT, username: OMIT, groups: OMIT, work_email: OMIT, personal_email: OMIT, mobile_phone_number: OMIT, employments: OMIT, home_location: OMIT, work_location: OMIT, manager: OMIT, team: OMIT, pay_group: OMIT, ssn: OMIT, gender: OMIT, ethnicity: OMIT, marital_status: OMIT, date_of_birth: OMIT, hire_date: OMIT, start_date: OMIT, remote_created_at: OMIT, employment_status: OMIT, termination_date: OMIT, avatar: OMIT, custom_fields: OMIT, remote_was_deleted: OMIT, field_mappings: OMIT, remote_data: OMIT, additional_properties: nil) ⇒ Merge::Hris::Employee constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of Employee to a JSON object.
Constructor Details
#initialize(id: OMIT, remote_id: OMIT, created_at: OMIT, modified_at: OMIT, employee_number: OMIT, company: OMIT, first_name: OMIT, last_name: OMIT, preferred_name: OMIT, display_full_name: OMIT, username: OMIT, groups: OMIT, work_email: OMIT, personal_email: OMIT, mobile_phone_number: OMIT, employments: OMIT, home_location: OMIT, work_location: OMIT, manager: OMIT, team: OMIT, pay_group: OMIT, ssn: OMIT, gender: OMIT, ethnicity: OMIT, marital_status: OMIT, date_of_birth: OMIT, hire_date: OMIT, start_date: OMIT, remote_created_at: OMIT, employment_status: OMIT, termination_date: OMIT, avatar: OMIT, custom_fields: OMIT, remote_was_deleted: OMIT, field_mappings: OMIT, remote_data: OMIT, additional_properties: nil) ⇒ Merge::Hris::Employee
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 239 240 241 242 243 244 245 246 247 248 249 250 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 279 280 281 282 283 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 204 def initialize(id: OMIT, remote_id: OMIT, created_at: OMIT, modified_at: OMIT, employee_number: OMIT, company: OMIT, first_name: OMIT, last_name: OMIT, preferred_name: OMIT, display_full_name: OMIT, username: OMIT, groups: OMIT, work_email: OMIT, personal_email: OMIT, mobile_phone_number: OMIT, employments: OMIT, home_location: OMIT, work_location: OMIT, manager: OMIT, team: OMIT, pay_group: OMIT, ssn: OMIT, gender: OMIT, ethnicity: OMIT, marital_status: OMIT, date_of_birth: OMIT, hire_date: OMIT, start_date: OMIT, remote_created_at: OMIT, employment_status: OMIT, termination_date: OMIT, avatar: OMIT, custom_fields: OMIT, remote_was_deleted: OMIT, field_mappings: OMIT, remote_data: OMIT, additional_properties: nil) @id = id if id != OMIT @remote_id = remote_id if remote_id != OMIT @created_at = created_at if created_at != OMIT @modified_at = modified_at if modified_at != OMIT @employee_number = employee_number if employee_number != OMIT @company = company if company != OMIT @first_name = first_name if first_name != OMIT @last_name = last_name if last_name != OMIT @preferred_name = preferred_name if preferred_name != OMIT @display_full_name = display_full_name if display_full_name != OMIT @username = username if username != OMIT @groups = groups if groups != OMIT @work_email = work_email if work_email != OMIT @personal_email = personal_email if personal_email != OMIT @mobile_phone_number = mobile_phone_number if mobile_phone_number != OMIT @employments = employments if employments != OMIT @home_location = home_location if home_location != OMIT @work_location = work_location if work_location != OMIT @manager = manager if manager != OMIT @team = team if team != OMIT @pay_group = pay_group if pay_group != OMIT @ssn = ssn if ssn != OMIT @gender = gender if gender != OMIT @ethnicity = ethnicity if ethnicity != OMIT @marital_status = marital_status if marital_status != OMIT @date_of_birth = date_of_birth if date_of_birth != OMIT @hire_date = hire_date if hire_date != OMIT @start_date = start_date if start_date != OMIT @remote_created_at = remote_created_at if remote_created_at != OMIT @employment_status = employment_status if employment_status != OMIT @termination_date = termination_date if termination_date != OMIT @avatar = avatar if avatar != OMIT @custom_fields = custom_fields if custom_fields != OMIT @remote_was_deleted = remote_was_deleted if remote_was_deleted != OMIT @field_mappings = field_mappings if field_mappings != OMIT @remote_data = remote_data if remote_data != OMIT @additional_properties = additional_properties @_field_set = { "id": id, "remote_id": remote_id, "created_at": created_at, "modified_at": modified_at, "employee_number": employee_number, "company": company, "first_name": first_name, "last_name": last_name, "preferred_name": preferred_name, "display_full_name": display_full_name, "username": username, "groups": groups, "work_email": work_email, "personal_email": personal_email, "mobile_phone_number": mobile_phone_number, "employments": employments, "home_location": home_location, "work_location": work_location, "manager": manager, "team": team, "pay_group": pay_group, "ssn": ssn, "gender": gender, "ethnicity": ethnicity, "marital_status": marital_status, "date_of_birth": date_of_birth, "hire_date": hire_date, "start_date": start_date, "remote_created_at": remote_created_at, "employment_status": employment_status, "termination_date": termination_date, "avatar": avatar, "custom_fields": custom_fields, "remote_was_deleted": remote_was_deleted, "field_mappings": field_mappings, "remote_data": remote_data }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
131 132 133 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 131 def additional_properties @additional_properties end |
#avatar ⇒ String (readonly)
Returns The URL of the employee’s avatar image.
121 122 123 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 121 def avatar @avatar end |
#company ⇒ Merge::Hris::EmployeeCompany (readonly)
Returns The ID of the employee’s company.
41 42 43 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 41 def company @company end |
#created_at ⇒ DateTime (readonly)
Returns The datetime that this object was created by Merge.
35 36 37 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 35 def created_at @created_at end |
#custom_fields ⇒ Hash{String => Object} (readonly)
Returns Custom fields configured for a given model.
123 124 125 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 123 def custom_fields @custom_fields end |
#date_of_birth ⇒ DateTime (readonly)
Returns The employee’s date of birth.
102 103 104 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 102 def date_of_birth @date_of_birth end |
#display_full_name ⇒ String (readonly)
Returns The employee’s full name, to use for display purposes. If a preferred first name is available, the full name will include the preferred first name.
50 51 52 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 50 def display_full_name @display_full_name end |
#employee_number ⇒ String (readonly)
Returns The employee’s number that appears in the third-party integration’s UI.
39 40 41 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 39 def employee_number @employee_number end |
#employment_status ⇒ Merge::Hris::EmploymentStatusEnum (readonly)
Returns The employment status of the employee.
-
‘ACTIVE` - ACTIVE
-
‘PENDING` - PENDING
-
‘INACTIVE` - INACTIVE.
117 118 119 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 117 def employment_status @employment_status end |
#employments ⇒ Array<Merge::Hris::EmployeeEmploymentsItem> (readonly)
Returns Array of ‘Employment` IDs for this Employee.
62 63 64 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 62 def employments @employments end |
#ethnicity ⇒ Merge::Hris::EthnicityEnum (readonly)
Returns The employee’s ethnicity.
-
‘AMERICAN_INDIAN_OR_ALASKA_NATIVE` - AMERICAN_INDIAN_OR_ALASKA_NATIVE
-
‘ASIAN_OR_INDIAN_SUBCONTINENT` - ASIAN_OR_INDIAN_SUBCONTINENT
-
‘BLACK_OR_AFRICAN_AMERICAN` - BLACK_OR_AFRICAN_AMERICAN
-
‘HISPANIC_OR_LATINO` - HISPANIC_OR_LATINO
-
‘NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER` -
NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER
-
‘TWO_OR_MORE_RACES` - TWO_OR_MORE_RACES
-
‘WHITE` - WHITE
-
‘PREFER_NOT_TO_DISCLOSE` - PREFER_NOT_TO_DISCLOSE.
92 93 94 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 92 def ethnicity @ethnicity end |
#field_mappings ⇒ Hash{String => Object} (readonly)
127 128 129 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 127 def field_mappings @field_mappings end |
#first_name ⇒ String (readonly)
Returns The employee’s first name.
43 44 45 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 43 def first_name @first_name end |
#gender ⇒ Merge::Hris::GenderEnum (readonly)
Returns The employee’s gender.
-
‘MALE` - MALE
-
‘FEMALE` - FEMALE
-
‘NON-BINARY` - NON-BINARY
-
‘OTHER` - OTHER
-
‘PREFER_NOT_TO_DISCLOSE` - PREFER_NOT_TO_DISCLOSE.
81 82 83 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 81 def gender @gender end |
#groups ⇒ Array<Merge::Hris::EmployeeGroupsItem> (readonly)
54 55 56 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 54 def groups @groups end |
#hire_date ⇒ DateTime (readonly)
Returns The date that the employee was hired, usually the day that an offer letter is signed. If an employee has multiple hire dates from previous employments, this represents the most recent hire date. Note: If you’re looking for the employee’s start date, refer to the start_date field.
107 108 109 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 107 def hire_date @hire_date end |
#home_location ⇒ Merge::Hris::EmployeeHomeLocation (readonly)
Returns The employee’s home address.
64 65 66 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 64 def home_location @home_location end |
#id ⇒ String (readonly)
31 32 33 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 31 def id @id end |
#last_name ⇒ String (readonly)
Returns The employee’s last name.
45 46 47 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 45 def last_name @last_name end |
#manager ⇒ Merge::Hris::EmployeeManager (readonly)
Returns The employee ID of the employee’s manager.
68 69 70 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 68 def manager @manager end |
#marital_status ⇒ Merge::Hris::MaritalStatusEnum (readonly)
Returns The employee’s filing status as related to marital status.
-
‘SINGLE` - SINGLE
-
‘MARRIED_FILING_JOINTLY` - MARRIED_FILING_JOINTLY
-
‘MARRIED_FILING_SEPARATELY` - MARRIED_FILING_SEPARATELY
-
‘HEAD_OF_HOUSEHOLD` - HEAD_OF_HOUSEHOLD
-
‘QUALIFYING_WIDOW_OR_WIDOWER_WITH_DEPENDENT_CHILD` -
QUALIFYING_WIDOW_OR_WIDOWER_WITH_DEPENDENT_CHILD.
100 101 102 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 100 def marital_status @marital_status end |
#mobile_phone_number ⇒ String (readonly)
Returns The employee’s mobile phone number.
60 61 62 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 60 def mobile_phone_number @mobile_phone_number end |
#modified_at ⇒ DateTime (readonly)
Returns The datetime that this object was modified by Merge.
37 38 39 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 37 def modified_at @modified_at end |
#pay_group ⇒ Merge::Hris::EmployeePayGroup (readonly)
Returns The employee’s pay group.
72 73 74 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 72 def pay_group @pay_group end |
#personal_email ⇒ String (readonly)
Returns The employee’s personal email.
58 59 60 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 58 def personal_email @personal_email end |
#preferred_name ⇒ String (readonly)
Returns The employee’s preferred first name.
47 48 49 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 47 def preferred_name @preferred_name end |
#remote_created_at ⇒ DateTime (readonly)
Returns When the third party’s employee was created.
112 113 114 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 112 def remote_created_at @remote_created_at end |
#remote_data ⇒ Array<Merge::Hris::RemoteData> (readonly)
129 130 131 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 129 def remote_data @remote_data end |
#remote_id ⇒ String (readonly)
Returns The third-party API ID of the matching object.
33 34 35 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 33 def remote_id @remote_id end |
#remote_was_deleted ⇒ Boolean (readonly)
125 126 127 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 125 def remote_was_deleted @remote_was_deleted end |
#ssn ⇒ String (readonly)
Returns The employee’s social security number.
74 75 76 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 74 def ssn @ssn end |
#start_date ⇒ DateTime (readonly)
Returns The date that the employee started working. If an employee was rehired, the most recent start date will be returned.
110 111 112 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 110 def start_date @start_date end |
#team ⇒ Merge::Hris::EmployeeTeam (readonly)
Returns The employee’s team.
70 71 72 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 70 def team @team end |
#termination_date ⇒ DateTime (readonly)
Returns The employee’s termination date.
119 120 121 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 119 def termination_date @termination_date end |
#username ⇒ String (readonly)
Returns The employee’s username that appears in the remote UI.
52 53 54 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 52 def username @username end |
#work_email ⇒ String (readonly)
Returns The employee’s work email.
56 57 58 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 56 def work_email @work_email end |
#work_location ⇒ Merge::Hris::EmployeeWorkLocation (readonly)
Returns The employee’s work address.
66 67 68 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 66 def work_location @work_location end |
Class Method Details
.from_json(json_object:) ⇒ Merge::Hris::Employee
Deserialize a JSON object to an instance of Employee
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 289 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) id = parsed_json["id"] remote_id = parsed_json["remote_id"] created_at = (DateTime.parse(parsed_json["created_at"]) unless parsed_json["created_at"].nil?) modified_at = (DateTime.parse(parsed_json["modified_at"]) unless parsed_json["modified_at"].nil?) employee_number = parsed_json["employee_number"] if parsed_json["company"].nil? company = nil else company = parsed_json["company"].to_json company = Merge::Hris::EmployeeCompany.from_json(json_object: company) end first_name = parsed_json["first_name"] last_name = parsed_json["last_name"] preferred_name = parsed_json["preferred_name"] display_full_name = parsed_json["display_full_name"] username = parsed_json["username"] groups = parsed_json["groups"]&.map do |item| item = item.to_json Merge::Hris::EmployeeGroupsItem.from_json(json_object: item) end work_email = parsed_json["work_email"] personal_email = parsed_json["personal_email"] mobile_phone_number = parsed_json["mobile_phone_number"] employments = parsed_json["employments"]&.map do |item| item = item.to_json Merge::Hris::EmployeeEmploymentsItem.from_json(json_object: item) end if parsed_json["home_location"].nil? home_location = nil else home_location = parsed_json["home_location"].to_json home_location = Merge::Hris::EmployeeHomeLocation.from_json(json_object: home_location) end if parsed_json["work_location"].nil? work_location = nil else work_location = parsed_json["work_location"].to_json work_location = Merge::Hris::EmployeeWorkLocation.from_json(json_object: work_location) end if parsed_json["manager"].nil? manager = nil else manager = parsed_json["manager"].to_json manager = Merge::Hris::EmployeeManager.from_json(json_object: manager) end if parsed_json["team"].nil? team = nil else team = parsed_json["team"].to_json team = Merge::Hris::EmployeeTeam.from_json(json_object: team) end if parsed_json["pay_group"].nil? pay_group = nil else pay_group = parsed_json["pay_group"].to_json pay_group = Merge::Hris::EmployeePayGroup.from_json(json_object: pay_group) end ssn = parsed_json["ssn"] gender = parsed_json["gender"] ethnicity = parsed_json["ethnicity"] marital_status = parsed_json["marital_status"] date_of_birth = (DateTime.parse(parsed_json["date_of_birth"]) unless parsed_json["date_of_birth"].nil?) hire_date = (DateTime.parse(parsed_json["hire_date"]) unless parsed_json["hire_date"].nil?) start_date = (DateTime.parse(parsed_json["start_date"]) unless parsed_json["start_date"].nil?) remote_created_at = unless parsed_json["remote_created_at"].nil? DateTime.parse(parsed_json["remote_created_at"]) end employment_status = parsed_json["employment_status"] termination_date = (DateTime.parse(parsed_json["termination_date"]) unless parsed_json["termination_date"].nil?) avatar = parsed_json["avatar"] custom_fields = parsed_json["custom_fields"] remote_was_deleted = parsed_json["remote_was_deleted"] field_mappings = parsed_json["field_mappings"] remote_data = parsed_json["remote_data"]&.map do |item| item = item.to_json Merge::Hris::RemoteData.from_json(json_object: item) end new( id: id, remote_id: remote_id, created_at: created_at, modified_at: modified_at, employee_number: employee_number, company: company, first_name: first_name, last_name: last_name, preferred_name: preferred_name, display_full_name: display_full_name, username: username, groups: groups, work_email: work_email, personal_email: personal_email, mobile_phone_number: mobile_phone_number, employments: employments, home_location: home_location, work_location: work_location, manager: manager, team: team, pay_group: pay_group, ssn: ssn, gender: gender, ethnicity: ethnicity, marital_status: marital_status, date_of_birth: date_of_birth, hire_date: hire_date, start_date: start_date, remote_created_at: remote_created_at, employment_status: employment_status, termination_date: termination_date, avatar: avatar, custom_fields: custom_fields, remote_was_deleted: remote_was_deleted, field_mappings: field_mappings, remote_data: remote_data, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given
hash and check each fields type against the current object's property
definitions.
423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 423 def self.validate_raw(obj:) obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.") obj.remote_id&.is_a?(String) != false || raise("Passed value for field obj.remote_id is not the expected type, validation failed.") obj.created_at&.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.") obj.modified_at&.is_a?(DateTime) != false || raise("Passed value for field obj.modified_at is not the expected type, validation failed.") obj.employee_number&.is_a?(String) != false || raise("Passed value for field obj.employee_number is not the expected type, validation failed.") obj.company.nil? || Merge::Hris::EmployeeCompany.validate_raw(obj: obj.company) obj.first_name&.is_a?(String) != false || raise("Passed value for field obj.first_name 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.preferred_name&.is_a?(String) != false || raise("Passed value for field obj.preferred_name is not the expected type, validation failed.") obj.display_full_name&.is_a?(String) != false || raise("Passed value for field obj.display_full_name is not the expected type, validation failed.") obj.username&.is_a?(String) != false || raise("Passed value for field obj.username is not the expected type, validation failed.") obj.groups&.is_a?(Array) != false || raise("Passed value for field obj.groups 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.personal_email&.is_a?(String) != false || raise("Passed value for field obj.personal_email is not the expected type, validation failed.") obj.mobile_phone_number&.is_a?(String) != false || raise("Passed value for field obj.mobile_phone_number is not the expected type, validation failed.") obj.employments&.is_a?(Array) != false || raise("Passed value for field obj.employments is not the expected type, validation failed.") obj.home_location.nil? || Merge::Hris::EmployeeHomeLocation.validate_raw(obj: obj.home_location) obj.work_location.nil? || Merge::Hris::EmployeeWorkLocation.validate_raw(obj: obj.work_location) obj.manager.nil? || Merge::Hris::EmployeeManager.validate_raw(obj: obj.manager) obj.team.nil? || Merge::Hris::EmployeeTeam.validate_raw(obj: obj.team) obj.pay_group.nil? || Merge::Hris::EmployeePayGroup.validate_raw(obj: obj.pay_group) obj.ssn&.is_a?(String) != false || raise("Passed value for field obj.ssn is not the expected type, validation failed.") obj.gender&.is_a?(Merge::Hris::GenderEnum) != false || raise("Passed value for field obj.gender is not the expected type, validation failed.") obj.ethnicity&.is_a?(Merge::Hris::EthnicityEnum) != false || raise("Passed value for field obj.ethnicity is not the expected type, validation failed.") obj.marital_status&.is_a?(Merge::Hris::MaritalStatusEnum) != false || raise("Passed value for field obj.marital_status is not the expected type, validation failed.") obj.date_of_birth&.is_a?(DateTime) != false || raise("Passed value for field obj.date_of_birth is not the expected type, validation failed.") obj.hire_date&.is_a?(DateTime) != false || raise("Passed value for field obj.hire_date is not the expected type, validation failed.") obj.start_date&.is_a?(DateTime) != false || raise("Passed value for field obj.start_date is not the expected type, validation failed.") obj.remote_created_at&.is_a?(DateTime) != false || raise("Passed value for field obj.remote_created_at is not the expected type, validation failed.") obj.employment_status&.is_a?(Merge::Hris::EmploymentStatusEnum) != false || raise("Passed value for field obj.employment_status is not the expected type, validation failed.") obj.termination_date&.is_a?(DateTime) != false || raise("Passed value for field obj.termination_date is not the expected type, validation failed.") obj.avatar&.is_a?(String) != false || raise("Passed value for field obj.avatar is not the expected type, validation failed.") obj.custom_fields&.is_a?(Hash) != false || raise("Passed value for field obj.custom_fields is not the expected type, validation failed.") obj.remote_was_deleted&.is_a?(Boolean) != false || raise("Passed value for field obj.remote_was_deleted is not the expected type, validation failed.") obj.field_mappings&.is_a?(Hash) != false || raise("Passed value for field obj.field_mappings is not the expected type, validation failed.") obj.remote_data&.is_a?(Array) != false || raise("Passed value for field obj.remote_data is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of Employee to a JSON object
413 414 415 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 413 def to_json(*_args) @_field_set&.to_json end |