# File lib/fog/aws/requests/lambda/list_event_source_mappings.rb, line 38
        def list_event_source_mappings(params={})
          response = Excon::Response.new
          response.status = 200

          function_name = params.delete('FunctionName')

          begin
            function = self.get_function_configuration('FunctionName' => function_name).body
            function_arn = function['FunctionArn']
          rescue Fog::AWS::Lambda::Error => e
            # interestingly enough, if you try to do a list_event_source_mappings
            # on a nonexisting function, Lambda API endpoint doesn't return
            # error, just an empty array.
          end

          event_source_mappings = []
          if function_arn
            event_source_mappings = self.data[:event_source_mappings].values.select do |m|
              m['FunctionArn'].eql?(function_arn)
            end
          end

          response.body = {
            'EventSourceMappings' => event_source_mappings,
            'NextMarker'          => nil
          }
          response
        end