def METHOD_NAME(event, context):
    for sqs_record in event["Records"]:
        try:
            sqs_record_body = json.loads((sqs_record["body"]))
            message = json.loads(sqs_record_body["Message"])
            # It is possble the payload is valid for both submission types
            # in this case we elect to submit via URL as that is the method
            # that does not require additional permissions be given to the lambda.
            if SubmissionRequestViaURL.could_be(message):
                submission = SubmissionRequestViaURL.try_from_message(message)
            elif SubmissionRequestViaS3.could_be(message):
                submission = SubmissionRequestViaS3.try_from_message(message)
            else:
                raise ValueError("Payload missing a required field")
        except ValueError as e:
            logger.exception("Failed to process submit event message.")
            logger.error(sqs_record)
            continue
        # ToDo try catch or deadletter queue to limit retries
        submission.submit(
            dynamodb_table=dynamodb.Table(DYNAMODB_TABLE),
            submissions_queue_url=SUBMISSIONS_QUEUE_URL,
        )