Last active
June 5, 2018 18:23
-
-
Save misterussell/0fc00a26c69f3b7a4c3fb0e5d8d3361c to your computer and use it in GitHub Desktop.
resolver request mapping template for 6 5 18 post
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#set($recipedata = []) | |
#foreach($recipe in ${ctx.args.recipes}) | |
$util.qr($recipe.put("author", $ctx.identity.username )) | |
$util.qr($recipedata.add($util.dynamodb.toMapValues($recipe))) | |
#end | |
#set($elementsdata = []) | |
#foreach($element in ${ctx.args.elements}) | |
$util.qr($elementsdata.add($util.dynamodb.toMapValues($element))) | |
#end | |
#set($ingredientsdata = []) | |
#foreach($ingredient in ${ctx.args.ingredients}) | |
$util.qr($ingredientsdata.add($util.dynamodb.toMapValues($ingredient))) | |
#end | |
{ | |
"version" : "2018-05-29", | |
"operation" : "BatchPutItem", | |
"tables" : { | |
"RecipeTable": $utils.toJson($recipedata), | |
"ElementTable": $utils.toJson($elementsdata), | |
"IngredientTable": $utils.toJson($ingredientsdata) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment