2011-02-28 13:29:34 -05:00
|
|
|
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 = {}
|
|
|
|
end
|
|
|
|
|
|
|
|
def end_element(name)
|
|
|
|
case name
|
2012-06-05 11:46:41 -04:00
|
|
|
when 'UserName', 'PolicyName'
|
2011-05-12 16:15:13 -04:00
|
|
|
@response[name] = value
|
2012-06-05 11:46:41 -04:00
|
|
|
when 'PolicyDocument'
|
|
|
|
@response[name] = if decoded_string = URI.decode(value)
|
|
|
|
Fog::JSON.decode(decoded_string) rescue value
|
|
|
|
else
|
|
|
|
value
|
|
|
|
end
|
2011-02-28 13:29:34 -05:00
|
|
|
when 'RequestId'
|
2011-05-12 16:15:13 -04:00
|
|
|
@response[name] = value
|
2011-02-28 13:29:34 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|