import json


def getProcessedCloudtrailRecords(cloudtrailRecords=None):
    """
    This function accepts the 'Records' portion of a
    cloudtrail monitoring report as a json object
    and extracts records to build a valid json string that can
    be stored in s3 and read by snowflake. The json string
    will be an array of records objects.
    """
    # validate input
    if not cloudtrailRecords :
        raise ValueError('cannot accept None / empty values')

    # get initialize processed records list
    processedRecords = [cloudtrailRecord for cloudtrailRecord in cloudtrailRecords]

    return json.dumps(processedRecords)