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(account_manager_id = nil, address = nil, business_name = nil, disabled = nil, email = nil, external_url = nil, first_name = nil, id = nil, last_name = nil, permalink = nil, phone = nil, resource_id = nil, role = nil, timezone = nil) ⇒ EntitiesUserResponse

Returns a new instance of 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( = nil,
               address = nil,
               business_name = nil,
               disabled = nil,
               email = nil,
               external_url = nil,
               first_name = nil,
               id = nil,
               last_name = nil,
               permalink = nil,
               phone = nil,
               resource_id = nil,
               role = nil,
               timezone = nil)
  @account_manager_id = 
  @address = address
  @business_name = business_name
  @disabled = disabled
  @email = email
  @external_url = external_url
  @first_name = first_name
  @id = id
  @last_name = last_name
  @permalink = permalink
  @phone = phone
  @resource_id = resource_id
  @role = role
  @timezone = timezone
end

Instance Attribute Details

#account_manager_idInteger

id of Account Manager user for User

Returns:

  • (Integer)


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

def 
  @account_manager_id
end

#addressEntitiesAddressEntity

address of User



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

def address
  @address
end

#business_nameString

business name for User

Returns:



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

def business_name
  @business_name
end

#disabledBoolean

status of user

Returns:

  • (Boolean)


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

def disabled
  @disabled
end

#emailString

email of User

Returns:



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

def email
  @email
end

#external_urlString

external url to business

Returns:



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

def external_url
  @external_url
end

#first_nameString

first name of User

Returns:



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

def first_name
  @first_name
end

#idInteger

id of User

Returns:

  • (Integer)


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

def id
  @id
end

#last_nameString

last name of User

Returns:



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

def last_name
  @last_name
end

permalink of User

Returns:



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

def permalink
  @permalink
end

#phoneString

phone number of User

Returns:



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

def phone
  @phone
end

#resource_idInteger

id of defacto Resource for User

Returns:

  • (Integer)


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

def resource_id
  @resource_id
end

#roleString

User account type

Returns:



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

def role
  @role
end

#timezoneString

timezone of User,

Returns:



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

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

def self.from_hash(hash)
  if hash == nil
    nil
  else
    # Extract variables from the hash

     = hash["account_manager_id"]
    address = EntitiesAddressEntity.from_hash(hash["address"]) if hash["address"]
    business_name = hash["business_name"]
    disabled = hash["disabled"]
    email = hash["email"]
    external_url = hash["external_url"]
    first_name = hash["first_name"]
    id = hash["id"]
    last_name = hash["last_name"]
    permalink = hash["permalink"]
    phone = hash["phone"]
    resource_id = hash["resource_id"]
    role = hash["role"]
    timezone = hash["timezone"]

    # Create object from extracted values

    EntitiesUserResponse.new(,
                             address,
                             business_name,
                             disabled,
                             email,
                             external_url,
                             first_name,
                             id,
                             last_name,
                             permalink,
                             phone,
                             resource_id,
                             role,
                             timezone)
  end
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["account_manager_id"] = "account_manager_id"
    @hash["address"] = "address"
    @hash["business_name"] = "business_name"
    @hash["disabled"] = "disabled"
    @hash["email"] = "email"
    @hash["external_url"] = "external_url"
    @hash["first_name"] = "first_name"
    @hash["id"] = "id"
    @hash["last_name"] = "last_name"
    @hash["permalink"] = "permalink"
    @hash["phone"] = "phone"
    @hash["resource_id"] = "resource_id"
    @hash["role"] = "role"
    @hash["timezone"] = "timezone"
  end
  @hash
end