Class: Merge::Hris::EmployeeRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/merge_ruby_client/hris/types/employee_request.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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(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, employment_status: OMIT, termination_date: OMIT, avatar: OMIT, integration_params: OMIT, linked_account_params: OMIT, additional_properties: nil) ⇒ Merge::Hris::EmployeeRequest

Parameters:

  • employee_number (String) (defaults to: OMIT)

    The employee’s number that appears in the third-party integration’s UI.

  • company (Merge::Hris::EmployeeRequestCompany) (defaults to: OMIT)

    The ID of the employee’s company.

  • first_name (String) (defaults to: OMIT)

    The employee’s first name.

  • last_name (String) (defaults to: OMIT)

    The employee’s last name.

  • preferred_name (String) (defaults to: OMIT)

    The employee’s preferred first name.

  • display_full_name (String) (defaults to: OMIT)

    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.

  • username (String) (defaults to: OMIT)

    The employee’s username that appears in the remote UI.

  • groups (Array<Merge::Hris::EmployeeRequestGroupsItem>) (defaults to: OMIT)
  • work_email (String) (defaults to: OMIT)

    The employee’s work email.

  • personal_email (String) (defaults to: OMIT)

    The employee’s personal email.

  • mobile_phone_number (String) (defaults to: OMIT)

    The employee’s mobile phone number.

  • employments (Array<Merge::Hris::EmployeeRequestEmploymentsItem>) (defaults to: OMIT)

    Array of ‘Employment` IDs for this Employee.

  • home_location (Merge::Hris::EmployeeRequestHomeLocation) (defaults to: OMIT)

    The employee’s home address.

  • work_location (Merge::Hris::EmployeeRequestWorkLocation) (defaults to: OMIT)

    The employee’s work address.

  • manager (Merge::Hris::EmployeeRequestManager) (defaults to: OMIT)

    The employee ID of the employee’s manager.

  • team (Merge::Hris::EmployeeRequestTeam) (defaults to: OMIT)

    The employee’s team.

  • pay_group (Merge::Hris::EmployeeRequestPayGroup) (defaults to: OMIT)

    The employee’s pay group

  • ssn (String) (defaults to: OMIT)

    The employee’s social security number.

  • gender (Merge::Hris::GenderEnum) (defaults to: OMIT)

    The employee’s gender.

    • ‘MALE` - MALE

    • ‘FEMALE` - FEMALE

    • ‘NON-BINARY` - NON-BINARY

    • ‘OTHER` - OTHER

    • ‘PREFER_NOT_TO_DISCLOSE` - PREFER_NOT_TO_DISCLOSE

  • ethnicity (Merge::Hris::EthnicityEnum) (defaults to: OMIT)

    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

  • marital_status (Merge::Hris::MaritalStatusEnum) (defaults to: OMIT)

    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

  • date_of_birth (DateTime) (defaults to: OMIT)

    The employee’s date of birth.

  • hire_date (DateTime) (defaults to: OMIT)

    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.

  • start_date (DateTime) (defaults to: OMIT)

    The date that the employee started working. If an employee was rehired, the most recent start date will be returned.

  • employment_status (Merge::Hris::EmploymentStatusEnum) (defaults to: OMIT)

    The employment status of the employee.

    • ‘ACTIVE` - ACTIVE

    • ‘PENDING` - PENDING

    • ‘INACTIVE` - INACTIVE

  • termination_date (DateTime) (defaults to: OMIT)

    The employee’s termination date.

  • avatar (String) (defaults to: OMIT)

    The URL of the employee’s avatar image.

  • integration_params (Hash{String => Object}) (defaults to: OMIT)
  • linked_account_params (Hash{String => Object}) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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
239
240
241
242
243
244
245
246
247
248
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 183

def initialize(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, employment_status: OMIT, termination_date: OMIT, avatar: OMIT, integration_params: OMIT, linked_account_params: OMIT, additional_properties: nil)
  @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
  @employment_status = employment_status if employment_status != OMIT
  @termination_date = termination_date if termination_date != OMIT
  @avatar = avatar if avatar != OMIT
  @integration_params = integration_params if integration_params != OMIT
  @linked_account_params =  if  != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "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,
    "employment_status": employment_status,
    "termination_date": termination_date,
    "avatar": avatar,
    "integration_params": integration_params,
    "linked_account_params": 
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



117
118
119
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 117

def additional_properties
  @additional_properties
end

#avatarString (readonly)

Returns The URL of the employee’s avatar image.

Returns:

  • (String)

    The URL of the employee’s avatar image.



111
112
113
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 111

def avatar
  @avatar
end

#companyMerge::Hris::EmployeeRequestCompany (readonly)

Returns The ID of the employee’s company.

Returns:



33
34
35
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 33

def company
  @company
end

#date_of_birthDateTime (readonly)

Returns The employee’s date of birth.

Returns:

  • (DateTime)

    The employee’s date of birth.



94
95
96
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 94

def date_of_birth
  @date_of_birth
end

#display_full_nameString (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.

Returns:

  • (String)

    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.



42
43
44
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 42

def display_full_name
  @display_full_name
end

#employee_numberString (readonly)

Returns The employee’s number that appears in the third-party integration’s UI.

Returns:

  • (String)

    The employee’s number that appears in the third-party integration’s UI.



31
32
33
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 31

def employee_number
  @employee_number
end

#employment_statusMerge::Hris::EmploymentStatusEnum (readonly)

Returns The employment status of the employee.

  • ‘ACTIVE` - ACTIVE

  • ‘PENDING` - PENDING

  • ‘INACTIVE` - INACTIVE.

