Class: OpenapiClient::EmployeeResponse
- Inherits:
-
Object
- Object
- OpenapiClient::EmployeeResponse
- Defined in:
- lib/openapi_client/models/employee_response.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#avatar ⇒ Object
Returns the value of attribute avatar.
-
#bank_account ⇒ Object
Returns the value of attribute bank_account.
-
#custom_fields ⇒ Object
Returns the value of attribute custom_fields.
-
#date_of_birth ⇒ Object
Returns the value of attribute date_of_birth.
-
#display_full_name ⇒ Object
Returns the value of attribute display_full_name.
-
#employee_number ⇒ Object
Returns the value of attribute employee_number.
-
#employment_status ⇒ Object
Returns the value of attribute employment_status.
-
#employment_type ⇒ Object
Returns the value of attribute employment_type.
-
#employments ⇒ Object
Returns the value of attribute employments.
-
#ethnicity ⇒ Object
Returns the value of attribute ethnicity.
-
#first_name ⇒ Object
the first name of the individual.
-
#gender ⇒ Object
Returns the value of attribute gender.
-
#groups ⇒ Object
Returns the value of attribute groups.
-
#home_location ⇒ Object
Returns the value of attribute home_location.
-
#id ⇒ Object
The Affix-assigned id of the individual.
-
#job_title ⇒ Object
Returns the value of attribute job_title.
-
#last_name ⇒ Object
the last name of the individual.
-
#manager ⇒ Object
Returns the value of attribute manager.
-
#marital_status ⇒ Object
Returns the value of attribute marital_status.
-
#mobile_phone_number ⇒ Object
+1234567890.
-
#nationality ⇒ Object
Returns the value of attribute nationality.
-
#personal_email ⇒ Object
the personal email of the individual.
-
#remote_created_at ⇒ Object
Returns the value of attribute remote_created_at.
-
#remote_id ⇒ Object
the remote system-assigned id of the individual.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
-
#tax_id ⇒ Object
Returns the value of attribute tax_id.
-
#termination_date ⇒ Object
Returns the value of attribute termination_date.
-
#work_email ⇒ Object
the work email of the individual.
-
#work_location ⇒ Object
Returns the value of attribute work_location.
Class Method Summary collapse
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ EmployeeResponse
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ EmployeeResponse
Initializes the object
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 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 |
# File 'lib/openapi_client/models/employee_response.rb', line 213 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.bank_account = attributes[:'bank_account'] end if attributes.key?(:'employments') if (value = attributes[:'employments']).is_a?(Array) self.employments = 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 end |
Instance Attribute Details
#avatar ⇒ Object
Returns the value of attribute avatar.
67 68 69 |
# File 'lib/openapi_client/models/employee_response.rb', line 67 def avatar @avatar end |
#bank_account ⇒ Object
Returns the value of attribute bank_account.
75 76 77 |
# File 'lib/openapi_client/models/employee_response.rb', line 75 def bank_account @bank_account end |
#custom_fields ⇒ Object
Returns the value of attribute custom_fields.
79 80 81 |
# File 'lib/openapi_client/models/employee_response.rb', line 79 def custom_fields @custom_fields end |
#date_of_birth ⇒ Object
Returns the value of attribute date_of_birth.
55 56 57 |
# File 'lib/openapi_client/models/employee_response.rb', line 55 def date_of_birth @date_of_birth end |
#display_full_name ⇒ Object
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 |
#employee_number ⇒ Object
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_status ⇒ Object
Returns the value of attribute employment_status.
57 58 59 |
# File 'lib/openapi_client/models/employee_response.rb', line 57 def employment_status @employment_status end |
#employment_type ⇒ Object
Returns the value of attribute employment_type.
59 60 61 |
# File 'lib/openapi_client/models/employee_response.rb', line 59 def employment_type @employment_type end |
#employments ⇒ Object
Returns the value of attribute employments.
77 78 79 |
# File 'lib/openapi_client/models/employee_response.rb', line 77 def employments @employments end |
#ethnicity ⇒ Object
Returns the value of attribute ethnicity.
51 52 53 |
# File 'lib/openapi_client/models/employee_response.rb', line 51 def ethnicity @ethnicity end |
#first_name ⇒ Object
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 |
#gender ⇒ Object
Returns the value of attribute gender.
49 50 51 |
# File 'lib/openapi_client/models/employee_response.rb', line 49 def gender @gender end |
#groups ⇒ Object
Returns the value of attribute groups.
81 82 83 |
# File 'lib/openapi_client/models/employee_response.rb', line 81 def groups @groups end |
#home_location ⇒ Object
Returns the value of attribute home_location.
69 70 71 |
# File 'lib/openapi_client/models/employee_response.rb', line 69 def home_location @home_location end |
#id ⇒ Object
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_title ⇒ Object
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_name ⇒ Object
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 |
#manager ⇒ Object
Returns the value of attribute manager.
73 74 75 |
# File 'lib/openapi_client/models/employee_response.rb', line 73 def manager @manager end |
#marital_status ⇒ Object
Returns the value of attribute marital_status.
53 54 55 |
# File 'lib/openapi_client/models/employee_response.rb', line 53 def marital_status @marital_status end |
#mobile_phone_number ⇒ Object
+1234567890
45 46 47 |
# File 'lib/openapi_client/models/employee_response.rb', line 45 def mobile_phone_number @mobile_phone_number end |
#nationality ⇒ Object
Returns the value of attribute nationality.
34 35 36 |
# File 'lib/openapi_client/models/employee_response.rb', line 34 def nationality @nationality end |
#personal_email ⇒ Object
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_at ⇒ Object
Returns the value of attribute remote_created_at.
63 64 65 |
# File 'lib/openapi_client/models/employee_response.rb', line 63 def remote_created_at @remote_created_at end |
#remote_id ⇒ Object
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_date ⇒ Object
Returns the value of attribute start_date.
61 62 63 |
# File 'lib/openapi_client/models/employee_response.rb', line 61 def start_date @start_date end |
#tax_id ⇒ Object
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_date ⇒ Object
Returns the value of attribute termination_date.
65 66 67 |
# File 'lib/openapi_client/models/employee_response.rb', line 65 def termination_date @termination_date end |
#work_email ⇒ Object
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_location ⇒ Object
Returns the value of attribute work_location.
71 72 73 |
# File 'lib/openapi_client/models/employee_response.rb', line 71 def work_location @work_location end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
141 142 143 |
# File 'lib/openapi_client/models/employee_response.rb', line 141 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
106 107 108 109 110 111 112 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 |
# File 'lib/openapi_client/models/employee_response.rb', line 106 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', :'employments' => :'employments', :'custom_fields' => :'custom_fields', :'groups' => :'groups' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
491 492 493 |
# File 'lib/openapi_client/models/employee_response.rb', line 491 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
# File 'lib/openapi_client/models/employee_response.rb', line 181 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', :'employments', :'custom_fields', :'groups' ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/openapi_client/models/employee_response.rb', line 146 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' => :'String', :'employment_type' => :'String', :'start_date' => :'Date', :'remote_created_at' => :'Date', :'termination_date' => :'Date', :'avatar' => :'String', :'home_location' => :'AddressResponse', :'work_location' => :'LocationResponse', :'manager' => :'CreateEmployeeRequestManager', :'bank_account' => :'CreateEmployeeRequestBankAccount', :'employments' => :'Array<EmploymentResponse>', :'custom_fields' => :'Object', :'groups' => :'Array<GroupResponse>' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 |
# File 'lib/openapi_client/models/employee_response.rb', line 442 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 && bank_account == o.bank_account && employments == o.employments && custom_fields == o.custom_fields && groups == o.groups end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 |
# File 'lib/openapi_client/models/employee_response.rb', line 521 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
592 593 594 595 596 597 598 599 600 601 602 603 604 |
# File 'lib/openapi_client/models/employee_response.rb', line 592 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
498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 |
# File 'lib/openapi_client/models/employee_response.rb', line 498 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
478 479 480 |
# File 'lib/openapi_client/models/employee_response.rb', line 478 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
484 485 486 |
# File 'lib/openapi_client/models/employee_response.rb', line 484 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, bank_account, employments, custom_fields, groups].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 |
# File 'lib/openapi_client/models/employee_response.rb', line 349 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_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
568 569 570 |
# File 'lib/openapi_client/models/employee_response.rb', line 568 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
574 575 576 577 578 579 580 581 582 583 584 585 586 |
# File 'lib/openapi_client/models/employee_response.rb', line 574 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_s ⇒ String
Returns the string representation of the object
562 563 564 |
# File 'lib/openapi_client/models/employee_response.rb', line 562 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 |
# File 'lib/openapi_client/models/employee_response.rb', line 372 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", "not_specified", "null"]) return false unless marital_status_validator.valid?(@marital_status) employment_status_validator = EnumAttributeValidator.new('String', ["null", "active", "inactive", "pending", "leave"]) return false unless employment_status_validator.valid?(@employment_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 |