stackone_hris_client 1.3.2 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +14 -5
  4. data/docs/AccountsApi.md +4 -7
  5. data/docs/CompaniesApi.md +3 -5
  6. data/docs/ConnectSessionsApi.md +3 -5
  7. data/docs/CountryCodeEnum.md +20 -0
  8. data/docs/Employee.md +5 -9
  9. data/docs/EmployeesApi.md +5 -7
  10. data/docs/Employment.md +3 -3
  11. data/docs/EmploymentStatusEnum.md +20 -0
  12. data/docs/EmploymentTypeEnum.md +20 -0
  13. data/docs/EmploymentsApi.md +3 -5
  14. data/docs/EthnicityEnum.md +20 -0
  15. data/docs/GenderEnum.md +20 -0
  16. data/docs/Location.md +2 -2
  17. data/docs/LocationTypeEnum.md +20 -0
  18. data/docs/LocationsApi.md +3 -5
  19. data/docs/MaritalStatusEnum.md +20 -0
  20. data/docs/PayFrequencyEnum.md +20 -0
  21. data/docs/PayPeriodEnum.md +20 -0
  22. data/gem-config.yml +1 -1
  23. data/lib/stackone_hris_client/models/country_code_enum.rb +270 -0
  24. data/lib/stackone_hris_client/models/employee.rb +6 -106
  25. data/lib/stackone_hris_client/models/employment.rb +3 -61
  26. data/lib/stackone_hris_client/models/employment_status_enum.rb +270 -0
  27. data/lib/stackone_hris_client/models/employment_type_enum.rb +270 -0
  28. data/lib/stackone_hris_client/models/ethnicity_enum.rb +270 -0
  29. data/lib/stackone_hris_client/models/gender_enum.rb +270 -0
  30. data/lib/stackone_hris_client/models/location.rb +2 -36
  31. data/lib/stackone_hris_client/models/location_type_enum.rb +270 -0
  32. data/lib/stackone_hris_client/models/marital_status_enum.rb +270 -0
  33. data/lib/stackone_hris_client/models/pay_frequency_enum.rb +270 -0
  34. data/lib/stackone_hris_client/models/pay_period_enum.rb +270 -0
  35. data/lib/stackone_hris_client/version.rb +1 -1
  36. data/lib/stackone_hris_client.rb +9 -0
  37. data/spec/configuration_spec.rb +3 -3
  38. data/spec/models/country_code_enum_spec.rb +44 -0
  39. data/spec/models/employment_status_enum_spec.rb +44 -0
  40. data/spec/models/employment_type_enum_spec.rb +44 -0
  41. data/spec/models/ethnicity_enum_spec.rb +44 -0
  42. data/spec/models/gender_enum_spec.rb +44 -0
  43. data/spec/models/location_type_enum_spec.rb +44 -0
  44. data/spec/models/marital_status_enum_spec.rb +44 -0
  45. data/spec/models/pay_frequency_enum_spec.rb +44 -0
  46. data/spec/models/pay_period_enum_spec.rb +44 -0
  47. metadata +38 -2
