Class: OpenapiClient::EmployeeResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/openapi_client/models/employee_response.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ EmployeeResponse

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
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
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
# File 'lib/openapi_client/models/employee_response.rb', line 229

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::EmployeeResponse` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::EmployeeResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'id')
    self.id = attributes[:'id']
  end

  if attributes.key?(:'remote_id')
    self.remote_id = attributes[:'remote_id']
  end

  if attributes.key?(:'employee_number')
    self.employee_number = attributes[:'employee_number']
  end

  if attributes.key?(:'first_name')
    self.first_name = attributes[:'first_name']
  end

  if attributes.key?(:'last_name')
    self.last_name = attributes[:'last_name']
  end

  if attributes.key?(:'display_full_name')
    self.display_full_name = attributes[:'display_full_name']
  end

  if attributes.key?(:'nationality')
    self.nationality = attributes[:'nationality']
  end

  if attributes.key?(:'job_title')
    self.job_title = attributes[:'job_title']
  end

  if attributes.key?(:'work_email')
    self.work_email = attributes[:'work_email']
  end

  if attributes.key?(:'personal_email')
    self.personal_email = attributes[:'personal_email']
  end

  if attributes.key?(:'mobile_phone_number')
    self.mobile_phone_number = attributes[:'mobile_phone_number']
  end

  if attributes.key?(:'tax_id')
    self.tax_id = attributes[:'tax_id']
  end

  if attributes.key?(:'gender')
    self.gender = attributes[:'gender']
  end

  if attributes.key?(:'ethnicity')
    self.ethnicity = attributes[:'ethnicity']
  end

  if attributes.key?(:'marital_status')
    self.marital_status = attributes[:'marital_status']
  end

  if attributes.key?(:'date_of_birth')
    self.date_of_birth = attributes[:'date_of_birth']
  end

  if attributes.key?(:'employment_status')
    self.employment_status = attributes[:'employment_status']
  end

  if attributes.key?(:'employment_type')
    self.employment_type = attributes[:'employment_type']
  end

  if attributes.key?(:'start_date')
    self.start_date = attributes[:'start_date']
  end

  if attributes.key?(:'remote_created_at')
    self.remote_created_at = attributes[:'remote_created_at']
  end

  if attributes.key?(:'termination_date')
    self.termination_date = attributes[:'termination_date']
  end

  if attributes.key?(:'avatar')
    self.avatar = attributes[:'avatar']
  end

  if attributes.key?(:'home_location')
    self.home_location = attributes[:'home_location']
  end

  if attributes.key?(:'work_location')
    self.work_location = attributes[:'work_location']
  end

  if attributes.key?(:'manager')
    self.manager = attributes[:'manager']
  end

  if attributes.key?(:'bank_account')
    self. = attributes[:'bank_account']
  end

  if attributes.key?(:'employment_history')
    if (value = attributes[:'employment_history']).is_a?(Array)
      self.employment_history = value
    end
  end

  if attributes.key?(:'compensation_history')
    if (value = attributes[:'compensation_history']).is_a?(Array)
      self.compensation_history = value
    end
  end

  if attributes.key?(:'custom_fields')
    self.custom_fields = attributes[:'custom_fields']
  end

  if attributes.key?(:'groups')
    if (value = attributes[:'groups']).is_a?(Array)
      self.groups = value
    end
  end

  if attributes.key?(:'dependents')
    if (value = attributes[:'dependents']).is_a?(Array)
      self.dependents = value
    end
  end

  if attributes.key?(:'emergency_contacts')
    if (value = attributes[:'emergency_contacts']).is_a?(Array)
      self.emergency_contacts = value
    end
  end
end

Instance Attribute Details

#avatarObject

Returns the value of attribute avatar.



68
69
70
# File 'lib/openapi_client/models/employee_response.rb', line 68

def avatar
  @avatar
end

#bank_accountObject

Returns the value of attribute bank_account.



76
77
78
# File 'lib/openapi_client/models/employee_response.rb', line 76

def 
  @bank_account
end

#compensation_historyObject

Returns the value of attribute compensation_history.



80
81
82
# File 'lib/openapi_client/models/employee_response.rb', line 80

def compensation_history
  @compensation_history
end

#custom_fieldsObject

Returns the value of attribute custom_fields.



82
83
84
# File 'lib/openapi_client/models/employee_response.rb', line 82

def custom_fields
  @custom_fields
end

#date_of_birthObject

Returns the value of attribute date_of_birth.



56
57
58
# File 'lib/openapi_client/models/employee_response.rb', line 56

def date_of_birth
  @date_of_birth
end

#dependentsObject

Returns the value of attribute dependents.



86
87
88
# File 'lib/openapi_client/models/employee_response.rb', line 86

def dependents
  @dependents
end

#display_full_nameObject

Returns the value of attribute display_full_name.



32
33
34
# File 'lib/openapi_client/models/employee_response.rb', line 32

def display_full_name
  @display_full_name
end

#emergency_contactsObject

Returns the value of attribute emergency_contacts.



88
89
90
# File 'lib/openapi_client/models/employee_response.rb', line 88

def emergency_contacts
  @emergency_contacts
end

#employee_numberObject

Returns the value of attribute employee_number.



24
25
26
# File 'lib/openapi_client/models/employee_response.rb', line 24

def employee_number
  @employee_number
end

#employment_historyObject

Returns the value of attribute employment_history.



78
79
80
# File 'lib/openapi_client/models/employee_response.rb', line 78

def employment_history
  @employment_history
end

#employment_statusObject

Returns the value of attribute employment_status.



58
59
60
# File 'lib/openapi_client/models/employee_response.rb', line 58

def employment_status
  @employment_status
end

#employment_typeObject

Returns the value of attribute employment_type.



60
61
62
# File 'lib/openapi_client/models/employee_response.rb', line 60

def employment_type
  @employment_type
end

#ethnicityObject

Returns the value of attribute ethnicity.



51
52
53
# File 'lib/openapi_client/models/employee_response.rb', line 51

def ethnicity
  @ethnicity
end

#first_nameObject

the first name of the individual



27
28
29
# File 'lib/openapi_client/models/employee_response.rb', line 27

def first_name
  @first_name
end

#genderObject

Returns the value of attribute gender.



49
50
51
# File 'lib/openapi_client/models/employee_response.rb', line 49

def gender
  @gender
end

#groupsObject

Returns the value of attribute groups.



84
85
86
# File 'lib/openapi_client/models/employee_response.rb', line 84

def groups
  @groups
end

#home_locationObject

Returns the value of attribute home_location.



70
71
72
# File 'lib/openapi_client/models/employee_response.rb', line 70

def home_location
  @home_location
end

#idObject

The Affix-assigned id of the individual



19
20
21
# File 'lib/openapi_client/models/employee_response.rb', line 19

def id
  @id
end

#job_titleObject

Returns the value of attribute job_title.



36
37
38
# File 'lib/openapi_client/models/employee_response.rb', line 36

def job_title
  @job_title
end

#last_nameObject

the last name of the individual



30
31
32
# File 'lib/openapi_client/models/employee_response.rb', line 30

def last_name
  @last_name
end

#managerObject

Returns the value of attribute manager.



74
75
76
# File 'lib/openapi_client/models/employee_response.rb', line 74

def manager
  @manager
end

#marital_statusObject

‘other` option can include co-habitating, civil partnership, separated, widowed, etc



