stackone_hris_client 1.6.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (135) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/README.md +31 -5
  4. data/docs/Account.md +1 -1
  5. data/docs/AccountMeta.md +22 -0
  6. data/docs/AccountsApi.md +70 -2
  7. data/docs/CompaniesApi.md +1 -1
  8. data/docs/ConnectSessionsApi.md +1 -1
  9. data/docs/CreateEmployeeResult.md +22 -0
  10. data/docs/Employee.md +56 -54
  11. data/docs/EmployeeApiModel.md +80 -0
  12. data/docs/EmployeeApiModelAvatar.md +20 -0
  13. data/docs/EmployeeApiModelEmploymentStatus.md +20 -0
  14. data/docs/EmployeeApiModelEmploymentType.md +20 -0
  15. data/docs/EmployeeApiModelEthnicity.md +20 -0
  16. data/docs/EmployeeApiModelGender.md +20 -0
  17. data/docs/EmployeeApiModelHomeLocation.md +38 -0
  18. data/docs/EmployeeApiModelMaritalStatus.md +20 -0
  19. data/docs/EmployeeApiModelWorkLocation.md +38 -0
  20. data/docs/EmployeeCustomFieldTypeEnum.md +20 -0
  21. data/docs/EmployeeCustomFields.md +30 -0
  22. data/docs/EmployeeCustomFieldsType.md +20 -0
  23. data/docs/EmployeeResult.md +1 -1
  24. data/docs/EmployeesApi.md +219 -5
  25. data/docs/EmployeesPaginated.md +1 -1
  26. data/docs/Employment.md +17 -15
  27. data/docs/EmploymentEmploymentContractType.md +20 -0
  28. data/docs/EmploymentEmploymentType.md +20 -0
  29. data/docs/EmploymentPayFrequency.md +20 -0
  30. data/docs/EmploymentPayPeriod.md +20 -0
  31. data/docs/EmploymentScheduleTypeEnum.md +20 -0
  32. data/docs/EmploymentsApi.md +3 -3
  33. data/docs/HrisCreateEmployeeRequestDto.md +80 -0
  34. data/docs/Location.md +20 -20
  35. data/docs/LocationCountry.md +20 -0
  36. data/docs/LocationLocationType.md +20 -0
  37. data/docs/LocationsApi.md +1 -1
  38. data/gem-config.yml +2 -2
  39. data/generate_gem.sh +0 -0
  40. data/lib/stackone_hris_client/api/accounts_api.rb +61 -0
  41. data/lib/stackone_hris_client/api/employees_api.rb +231 -0
  42. data/lib/stackone_hris_client/models/account.rb +0 -5
  43. data/lib/stackone_hris_client/models/account_meta.rb +284 -0
  44. data/lib/stackone_hris_client/models/country_code_enum.rb +0 -6
  45. data/lib/stackone_hris_client/models/create_employee_result.rb +250 -0
  46. data/lib/stackone_hris_client/models/employee.rb +110 -126
  47. data/lib/stackone_hris_client/models/employee_api_model.rb +523 -0
  48. data/lib/stackone_hris_client/models/employee_api_model_avatar.rb +234 -0
  49. data/lib/stackone_hris_client/models/employee_api_model_employment_status.rb +272 -0
  50. data/lib/stackone_hris_client/models/employee_api_model_employment_type.rb +272 -0
  51. data/lib/stackone_hris_client/models/employee_api_model_ethnicity.rb +272 -0
  52. data/lib/stackone_hris_client/models/employee_api_model_gender.rb +272 -0
  53. data/lib/stackone_hris_client/models/employee_api_model_home_location.rb +324 -0
  54. data/lib/stackone_hris_client/models/employee_api_model_marital_status.rb +272 -0
  55. data/lib/stackone_hris_client/models/employee_api_model_work_location.rb +324 -0
  56. data/lib/stackone_hris_client/models/employee_custom_field_type_enum.rb +264 -0
  57. data/lib/stackone_hris_client/models/employee_custom_fields.rb +279 -0
  58. data/lib/stackone_hris_client/models/employee_custom_fields_type.rb +272 -0
  59. data/lib/stackone_hris_client/models/employment.rb +21 -6
  60. data/lib/stackone_hris_client/models/employment_employment_contract_type.rb +272 -0
  61. data/lib/stackone_hris_client/models/employment_employment_type.rb +272 -0
  62. data/lib/stackone_hris_client/models/employment_pay_frequency.rb +272 -0
  63. data/lib/stackone_hris_client/models/employment_pay_period.rb +272 -0
  64. data/lib/stackone_hris_client/models/employment_schedule_type_enum.rb +264 -0
  65. data/lib/stackone_hris_client/models/employment_status_enum.rb +0 -6
  66. data/lib/stackone_hris_client/models/employment_type_enum.rb +0 -6
  67. data/lib/stackone_hris_client/models/ethnicity_enum.rb +0 -6
  68. data/lib/stackone_hris_client/models/gender_enum.rb +0 -6
  69. data/lib/stackone_hris_client/models/hris_create_employee_request_dto.rb +523 -0
  70. data/lib/stackone_hris_client/models/location.rb +11 -7
  71. data/lib/stackone_hris_client/models/location_country.rb +272 -0
  72. data/lib/stackone_hris_client/models/location_location_type.rb +272 -0
  73. data/lib/stackone_hris_client/models/location_type_enum.rb +0 -6
  74. data/lib/stackone_hris_client/models/marital_status_enum.rb +0 -6
  75. data/lib/stackone_hris_client/models/pay_frequency_enum.rb +0 -6
  76. data/lib/stackone_hris_client/models/pay_period_enum.rb +0 -6
  77. data/lib/stackone_hris_client/version.rb +1 -1
  78. data/lib/stackone_hris_client.rb +22 -0
  79. data/spec/api/accounts_api_spec.rb +30 -8
  80. data/spec/api/companies_api_spec.rb +13 -13
  81. data/spec/api/connect_sessions_api_spec.rb +8 -8
  82. data/spec/api/employees_api_spec.rb +60 -18
  83. data/spec/api/employments_api_spec.rb +13 -13
  84. data/spec/api/locations_api_spec.rb +9 -9
  85. data/spec/models/account_meta_spec.rb +50 -0
  86. data/spec/models/account_spec.rb +18 -12
  87. data/spec/models/companies_paginated_spec.rb +4 -4
  88. data/spec/models/company_result_spec.rb +3 -3
  89. data/spec/models/company_spec.rb +4 -4
  90. data/spec/models/connect_session_authenticate_spec.rb +5 -5
  91. data/spec/models/connect_session_create_spec.rb +17 -11
  92. data/spec/models/connect_session_spec.rb +14 -14
  93. data/spec/models/connect_session_token_spec.rb +15 -15
  94. data/spec/models/country_code_enum_spec.rb +4 -4
  95. data/spec/models/create_employee_result_spec.rb +46 -0
  96. data/spec/models/employee.rb +220 -0
  97. data/spec/models/employee_api_model_avatar_spec.rb +40 -0
  98. data/spec/models/employee_api_model_employment_status_spec.rb +44 -0
  99. data/spec/models/employee_api_model_employment_type_spec.rb +44 -0
  100. data/spec/models/employee_api_model_ethnicity_spec.rb +44 -0
  101. data/spec/models/employee_api_model_gender_spec.rb +44 -0
  102. data/spec/models/employee_api_model_home_location_spec.rb +94 -0
  103. data/spec/models/employee_api_model_marital_status_spec.rb +44 -0
  104. data/spec/models/employee_api_model_spec.rb +220 -0
  105. data/spec/models/employee_api_model_work_location_spec.rb +94 -0
  106. data/spec/models/employee_custom_field_type_enum_spec.rb +44 -0
  107. data/spec/models/employee_custom_fields_spec.rb +70 -0
  108. data/spec/models/employee_custom_fields_type_spec.rb +44 -0
  109. data/spec/models/employee_result_spec.rb +6 -6
  110. data/spec/models/employees_paginated_spec.rb +7 -7
  111. data/spec/models/employment_employment_contract_type_spec.rb +44 -0
  112. data/spec/models/employment_employment_type_spec.rb +44 -0
  113. data/spec/models/employment_pay_frequency_spec.rb +44 -0
  114. data/spec/models/employment_pay_period_spec.rb +44 -0
  115. data/spec/models/employment_result_spec.rb +3 -3
  116. data/spec/models/employment_schedule_type_enum_spec.rb +44 -0
  117. data/spec/models/employment_spec.rb +16 -10
  118. data/spec/models/employment_status_enum_spec.rb +4 -4
  119. data/spec/models/employment_type_enum_spec.rb +4 -4
  120. data/spec/models/employments_paginated_spec.rb +4 -4
  121. data/spec/models/ethnicity_enum_spec.rb +4 -4
  122. data/spec/models/gender_enum_spec.rb +4 -4
  123. data/spec/models/hris_create_employee_request_dto_spec.rb +220 -0
  124. data/spec/models/image_spec.rb +3 -3
  125. data/spec/models/location_country_spec.rb +44 -0
  126. data/spec/models/location_location_type_spec.rb +44 -0
  127. data/spec/models/location_result_spec.rb +3 -3
  128. data/spec/models/location_spec.rb +12 -12
  129. data/spec/models/location_type_enum_spec.rb +3 -3
  130. data/spec/models/locations_paginated_spec.rb +4 -4
  131. data/spec/models/marital_status_enum_spec.rb +4 -4
  132. data/spec/models/pay_frequency_enum_spec.rb +4 -4
  133. data/spec/models/pay_period_enum_spec.rb +3 -3
  134. metadata +92 -4
  135. data/spec/models/employee_spec.rb +0 -124
