Sha256: 9d6ca14130909b41fbefb15e51d66f27d08ef1a1c79940eba74f8b6bc0d4abeb

Contents?: true

Size: 825 Bytes

Versions: 8

Compression:

Stored size: 825 Bytes

Contents

require 'fog/core/model'

module Fog
  module AWS
    class IAM

      class User < Fog::Model

        identity  :id, :aliases => 'UserName'
        attribute :path, :aliases => 'Path'
        attribute :arn, :aliases => 'Arn'
        attribute :user_id, :aliases => 'UserId'
        
        def save
          requires :id
          data = connection.create_user(id).body['User']
          merge_attributes(data)
          true
        end
        
        def destroy
          requires :id
          connection.delete_user(id)
          true
        end
        
        def policies
          requires :id
          connection.policies(:username => id)
        end
        
        def access_keys
          requires :id
          connection.access_keys(:username => id)
        end
        
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 4 rubygems

Version Path
fog-parser-fix-1.6.1 lib/fog/aws/models/iam/user.rb
fog-test-again-1.6.0 lib/fog/aws/models/iam/user.rb
fog-parser-fix-1.6.0 lib/fog/aws/models/iam/user.rb
fog-maestrodev-1.7.0.20121114190951 lib/fog/aws/models/iam/user.rb
fog-1.7.0 lib/fog/aws/models/iam/user.rb
fog-1.6.0 lib/fog/aws/models/iam/user.rb
fog-1.5.0 lib/fog/aws/models/iam/user.rb
fog-1.4.0 lib/fog/aws/models/iam/user.rb