Class: WhenIWork::User
- Inherits:
-
Object
- Object
- WhenIWork::User
- Includes:
- Response
- Defined in:
- lib/wheniwork-ruby/models/user.rb
Instance Attribute Summary collapse
-
#account_id ⇒ Object
Returns the value of attribute account_id.
-
#email ⇒ Object
Returns the value of attribute email.
-
#employee_code ⇒ Object
Returns the value of attribute employee_code.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#id ⇒ Object
Returns the value of attribute id.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#locations ⇒ Object
Returns the value of attribute locations.
-
#phone_number ⇒ Object
Returns the value of attribute phone_number.
-
#positions ⇒ Object
Returns the value of attribute positions.
-
#role ⇒ Object
Returns the value of attribute role.
Attributes included from Response
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ User
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods included from Response
#_deserialize, #_to_hash, #build_from_hash, #eql?, #to_body, #to_hash, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ User
Initializes the object
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/wheniwork-ruby/models/user.rb', line 73 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} if attributes.has_key?(:'id') self.id = attributes[:'id'] end if attributes.has_key?(:'account_id') self.account_id = attributes[:'account_id'] end if attributes.has_key?(:'role') self.role = attributes[:'role'] end if attributes.has_key?(:'email') self.email = attributes[:'email'] end if attributes.has_key?(:'first_name') self.first_name = attributes[:'first_name'] end if attributes.has_key?(:'last_name') self.last_name = attributes[:'last_name'] end if attributes.has_key?(:'phone_number') self.phone_number = attributes[:'phone_number'] end if attributes.has_key?(:'employee_code') self.employee_code = attributes[:'employee_code'] end if attributes.has_key?(:'positions') if (value = attributes[:'positions']).is_a?(Array) self.positions = value end end if attributes.has_key?(:'locations') if (value = attributes[:'locations']).is_a?(Array) self.locations = value end end end |
Instance Attribute Details
#account_id ⇒ Object
Returns the value of attribute account_id.
29 30 31 |
# File 'lib/wheniwork-ruby/models/user.rb', line 29 def account_id @account_id end |
#email ⇒ Object
Returns the value of attribute email.
31 32 33 |
# File 'lib/wheniwork-ruby/models/user.rb', line 31 def email @email end |
#employee_code ⇒ Object
Returns the value of attribute employee_code.
35 36 37 |
# File 'lib/wheniwork-ruby/models/user.rb', line 35 def employee_code @employee_code end |
#first_name ⇒ Object
Returns the value of attribute first_name.
32 33 34 |
# File 'lib/wheniwork-ruby/models/user.rb', line 32 def first_name @first_name end |
#id ⇒ Object
Returns the value of attribute id.
28 29 30 |
# File 'lib/wheniwork-ruby/models/user.rb', line 28 def id @id end |
#last_name ⇒ Object
Returns the value of attribute last_name.
33 34 35 |
# File 'lib/wheniwork-ruby/models/user.rb', line 33 def last_name @last_name end |
#locations ⇒ Object
Returns the value of attribute locations.
37 38 39 |
# File 'lib/wheniwork-ruby/models/user.rb', line 37 def locations @locations end |
#phone_number ⇒ Object
Returns the value of attribute phone_number.
34 35 36 |
# File 'lib/wheniwork-ruby/models/user.rb', line 34 def phone_number @phone_number end |
#positions ⇒ Object
Returns the value of attribute positions.
36 37 38 |
# File 'lib/wheniwork-ruby/models/user.rb', line 36 def positions @positions end |
#role ⇒ Object
Returns the value of attribute role.
30 31 32 |
# File 'lib/wheniwork-ruby/models/user.rb', line 30 def role @role end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/wheniwork-ruby/models/user.rb', line 40 def self.attribute_map { :'id' => :'id', :'account_id' => :'account_id', :'role' => :'role', :'email' => :'email', :'first_name' => :'first_name', :'last_name' => :'last_name', :'phone_number' => :'phone_number', :'employee_code' => :'employee_code', :'positions' => :'positions', :'locations' => :'locations' } end |
.swagger_types ⇒ Object
Attribute type mapping.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/wheniwork-ruby/models/user.rb', line 56 def self.swagger_types { :'id' => :'Integer', :'account_id' => :'Integer', :'role' => :'Integer', :'email' => :'String', :'first_name' => :'String', :'last_name' => :'String', :'phone_number' => :'String', :'employee_code' => :'String', :'positions' => :'Array<Integer>', :'locations' => :'Array<Integer>' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/wheniwork-ruby/models/user.rb', line 139 def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && account_id == o.account_id && role == o.role && email == o.email && first_name == o.first_name && last_name == o.last_name && phone_number == o.phone_number && employee_code == o.employee_code && positions == o.positions && locations == o.locations end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
156 157 158 |
# File 'lib/wheniwork-ruby/models/user.rb', line 156 def hash [id, account_id, role, email, first_name, last_name, phone_number, employee_code, positions, locations].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
127 128 129 130 |
# File 'lib/wheniwork-ruby/models/user.rb', line 127 def list_invalid_properties invalid_properties = Array.new return invalid_properties end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
134 135 |
# File 'lib/wheniwork-ruby/models/user.rb', line 134 def valid? end |