@@ -0,0 +1,270 @@
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.5.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module StackOneHRIS
17
+ class CountryCodeEnum
18
+ attr_accessor :value
19
+
20
+ attr_accessor :source_value
21
+
22
+ class EnumAttributeValidator
23
+ attr_reader :datatype
24
+ attr_reader :allowable_values
25
+
26
+ def initialize(datatype, allowable_values)
27
+ @allowable_values = allowable_values.map do |value|
28
+ case datatype.to_s
29
+ when /Integer/i
30
+ value.to_i
31
+ when /Float/i
32
+ value.to_f
33
+ else
34
+ value
35
+ end
36
+ end
37
+ end
38
+
39
+ def valid?(value)
40
+ !value || allowable_values.include?(value)
41
+ end
42
+ end
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ :'value' => :'value',
48
+ :'source_value' => :'source_value'
49
+ }
50
+ end
51
+
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ attribute_map.values
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.openapi_types
59
+ {
60
+ :'value' => :'String',
61
+ :'source_value' => :'String'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ ])
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `StackOneHRIS::CountryCodeEnum` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!self.class.attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `StackOneHRIS::CountryCodeEnum`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'value')
87
+ self.value = attributes[:'value']
88
+ end
89
+
90
+ if attributes.key?(:'source_value')
91
+ self.source_value = attributes[:'source_value']
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ invalid_properties = Array.new
99
+ if @value.nil?
100
+ invalid_properties.push('invalid value for "value", value cannot be nil.')
101
+ end
102
+
103
+ if @source_value.nil?
104
+ invalid_properties.push('invalid value for "source_value", source_value cannot be nil.')
105
+ end
106
+
107
+ invalid_properties
108
+ end
109
+
110
+ # Check to see if the all the properties in the model are valid
111
+ # @return true if the model is valid
112
+ def valid?
113
+ return false if @value.nil?
114
+ value_validator = EnumAttributeValidator.new('String', ["AF", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BQ", "BA", "BW", "BV", "BR", "IO", "BN", "BG", "BF", "BI", "KH", "CM", "CA", "CV", "KY", "CF", "TD", "CL", "CN", "CX", "CC", "CO", "KM", "CG", "CD", "CK", "CR", "HR", "CU", "CW", "CY", "CZ", "CI", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "ET", "FK", "FO", "FJ", "FI", "FR", "GF", "PF", "TF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HM", "VA", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MK", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "YT", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MP", "NO", "OM", "PK", "PW", "PS", "PA", "PG", "PY", "PE", "PH", "PN", "PL", "PT", "PR", "QA", "RO", "RU", "RW", "RE", "BL", "SH", "KN", "LC", "MF", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SJ", "SZ", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "US", "UM", "UY", "UZ", "VU", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW"])
115
+ return false unless value_validator.valid?(@value)
116
+ return false if @source_value.nil?
117
+ true
118
+ end
119
+
120
+ # Custom attribute writer method checking allowed values (enum).
121
+ # @param [Object] value Object to be assigned
122
+ def value=(value)
123
+ validator = EnumAttributeValidator.new('String', ["AF", "AL", "DZ", "AS", "AD", "AO", "AI", "AQ", "AG", "AR", "AM", "AW", "AU", "AT", "AZ", "BS", "BH", "BD", "BB", "BY", "BE", "BZ", "BJ", "BM", "BT", "BO", "BQ", "BA", "BW", "BV", "BR", "IO", "BN", "BG", "BF", "BI", "KH", "CM", "CA", "CV", "KY", "CF", "TD", "CL", "CN", "CX", "CC", "CO", "KM", "CG", "CD", "CK", "CR", "HR", "CU", "CW", "CY", "CZ", "CI", "DK", "DJ", "DM", "DO", "EC", "EG", "SV", "GQ", "ER", "EE", "ET", "FK", "FO", "FJ", "FI", "FR", "GF", "PF", "TF", "GA", "GM", "GE", "DE", "GH", "GI", "GR", "GL", "GD", "GP", "GU", "GT", "GG", "GN", "GW", "GY", "HT", "HM", "VA", "HN", "HK", "HU", "IS", "IN", "ID", "IR", "IQ", "IE", "IM", "IL", "IT", "JM", "JP", "JE", "JO", "KZ", "KE", "KI", "KP", "KR", "KW", "KG", "LA", "LV", "LB", "LS", "LR", "LY", "LI", "LT", "LU", "MO", "MK", "MG", "MW", "MY", "MV", "ML", "MT", "MH", "MQ", "MR", "MU", "YT", "MX", "FM", "MD", "MC", "MN", "ME", "MS", "MA", "MZ", "MM", "NA", "NR", "NP", "NL", "NC", "NZ", "NI", "NE", "NG", "NU", "NF", "MP", "NO", "OM", "PK", "PW", "PS", "PA", "PG", "PY", "PE", "PH", "PN", "PL", "PT", "PR", "QA", "RO", "RU", "RW", "RE", "BL", "SH", "KN", "LC", "MF", "PM", "VC", "WS", "SM", "ST", "SA", "SN", "RS", "SC", "SL", "SG", "SX", "SK", "SI", "SB", "SO", "ZA", "GS", "SS", "ES", "LK", "SD", "SR", "SJ", "SZ", "SE", "CH", "SY", "TW", "TJ", "TZ", "TH", "TL", "TG", "TK", "TO", "TT", "TN", "TR", "TM", "TC", "TV", "UG", "UA", "AE", "GB", "US", "UM", "UY", "UZ", "VU", "VE", "VN", "VG", "VI", "WF", "EH", "YE", "ZM", "ZW"])
124
+ unless validator.valid?(value)
125
+ fail ArgumentError, "invalid value for \"value\", must be one of #{validator.allowable_values}."
126
+ end
127
+ @value = value
128
+ end
129
+
130
+ # Checks equality by comparing each attribute.
131
+ # @param [Object] Object to be compared
132
+ def ==(o)
133
+ return true if self.equal?(o)
134
+ self.class == o.class &&
135
+ value == o.value &&
136
+ source_value == o.source_value
137
+ end
138
+
139
+ # @see the `==` method
140
+ # @param [Object] Object to be compared
141
+ def eql?(o)
142
+ self == o
143
+ end
144
+
145
+ # Calculates hash code according to all attributes.
146
+ # @return [Integer] Hash code
147
+ def hash
148
+ [value, source_value].hash
149
+ end
150
+
151
+ # Builds the object from hash
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ # @return [Object] Returns the model itself
154
+ def self.build_from_hash(attributes)
155
+ new.build_from_hash(attributes)
156
+ end
157
+
158
+ # Builds the object from hash
159
+ # @param [Hash] attributes Model attributes in the form of hash
160
+ # @return [Object] Returns the model itself
161
+ def build_from_hash(attributes)
162
+ return nil unless attributes.is_a?(Hash)
163
+ attributes = attributes.transform_keys(&:to_sym)
164
+ self.class.openapi_types.each_pair do |key, type|
165
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
166
+ self.send("#{key}=", nil)
167
+ elsif type =~ /\AArray<(.*)>/i
168
+ # check to ensure the input is an array given that the attribute
169
+ # is documented as an array but the input is not
170
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
171
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
172
+ end
173
+ elsif !attributes[self.class.attribute_map[key]].nil?
174
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
175
+ end
176
+ end
177
+
178
+ self
179
+ end
180
+
181
+ # Deserializes the data based on type
182
+ # @param string type Data type
183
+ # @param string value Value to be deserialized
184
+ # @return [Object] Deserialized data
185
+ def _deserialize(type, value)
186
+ case type.to_sym
187
+ when :Time
188
+ Time.parse(value)
189
+ when :Date
190
+ Date.parse(value)
191
+ when :String
192
+ value.to_s
193
+ when :Integer
194
+ value.to_i
195
+ when :Float
196
+ value.to_f
197
+ when :Boolean
198
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
199
+ true
200
+ else
201
+ false
202
+ end
203
+ when :Object
204
+ # generic object (usually a Hash), return directly
205
+ value
206
+ when /\AArray<(?<inner_type>.+)>\z/
207
+ inner_type = Regexp.last_match[:inner_type]
208
+ value.map { |v| _deserialize(inner_type, v) }
209
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
210
+ k_type = Regexp.last_match[:k_type]
211
+ v_type = Regexp.last_match[:v_type]
212
+ {}.tap do |hash|
213
+ value.each do |k, v|
214
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
215
+ end
216
+ end
217
+ else # model
218
+ # models (e.g. Pet) or oneOf
219
+ klass = StackOneHRIS.const_get(type)
220
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
221
+ end
222
+ end
223
+
224
+ # Returns the string representation of the object
225
+ # @return [String] String presentation of the object
226
+ def to_s
227
+ to_hash.to_s
228
+ end
229
+
230
+ # to_body is an alias to to_hash (backward compatibility)
231
+ # @return [Hash] Returns the object in the form of hash
232
+ def to_body
233
+ to_hash
234
+ end
235
+
236
+ # Returns the object in the form of hash
237
+ # @return [Hash] Returns the object in the form of hash
238
+ def to_hash
239
+ hash = {}
240
+ self.class.attribute_map.each_pair do |attr, param|
241
+ value = self.send(attr)
242
+ if value.nil?
243
+ is_nullable = self.class.openapi_nullable.include?(attr)
244
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
245
+ end
246
+
247
+ hash[param] = _to_hash(value)
248
+ end
249
+ hash
250
+ end
251
+
252
+ # Outputs non-array value in the form of hash
253
+ # For object, use to_hash. Otherwise, just return the value
254
+ # @param [Object] value Any valid value
255
+ # @return [Hash] Returns the value in the form of hash
256
+ def _to_hash(value)
257
+ if value.is_a?(Array)
258
+ value.compact.map { |v| _to_hash(v) }
259
+ elsif value.is_a?(Hash)
260
+ {}.tap do |hash|
261
+ value.each { |k, v| hash[k] = _to_hash(v) }
262
+ end
263
+ elsif value.respond_to? :to_hash
264
+ value.to_hash
265
+ else
266
+ value
267
+ end
268
+ end
269
+ end
270
+ end
@@ -67,10 +67,6 @@ module StackOneHRIS
67
67
 
68
68
  attr_accessor :company_name
69
69
 
70
- attr_accessor :home_country_location
71
-
72
- attr_accessor :work_country_location
73
-
74
70
  attr_accessor :home_location
75
71
 
76
72
  attr_accessor :work_location
@@ -79,28 +75,6 @@ module StackOneHRIS
79
75
 
80
76
  attr_accessor :employments
81
77
 
82
- class EnumAttributeValidator
83
- attr_reader :datatype
84
- attr_reader :allowable_values
85
-
86
- def initialize(datatype, allowable_values)
87
- @allowable_values = allowable_values.map do |value|
88
- case datatype.to_s
89
- when /Integer/i
90
- value.to_i
91
- when /Float/i
92
- value.to_f
93
- else
94
- value
95
- end
96
- end
97
- end
98
-
99
- def valid?(value)
100
- !value || allowable_values.include?(value)
101
- end
102
- end
103
-
104
78
  # Attribute mapping from ruby-style variable name to JSON key.
105
79
  def self.attribute_map
106
80
  {
@@ -130,8 +104,6 @@ module StackOneHRIS
130
104
  :'employment_status' => :'employment_status',
131
105
  :'termination_date' => :'termination_date',
132
106
  :'company_name' => :'company_name',
133
- :'home_country_location' => :'home_country_location',
134
- :'work_country_location' => :'work_country_location',
135
107
  :'home_location' => :'home_location',
136
108
  :'work_location' => :'work_location',
137
109
  :'company' => :'company',
@@ -152,11 +124,11 @@ module StackOneHRIS
152
124
  :'last_name' => :'String',
153
125
  :'name' => :'String',
154
126
  :'display_name' => :'String',
155
- :'gender' => :'String',
156
- :'ethnicity' => :'String',
127
+ :'gender' => :'GenderEnum',
128
+ :'ethnicity' => :'EthnicityEnum',
157
129
  :'date_of_birth' => :'Time',
158
130
  :'birthday' => :'Time',
159
- :'marital_status' => :'String',
131
+ :'marital_status' => :'MaritalStatusEnum',
160
132
  :'avatar_url' => :'String',
161
133
  :'personal_email' => :'String',
162
134
  :'personal_phone_number' => :'String',
@@ -169,12 +141,10 @@ module StackOneHRIS
169
141
  :'start_date' => :'Time',
170
142
  :'tenure' => :'Float',
171
143
  :'work_anniversary' => :'Time',
172
- :'employment_type' => :'String',
173
- :'employment_status' => :'String',
144
+ :'employment_type' => :'EmploymentTypeEnum',
145
+ :'employment_status' => :'EmploymentStatusEnum',
174
146
  :'termination_date' => :'Time',
175
147
  :'company_name' => :'String',
176
- :'home_country_location' => :'String',
177
- :'work_country_location' => :'String',
178
148
  :'home_location' => :'Location',
179
149
  :'work_location' => :'Location',
180
150
  :'company' => :'String',
@@ -307,14 +277,6 @@ module StackOneHRIS
307
277
  self.company_name = attributes[:'company_name']
308
278
  end
309
279
 
310
- if attributes.key?(:'home_country_location')
311
- self.home_country_location = attributes[:'home_country_location']
312
- end
313
-
314
- if attributes.key?(:'work_country_location')
315
- self.work_country_location = attributes[:'work_country_location']
316
- end
317
-
318
280
  if attributes.key?(:'home_location')
319
281
  self.home_location = attributes[:'home_location']
320
282
  end
@@ -390,73 +352,13 @@ module StackOneHRIS
390
352
  return false if @name.nil?
391
353
  return false if @display_name.nil?
392
354
  return false if @gender.nil?
393
- gender_validator = EnumAttributeValidator.new('String', ["male", "female", "non_binary", "other", "not_disclosed", "unmapped_value"])
394
- return false unless gender_validator.valid?(@gender)
395
- ethnicity_validator = EnumAttributeValidator.new('String', ["white", "black_or_african_american", "asian", "hispanic_or_latino", "american_indian_or_alaska_native", "native_hawaiian_or_pacific_islander", "two_or_more_races", "not_disclosed", "unmapped_value"])
396
- return false unless ethnicity_validator.valid?(@ethnicity)
397
- marital_status_validator = EnumAttributeValidator.new('String', ["single", "married", "divorced", "widowed", "domestic_partnership", "separated", "other", "unmapped_value"])
398
- return false unless marital_status_validator.valid?(@marital_status)
399
355
  return false if @personal_phone_number.nil?
400
356
  return false if @work_email.nil?
401
357
  return false if @work_phone_number.nil?
402
358
  return false if @department.nil?
403
- employment_type_validator = EnumAttributeValidator.new('String', ["full_time", "part_time", "contractor", "intern", "freelance", "terminated", "unmapped_value", "temporary", "seasonal", "volunteer"])
404
- return false unless employment_type_validator.valid?(@employment_type)
405
- employment_status_validator = EnumAttributeValidator.new('String', ["active", "pending", "terminated", "unmapped_value"])
406
- return false unless employment_status_validator.valid?(@employment_status)
407
359
  true
408
360
  end
409
361
 
410
- # Custom attribute writer method checking allowed values (enum).
411
- # @param [Object] gender Object to be assigned
412
- def gender=(gender)
413
- validator = EnumAttributeValidator.new('String', ["male", "female", "non_binary", "other", "not_disclosed", "unmapped_value"])
414
- unless validator.valid?(gender)
415
- fail ArgumentError, "invalid value for \"gender\", must be one of #{validator.allowable_values}."
416
- end
417
- @gender = gender
418
- end
419
-
420
- # Custom attribute writer method checking allowed values (enum).
421
- # @param [Object] ethnicity Object to be assigned
422
- def ethnicity=(ethnicity)
423
- validator = EnumAttributeValidator.new('String', ["white", "black_or_african_american", "asian", "hispanic_or_latino", "american_indian_or_alaska_native", "native_hawaiian_or_pacific_islander", "two_or_more_races", "not_disclosed", "unmapped_value"])
424
- unless validator.valid?(ethnicity)
425
- fail ArgumentError, "invalid value for \"ethnicity\", must be one of #{validator.allowable_values}."
426
- end
427
- @ethnicity = ethnicity
428
- end
429
-
430
- # Custom attribute writer method checking allowed values (enum).
431
- # @param [Object] marital_status Object to be assigned
432
- def marital_status=(marital_status)
433
- validator = EnumAttributeValidator.new('String', ["single", "married", "divorced", "widowed", "domestic_partnership", "separated", "other", "unmapped_value"])
434
- unless validator.valid?(marital_status)
435
- fail ArgumentError, "invalid value for \"marital_status\", must be one of #{validator.allowable_values}."
436
- end
437
- @marital_status = marital_status
438
- end
439
-
440
- # Custom attribute writer method checking allowed values (enum).
441
- # @param [Object] employment_type Object to be assigned
442
- def employment_type=(employment_type)
443
- validator = EnumAttributeValidator.new('String', ["full_time", "part_time", "contractor", "intern", "freelance", "terminated", "unmapped_value", "temporary", "seasonal", "volunteer"])
444
- unless validator.valid?(employment_type)
445
- fail ArgumentError, "invalid value for \"employment_type\", must be one of #{validator.allowable_values}."
446
- end
447
- @employment_type = employment_type
448
- end
449
-
450
- # Custom attribute writer method checking allowed values (enum).
451
- # @param [Object] employment_status Object to be assigned
452
- def employment_status=(employment_status)
453
- validator = EnumAttributeValidator.new('String', ["active", "pending", "terminated", "unmapped_value"])
454
- unless validator.valid?(employment_status)
455
- fail ArgumentError, "invalid value for \"employment_status\", must be one of #{validator.allowable_values}."
456
- end
457
- @employment_status = employment_status
458
- end
459
-
460
362
  # Checks equality by comparing each attribute.
461
363
  # @param [Object] Object to be compared
462
364
  def ==(o)
@@ -488,8 +390,6 @@ module StackOneHRIS
488
390
  employment_status == o.employment_status &&
489
391
  termination_date == o.termination_date &&
490
392
  company_name == o.company_name &&
491
- home_country_location == o.home_country_location &&
492
- work_country_location == o.work_country_location &&
493
393
  home_location == o.home_location &&
494
394
  work_location == o.work_location &&
495
395
  company == o.company &&
@@ -505,7 +405,7 @@ module StackOneHRIS
505
405
  # Calculates hash code according to all attributes.
506
406
  # @return [Integer] Hash code
507
407
  def hash
508
- [id, first_name, last_name, name, display_name, gender, ethnicity, date_of_birth, birthday, marital_status, avatar_url, personal_email, personal_phone_number, work_email, work_phone_number, job_title, department, manager_id, hire_date, start_date, tenure, work_anniversary, employment_type, employment_status, termination_date, company_name, home_country_location, work_country_location, home_location, work_location, company, employments].hash
408
+ [id, first_name, last_name, name, display_name, gender, ethnicity, date_of_birth, birthday, marital_status, avatar_url, personal_email, personal_phone_number, work_email, work_phone_number, job_title, department, manager_id, hire_date, start_date, tenure, work_anniversary, employment_type, employment_status, termination_date, company_name, home_location, work_location, company, employments].hash
509
409
  end
510
410
 
511
411
  # Builds the object from hash
@@ -33,28 +33,6 @@ module StackOneHRIS
33
33
 
34
34
  attr_accessor :employment_type
35
35
 
36
- class EnumAttributeValidator
37
- attr_reader :datatype
38
- attr_reader :allowable_values
39
-
40
- def initialize(datatype, allowable_values)
41
- @allowable_values = allowable_values.map do |value|
42
- case datatype.to_s
43
- when /Integer/i
44
- value.to_i
45
- when /Float/i
46
- value.to_f
47
- else
48
- value
49
- end
50
- end
51
- end
52
-
53
- def valid?(value)
54
- !value || allowable_values.include?(value)
55
- end
56
- end
57
-
58
36
  # Attribute mapping from ruby-style variable name to JSON key.
59
37
  def self.attribute_map
60
38
  {
@@ -82,11 +60,11 @@ module StackOneHRIS
82
60
  :'employee_id' => :'String',
83
61
  :'job_title' => :'String',
84
62
  :'pay_rate' => :'String',
85
- :'pay_period' => :'String',
86
- :'pay_frequency' => :'String',
63
+ :'pay_period' => :'PayPeriodEnum',
64
+ :'pay_frequency' => :'PayFrequencyEnum',
87
65
  :'pay_currency' => :'String',
88
66
  :'effective_date' => :'Time',
89
- :'employment_type' => :'String'
67
+ :'employment_type' => :'EmploymentTypeEnum'
90
68
  }
91
69
  end
92
70
 
@@ -163,45 +141,9 @@ module StackOneHRIS
163
141
  # @return true if the model is valid
164
142
  def valid?
165
143
  return false if @employee_id.nil?
166
- pay_period_validator = EnumAttributeValidator.new('String', ["hour", "day", "week", "every_two_weeks", "month", "quarter", "every_six_months", "year", "unmapped_value"])
167
- return false unless pay_period_validator.valid?(@pay_period)
168
- pay_frequency_validator = EnumAttributeValidator.new('String', ["hourly", "weekly", "bi_weekly", "four_weekly", "semi_monthly", "monthly", "quarterly", "semi_annually", "yearly", "thirteen_monthly", "pro_rata", "unmapped_value"])
169
- return false unless pay_frequency_validator.valid?(@pay_frequency)
170
- employment_type_validator = EnumAttributeValidator.new('String', ["full_time", "part_time", "contractor", "intern", "freelance", "terminated", "unmapped_value", "temporary", "seasonal", "volunteer"])
171
- return false unless employment_type_validator.valid?(@employment_type)
172
144
  true
173
145
  end
174
146
 
175
- # Custom attribute writer method checking allowed values (enum).
176
- # @param [Object] pay_period Object to be assigned
177
- def pay_period=(pay_period)
178
- validator = EnumAttributeValidator.new('String', ["hour", "day", "week", "every_two_weeks", "month", "quarter", "every_six_months", "year", "unmapped_value"])
179
- unless validator.valid?(pay_period)
180
- fail ArgumentError, "invalid value for \"pay_period\", must be one of #{validator.allowable_values}."
181
- end
182
- @pay_period = pay_period
183
- end
184
-
185
- # Custom attribute writer method checking allowed values (enum).
186
- # @param [Object] pay_frequency Object to be assigned
187
- def pay_frequency=(pay_frequency)
188
- validator = EnumAttributeValidator.new('String', ["hourly", "weekly", "bi_weekly", "four_weekly", "semi_monthly", "monthly", "quarterly", "semi_annually", "yearly", "thirteen_monthly", "pro_rata", "unmapped_value"])
189
- unless validator.valid?(pay_frequency)
190
- fail ArgumentError, "invalid value for \"pay_frequency\", must be one of #{validator.allowable_values}."
191
- end
192
- @pay_frequency = pay_frequency
193
- end
194
-
195
- # Custom attribute writer method checking allowed values (enum).
196
- # @param [Object] employment_type Object to be assigned
197
- def employment_type=(employment_type)
198
- validator = EnumAttributeValidator.new('String', ["full_time", "part_time", "contractor", "intern", "freelance", "terminated", "unmapped_value", "temporary", "seasonal", "volunteer"])
199
- unless validator.valid?(employment_type)
200
- fail ArgumentError, "invalid value for \"employment_type\", must be one of #{validator.allowable_values}."
201
- end
202
- @employment_type = employment_type
203
- end
204
-
205
147
  # Checks equality by comparing each attribute.
206
148
  # @param [Object] Object to be compared
207
149
  def ==(o)