Sha256: c6045e5aebead527f2682b927d242b6a6d501f89b8ed2fca40ff8720b2ca54a4

Contents?: true

Size: 1.21 KB

Versions: 69

Compression:

Stored size: 1.21 KB

Contents

module Fog
  module AWS
    class Lambda
      class Real

        # Deletes the specified Lambda function code and configuration.
        # http://docs.aws.amazon.com/lambda/latest/dg/API_DeleteFunction.html
        # ==== Parameters
        # * FunctionName <~String> - Lambda function to delete.
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~String>:
        def delete_function(params={})
          function_name = params.delete('FunctionName')
          request({
            :method  => 'DELETE',
            :path    => "/functions/#{function_name}",
            :expects => 204
          }.merge(params))
        end
      end

      class Mock
        def delete_function(params={})
          response = Excon::Response.new
          response.status = 204
          response.body = ''

          function = self.get_function_configuration(params).body
          function_id = function['FunctionArn']

          self.data[:functions].delete function_id
          self.data[:permissions].delete function_id
          self.data[:event_source_mappings].delete_if do |m,f|
            f['FunctionArn'].eql?(function_id)
          end

          response
        end
      end
    end
  end
end

Version data entries

69 entries across 67 versions & 3 rubygems

Version Path
fog-aws-3.30.0 lib/fog/aws/requests/lambda/delete_function.rb
fog-aws-3.29.0 lib/fog/aws/requests/lambda/delete_function.rb
fog-aws-3.28.0 lib/fog/aws/requests/lambda/delete_function.rb
fog-aws-3.27.0 lib/fog/aws/requests/lambda/delete_function.rb
fog-aws-3.26.0 lib/fog/aws/requests/lambda/delete_function.rb
fog-aws-3.25.0 lib/fog/aws/requests/lambda/delete_function.rb
fog-aws-3.24.0 lib/fog/aws/requests/lambda/delete_function.rb
fog-aws-3.23.0 lib/fog/aws/requests/lambda/delete_function.rb
fog-aws-3.22.0 lib/fog/aws/requests/lambda/delete_function.rb
fog-aws-3.21.1 lib/fog/aws/requests/lambda/delete_function.rb
fog-aws-3.21.0 lib/fog/aws/requests/lambda/delete_function.rb
fog-aws-3.20.0 lib/fog/aws/requests/lambda/delete_function.rb
fog-aws-3.19.0 lib/fog/aws/requests/lambda/delete_function.rb
fog-aws-3.18.0 lib/fog/aws/requests/lambda/delete_function.rb
fog-aws-3.17.0 lib/fog/aws/requests/lambda/delete_function.rb
fog-aws-3.16.0 lib/fog/aws/requests/lambda/delete_function.rb
fog-aws-3.15.0 lib/fog/aws/requests/lambda/delete_function.rb
fog-aws-3.14.0 lib/fog/aws/requests/lambda/delete_function.rb
fog-aws-3.13.0 lib/fog/aws/requests/lambda/delete_function.rb
fog-aws-3.12.0 lib/fog/aws/requests/lambda/delete_function.rb