Created
July 22, 2020 18:18
-
-
Save Nxtra/1bdcf9d737ab96008c49ef9682a0770f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def handle(event, context): | |
output = [] | |
for record in event['records']: | |
payload = base64.b64decode(record['data']) | |
result = dropped_or_okay(payload) | |
if result == 'Ok': | |
payload = preprocess_payload(payload) | |
output_record = { | |
'recordId': record['recordId'], | |
'result': result, | |
'data': base64.b64encode(json.dumps(payload).encode("utf-8")).decode("utf-8") | |
} | |
output.append(output_record) | |
return {'records': output} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment