Sha256: d4f75d4aa2fe2b78286004657c7d29d39209ba0ae258f73c0df679d7a738e720

Contents?: true

Size: 787 Bytes

Versions: 10

Compression:

Stored size: 787 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 = service.create_user(id, path || '/').body['User']
          merge_attributes(data)
          true
        end

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

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

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

      end
    end
  end
end

Version data entries

10 entries across 10 versions & 5 rubygems

Version Path
hpfog-0.0.20 lib/fog/aws/models/iam/user.rb
vagrant-shell-0.2.6 vendor/bundle/gems/fog-1.10.1/lib/fog/aws/models/iam/user.rb
vagrant-shell-0.2.5 vendor/bundle/gems/fog-1.10.1/lib/fog/aws/models/iam/user.rb
fog-1.10.1 lib/fog/aws/models/iam/user.rb
fog-test-me-1.10.0 lib/fog/aws/models/iam/user.rb
fog-1.10.0 lib/fog/aws/models/iam/user.rb
fog-1.9.0 lib/fog/aws/models/iam/user.rb
fog-maestrodev-1.8.0.20130114204828 lib/fog/aws/models/iam/user.rb
fog-maestrodev-1.8.0.20130111070250 lib/fog/aws/models/iam/user.rb
fog-maestrodev-1.8.0.20130109172219 lib/fog/aws/models/iam/user.rb