54
55
56
# File 'lib/openapi_client/models/employee_response.rb', line 54

def marital_status
  @marital_status
end

#mobile_phone_numberObject

+1234567890



45
46
47
# File 'lib/openapi_client/models/employee_response.rb', line 45

def mobile_phone_number
  @mobile_phone_number
end

#nationalityObject

Returns the value of attribute nationality.



34
35
36
# File 'lib/openapi_client/models/employee_response.rb', line 34

def nationality
  @nationality
end

#personal_emailObject

the personal email of the individual



42
43
44
# File 'lib/openapi_client/models/employee_response.rb', line 42

def personal_email
  @personal_email
end

#remote_created_atObject

Returns the value of attribute remote_created_at.



64
65
66
# File 'lib/openapi_client/models/employee_response.rb', line 64

def remote_created_at
  @remote_created_at
end

#remote_idObject

the remote system-assigned id of the individual



22
23
24
# File 'lib/openapi_client/models/employee_response.rb', line 22

def remote_id
  @remote_id
end

#start_dateObject

Returns the value of attribute start_date.



62
63
64
# File 'lib/openapi_client/models/employee_response.rb', line 62

def start_date
  @start_date
end

#tax_idObject

Returns the value of attribute tax_id.



47
48
49
# File 'lib/openapi_client/models/employee_response.rb', line 47

