Skip to content

Instantly share code, notes, and snippets.

@Nxtra
Created Jul 22, 2020
Embed
What would you like to do?
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