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



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

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

#destroyObject



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

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

#policiesObject



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

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

#saveObject



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

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