@@ -0,0 +1,523 @@
1
+ =begin
2
+ #StackOne Unified API - HRIS
3
+
4
+ #The documentation for the StackOne Unified API - HRIS
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.6.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module StackOneHRIS
17
+ class HrisCreateEmployeeRequestDto
18
+ # The employee ID
19
+ attr_accessor :id
20
+
21
+ # The employee first name
22
+ attr_accessor :first_name
23
+
24
+ # The employee last name
25
+ attr_accessor :last_name
26
+
27
+ # The employee name
28
+ attr_accessor :name
29
+
30
+ # The employee display name
31
+ attr_accessor :display_name
32
+
33
+ # The employee avatar Url
34
+ attr_accessor :avatar_url
35
+
36
+ # The employee personal email
37
+ attr_accessor :personal_email
38
+
39
+ # The employee personal phone number
40
+ attr_accessor :personal_phone_number
41
+
42
+ # The employee work email
43
+ attr_accessor :work_email
44
+
45
+ # The employee work phone number
46
+ attr_accessor :work_phone_number
47
+
48
+ # The employee job title
49
+ attr_accessor :job_title
50
+
51
+ # The employee department
52
+ attr_accessor :department
53
+
54
+ # The employee manager ID
55
+ attr_accessor :manager_id
56
+
57
+ attr_accessor :gender
58
+
59
+ attr_accessor :ethnicity
60
+
61
+ # The employee date_of_birth
62
+ attr_accessor :date_of_birth
63
+
64
+ # The employee birthday
65
+ attr_accessor :birthday
66
+
67
+ attr_accessor :marital_status
68
+
69
+ attr_accessor :avatar
70
+
71
+ # The employee hire date
72
+ attr_accessor :hire_date
73
+
74
+ # The employee start date
75
+ attr_accessor :start_date
76
+
77
+ # The employee tenure
78
+ attr_accessor :tenure
79
+
80
+ # The employee work anniversary
81
+ attr_accessor :work_anniversary
82
+
83
+ attr_accessor :employment_type
84
+
85
+ attr_accessor :employment_contract_type
86
+
87
+ attr_accessor :employment_status
88
+
89
+ # The employee termination date
90
+ attr_accessor :termination_date
91
+
92
+ attr_accessor :home_location
93
+
94
+ attr_accessor :work_location
95
+
96
+ # The employee company name
97
+ attr_accessor :company_name
98
+
99
+ # The employee employments
100
+ attr_accessor :employments
101
+
102
+ # The employee custom fields
103
+ attr_accessor :custom_fields
104
+
105
+ # Attribute mapping from ruby-style variable name to JSON key.
106
+ def self.attribute_map
107
+ {
108
+ :'id' => :'id',
109
+ :'first_name' => :'first_name',
110
+ :'last_name' => :'last_name',
111
+ :'name' => :'name',
112
+ :'display_name' => :'display_name',
113
+ :'avatar_url' => :'avatar_url',
114
+ :'personal_email' => :'personal_email',
115
+ :'personal_phone_number' => :'personal_phone_number',
116
+ :'work_email' => :'work_email',
117
+ :'work_phone_number' => :'work_phone_number',
118
+ :'job_title' => :'job_title',
119
+ :'department' => :'department',
120
+ :'manager_id' => :'manager_id',
121
+ :'gender' => :'gender',
122
+ :'ethnicity' => :'ethnicity',
123
+ :'date_of_birth' => :'date_of_birth',
124
+ :'birthday' => :'birthday',
125
+ :'marital_status' => :'marital_status',
126
+ :'avatar' => :'avatar',
127
+ :'hire_date' => :'hire_date',
128
+ :'start_date' => :'start_date',
129
+ :'tenure' => :'tenure',
130
+ :'work_anniversary' => :'work_anniversary',
131
+ :'employment_type' => :'employment_type',
132
+ :'employment_contract_type' => :'employment_contract_type',
133
+ :'employment_status' => :'employment_status',
134
+ :'termination_date' => :'termination_date',
135
+ :'home_location' => :'home_location',
136
+ :'work_location' => :'work_location',
137
+ :'company_name' => :'company_name',
138
+ :'employments' => :'employments',
139
+ :'custom_fields' => :'custom_fields'
140
+ }
141
+ end
142
+
143
+ # Returns all the JSON keys this model knows about
144
+ def self.acceptable_attributes
145
+ attribute_map.values
146
+ end
147
+
148
+ # Attribute type mapping.
149
+ def self.openapi_types
150
+ {
151
+ :'id' => :'String',
152
+ :'first_name' => :'String',
153
+ :'last_name' => :'String',
154
+ :'name' => :'String',
155
+ :'display_name' => :'String',
156
+ :'avatar_url' => :'String',
157
+ :'personal_email' => :'String',
158
+ :'personal_phone_number' => :'String',
159
+ :'work_email' => :'String',
160
+ :'work_phone_number' => :'String',
161
+ :'job_title' => :'String',
162
+ :'department' => :'String',
163
+ :'manager_id' => :'String',
164
+ :'gender' => :'EmployeeApiModelGender',
165
+ :'ethnicity' => :'EmployeeApiModelEthnicity',
166
+ :'date_of_birth' => :'Time',
167
+ :'birthday' => :'Time',
168
+ :'marital_status' => :'EmployeeApiModelMaritalStatus',
169
+ :'avatar' => :'EmployeeApiModelAvatar',
170
+ :'hire_date' => :'Time',
171
+ :'start_date' => :'Time',
172
+ :'tenure' => :'String',
173
+ :'work_anniversary' => :'Time',
174
+ :'employment_type' => :'EmployeeApiModelEmploymentType',
175
+ :'employment_contract_type' => :'EmploymentEmploymentContractType',
176
+ :'employment_status' => :'EmployeeApiModelEmploymentStatus',
177
+ :'termination_date' => :'Time',
178
+ :'home_location' => :'EmployeeApiModelHomeLocation',
179
+ :'work_location' => :'EmployeeApiModelWorkLocation',
180
+ :'company_name' => :'String',
181
+ :'employments' => :'Array<Employment>',
182
+ :'custom_fields' => :'Array<EmployeeCustomFields>'
183
+ }
184
+ end
185
+
186
+ # List of attributes with nullable: true
187
+ def self.openapi_nullable
188
+ Set.new([
189
+ ])
190
+ end
191
+
192
+ # Initializes the object
193
+ # @param [Hash] attributes Model attributes in the form of hash
194
+ def initialize(attributes = {})
195
+ if (!attributes.is_a?(Hash))
196
+ fail ArgumentError, "The input argument (attributes) must be a hash in `StackOneHRIS::HrisCreateEmployeeRequestDto` initialize method"
197
+ end
198
+
199
+ # check to see if the attribute exists and convert string to symbol for hash key
200
+ attributes = attributes.each_with_object({}) { |(k, v), h|
201
+ if (!self.class.attribute_map.key?(k.to_sym))
202
+ fail ArgumentError, "`#{k}` is not a valid attribute in `StackOneHRIS::HrisCreateEmployeeRequestDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
203
+ end
204
+ h[k.to_sym] = v
205
+ }
206
+
207
+ if attributes.key?(:'id')
208
+ self.id = attributes[:'id']
209
+ end
210
+
211
+ if attributes.key?(:'first_name')
212
+ self.first_name = attributes[:'first_name']
213
+ end
214
+
215
+ if attributes.key?(:'last_name')
216
+ self.last_name = attributes[:'last_name']
217
+ end
218
+
219
+ if attributes.key?(:'name')
220
+ self.name = attributes[:'name']
221
+ end
222
+
223
+ if attributes.key?(:'display_name')
224
+ self.display_name = attributes[:'display_name']
225
+ end
226
+
227
+ if attributes.key?(:'avatar_url')
228
+ self.avatar_url = attributes[:'avatar_url']
229
+ end
230
+
231
+ if attributes.key?(:'personal_email')
232
+ self.personal_email = attributes[:'personal_email']
233
+ end
234
+
235
+ if attributes.key?(:'personal_phone_number')
236
+ self.personal_phone_number = attributes[:'personal_phone_number']
237
+ end
238
+
239
+ if attributes.key?(:'work_email')
240
+ self.work_email = attributes[:'work_email']
241
+ end
242
+
243
+ if attributes.key?(:'work_phone_number')
244
+ self.work_phone_number = attributes[:'work_phone_number']
245
+ end
246
+
247
+ if attributes.key?(:'job_title')
248
+ self.job_title = attributes[:'job_title']
249
+ end
250
+
251
+ if attributes.key?(:'department')
252
+ self.department = attributes[:'department']
253
+ end
254
+
255
+ if attributes.key?(:'manager_id')
256
+ self.manager_id = attributes[:'manager_id']
257
+ end
258
+
259
+ if attributes.key?(:'gender')
260
+ self.gender = attributes[:'gender']
261
+ end
262
+
263
+ if attributes.key?(:'ethnicity')
264
+ self.ethnicity = attributes[:'ethnicity']
265
+ end
266
+
267
+ if attributes.key?(:'date_of_birth')
268
+ self.date_of_birth = attributes[:'date_of_birth']
269
+ end
270
+
271
+ if attributes.key?(:'birthday')
272
+ self.birthday = attributes[:'birthday']
273
+ end
274
+
275
+ if attributes.key?(:'marital_status')
276
+ self.marital_status = attributes[:'marital_status']
277
+ end
278
+
279
+ if attributes.key?(:'avatar')
280
+ self.avatar = attributes[:'avatar']
281
+ end
282
+
283
+ if attributes.key?(:'hire_date')
284
+ self.hire_date = attributes[:'hire_date']
285
+ end
286
+
287
+ if attributes.key?(:'start_date')
288
+ self.start_date = attributes[:'start_date']
289
+ end
290
+
291
+ if attributes.key?(:'tenure')
292
+ self.tenure = attributes[:'tenure']
293
+ end
294
+
295
+ if attributes.key?(:'work_anniversary')
296
+ self.work_anniversary = attributes[:'work_anniversary']
297
+ end
298
+
299
+ if attributes.key?(:'employment_type')
300
+ self.employment_type = attributes[:'employment_type']
301
+ end
302
+
303
+ if attributes.key?(:'employment_contract_type')
304
+ self.employment_contract_type = attributes[:'employment_contract_type']
305
+ end
306
+
307
+ if attributes.key?(:'employment_status')
308
+ self.employment_status = attributes[:'employment_status']
309
+ end
310
+
311
+ if attributes.key?(:'termination_date')
312
+ self.termination_date = attributes[:'termination_date']
313
+ end
314
+
315
+ if attributes.key?(:'home_location')
316
+ self.home_location = attributes[:'home_location']
317
+ end
318
+
319
+ if attributes.key?(:'work_location')
320
+ self.work_location = attributes[:'work_location']
321
+ end
322
+
323
+ if attributes.key?(:'company_name')
324
+ self.company_name = attributes[:'company_name']
325
+ end
326
+
327
+ if attributes.key?(:'employments')
328
+ if (value = attributes[:'employments']).is_a?(Array)
329
+ self.employments = value
330
+ end
331
+ end
332
+
333
+ if attributes.key?(:'custom_fields')
334
+ if (value = attributes[:'custom_fields']).is_a?(Array)
335
+ self.custom_fields = value
336
+ end
337
+ end
338
+ end
339
+
340
+ # Show invalid properties with the reasons. Usually used together with valid?
341
+ # @return Array for valid properties with the reasons
342
+ def list_invalid_properties
343
+ invalid_properties = Array.new
344
+ invalid_properties
345
+ end
346
+
347
+ # Check to see if the all the properties in the model are valid
348
+ # @return true if the model is valid
349
+ def valid?
350
+ true
351
+ end
352
+
353
+ # Checks equality by comparing each attribute.
354
+ # @param [Object] Object to be compared
355
+ def ==(o)
356
+ return true if self.equal?(o)
357
+ self.class == o.class &&
358
+ id == o.id &&
359
+ first_name == o.first_name &&
360
+ last_name == o.last_name &&
361
+ name == o.name &&
362
+ display_name == o.display_name &&
363
+ avatar_url == o.avatar_url &&
364
+ personal_email == o.personal_email &&
365
+ personal_phone_number == o.personal_phone_number &&
366
+ work_email == o.work_email &&
367
+ work_phone_number == o.work_phone_number &&
368
+ job_title == o.job_title &&
369
+ department == o.department &&
370
+ manager_id == o.manager_id &&
371
+ gender == o.gender &&
372
+ ethnicity == o.ethnicity &&
373
+ date_of_birth == o.date_of_birth &&
374
+ birthday == o.birthday &&
375
+ marital_status == o.marital_status &&
376
+ avatar == o.avatar &&
377
+ hire_date == o.hire_date &&
378
+ start_date == o.start_date &&
379
+ tenure == o.tenure &&
380
+ work_anniversary == o.work_anniversary &&
381
+ employment_type == o.employment_type &&
382
+ employment_contract_type == o.employment_contract_type &&
383
+ employment_status == o.employment_status &&
384
+ termination_date == o.termination_date &&
385
+ home_location == o.home_location &&
386
+ work_location == o.work_location &&
387
+ company_name == o.company_name &&
388
+ employments == o.employments &&
389
+ custom_fields == o.custom_fields
390
+ end
391
+
392
+ # @see the `==` method
393
+ # @param [Object] Object to be compared
394
+ def eql?(o)
395
+ self == o
396
+ end
397
+
398
+ # Calculates hash code according to all attributes.
399
+ # @return [Integer] Hash code
400
+ def hash
401
+ [id, first_name, last_name, name, display_name, avatar_url, personal_email, personal_phone_number, work_email, work_phone_number, job_title, department, manager_id, gender, ethnicity, date_of_birth, birthday, marital_status, avatar, hire_date, start_date, tenure, work_anniversary, employment_type, employment_contract_type, employment_status, termination_date, home_location, work_location, company_name, employments, custom_fields].hash
402
+ end
403
+
404
+ # Builds the object from hash
405
+ # @param [Hash] attributes Model attributes in the form of hash
406
+ # @return [Object] Returns the model itself
407
+ def self.build_from_hash(attributes)
408
+ new.build_from_hash(attributes)
409
+ end
410
+
411
+ # Builds the object from hash
412
+ # @param [Hash] attributes Model attributes in the form of hash
413
+ # @return [Object] Returns the model itself
414
+ def build_from_hash(attributes)
415
+ return nil unless attributes.is_a?(Hash)
416
+ attributes = attributes.transform_keys(&:to_sym)
417
+ self.class.openapi_types.each_pair do |key, type|
418
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
419
+ self.send("#{key}=", nil)
420
+ elsif type =~ /\AArray<(.*)>/i
421
+ # check to ensure the input is an array given that the attribute
422
+ # is documented as an array but the input is not
423
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
424
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
425
+ end
426
+ elsif !attributes[self.class.attribute_map[key]].nil?
427
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
428
+ end
429
+ end
430
+
431
+ self
432
+ end
433
+
434
+ # Deserializes the data based on type
435
+ # @param string type Data type
436
+ # @param string value Value to be deserialized
437
+ # @return [Object] Deserialized data
438
+ def _deserialize(type, value)
439
+ case type.to_sym
440
+ when :Time
441
+ Time.parse(value)
442
+ when :Date
443
+ Date.parse(value)
444
+ when :String
445
+ value.to_s
446
+ when :Integer
447
+ value.to_i
448
+ when :Float
449
+ value.to_f
450
+ when :Boolean
451
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
452
+ true
453
+ else
454
+ false
455
+ end
456
+ when :Object
457
+ # generic object (usually a Hash), return directly
458
+ value
459
+ when /\AArray<(?<inner_type>.+)>\z/
460
+ inner_type = Regexp.last_match[:inner_type]
461
+ value.map { |v| _deserialize(inner_type, v) }
462
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
463
+ k_type = Regexp.last_match[:k_type]
464
+ v_type = Regexp.last_match[:v_type]
465
+ {}.tap do |hash|
466
+ value.each do |k, v|
467
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
468
+ end
469
+ end
470
+ else # model
471
+ # models (e.g. Pet) or oneOf
472
+ klass = StackOneHRIS.const_get(type)
473
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
474
+ end
475
+ end
476
+
477
+ # Returns the string representation of the object
478
+ # @return [String] String presentation of the object
479
+ def to_s
480
+ to_hash.to_s
481
+ end
482
+
483
+ # to_body is an alias to to_hash (backward compatibility)
484
+ # @return [Hash] Returns the object in the form of hash
485
+ def to_body
486
+ to_hash
487
+ end
488
+
489
+ # Returns the object in the form of hash
490
+ # @return [Hash] Returns the object in the form of hash
491
+ def to_hash
492
+ hash = {}
493
+ self.class.attribute_map.each_pair do |attr, param|
494
+ value = self.send(attr)
495
+ if value.nil?
496
+ is_nullable = self.class.openapi_nullable.include?(attr)
497
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
498
+ end
499
+
500
+ hash[param] = _to_hash(value)
501
+ end
502
+ hash
503
+ end
504
+
505
+ # Outputs non-array value in the form of hash
506
+ # For object, use to_hash. Otherwise, just return the value
507
+ # @param [Object] value Any valid value
508
+ # @return [Hash] Returns the value in the form of hash
509
+ def _to_hash(value)
510
+ if value.is_a?(Array)
511
+ value.compact.map { |v| _to_hash(v) }
512
+ elsif value.is_a?(Hash)
513
+ {}.tap do |hash|
514
+ value.each { |k, v| hash[k] = _to_hash(v) }
515
+ end
516
+ elsif value.respond_to? :to_hash
517
+ value.to_hash
518
+ else
519
+ value
520
+ end
521
+ end
522
+ end
523
+ end
@@ -15,22 +15,31 @@ require 'time'
15
15
 
