2010-11-08 07:21:31 -05:00
|
|
|
require 'fog/core/model'
|
|
|
|
|
|
|
|
module Fog
|
2011-06-16 19:28:54 -04:00
|
|
|
module Compute
|
|
|
|
class Brightbox
|
2010-11-08 07:21:31 -05:00
|
|
|
|
|
|
|
class User < Fog::Model
|
|
|
|
|
|
|
|
identity :id
|
|
|
|
attribute :resource_type
|
2011-08-22 12:41:18 -04:00
|
|
|
attribute :url
|
|
|
|
|
2010-11-08 07:21:31 -05:00
|
|
|
attribute :name
|
|
|
|
attribute :email_address
|
|
|
|
attribute :ssh_key
|
|
|
|
|
2011-08-22 12:41:18 -04:00
|
|
|
# Boolean flags
|
|
|
|
attribute :email_verified
|
|
|
|
attribute :messaging_pref
|
|
|
|
|
|
|
|
# Links - to be replaced
|
2010-11-08 07:21:31 -05:00
|
|
|
attribute :account_id, :aliases => "default_account", :squash => "id"
|
|
|
|
attribute :accounts
|
|
|
|
|
|
|
|
def save
|
|
|
|
requires :identity
|
|
|
|
|
|
|
|
options = {
|
2010-11-19 16:45:45 -05:00
|
|
|
:email_address => email_address,
|
|
|
|
:ssh_key => ssh_key,
|
|
|
|
:name => name
|
2010-11-08 07:21:31 -05:00
|
|
|
}
|
|
|
|
|
2012-12-22 18:29:21 -05:00
|
|
|
data = service.update_user(identity, options)
|
2010-11-08 07:21:31 -05:00
|
|
|
merge_attributes(data)
|
|
|
|
true
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|