2010-11-08 07:21:31 -05:00
|
|
|
require 'fog/core/model'
|
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Brightbox
|
|
|
|
class Compute
|
|
|
|
|
|
|
|
class User < Fog::Model
|
|
|
|
|
|
|
|
identity :id
|
|
|
|
|
|
|
|
attribute :url
|
|
|
|
attribute :resource_type
|
|
|
|
attribute :name
|
|
|
|
attribute :email_address
|
|
|
|
attribute :email_verified
|
|
|
|
attribute :ssh_key
|
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2010-11-09 12:40:04 -05:00
|
|
|
data = connection.update_user(identity, options)
|
2010-11-08 07:21:31 -05:00
|
|
|
merge_attributes(data)
|
|
|
|
true
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|