merge_hris_client 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (232) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +179 -0
  4. data/Rakefile +10 -0
  5. data/config.json +1 -0
  6. data/docs/AccountIntegration.md +28 -0
  7. data/docs/AccountToken.md +18 -0
  8. data/docs/AccountTokenApi.md +79 -0
  9. data/docs/AvailableActions.md +22 -0
  10. data/docs/AvailableActionsApi.md +79 -0
  11. data/docs/Benefit.md +32 -0
  12. data/docs/BenefitPlanTypeEnum.md +15 -0
  13. data/docs/BenefitsApi.md +181 -0
  14. data/docs/CompaniesApi.md +175 -0
  15. data/docs/Company.md +28 -0
  16. data/docs/CountryEnum.md +15 -0
  17. data/docs/DataPassthrough.md +24 -0
  18. data/docs/DataPassthroughRequest.md +26 -0
  19. data/docs/Deduction.md +28 -0
  20. data/docs/Earning.md +26 -0
  21. data/docs/Employee.md +66 -0
  22. data/docs/EmployeePayrollRun.md +42 -0
  23. data/docs/EmployeePayrollRunsApi.md +183 -0
  24. data/docs/EmployeesApi.md +187 -0
  25. data/docs/Employment.md +38 -0
  26. data/docs/EmploymentStatusEnum.md +15 -0
  27. data/docs/EmploymentTypeEnum.md +15 -0
  28. data/docs/EmploymentsApi.md +177 -0
  29. data/docs/EndUserDetails.md +24 -0
  30. data/docs/EndUserDetailsRequest.md +26 -0
  31. data/docs/EthnicityEnum.md +15 -0
  32. data/docs/FlsaStatusEnum.md +15 -0
  33. data/docs/GenderEnum.md +15 -0
  34. data/docs/GenerateKeyApi.md +79 -0
  35. data/docs/GenerateRemoteKeyRequest.md +18 -0
  36. data/docs/LinkToken.md +20 -0
  37. data/docs/LinkTokenApi.md +79 -0
  38. data/docs/Location.md +36 -0
  39. data/docs/LocationsApi.md +175 -0
  40. data/docs/MaritalStatusEnum.md +15 -0
  41. data/docs/MethodEnum.md +15 -0
  42. data/docs/ModelOperation.md +22 -0
  43. data/docs/NullEnum.md +15 -0
  44. data/docs/PaginatedBenefitList.md +22 -0
  45. data/docs/PaginatedCompanyList.md +22 -0
  46. data/docs/PaginatedEmployeeList.md +22 -0
  47. data/docs/PaginatedEmployeePayrollRunList.md +22 -0
  48. data/docs/PaginatedEmploymentList.md +22 -0
  49. data/docs/PaginatedLocationList.md +22 -0
  50. data/docs/PaginatedPayrollRunList.md +22 -0
  51. data/docs/PaginatedTeamList.md +22 -0
  52. data/docs/PaginatedTimeOffList.md +22 -0
  53. data/docs/PassthroughApi.md +81 -0
  54. data/docs/PayCurrencyEnum.md +15 -0
  55. data/docs/PayFrequencyEnum.md +15 -0
  56. data/docs/PayPeriodEnum.md +15 -0
  57. data/docs/PayrollRun.md +32 -0
  58. data/docs/PayrollRunsApi.md +175 -0
  59. data/docs/RegenerateKeyApi.md +79 -0
  60. data/docs/RemoteData.md +20 -0
  61. data/docs/RemoteKey.md +20 -0
  62. data/docs/RemoteKeyForRegeneration.md +18 -0
  63. data/docs/RemoteKeyForRegenerationRequest.md +18 -0
  64. data/docs/RemoteResponse.md +26 -0
  65. data/docs/RequestTypeEnum.md +15 -0
  66. data/docs/RunStateEnum.md +15 -0
  67. data/docs/RunTypeEnum.md +15 -0
  68. data/docs/StateEnum.md +15 -0
  69. data/docs/SyncStatus.md +28 -0
  70. data/docs/SyncStatusApi.md +79 -0
  71. data/docs/Tax.md +28 -0
  72. data/docs/Team.md +24 -0
  73. data/docs/TeamsApi.md +175 -0
  74. data/docs/TimeOff.md +36 -0
  75. data/docs/TimeOffApi.md +183 -0
  76. data/docs/TimeOffStatusEnum.md +15 -0
  77. data/docs/TypeEnum.md +15 -0
  78. data/docs/UnitsEnum.md +15 -0
  79. data/git_push.sh +58 -0
  80. data/lib/merge_hris_client.rb +110 -0
  81. data/lib/merge_hris_client/api/account_token_api.rb +83 -0
  82. data/lib/merge_hris_client/api/available_actions_api.rb +84 -0
  83. data/lib/merge_hris_client/api/benefits_api.rb +196 -0
  84. data/lib/merge_hris_client/api/companies_api.rb +179 -0
  85. data/lib/merge_hris_client/api/employee_payroll_runs_api.rb +199 -0
  86. data/lib/merge_hris_client/api/employees_api.rb +205 -0
  87. data/lib/merge_hris_client/api/employments_api.rb +182 -0
  88. data/lib/merge_hris_client/api/generate_key_api.rb +85 -0
  89. data/lib/merge_hris_client/api/link_token_api.rb +85 -0
  90. data/lib/merge_hris_client/api/locations_api.rb +179 -0
  91. data/lib/merge_hris_client/api/passthrough_api.rb +92 -0
  92. data/lib/merge_hris_client/api/payroll_runs_api.rb +179 -0
  93. data/lib/merge_hris_client/api/regenerate_key_api.rb +85 -0
  94. data/lib/merge_hris_client/api/sync_status_api.rb +84 -0
  95. data/lib/merge_hris_client/api/teams_api.rb +179 -0
  96. data/lib/merge_hris_client/api/time_off_api.rb +199 -0
  97. data/lib/merge_hris_client/api_client.rb +390 -0
  98. data/lib/merge_hris_client/api_error.rb +57 -0
  99. data/lib/merge_hris_client/configuration.rb +279 -0
  100. data/lib/merge_hris_client/models/account_integration.rb +325 -0
  101. data/lib/merge_hris_client/models/account_token.rb +223 -0
  102. data/lib/merge_hris_client/models/available_actions.rb +249 -0
  103. data/lib/merge_hris_client/models/benefit.rb +297 -0
  104. data/lib/merge_hris_client/models/benefit_plan_type_enum.rb +56 -0
  105. data/lib/merge_hris_client/models/company.rb +277 -0
  106. data/lib/merge_hris_client/models/country_enum.rb +282 -0
  107. data/lib/merge_hris_client/models/data_passthrough.rb +262 -0
  108. data/lib/merge_hris_client/models/data_passthrough_request.rb +271 -0
  109. data/lib/merge_hris_client/models/deduction.rb +275 -0
  110. data/lib/merge_hris_client/models/earning.rb +264 -0
  111. data/lib/merge_hris_client/models/employee.rb +544 -0
  112. data/lib/merge_hris_client/models/employee_payroll_run.rb +352 -0
  113. data/lib/merge_hris_client/models/employment.rb +330 -0
  114. data/lib/merge_hris_client/models/employment_status_enum.rb +37 -0
  115. data/lib/merge_hris_client/models/employment_type_enum.rb +39 -0
  116. data/lib/merge_hris_client/models/end_user_details.rb +289 -0
  117. data/lib/merge_hris_client/models/end_user_details_request.rb +298 -0
  118. data/lib/merge_hris_client/models/ethnicity_enum.rb +42 -0
  119. data/lib/merge_hris_client/models/flsa_status_enum.rb +38 -0
  120. data/lib/merge_hris_client/models/gender_enum.rb +39 -0
  121. data/lib/merge_hris_client/models/generate_remote_key_request.rb +224 -0
  122. data/lib/merge_hris_client/models/link_token.rb +237 -0
  123. data/lib/merge_hris_client/models/location.rb +319 -0
  124. data/lib/merge_hris_client/models/marital_status_enum.rb +39 -0
  125. data/lib/merge_hris_client/models/method_enum.rb +41 -0
  126. data/lib/merge_hris_client/models/model_operation.rb +256 -0
  127. data/lib/merge_hris_client/models/paginated_benefit_list.rb +240 -0
  128. data/lib/merge_hris_client/models/paginated_company_list.rb +240 -0
  129. data/lib/merge_hris_client/models/paginated_employee_list.rb +240 -0
  130. data/lib/merge_hris_client/models/paginated_employee_payroll_run_list.rb +240 -0
  131. data/lib/merge_hris_client/models/paginated_employment_list.rb +240 -0
  132. data/lib/merge_hris_client/models/paginated_location_list.rb +240 -0
  133. data/lib/merge_hris_client/models/paginated_payroll_run_list.rb +240 -0
  134. data/lib/merge_hris_client/models/paginated_team_list.rb +240 -0
  135. data/lib/merge_hris_client/models/paginated_time_off_list.rb +240 -0
  136. data/lib/merge_hris_client/models/pay_currency_enum.rb +340 -0
  137. data/lib/merge_hris_client/models/pay_frequency_enum.rb +43 -0
  138. data/lib/merge_hris_client/models/pay_period_enum.rb +42 -0
  139. data/lib/merge_hris_client/models/payroll_run.rb +297 -0
  140. data/lib/merge_hris_client/models/remote_data.rb +234 -0
  141. data/lib/merge_hris_client/models/remote_key.rb +238 -0
  142. data/lib/merge_hris_client/models/remote_key_for_regeneration.rb +224 -0
  143. data/lib/merge_hris_client/models/remote_key_for_regeneration_request.rb +224 -0
  144. data/lib/merge_hris_client/models/remote_response.rb +279 -0
  145. data/lib/merge_hris_client/models/request_type_enum.rb +38 -0
  146. data/lib/merge_hris_client/models/run_state_enum.rb +39 -0
  147. data/lib/merge_hris_client/models/run_type_enum.rb +49 -0
  148. data/lib/merge_hris_client/models/state_enum.rb +93 -0
  149. data/lib/merge_hris_client/models/sync_status.rb +294 -0
  150. data/lib/merge_hris_client/models/tax.rb +275 -0
  151. data/lib/merge_hris_client/models/team.rb +253 -0
  152. data/lib/merge_hris_client/models/time_off.rb +319 -0
  153. data/lib/merge_hris_client/models/time_off_status_enum.rb +39 -0
  154. data/lib/merge_hris_client/models/type_enum.rb +38 -0
  155. data/lib/merge_hris_client/models/units_enum.rb +36 -0
  156. data/lib/merge_hris_client/version.rb +15 -0
  157. data/merge_hris_client-1.0.0.gem +0 -0
  158. data/merge_hris_client.gemspec +38 -0
  159. data/pull_request_template.md +20 -0
  160. data/spec/api/account_token_api_spec.rb +46 -0
  161. data/spec/api/available_actions_api_spec.rb +46 -0
  162. data/spec/api/benefits_api_spec.rb +68 -0
  163. data/spec/api/companies_api_spec.rb +65 -0
  164. data/spec/api/employee_payroll_runs_api_spec.rb +69 -0
  165. data/spec/api/employees_api_spec.rb +71 -0
  166. data/spec/api/employments_api_spec.rb +66 -0
  167. data/spec/api/link_token_api_spec.rb +46 -0
  168. data/spec/api/locations_api_spec.rb +65 -0
  169. data/spec/api/passthrough_api_spec.rb +48 -0
  170. data/spec/api/payroll_runs_api_spec.rb +65 -0
  171. data/spec/api/regenerate_key_api_spec.rb +46 -0
  172. data/spec/api/teams_api_spec.rb +65 -0
  173. data/spec/api/time_off_api_spec.rb +69 -0
  174. data/spec/api_client_spec.rb +226 -0
  175. data/spec/configuration_spec.rb +42 -0
  176. data/spec/models/account_integration_spec.rb +58 -0
  177. data/spec/models/account_token_spec.rb +34 -0
  178. data/spec/models/available_actions_spec.rb +34 -0
  179. data/spec/models/benefit_plan_type_enum_spec.rb +28 -0
  180. data/spec/models/benefit_spec.rb +70 -0
  181. data/spec/models/company_spec.rb +58 -0
  182. data/spec/models/country_enum_spec.rb +28 -0
  183. data/spec/models/data_passthrough_request_spec.rb +58 -0
  184. data/spec/models/data_passthrough_spec.rb +52 -0
  185. data/spec/models/deduction_spec.rb +58 -0
  186. data/spec/models/earning_spec.rb +52 -0
  187. data/spec/models/employee_payroll_run_spec.rb +100 -0
  188. data/spec/models/employee_spec.rb +166 -0
  189. data/spec/models/employment_spec.rb +88 -0
  190. data/spec/models/employment_status_enum_spec.rb +28 -0
  191. data/spec/models/employment_type_enum_spec.rb +28 -0
  192. data/spec/models/end_user_details_request_spec.rb +56 -0
  193. data/spec/models/end_user_details_spec.rb +56 -0
  194. data/spec/models/ethnicity_enum_spec.rb +28 -0
  195. data/spec/models/flsa_status_enum_spec.rb +28 -0
  196. data/spec/models/gender_enum_spec.rb +28 -0
  197. data/spec/models/link_token_spec.rb +40 -0
  198. data/spec/models/location_spec.rb +82 -0
  199. data/spec/models/marital_status_enum_spec.rb +28 -0
  200. data/spec/models/method_enum_spec.rb +28 -0
  201. data/spec/models/model_operation_spec.rb +40 -0
  202. data/spec/models/paginated_benefit_list_spec.rb +46 -0
  203. data/spec/models/paginated_company_list_spec.rb +46 -0
  204. data/spec/models/paginated_employee_list_spec.rb +46 -0
  205. data/spec/models/paginated_employee_payroll_run_list_spec.rb +46 -0
  206. data/spec/models/paginated_employment_list_spec.rb +46 -0
  207. data/spec/models/paginated_location_list_spec.rb +46 -0
  208. data/spec/models/paginated_payroll_run_list_spec.rb +46 -0
  209. data/spec/models/paginated_team_list_spec.rb +46 -0
  210. data/spec/models/paginated_time_off_list_spec.rb +46 -0
  211. data/spec/models/pay_currency_enum_spec.rb +28 -0
  212. data/spec/models/pay_frequency_enum_spec.rb +28 -0
  213. data/spec/models/pay_period_enum_spec.rb +28 -0
  214. data/spec/models/payroll_run_spec.rb +70 -0
  215. data/spec/models/remote_data_spec.rb +40 -0
  216. data/spec/models/remote_key_for_regeneration_request_spec.rb +34 -0
  217. data/spec/models/remote_key_for_regeneration_spec.rb +34 -0
  218. data/spec/models/remote_key_spec.rb +40 -0
  219. data/spec/models/remote_response_spec.rb +58 -0
  220. data/spec/models/request_type_enum_spec.rb +28 -0
  221. data/spec/models/run_state_enum_spec.rb +28 -0
  222. data/spec/models/run_type_enum_spec.rb +28 -0
  223. data/spec/models/state_enum_spec.rb +28 -0
  224. data/spec/models/tax_spec.rb +58 -0
  225. data/spec/models/team_spec.rb +46 -0
  226. data/spec/models/time_off_spec.rb +82 -0
  227. data/spec/models/time_off_status_enum_spec.rb +28 -0
  228. data/spec/models/type_enum_spec.rb +28 -0
  229. data/spec/models/units_enum_spec.rb +28 -0
  230. data/spec/spec_helper.rb +111 -0
  231. data/test_ruby.rb +30 -0
  232. metadata +385 -0
