Class: Gonebusy::EntitiesUserResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/gonebusy/models/entities_user_response.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(id = nil, resource_id = nil, account_manager_id = nil, email = nil, phone = nil, first_name = nil, last_name = nil, disabled = nil, business_name = nil, external_url = nil, permalink = nil, timezone = nil, address = nil, role = nil) ⇒ EntitiesUserResponse



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
# File 'lib/gonebusy/models/entities_user_response.rb', line 83

def initialize(id = nil,
               resource_id = nil,
                = nil,
               email = nil,
               phone = nil,
               first_name = nil,
               last_name = nil,
               disabled = nil,
               business_name = nil,
               external_url = nil,
               permalink = nil,
               timezone = nil,
               address = nil,
               role = nil)
  @id = id
  @resource_id = resource_id
  @account_manager_id = 
  @email = email
  @phone = phone
  @first_name = first_name
  @last_name = last_name
  @disabled = disabled
  @business_name = business_name
  @external_url = external_url
  @permalink = permalink
  @timezone = timezone
  @address = address
  @role = role
end

Instance Attribute Details

#account_manager_idInteger

id of Account Manager user for User



15
16
17
# File 'lib/gonebusy/models/entities_user_response.rb', line 15

def 
  @account_manager_id
end

#addressEntitiesAddressEntity

address of User



55
56
57
# File 'lib/gonebusy/models/entities_user_response.rb', line 55

def address
  @address
end

#business_nameString

business name for User



39
40
41
# File 'lib/gonebusy/models/entities_user_response.rb', line 39

def business_name
  @business_name
end

#disabledBoolean

status of user



35
36
37
# File 'lib/gonebusy/models/entities_user_response.rb', line 35

def disabled
  @disabled
end

#emailString

email of User



19
20
21
# File 'lib/gonebusy/models/entities_user_response.rb', line 19

def email
  @email
end

#external_urlString

external url to business



43
44
45
# File 'lib/gonebusy/models/entities_user_response.rb', line 43

def external_url
  @external_url
end

#first_nameString

first name of User



27
28
29
# File 'lib/gonebusy/models/entities_user_response.rb', line 27

def first_name
  @first_name
end

#idInteger

id of User



7
8
9
# File 'lib/gonebusy/models/entities_user_response.rb', line 7

def id
  @id
end

#last_nameString

last name of User



31
32
33
# File 'lib/gonebusy/models/entities_user_response.rb', line 31

def last_name
  @last_name
end

permalink of User



47
48
49
# File 'lib/gonebusy/models/entities_user_response.rb', line 47

def permalink
  @permalink
end

#phoneString

phone number of User



23
24
25
# File 'lib/gonebusy/models/entities_user_response.rb', line 23

def phone
  @phone
end

#resource_idInteger

id of defacto Resource for User



11
12
13
# File 'lib/gonebusy/models/entities_user_response.rb', line 11

def resource_id
  @resource_id
end

#roleString

User account type



59
60
61
# File 'lib/gonebusy/models/entities_user_response.rb', line 59

def role
  @role
end

#timezoneString

timezone of User,



51
52
53
# File 'lib/gonebusy/models/entities_user_response.rb', line 51

def timezone
  @timezone
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash



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/gonebusy/models/entities_user_response.rb', line 114

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash
  id = hash['id']
  resource_id = hash['resource_id']
   = hash['account_manager_id']
  email = hash['email']
  phone = hash['phone']
  first_name = hash['first_name']
  last_name = hash['last_name']
  disabled = hash['disabled']
  business_name = hash['business_name']
  external_url = hash['external_url']
  permalink = hash['permalink']
  timezone = hash['timezone']
  address = EntitiesAddressEntity.from_hash(hash['address']) if hash['address']
  role = hash['role']

  # Create object from extracted values
  EntitiesUserResponse.new(id,
                           resource_id,
                           ,
                           email,
                           phone,
                           first_name,
                           last_name,
                           disabled,
                           business_name,
                           external_url,
                           permalink,
                           timezone,
                           address,
                           role)
end

.namesObject

A mapping from model property names to API property names



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/gonebusy/models/entities_user_response.rb', line 62

def self.names
  if @_hash.nil?
    @_hash = {}
    @_hash["id"] = "id"
    @_hash["resource_id"] = "resource_id"
    @_hash["account_manager_id"] = "account_manager_id"
    @_hash["email"] = "email"
    @_hash["phone"] = "phone"
    @_hash["first_name"] = "first_name"
    @_hash["last_name"] = "last_name"
    @_hash["disabled"] = "disabled"
    @_hash["business_name"] = "business_name"
    @_hash["external_url"] = "external_url"
    @_hash["permalink"] = "permalink"
    @_hash["timezone"] = "timezone"
    @_hash["address"] = "address"
    @_hash["role"] = "role"
  end
  @_hash
end