Returns:



107
108
109
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 107

def employment_status
  @employment_status
end

#employmentsArray<Merge::Hris::EmployeeRequestEmploymentsItem> (readonly)

Returns Array of ‘Employment` IDs for this Employee.

Returns:



54
55
56
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 54

def employments
  @employments
end

#ethnicityMerge::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.

Returns:

  • (Merge::Hris::EthnicityEnum)

    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



84
85
86
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 84

def ethnicity
  @ethnicity
end

#first_nameString (readonly)

Returns The employee’s first name.

Returns:

  • (String)

    The employee’s first name.



35
36
37
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 35

def first_name
  @first_name
end

#genderMerge::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.

Returns:

  • (Merge::Hris::GenderEnum)

    The employee’s gender.

    • ‘MALE` - MALE

    • ‘FEMALE` - FEMALE

    • ‘NON-BINARY` - NON-BINARY

    • ‘OTHER` - OTHER

    • ‘PREFER_NOT_TO_DISCLOSE` - PREFER_NOT_TO_DISCLOSE



73
74
75
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 73

def gender
  @gender
end

#groupsArray<Merge::Hris::EmployeeRequestGroupsItem> (readonly)



46
47
48
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 46

def groups
  @groups
end

#hire_dateDateTime (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.

Returns:

  • (DateTime)

    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.



99
100
101
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 99

def hire_date
  @hire_date
end

#home_locationMerge::Hris::EmployeeRequestHomeLocation (readonly)

Returns The employee’s home address.

Returns:



56
57
58
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 56

def home_location
  @home_location
end

#integration_paramsHash{String => Object} (readonly)

Returns:

  • (Hash{String => Object})


113
114
115
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 113

def integration_params
  @integration_params
end

#last_nameString (readonly)

Returns The employee’s last name.

Returns:

  • (String)

    The employee’s last name.



37
38
39
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 37

def last_name
  @last_name
end

#linked_account_paramsHash{String => Object} (readonly)

Returns:

  • (Hash{String => Object})


115
116
117
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 115

def 
  @linked_account_params
end

#managerMerge::Hris::EmployeeRequestManager (readonly)

Returns The employee ID of the employee’s manager.

Returns:



60
61
62
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 60

def manager
  @manager
end

#marital_statusMerge::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.

Returns:

  • (Merge::Hris::MaritalStatusEnum)

    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



92
93
94
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 92

def marital_status
  @marital_status
end

#mobile_phone_numberString (readonly)

Returns The employee’s mobile phone number.

Returns:

  • (String)

    The employee’s mobile phone number.



52
53
54
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 52

def mobile_phone_number
  @mobile_phone_number
end

#pay_groupMerge::Hris::EmployeeRequestPayGroup (readonly)

Returns The employee’s pay group.

Returns:



64
65
66
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 64

def pay_group
  @pay_group
end

#personal_emailString (readonly)

Returns The employee’s personal email.

Returns:

  • (String)

    The employee’s personal email.



