Skip to content

Instantly share code, notes, and snippets.

@appwiz
Created October 15, 2018 04:02
Show Gist options
  • Save appwiz/60fdcbeb97b8aaef2b8f5e804dc3261b to your computer and use it in GitHub Desktop.
Save appwiz/60fdcbeb97b8aaef2b8f5e804dc3261b to your computer and use it in GitHub Desktop.
Voice Commands - API - CreateColorCommand
{
"version": "2017-02-28",
"operation": "PutItem",
"key": {
"id": $util.dynamodb.toDynamoDBJson($util.autoId()),
"timestamp": $util.dynamodb.toDynamoDBJson($util.time.nowISO8601()),
},
"attributeValues": $util.dynamodb.toMapValuesJson($ctx.args.input),
"condition": {
"expression": "attribute_not_exists(#id) AND attribute_not_exists(#timestamp)",
"expressionNames": {
"#id": "id",
"#timestamp": "timestamp",
},
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment