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. By default, it returns all employees. To filter for only active
employees, set the `employment_status` query parameter to `ACTIVE`.
### 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
Indicates whether or not this object has been deleted in the third party platform.
-
#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
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 284 285 286 287 288 289 290 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 211 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.
135 136 137 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 135 def additional_properties @additional_properties end |
#avatar ⇒ String (readonly)
Returns The URL of the employee’s avatar image.
122 123 124 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 122 def avatar @avatar end |
#company ⇒ Merge::Hris::EmployeeCompany (readonly)
Returns The ID of the employee’s company.
42 43 44 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 42 def company @company end |
#created_at ⇒ DateTime (readonly)
Returns The datetime that this object was created by Merge.
36 37 38 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 36 def created_at @created_at end |
#custom_fields ⇒ Hash{String => Object} (readonly)
Returns Custom fields configured for a given model.
124 125 126 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 124 def custom_fields @custom_fields end |
#date_of_birth ⇒ DateTime (readonly)
Returns The employee’s date of birth.
103 104 105 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 103 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.
51 52 53 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 51 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.
40 41 42 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 40 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.
118 119 120 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 118 def employment_status @employment_status end |
#employments ⇒ Array<Merge::Hris::EmployeeEmploymentsItem> (readonly)
Returns Array of ‘Employment` IDs for this Employee.
63 64 65 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 63 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.
93 94 95 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 93 def ethnicity @ethnicity end |
#field_mappings ⇒ Hash{String => Object} (readonly)
131 132 133 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 131 def field_mappings @field_mappings end |
#first_name ⇒ String (readonly)
Returns The employee’s first name.
44 45 46 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 44 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.
82 83 84 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 82 def gender @gender end |
#groups ⇒ Array<Merge::Hris::EmployeeGroupsItem> (readonly)
55 56 57 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 55 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.
108 109 110 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 108 def hire_date @hire_date end |
#home_location ⇒ Merge::Hris::EmployeeHomeLocation (readonly)
Returns The employee’s home address.
65 66 67 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 65 def home_location @home_location end |
#id ⇒ String (readonly)
32 33 34 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 32 def id @id end |
#last_name ⇒ String (readonly)
Returns The employee’s last name.
46 47 48 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 46 def last_name @last_name end |
#manager ⇒ Merge::Hris::EmployeeManager (readonly)
Returns The employee ID of the employee’s manager.
69 70 71 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 69 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.
101 102 103 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 101 def marital_status @marital_status end |
#mobile_phone_number ⇒ String (readonly)
Returns The employee’s mobile phone number.
61 62 63 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 61 def mobile_phone_number @mobile_phone_number end |
#modified_at ⇒ DateTime (readonly)
Returns The datetime that this object was modified by Merge.
38 39 40 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 38 def modified_at @modified_at end |
#pay_group ⇒ Merge::Hris::EmployeePayGroup (readonly)
Returns The employee’s pay group.
73 74 75 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 73 def pay_group @pay_group end |
#personal_email ⇒ String (readonly)
Returns The employee’s personal email.
59 60 61 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 59 def personal_email @personal_email end |
#preferred_name ⇒ String (readonly)
Returns The employee’s preferred first name.
48 49 50 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 48 def preferred_name @preferred_name end |
#remote_created_at ⇒ DateTime (readonly)
Returns When the third party’s employee was created.
113 114 115 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 113 def remote_created_at @remote_created_at end |
#remote_data ⇒ Array<Merge::Hris::RemoteData> (readonly)
133 134 135 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 133 def remote_data @remote_data end |
#remote_id ⇒ String (readonly)
Returns The third-party API ID of the matching object.
34 35 36 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 34 def remote_id @remote_id end |
#remote_was_deleted ⇒ Boolean (readonly)
Returns Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](docs.merge.dev/integrations/hris/supported-features/).
129 130 131 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 129 def remote_was_deleted @remote_was_deleted end |
#ssn ⇒ String (readonly)
Returns The employee’s social security number.
75 76 77 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 75 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.
111 112 113 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 111 def start_date @start_date end |
#team ⇒ Merge::Hris::EmployeeTeam (readonly)
Returns The employee’s team.
71 72 73 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 71 def team @team end |
#termination_date ⇒ DateTime (readonly)
Returns The employee’s termination date.
120 121 122 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 120 def termination_date @termination_date end |
#username ⇒ String (readonly)
Returns The employee’s username that appears in the remote UI.
53 54 55 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 53 def username @username end |
#work_email ⇒ String (readonly)
Returns The employee’s work email.
57 58 59 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 57 def work_email @work_email end |
#work_location ⇒ Merge::Hris::EmployeeWorkLocation (readonly)
Returns The employee’s work address.
67 68 69 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 67 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
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 409 410 411 412 413 414 415 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 296 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.
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 461 462 463 464 465 466 467 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 430 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
420 421 422 |
# File 'lib/merge_ruby_client/hris/types/employee.rb', line 420 def to_json(*_args) @_field_set&.to_json end |