def lambda_handler(event, context):
<EOL>operations = {<EOL>'<STR_LIT>': lambda dynamo, x: dynamo.delete_item(**x),<EOL>'<STR_LIT:GET>': lambda dynamo, x: dynamo.scan(**x),<EOL>'<STR_LIT:POST>': lambda dynamo, x: dynamo.put_item(**x),<EOL>'<STR_LIT>': lambda dynamo, x: dynamo.update_item(**x),<EOL>}<EOL>operation = event['<STR_LIT>']<EOL>if operation in operations:<EOL><INDENT>payload = event['<STR_LIT>'] if operation == '<STR_LIT:GET>' else json.loads(event['<STR_LIT:body>'])<EOL>return respond(None, operations[operation](dynamo, payload))<EOL><DEDENT>else:<EOL><INDENT>return respond(ValueError('<STR_LIT>'.format(operation)))<EOL><DEDENT>
Demonstrates a simple HTTP endpoint using API Gateway. You have full
    access to the request and response payload, including headers and
    status code.

    To scan a DynamoDB table, make a GET request with the TableName as a
    query string parameter. To put, update, or delete an item, make a POST,
    PUT, or DELETE request respectively, passing in the payload to the
    DynamoDB API as a JSON body.