50
51
52
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 50

def personal_email
  @personal_email
end

#preferred_nameString (readonly)

Returns The employee’s preferred first name.

Returns:

  • (String)

    The employee’s preferred first name.



39
40
41
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 39

def preferred_name
  @preferred_name
end

#ssnString (readonly)

Returns The employee’s social security number.

Returns:

  • (String)

    The employee’s social security number.



66
67
68
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 66

def ssn
  @ssn
end

#start_dateDateTime (readonly)

Returns The date that the employee started working. If an employee was rehired, the most recent start date will be returned.

Returns:

  • (DateTime)

    The date that the employee started working. If an employee was rehired, the most recent start date will be returned.



102
103
104
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 102

def start_date
  @start_date
end

#teamMerge::Hris::EmployeeRequestTeam (readonly)

Returns The employee’s team.

Returns:



62
63
64
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 62

def team
  @team
end

#termination_dateDateTime (readonly)

Returns The employee’s termination date.

Returns:

  • (DateTime)

    The employee’s termination date.



109
110
111
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 109

def termination_date
  @termination_date
end

#usernameString (readonly)

Returns The employee’s username that appears in the remote UI.

Returns:

  • (String)

    The employee’s username that appears in the remote UI.



44
45
46
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 44

def username
  @username
end

#work_emailString (readonly)

Returns The employee’s work email.

Returns:

  • (String)

    The employee’s work email.



48
49
50
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 48

def work_email
  @work_email
end

#work_locationMerge::Hris::EmployeeRequestWorkLocation (readonly)

Returns The employee’s work address.

Returns:



58
59
60
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 58

def work_location
  @work_location
end

Class Method Details

.from_json(json_object:) ⇒ Merge::Hris::EmployeeRequest

Deserialize a JSON object to an instance of EmployeeRequest

Parameters:

  • json_object (String)

Returns:



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
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
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 254

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  employee_number = parsed_json["employee_number"]
  if parsed_json["company"].nil?
    company = nil
  else
    company = parsed_json["company"].to_json
    company = Merge::Hris::EmployeeRequestCompany.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::EmployeeRequestGroupsItem.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::EmployeeRequestEmploymentsItem.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::EmployeeRequestHomeLocation.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::EmployeeRequestWorkLocation.from_json(json_object: work_location)
  end
  if parsed_json["manager"].nil?
    manager = nil
  else
    manager = parsed_json["manager"].to_json
    manager = Merge::Hris::EmployeeRequestManager.from_json(json_object: manager)
  end
  if parsed_json["team"].nil?
    team = nil
  else
    team = parsed_json["team"].to_json
    team = Merge::Hris::EmployeeRequestTeam.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::EmployeeRequestPayGroup.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?)
  employment_status = parsed_json["employment_status"]
  termination_date = (DateTime.parse(parsed_json["termination_date"]) unless parsed_json["termination_date"].nil?)
  avatar = parsed_json["avatar"]
  integration_params = parsed_json["integration_params"]
   = parsed_json["linked_account_params"]
  new(
    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,
    employment_status: employment_status,
    termination_date: termination_date,
    avatar: avatar,
    integration_params: integration_params,
    linked_account_params: ,
    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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


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
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 369

def self.validate_raw(obj:)
  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::EmployeeRequestCompany.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::EmployeeRequestHomeLocation.validate_raw(obj: obj.home_location)
  obj.work_location.nil? || Merge::Hris::EmployeeRequestWorkLocation.validate_raw(obj: obj.work_location)
  obj.manager.nil? || Merge::Hris::EmployeeRequestManager.validate_raw(obj: obj.manager)
  obj.team.nil? || Merge::Hris::EmployeeRequestTeam.validate_raw(obj: obj.team)
  obj.pay_group.nil? || Merge::Hris::EmployeeRequestPayGroup.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.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.integration_params&.is_a?(Hash) != false || raise("Passed value for field obj.integration_params is not the expected type, validation failed.")
  obj.&.is_a?(Hash) != false || raise("Passed value for field obj.linked_account_params is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of EmployeeRequest to a JSON object

Returns:

  • (String)


359
360
361
# File 'lib/merge_ruby_client/hris/types/employee_request.rb', line 359

def to_json(*_args)
  @_field_set&.to_json
end