/**
 * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * This file is licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License. A copy of
 * the License is located at
 *
 * http://aws.amazon.com/apache2.0/
 *
 * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 *
 */

// snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.]
// snippet-sourcedescription:[DynamoDBAsyncGetItem.java demonstrates how to get an item by using the DynamoDbAsyncClient object]
// snippet-service:[dynamodb]
// snippet-keyword:[Java]
// snippet-keyword:[Amazon DynamoDB]
// snippet-keyword:[Code Sample]
// snippet-sourcetype:[full-example]
// snippet-sourcedate:[2019-11-19]
// snippet-sourceauthor:[AWS]

package com.example.lambda.demo;

import software.amazon.awssdk.services.lambda.LambdaClient;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.lambda.model.InvokeResponse;
import software.amazon.awssdk.services.lambda.model.DeleteFunctionRequest;
import software.amazon.awssdk.services.lambda.model.ServiceException;


public class DeleteFunction {

    public static void main(String[] args) {

        if (args.length < 1) {
            System.out.println("Please specify a function name");
            System.exit(1);
        }

        InvokeResponse res = null ;
        String functionName = args[0];
        try
        {
            Region region = Region.US_WEST_2;
            LambdaClient awsLambda = LambdaClient.builder().region(region).build();

            //Setup an InvokeRequest
            DeleteFunctionRequest request =  DeleteFunctionRequest.builder()
                    .functionName(functionName)
                     .build();

            //Invoke the Lambda function
            awsLambda.deleteFunction(request);

            //write out the response
            System.out.println("Done");
        }
        catch(ServiceException e)
        {
            e.getStackTrace();
        }
    }
}

@@ -993,44 +993,150 @@
 %5BAWS
-%5D%0A%0Apackage com.example.lambda.demo;%0A
+-scmacdon%5D%0A%0A%0A// snippet-start:%5Blambda.Java.DeleteFunction.complete%5D%0Apackage com.example.lambda;%0A%0A// snippet-start:%5Blambda.java2.delete.import%5D
 %0Aimp
@@ -1242,76 +1242,8 @@
 on;%0A
-import software.amazon.awssdk.services.lambda.model.InvokeResponse;%0A
 impo
@@ -1383,16 +1383,59 @@
 eption;%0A
+// snippet-end:%5Blambda.java2.delete.import%5D
 %0A%0Apublic
@@ -1653,35 +1653,51 @@
     
-InvokeResponse res = null ;
+// snippet-start:%5Blambda.java2.delete.main%5D
 %0A   
@@ -1908,22 +1908,30 @@
 etup an 
-Invoke
+DeleteFunction
 Request%0A
@@ -2075,17 +2075,16 @@
         
- 
 .build()
@@ -2118,24 +2118,37 @@
  Lambda 
-function
+deleteFunction method
 %0A       
@@ -2190,46 +2190,8 @@
 st);
-%0A%0A            //write out the response
 %0A   
@@ -2326,12 +2326,116 @@
   %7D%0A
-    %7D%0A%7D
+%0A        // snippet-end:%5Blambda.java2.delete.main%5D%0A    %7D%0A%7D%0A// snippet-end:%5Blambda.Java.DeleteFunction.complete%5D
 %0A

Update DeleteFunction.java