def tax_id
  @tax_id
end

#termination_dateObject

Returns the value of attribute termination_date.



66
67
68
# File 'lib/openapi_client/models/employee_response.rb', line 66

def termination_date
  @termination_date
end

#work_emailObject

the work email of the individual



39
40
41
# File 'lib/openapi_client/models/employee_response.rb', line 39

def work_email
  @work_email
end

#work_locationObject

Returns the value of attribute work_location.



72
73
74
# File 'lib/openapi_client/models/employee_response.rb', line 72

def work_location
  @work_location
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



151
152
153
# File 'lib/openapi_client/models/employee_response.rb', line 151

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/openapi_client/models/employee_response.rb', line 113

def self.attribute_map
  {
    :'id' => :'id',
    :'remote_id' => :'remote_id',
    :'employee_number' => :'employee_number',
    :'first_name' => :'first_name',
    :'last_name' => :'last_name',
    :'display_full_name' => :'display_full_name',
    :'nationality' => :'nationality',
    :'job_title' => :'job_title',
    :'work_email' => :'work_email',
    :'personal_email' => :'personal_email',
    :'mobile_phone_number' => :'mobile_phone_number',
    :'tax_id' => :'tax_id',
    :'gender' => :'gender',
    :'ethnicity' => :'ethnicity',
    :'marital_status' => :'marital_status',
    :'date_of_birth' => :'date_of_birth',
    :'employment_status' => :'employment_status',
    :'employment_type' => :'employment_type',
    :'start_date' => :'start_date',
    :'remote_created_at' => :'remote_created_at',
    :'termination_date' => :'termination_date',
    :'avatar' => :'avatar',
    :'home_location' => :'home_location',
    :'work_location' => :'work_location',
    :'manager' => :'manager',
    :'bank_account' => :'bank_account',
    :'employment_history' => :'employment_history',
    :'compensation_history' => :'compensation_history',
    :'custom_fields' => :'custom_fields',
    :'groups' => :'groups',
    :'dependents' => :'dependents',
    :'emergency_contacts' => :'emergency_contacts'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



516
517
518
# File 'lib/openapi_client/models/employee_response.rb', line 516

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



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
# File 'lib/openapi_client/models/employee_response.rb', line 194

def self.openapi_nullable
  Set.new([
    :'employee_number',
    :'display_full_name',
    :'nationality',
    :'job_title',
    :'work_email',
    :'personal_email',
    :'mobile_phone_number',
    :'tax_id',
    :'gender',
    :'ethnicity',
    :'marital_status',
    :'date_of_birth',
    :'employment_status',
    :'employment_type',
    :'start_date',
    :'remote_created_at',
    :'termination_date',
    :'avatar',
    :'home_location',
    :'work_location',
    :'manager',
    :'bank_account',
    :'employment_history',
    :'compensation_history',
    :'custom_fields',
    :'groups',
    :'dependents',
    :'emergency_contacts'
  ])
end

.openapi_typesObject

Attribute type mapping.



156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/openapi_client/models/employee_response.rb', line 156

def self.openapi_types
  {
    :'id' => :'String',
    :'remote_id' => :'String',
    :'employee_number' => :'String',
    :'first_name' => :'String',
    :'last_name' => :'String',
    :'display_full_name' => :'String',
    :'nationality' => :'String',
    :'job_title' => :'String',
    :'work_email' => :'String',
    :'personal_email' => :'String',
    :'mobile_phone_number' => :'String',
    :'tax_id' => :'String',
    :'gender' => :'String',
    :'ethnicity' => :'String',
    :'marital_status' => :'String',
    :'date_of_birth' => :'Date',
    :'employment_status' => :'EmploymentStatusResponse',
    :'employment_type' => :'String',
    :'start_date' => :'Date',
    :'remote_created_at' => :'Date',
    :'termination_date' => :'Date',
    :'avatar' => :'String',
    :'home_location' => :'AddressResponse',
    :'work_location' => :'LocationResponse',
    :'manager' => :'EmployeeResponseManager',
    :'bank_account' => :'CreateEmployeeRequestBankAccount',
    :'employment_history' => :'Array<EmploymentHistoryResponse>',
    :'compensation_history' => :'Array<CompensationHistoryResponse>',
    :'custom_fields' => :'Object',
    :'groups' => :'Array<GroupResponse>',
    :'dependents' => :'Array<CreateEmployeeRequestDependents>',
    :'emergency_contacts' => :'Array<CreateEmployeeRequestEmergencyContacts>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
# File 'lib/openapi_client/models/employee_response.rb', line 464

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      remote_id == o.remote_id &&
      employee_number == o.employee_number &&
      first_name == o.first_name &&
      last_name == o.last_name &&
      display_full_name == o.display_full_name &&
      nationality == o.nationality &&
      job_title == o.job_title &&
      work_email == o.work_email &&
      personal_email == o.personal_email &&
      mobile_phone_number == o.mobile_phone_number &&
      tax_id == o.tax_id &&
      gender == o.gender &&
      ethnicity == o.ethnicity &&
      marital_status == o.marital_status &&
      date_of_birth == o.date_of_birth &&
      employment_status == o.employment_status &&
      employment_type == o.employment_type &&
      start_date == o.start_date &&
      remote_created_at == o.remote_created_at &&
      termination_date == o.termination_date &&
      avatar == o.avatar &&
      home_location == o.home_location &&
      work_location == o.work_location &&
      manager == o.manager &&
       == o. &&
      employment_history == o.employment_history &&
      compensation_history == o.compensation_history &&
      custom_fields == o.custom_fields &&
      groups == o.groups &&
      dependents == o.dependents &&
      emergency_contacts == o.emergency_contacts
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
# File 'lib/openapi_client/models/employee_response.rb', line 546

def _deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = OpenapiClient.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



617
618
619
620
621
622
623
624
625
626
627
628
629
# File 'lib/openapi_client/models/employee_response.rb', line 617

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
# File 'lib/openapi_client/models/employee_response.rb', line 523

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.openapi_types.each_pair do |key, type|
    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{key}=", nil)
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


503
504
505
# File 'lib/openapi_client/models/employee_response.rb', line 503

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



509
510
511
# File 'lib/openapi_client/models/employee_response.rb', line 509

def hash
  [id, remote_id, employee_number, first_name, last_name, display_full_name, nationality, job_title, work_email, personal_email, mobile_phone_number, tax_id, gender, ethnicity, marital_status, date_of_birth, employment_status, employment_type, start_date, remote_created_at, termination_date, avatar, home_location, work_location, manager, , employment_history, compensation_history, custom_fields, groups, dependents, emergency_contacts].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
# File 'lib/openapi_client/models/employee_response.rb', line 383

def list_invalid_properties
  invalid_properties = Array.new
  if @id.nil?
    invalid_properties.push('invalid value for "id", id cannot be nil.')
  end

  if @remote_id.nil?
    invalid_properties.push('invalid value for "remote_id", remote_id cannot be nil.')
  end

  if @first_name.nil?
    invalid_properties.push('invalid value for "first_name", first_name cannot be nil.')
  end

  if @last_name.nil?
    invalid_properties.push('invalid value for "last_name", last_name cannot be nil.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



593
594
595
# File 'lib/openapi_client/models/employee_response.rb', line 593

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



599
600
601
602
603
604
605
606
607
608
609
610
611
# File 'lib/openapi_client/models/employee_response.rb', line 599

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



587
588
589
# File 'lib/openapi_client/models/employee_response.rb', line 587

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
# File 'lib/openapi_client/models/employee_response.rb', line 406

def valid?
  return false if @id.nil?
  return false if @remote_id.nil?
  return false if @first_name.nil?
  return false if @last_name.nil?
  gender_validator = EnumAttributeValidator.new('String', ["male", "female", "not_specified", "null"])
  return false unless gender_validator.valid?(@gender)
  ethnicity_validator = EnumAttributeValidator.new('String', ["null", "asian", "black", "hispanic", "mixed", "not_specified", "other", "white"])
  return false unless ethnicity_validator.valid?(@ethnicity)
  marital_status_validator = EnumAttributeValidator.new('String', ["single", "married", "divorced", "not_specified", "other", "null"])
  return false unless marital_status_validator.valid?(@marital_status)
  employment_type_validator = EnumAttributeValidator.new('String', ["null", "full_time", "part_time", "contractor", "other"])
  return false unless employment_type_validator.valid?(@employment_type)
  true
end