Class: Fog::AWS::IAM::User

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/aws/models/iam/user.rb

Instance Attribute Summary

Attributes inherited from Model

#collection, #service

Instance Method Summary collapse

Methods inherited from Model

#initialize, #inspect, #reload, #symbolize_keys, #to_json, #wait_for

Methods included from Fog::Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Core::DeprecatedConnectionAccessors

#connection, #connection=, #prepare_service_value

Methods included from Fog::Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one

Constructor Details

This class inherits a constructor from Fog::Model

Instance Method Details

#access_keysObject



33
34
35
36
# File 'lib/fog/aws/models/iam/user.rb', line 33

def access_keys
  requires :id
  service.access_keys(:username => id)
end

#destroyObject



22
23
24
25
26
# File 'lib/fog/aws/models/iam/user.rb', line 22

def destroy
  requires :id
  service.delete_user(id)
  true
end

#policiesObject



28
29
30
31
# File 'lib/fog/aws/models/iam/user.rb', line 28

def policies
  requires :id
  service.policies(:username => id)
end

#saveObject



15
16
17
18
19
20
# File 'lib/fog/aws/models/iam/user.rb', line 15

def save
  requires :id
  data = service.create_user(id, path || '/').body['User']
  merge_attributes(data)
  true
end