def get_policy(params={})
response = Excon::Response.new
function = self.get_function_configuration(params).body
function_arn = function['FunctionArn']
statements = self.data[:permissions][function_arn] || []
if statements.empty?
message = "ResourceNotFoundException => "
message << "The resource you requested does not exist."
raise Fog::AWS::Lambda::Error, message
end
policy = {
'Version' => '2012-10-17',
'Statement' => statements,
'Id' => 'default'
}
response.status = 200
response.body = { 'Policy' => policy }
response
end