Sha256: 4a3f77476df3098d3b137ef832fa75e01295416f002952fe22e6b0bde12050a8

Contents?: true

Size: 886 Bytes

Versions: 16

Compression:

Stored size: 886 Bytes

Contents

module Fog
  module Parsers
    module AWS
      module IAM
        class GetUserPolicy < Fog::Parsers::Base
        # http://docs.amazonwebservices.com/IAM/latest/APIReference/API_GetUserPolicy.html

          def reset
            @response = { 'Policy' => {} }
          end

          def end_element(name)
            case name
            when 'UserName', 'PolicyName'
              @response['Policy'][name] = value
            when 'PolicyDocument'
              @response['Policy'][name] = if decoded_string = URI.decode_www_form_component(value)
                                  Fog::JSON.decode(decoded_string) rescue value
                                else
                                  value
                                end
            when 'RequestId'
              @response[name] = value
            end
          end
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
fog-aws-3.29.0 lib/fog/aws/parsers/iam/get_user_policy.rb
fog-aws-3.28.0 lib/fog/aws/parsers/iam/get_user_policy.rb
fog-aws-3.27.0 lib/fog/aws/parsers/iam/get_user_policy.rb
fog-aws-3.26.0 lib/fog/aws/parsers/iam/get_user_policy.rb
fog-aws-3.25.0 lib/fog/aws/parsers/iam/get_user_policy.rb
fog-aws-3.24.0 lib/fog/aws/parsers/iam/get_user_policy.rb
fog-aws-3.23.0 lib/fog/aws/parsers/iam/get_user_policy.rb
fog-aws-3.22.0 lib/fog/aws/parsers/iam/get_user_policy.rb
fog-aws-3.21.1 lib/fog/aws/parsers/iam/get_user_policy.rb
fog-aws-3.21.0 lib/fog/aws/parsers/iam/get_user_policy.rb
fog-aws-3.20.0 lib/fog/aws/parsers/iam/get_user_policy.rb
fog-aws-3.19.0 lib/fog/aws/parsers/iam/get_user_policy.rb
fog-aws-3.18.0 lib/fog/aws/parsers/iam/get_user_policy.rb
fog-aws-3.17.0 lib/fog/aws/parsers/iam/get_user_policy.rb
fog-aws-3.16.0 lib/fog/aws/parsers/iam/get_user_policy.rb
fog-aws-3.15.0 lib/fog/aws/parsers/iam/get_user_policy.rb