/**
 * 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.InvokeRequest;
import software.amazon.awssdk.core.SdkBytes;
import software.amazon.awssdk.services.lambda.model.InvokeResponse;


public class LambdaInvoke {

    public static void main(String[] args) {

        InvokeResponse res = null ;
        try
        {
            Region region = Region.US_WEST_2;
            LambdaClient awsLambda = LambdaClient.builder().region(region).build();

            //Need a SdkBytes instance for the payload
            SdkBytes payload = SdkBytes.fromUtf8String("{\n" +
                    " \"Hello \": \"Paris\",\n" +
                    " \"countryCode\": \"FR\"\n" +
                    "}" ) ;

            //Setup an InvokeRequest
            InvokeRequest request =  InvokeRequest.builder()
                    .functionName("arn:aws:lambda:us-west-2:335446330391:function:HelloFunction")
                    .payload(payload)
                    .build();

            //Invoke the Lambda function
            res = awsLambda.invoke(request);

            //Get the response
            String value = res.payload().asUtf8String() ;

            //write out the response
            System.out.println(value);

        }
        catch(Exception e)
        {
            e.getStackTrace();
        }
    }
}

@@ -668,28 +668,20 @@
 on:%5B
-DynamoDBAsyncGetItem
+LambdaInvoke
 .jav
@@ -706,19 +706,37 @@
  to 
-get an item
+invoke an AWS Lambda function
  by 
@@ -749,21 +749,14 @@
 the 
-DynamoDbAsync
+Lambda
 Clie
@@ -790,16 +790,14 @@
 ce:%5B
-dynamodb
+Lambda
 %5D%0A//
@@ -851,16 +851,14 @@
 zon 
-DynamoDB
+Lambda
 %5D%0A//
@@ -992,44 +992,148 @@
 %5BAWS
-%5D%0A%0Apackage com.example.lambda.demo;%0A
+-scmacdon%5D%0A%0A// snippet-start:%5Blambda.java2.LambdaInvoke.complete%5D%0Apackage com.example.lambda;%0A%0A// snippet-start:%5Blambda.java2.invoke.import%5D
 %0Aimp
@@ -1415,16 +1415,59 @@
 sponse;%0A
+// snippet-end:%5Blambda.java2.invoke.import%5D
 %0A%0Apublic
@@ -1531,24 +1531,517 @@
 %5B%5D args) %7B%0A%0A
+      %0A        if (args.length %3C 1) %7B%0A            System.out.println(%22Please specify a function name%22);%0A            System.exit(1);%0A        %7D%0A%0A        // snippet-start:%5Blambda.java2.delete.main%5D%0A        %0A        /*%0A        Function names appear as arn:aws:lambda:us-west-2:335556330391:function:HelloFunction%0A        you can retrieve the value by looking at the function in the AWS Console%0A        */%0A        String functionName = args%5B0%5D;%0A%0A        // snippet-start:%5Blambda.java2.invoke.main%5D%0A
         Invo
@@ -2601,70 +2601,20 @@
 ame(
-%22arn:aws:lambda:us-west-2:335446330391:function:HelloFunction%22
+functionName
 )%0A  
@@ -3030,8 +3030,110 @@
     
-%7D%0A%7D
+    // snippet-end:%5Blambda.java2.invoke.main%5D%0A    %7D%0A%7D%0A// snippet-end:%5Blambda.java2.LambdaInvoke.complete%5D
 %0A

Update LambdaInvoke.java