16
16
  module StackOneHRIS
17
17
  class Location
18
+ # The unique ID of the location
18
19
  attr_accessor :id
19
20
 
21
+ # The employee ID
20
22
  attr_accessor :employee_id
21
23
 
24
+ # The name of the location
22
25
  attr_accessor :name
23
26
 
27
+ # The phone number of the location
24
28
  attr_accessor :phone_number
25
29
 
30
+ # The first line of the address
26
31
  attr_accessor :street_1
27
32
 
33
+ # The second line of the address
28
34
  attr_accessor :street_2
29
35
 
36
+ # The city where the location is situated
30
37
  attr_accessor :city
31
38
 
39
+ # The state where the location is situated
32
40
  attr_accessor :state
33
41
 
42
+ # The ZIP code/Postal code of the location
34
43
  attr_accessor :zip_code
35
44
 
36
45
  attr_accessor :country
@@ -71,8 +80,8 @@ module StackOneHRIS
71
80
  :'city' => :'String',
72
81
  :'state' => :'String',
73
82
  :'zip_code' => :'String',
74
- :'country' => :'CountryCodeEnum',
75
- :'location_type' => :'LocationTypeEnum'
83
+ :'country' => :'LocationCountry',
84
+ :'location_type' => :'LocationLocationType'
76
85
  }
77
86
  end
78
87
 
@@ -146,17 +155,12 @@ module StackOneHRIS
146
155
  # @return Array for valid properties with the reasons
147
156
  def list_invalid_properties
148
157
  invalid_properties = Array.new
149
- if @employee_id.nil?
150
- invalid_properties.push('invalid value for "employee_id", employee_id cannot be nil.')
151
- end
152
-
153
158
  invalid_properties
154
159
  end
155
160
 
156
161
  # Check to see if the all the properties in the model are valid
157
162
  # @return true if the model is valid
158
163
  def valid?
159
- return false if @employee_id.nil?
160
164
  true
161
165
  end
162
166