Class: OpenapiClient::CreateEmployeeRequest
- Inherits:
-
Object
- Object
- OpenapiClient::CreateEmployeeRequest
- Defined in:
- lib/openapi_client/models/create_employee_request.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.
-
#compensation_history ⇒ Object
Returns the value of attribute compensation_history.
-
#custom_fields ⇒ Object
Returns the value of attribute custom_fields.
-
#date_of_birth ⇒ Object
Returns the value of attribute date_of_birth.
-
#dependents ⇒ Object
Returns the value of attribute dependents.
-
#display_full_name ⇒ Object
Returns the value of attribute display_full_name.
-
#emergency_contacts ⇒ Object
Returns the value of attribute emergency_contacts.
-
#employee_number ⇒ Object
Returns the value of attribute employee_number.
-
#employment_history ⇒ Object
Returns the value of attribute employment_history.
-
#employment_status ⇒ Object
Returns the value of attribute employment_status.
-
#employment_type ⇒ Object
Returns the value of attribute employment_type.
-
#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.
-
#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
‘other` option can include co-habitating, civil partnership, separated, widowed, etc.
-
#mobile_phone_number ⇒ Object
+1234567890.
-
#nationality ⇒ Object
Returns the value of attribute nationality.
-
#personal_email ⇒ Object
the personal email 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 = {}) ⇒ CreateEmployeeRequest
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 = {}) ⇒ CreateEmployeeRequest
Initializes the object
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 346 347 348 349 350 351 352 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 214 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CreateEmployeeRequest` 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::CreateEmployeeRequest`. 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?(:'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?(:'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?(:'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
#avatar ⇒ Object
Returns the value of attribute avatar.
60 61 62 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 60 def avatar @avatar end |
#bank_account ⇒ Object
Returns the value of attribute bank_account.
68 69 70 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 68 def bank_account @bank_account end |
#compensation_history ⇒ Object
Returns the value of attribute compensation_history.
72 73 74 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 72 def compensation_history @compensation_history end |
#custom_fields ⇒ Object
Returns the value of attribute custom_fields.
74 75 76 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 74 def custom_fields @custom_fields end |
#date_of_birth ⇒ Object
Returns the value of attribute date_of_birth.
50 51 52 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 50 def date_of_birth @date_of_birth end |
#dependents ⇒ Object
Returns the value of attribute dependents.
78 79 80 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 78 def dependents @dependents end |
#display_full_name ⇒ Object
Returns the value of attribute display_full_name.
26 27 28 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 26 def display_full_name @display_full_name end |
#emergency_contacts ⇒ Object
Returns the value of attribute emergency_contacts.
80 81 82 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 80 def emergency_contacts @emergency_contacts end |
#employee_number ⇒ Object
Returns the value of attribute employee_number.
18 19 20 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 18 def employee_number @employee_number end |
#employment_history ⇒ Object
Returns the value of attribute employment_history.
70 71 72 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 70 def employment_history @employment_history end |
#employment_status ⇒ Object
Returns the value of attribute employment_status.
52 53 54 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 52 def employment_status @employment_status end |
#employment_type ⇒ Object
Returns the value of attribute employment_type.
54 55 56 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 54 def employment_type @employment_type end |
#ethnicity ⇒ Object
Returns the value of attribute ethnicity.
45 46 47 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 45 def ethnicity @ethnicity end |
#first_name ⇒ Object
the first name of the individual
21 22 23 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 21 def first_name @first_name end |
#gender ⇒ Object
Returns the value of attribute gender.
43 44 45 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 43 def gender @gender end |
#groups ⇒ Object
Returns the value of attribute groups.
76 77 78 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 76 def groups @groups end |
#home_location ⇒ Object
Returns the value of attribute home_location.
62 63 64 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 62 def home_location @home_location end |
#job_title ⇒ Object
Returns the value of attribute job_title.
30 31 32 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 30 def job_title @job_title end |
#last_name ⇒ Object
the last name of the individual
24 25 26 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 24 def last_name @last_name end |
#manager ⇒ Object
Returns the value of attribute manager.
66 67 68 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 66 def manager @manager end |
#marital_status ⇒ Object
‘other` option can include co-habitating, civil partnership, separated, widowed, etc
48 49 50 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 48 def marital_status @marital_status end |
#mobile_phone_number ⇒ Object
+1234567890
39 40 41 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 39 def mobile_phone_number @mobile_phone_number end |
#nationality ⇒ Object
Returns the value of attribute nationality.
28 29 30 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 28 def nationality @nationality end |
#personal_email ⇒ Object
the personal email of the individual
36 37 38 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 36 def personal_email @personal_email end |
#start_date ⇒ Object
Returns the value of attribute start_date.
56 57 58 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 56 def start_date @start_date end |
#tax_id ⇒ Object
Returns the value of attribute tax_id.
41 42 43 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 41 def tax_id @tax_id end |
#termination_date ⇒ Object
Returns the value of attribute termination_date.
58 59 60 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 58 def termination_date @termination_date end |
#work_email ⇒ Object
the work email of the individual
33 34 35 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 33 def work_email @work_email end |
#work_location ⇒ Object
Returns the value of attribute work_location.
64 65 66 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 64 def work_location @work_location end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
140 141 142 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 140 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
105 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 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 105 def self.attribute_map { :'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', :'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
476 477 478 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 476 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
180 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 210 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 180 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', :'termination_date', :'avatar', :'home_location', :'work_location', :'manager', :'bank_account', :'employment_history', :'compensation_history', :'custom_fields', :'groups', :'dependents', :'emergency_contacts' ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
145 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 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 145 def self.openapi_types { :'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' => :'EmploymentStatusNotNullRequest', :'employment_type' => :'String', :'start_date' => :'Date', :'termination_date' => :'Date', :'avatar' => :'String', :'home_location' => :'AddressNoNonNullRequest', :'work_location' => :'LocationNoNonNullRequest', :'manager' => :'CreateEmployeeRequestManager', :'bank_account' => :'CreateEmployeeRequestBankAccount', :'employment_history' => :'Array<EmploymentHistoryNoNonNullRequest>', :'compensation_history' => :'Array<CompensationHistoryNoNonNullRequest>', :'custom_fields' => :'Object', :'groups' => :'Array<GroupNoNullEnumRequest>', :'dependents' => :'Array<CreateEmployeeRequestDependents>', :'emergency_contacts' => :'Array<CreateEmployeeRequestEmergencyContacts>' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 427 def ==(o) return true if self.equal?(o) self.class == o.class && 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 && 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 && 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
506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 506 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
577 578 579 580 581 582 583 584 585 586 587 588 589 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 577 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
483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 483 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
463 464 465 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 463 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
469 470 471 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 469 def hash [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, termination_date, avatar, home_location, work_location, manager, bank_account, employment_history, compensation_history, custom_fields, groups, dependents, emergency_contacts].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
356 357 358 359 360 361 362 363 364 365 366 367 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 356 def list_invalid_properties invalid_properties = Array.new 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)
553 554 555 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 553 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
559 560 561 562 563 564 565 566 567 568 569 570 571 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 559 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
547 548 549 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 547 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
371 372 373 374 375 376 377 378 379 380 381 382 383 |
# File 'lib/openapi_client/models/create_employee_request.rb', line 371 def valid? return false if @first_name.nil? return false if @last_name.nil? gender_validator = EnumAttributeValidator.new('String', ["male", "female", "not_specified"]) return false unless gender_validator.valid?(@gender) ethnicity_validator = EnumAttributeValidator.new('String', ["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"]) return false unless marital_status_validator.valid?(@marital_status) employment_type_validator = EnumAttributeValidator.new('String', ["full_time", "part_time", "contractor", "other"]) return false unless employment_type_validator.valid?(@employment_type) true end |