@@ -0,0 +1,544 @@
1
+ =begin
2
+ #Merge HRIS API
3
+
4
+ #The unified API for building rich integrations with multiple HR Information System platforms.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: hello@merge.dev
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.0.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module MergeHRISClient
17
+ # # The Employee Object ### Description The `Employee` object is used to represent an Employee for a company. ### Usage Example Fetch from the `LIST Employee` endpoint and filter by `ID` to show all employees.
18
+ class Employee
19
+ attr_accessor :id
20
+
21
+ # The third-party API ID of the matching object.
22
+ attr_accessor :remote_id
23
+
24
+ # The ID of the Employee's company.
25
+ attr_accessor :company
26
+
27
+ # The employee's first name.
28
+ attr_accessor :first_name
29
+
30
+ # The employee's last name.
31
+ attr_accessor :last_name
32
+
33
+ # The employee's full name, to use for display purposes.
34
+ attr_accessor :display_full_name
35
+
36
+ # The employee's work email.
37
+ attr_accessor :work_email
38
+
39
+ # The employee's personal email.
40
+ attr_accessor :personal_email
41
+
42
+ # The employee's mobile phone number.
43
+ attr_accessor :mobile_phone_number
44
+
45
+ attr_accessor :employments
46
+
47
+ # The employee's home address.
48
+ attr_accessor :home_location
49
+
50
+ # The employee's work address.
51
+ attr_accessor :work_location
52
+
53
+ # The employee ID of the employee's manager.
54
+ attr_accessor :manager
55
+
56
+ # The employee's team.
57
+ attr_accessor :team
58
+
59
+ # The employee's social security number.
60
+ attr_accessor :ssn
61
+
62
+ # The employee's gender.
63
+ attr_accessor :gender
64
+
65
+ # The employee's ethnicity.
66
+ attr_accessor :ethnicity
67
+
68
+ # The employee's marital status.
69
+ attr_accessor :marital_status
70
+
71
+ # The employee's date of birth.
72
+ attr_accessor :date_of_birth
73
+
74
+ # The employee's hire date.
75
+ attr_accessor :hire_date
76
+
77
+ # The employment status of the employee.
78
+ attr_accessor :employment_status
79
+
80
+ # The employee's termination date.
81
+ attr_accessor :termination_date
82
+
83
+ # The URL of the employee's avatar image.
84
+ attr_accessor :avatar
85
+
86
+ # The identification number for the employee.
87
+ attr_accessor :employee_number
88
+
89
+ attr_accessor :remote_data
90
+
91
+ # Attribute mapping from ruby-style variable name to JSON key.
92
+ def self.attribute_map
93
+ {
94
+ :'id' => :'id',
95
+ :'remote_id' => :'remote_id',
96
+ :'company' => :'company',
97
+ :'first_name' => :'first_name',
98
+ :'last_name' => :'last_name',
99
+ :'display_full_name' => :'display_full_name',
100
+ :'work_email' => :'work_email',
101
+ :'personal_email' => :'personal_email',
102
+ :'mobile_phone_number' => :'mobile_phone_number',
103
+ :'employments' => :'employments',
104
+ :'home_location' => :'home_location',
105
+ :'work_location' => :'work_location',
106
+ :'manager' => :'manager',
107
+ :'team' => :'team',
108
+ :'ssn' => :'ssn',
109
+ :'gender' => :'gender',
110
+ :'ethnicity' => :'ethnicity',
111
+ :'marital_status' => :'marital_status',
112
+ :'date_of_birth' => :'date_of_birth',
113
+ :'hire_date' => :'hire_date',
114
+ :'employment_status' => :'employment_status',
115
+ :'termination_date' => :'termination_date',
116
+ :'avatar' => :'avatar',
117
+ :'employee_number' => :'employee_number',
118
+ :'remote_data' => :'remote_data'
119
+ }
120
+ end
121
+
122
+ # Returns all the JSON keys this model knows about
123
+ def self.acceptable_attributes
124
+ attribute_map.values
125
+ end
126
+
127
+ # Attribute type mapping.
128
+ def self.openapi_types
129
+ {
130
+ :'id' => :'String',
131
+ :'remote_id' => :'String',
132
+ :'company' => :'String',
133
+ :'first_name' => :'String',
134
+ :'last_name' => :'String',
135
+ :'display_full_name' => :'String',
136
+ :'work_email' => :'String',
137
+ :'personal_email' => :'String',
138
+ :'mobile_phone_number' => :'String',
139
+ :'employments' => :'Array<String>',
140
+ :'home_location' => :'String',
141
+ :'work_location' => :'String',
142
+ :'manager' => :'String',
143
+ :'team' => :'String',
144
+ :'ssn' => :'String',
145
+ :'gender' => :'GenderEnum',
146
+ :'ethnicity' => :'EthnicityEnum',
147
+ :'marital_status' => :'MaritalStatusEnum',
148
+ :'date_of_birth' => :'Time',
149
+ :'hire_date' => :'Time',
150
+ :'employment_status' => :'EmploymentStatusEnum',
151
+ :'termination_date' => :'Time',
152
+ :'avatar' => :'String',
153
+ :'employee_number' => :'String',
154
+ :'remote_data' => :'Array<RemoteData>'
155
+ }
156
+ end
157
+
158
+ # List of attributes with nullable: true
159
+ def self.openapi_nullable
160
+ Set.new([
161
+ :'remote_id',
162
+ :'company',
163
+ :'first_name',
164
+ :'last_name',
165
+ :'display_full_name',
166
+ :'work_email',
167
+ :'personal_email',
168
+ :'mobile_phone_number',
169
+ :'home_location',
170
+ :'work_location',
171
+ :'manager',
172
+ :'team',
173
+ :'ssn',
174
+ :'gender',
175
+ :'ethnicity',
176
+ :'marital_status',
177
+ :'date_of_birth',
178
+ :'hire_date',
179
+ :'employment_status',
180
+ :'termination_date',
181
+ :'avatar',
182
+ :'employee_number',
183
+ :'remote_data'
184
+ ])
185
+ end
186
+
187
+ # Initializes the object
188
+ # @param [Hash] attributes Model attributes in the form of hash
189
+ def initialize(attributes = {})
190
+ if (!attributes.is_a?(Hash))
191
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MergeHRISClient::Employee` initialize method"
192
+ end
193
+
194
+ # check to see if the attribute exists and convert string to symbol for hash key
195
+ attributes = attributes.each_with_object({}) { |(k, v), h|
196
+ if (!self.class.attribute_map.key?(k.to_sym))
197
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MergeHRISClient::Employee`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
198
+ end
199
+ h[k.to_sym] = v
200
+ }
201
+
202
+ if attributes.key?(:'id')
203
+ self.id = attributes[:'id']
204
+ end
205
+
206
+ if attributes.key?(:'remote_id')
207
+ self.remote_id = attributes[:'remote_id']
208
+ end
209
+
210
+ if attributes.key?(:'company')
211
+ self.company = attributes[:'company']
212
+ end
213
+
214
+ if attributes.key?(:'first_name')
215
+ self.first_name = attributes[:'first_name']
216
+ end
217
+
218
+ if attributes.key?(:'last_name')
219
+ self.last_name = attributes[:'last_name']
220
+ end
221
+
222
+ if attributes.key?(:'display_full_name')
223
+ self.display_full_name = attributes[:'display_full_name']
224
+ end
225
+
226
+ if attributes.key?(:'work_email')
227
+ self.work_email = attributes[:'work_email']
228
+ end
229
+
230
+ if attributes.key?(:'personal_email')
231
+ self.personal_email = attributes[:'personal_email']
232
+ end
233
+
234
+ if attributes.key?(:'mobile_phone_number')
235
+ self.mobile_phone_number = attributes[:'mobile_phone_number']
236
+ end
237
+
238
+ if attributes.key?(:'employments')
239
+ if (value = attributes[:'employments']).is_a?(Array)
240
+ self.employments = value
241
+ end
242
+ end
243
+
244
+ if attributes.key?(:'home_location')
245
+ self.home_location = attributes[:'home_location']
246
+ end
247
+
248
+ if attributes.key?(:'work_location')
249
+ self.work_location = attributes[:'work_location']
250
+ end
251
+
252
+ if attributes.key?(:'manager')
253
+ self.manager = attributes[:'manager']
254
+ end
255
+
256
+ if attributes.key?(:'team')
257
+ self.team = attributes[:'team']
258
+ end
259
+
260
+ if attributes.key?(:'ssn')
261
+ self.ssn = attributes[:'ssn']
262
+ end
263
+
264
+ if attributes.key?(:'gender')
265
+ self.gender = attributes[:'gender']
266
+ end
267
+
268
+ if attributes.key?(:'ethnicity')
269
+ self.ethnicity = attributes[:'ethnicity']
270
+ end
271
+
272
+ if attributes.key?(:'marital_status')
273
+ self.marital_status = attributes[:'marital_status']
274
+ end
275
+
276
+ if attributes.key?(:'date_of_birth')
277
+ self.date_of_birth = attributes[:'date_of_birth']
278
+ end
279
+
280
+ if attributes.key?(:'hire_date')
281
+ self.hire_date = attributes[:'hire_date']
282
+ end
283
+
284
+ if attributes.key?(:'employment_status')
285
+ self.employment_status = attributes[:'employment_status']
286
+ end
287
+
288
+ if attributes.key?(:'termination_date')
289
+ self.termination_date = attributes[:'termination_date']
290
+ end
291
+
292
+ if attributes.key?(:'avatar')
293
+ self.avatar = attributes[:'avatar']
294
+ end
295
+
296
+ if attributes.key?(:'employee_number')
297
+ self.employee_number = attributes[:'employee_number']
298
+ end
299
+
300
+ if attributes.key?(:'remote_data')
301
+ if (value = attributes[:'remote_data']).is_a?(Array)
302
+ self.remote_data = value
303
+ end
304
+ end
305
+ end
306
+
307
+ # Show invalid properties with the reasons. Usually used together with valid?
308
+ # @return Array for valid properties with the reasons
309
+ def list_invalid_properties
310
+ invalid_properties = Array.new
311
+ if !@work_email.nil? && @work_email.to_s.length > 254
312
+ invalid_properties.push('invalid value for "work_email", the character length must be smaller than or equal to 254.')
313
+ end
314
+
315
+ if !@personal_email.nil? && @personal_email.to_s.length > 254
316
+ invalid_properties.push('invalid value for "personal_email", the character length must be smaller than or equal to 254.')
317
+ end
318
+
319
+ if !@ssn.nil? && @ssn.to_s.length > 100
320
+ invalid_properties.push('invalid value for "ssn", the character length must be smaller than or equal to 100.')
321
+ end
322
+
323
+ if !@avatar.nil? && @avatar.to_s.length > 700
324
+ invalid_properties.push('invalid value for "avatar", the character length must be smaller than or equal to 700.')
325
+ end
326
+
327
+ invalid_properties
328
+ end
329
+
330
+ # Check to see if the all the properties in the model are valid
331
+ # @return true if the model is valid
332
+ def valid?
333
+ return false if !@work_email.nil? && @work_email.to_s.length > 254
334
+ return false if !@personal_email.nil? && @personal_email.to_s.length > 254
335
+ return false if !@ssn.nil? && @ssn.to_s.length > 100
336
+ return false if !@avatar.nil? && @avatar.to_s.length > 700
337
+ true
338
+ end
339
+
340
+ # Custom attribute writer method with validation
341
+ # @param [Object] work_email Value to be assigned
342
+ def work_email=(work_email)
343
+ if !work_email.nil? && work_email.to_s.length > 254
344
+ fail ArgumentError, 'invalid value for "work_email", the character length must be smaller than or equal to 254.'
345
+ end
346
+
347
+ @work_email = work_email
348
+ end
349
+
350
+ # Custom attribute writer method with validation
351
+ # @param [Object] personal_email Value to be assigned
352
+ def personal_email=(personal_email)
353
+ if !personal_email.nil? && personal_email.to_s.length > 254
354
+ fail ArgumentError, 'invalid value for "personal_email", the character length must be smaller than or equal to 254.'
355
+ end
356
+
357
+ @personal_email = personal_email
358
+ end
359
+
360
+ # Custom attribute writer method with validation
361
+ # @param [Object] ssn Value to be assigned
362
+ def ssn=(ssn)
363
+ if !ssn.nil? && ssn.to_s.length > 100
364
+ fail ArgumentError, 'invalid value for "ssn", the character length must be smaller than or equal to 100.'
365
+ end
366
+
367
+ @ssn = ssn
368
+ end
369
+
370
+ # Custom attribute writer method with validation
371
+ # @param [Object] avatar Value to be assigned
372
+ def avatar=(avatar)
373
+ if !avatar.nil? && avatar.to_s.length > 700
374
+ fail ArgumentError, 'invalid value for "avatar", the character length must be smaller than or equal to 700.'
375
+ end
376
+
377
+ @avatar = avatar
378
+ end
379
+
380
+ # Checks equality by comparing each attribute.
381
+ # @param [Object] Object to be compared
382
+ def ==(o)
383
+ return true if self.equal?(o)
384
+ self.class == o.class &&
385
+ id == o.id &&
386
+ remote_id == o.remote_id &&
387
+ company == o.company &&
388
+ first_name == o.first_name &&
389
+ last_name == o.last_name &&
390
+ display_full_name == o.display_full_name &&
391
+ work_email == o.work_email &&
392
+ personal_email == o.personal_email &&
393
+ mobile_phone_number == o.mobile_phone_number &&
394
+ employments == o.employments &&
395
+ home_location == o.home_location &&
396
+ work_location == o.work_location &&
397
+ manager == o.manager &&
398
+ team == o.team &&
399
+ ssn == o.ssn &&
400
+ gender == o.gender &&
401
+ ethnicity == o.ethnicity &&
402
+ marital_status == o.marital_status &&
403
+ date_of_birth == o.date_of_birth &&
404
+ hire_date == o.hire_date &&
405
+ employment_status == o.employment_status &&
406
+ termination_date == o.termination_date &&
407
+ avatar == o.avatar &&
408
+ employee_number == o.employee_number &&
409
+ remote_data == o.remote_data
410
+ end
411
+
412
+ # @see the `==` method
413
+ # @param [Object] Object to be compared
414
+ def eql?(o)
415
+ self == o
416
+ end
417
+
418
+ # Calculates hash code according to all attributes.
419
+ # @return [Integer] Hash code
420
+ def hash
421
+ [id, remote_id, company, first_name, last_name, display_full_name, work_email, personal_email, mobile_phone_number, employments, home_location, work_location, manager, team, ssn, gender, ethnicity, marital_status, date_of_birth, hire_date, employment_status, termination_date, avatar, employee_number, remote_data].hash
422
+ end
423
+
424
+ # Builds the object from hash
425
+ # @param [Hash] attributes Model attributes in the form of hash
426
+ # @return [Object] Returns the model itself
427
+ def self.build_from_hash(attributes)
428
+ new.build_from_hash(attributes)
429
+ end
430
+
431
+ # Builds the object from hash
432
+ # @param [Hash] attributes Model attributes in the form of hash
433
+ # @return [Object] Returns the model itself
434
+ def build_from_hash(attributes)
435
+ return nil unless attributes.is_a?(Hash)
436
+ self.class.openapi_types.each_pair do |key, type|
437
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
438
+ self.send("#{key}=", nil)
439
+ elsif type =~ /\AArray<(.*)>/i
440
+ # check to ensure the input is an array given that the attribute
441
+ # is documented as an array but the input is not
442
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
443
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
444
+ end
445
+ elsif !attributes[self.class.attribute_map[key]].nil?
446
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
447
+ end
448
+ end
449
+
450
+ self
451
+ end
452
+
453
+ # Deserializes the data based on type
454
+ # @param string type Data type
455
+ # @param string value Value to be deserialized
456
+ # @return [Object] Deserialized data
457
+ def _deserialize(type, value)
458
+ case type.to_sym
459
+ when :Time
460
+ Time.parse(value)
461
+ when :Date
462
+ Date.parse(value)
463
+ when :String
464
+ value.to_s
465
+ when :Integer
466
+ value.to_i
467
+ when :Float
468
+ value.to_f
469
+ when :Boolean
470
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
471
+ true
472
+ else
473
+ false
474
+ end
475
+ when :Object
476
+ # generic object (usually a Hash), return directly
477
+ value
478
+ when /\AArray<(?<inner_type>.+)>\z/
479
+ inner_type = Regexp.last_match[:inner_type]
480
+ value.map { |v| _deserialize(inner_type, v) }
481
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
482
+ k_type = Regexp.last_match[:k_type]
483
+ v_type = Regexp.last_match[:v_type]
484
+ {}.tap do |hash|
485
+ value.each do |k, v|
486
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
487
+ end
488
+ end
489
+ else # model
490
+ # models (e.g. Pet) or oneOf
491
+ klass = MergeHRISClient.const_get(type)
492
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
493
+ end
494
+ end
495
+
496
+ # Returns the string representation of the object
497
+ # @return [String] String presentation of the object
498
+ def to_s
499
+ to_hash.to_s
500
+ end
501
+
502
+ # to_body is an alias to to_hash (backward compatibility)
503
+ # @return [Hash] Returns the object in the form of hash
504
+ def to_body
505
+ to_hash
506
+ end
507
+
508
+ # Returns the object in the form of hash
509
+ # @return [Hash] Returns the object in the form of hash
510
+ def to_hash
511
+ hash = {}
512
+ self.class.attribute_map.each_pair do |attr, param|
513
+ value = self.send(attr)
514
+ if value.nil?
515
+ is_nullable = self.class.openapi_nullable.include?(attr)
516
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
517
+ end
518
+
519
+ hash[param] = _to_hash(value)
520
+ end
521
+ hash
522
+ end
523
+
524
+ # Outputs non-array value in the form of hash
525
+ # For object, use to_hash. Otherwise, just return the value
526
+ # @param [Object] value Any valid value
527
+ # @return [Hash] Returns the value in the form of hash
528
+ def _to_hash(value)
529
+ if value.is_a?(Array)
530
+ value.compact.map { |v| _to_hash(v) }
531
+ elsif value.is_a?(Hash)
532
+ {}.tap do |hash|
533
+ value.each { |k, v| hash[k] = _to_hash(v) }
534
+ end
535
+ elsif value.respond_to? :to_hash
536
+ value.to_hash
537
+ else
538
+ value
539
+ end
540
+ end
541
+
542
+ end
543
+
544
+ end