Ejemplo n.º 1
0
def main(event, context):
    s3 = boto3.client('s3')
    path = 'tickets'
    try:
        now = datetime.now().strftime("%Y/%m/%d/%H:%M:%S")
        result = zoho_auth_function.main(path)
        response = result['body']['data']

        s3.put_object(Body=str(json.dumps(response)),
                      Bucket=BUCKET,
                      Key=f'{path}/{now}.json')
    except Exception as e:
        return str(e)
Ejemplo n.º 2
0
def main(event, context):
    s3 = boto3.client('s3')
    department_id = event['department_id']
    params = f'?department={department_id}'
    base_path = 'customerHappiness'
    path = f'{base_path}{params}'
    try:
        now = datetime.now().strftime("%Y/%m/%d/%H:%M:%S")
        result = zoho_auth_function.main(path)
        response = result['body']['data']
        s3.put_object(
            Body=str(json.dumps(response)),
            Bucket=BUCKET,
            Key=f'{base_path}/departmentId:{department_id}/{now}.json')
    except Exception as e:
        return str(e)
Ejemplo n.º 3
0
def main(event, context):
    s3 = boto3.client('s3')
    status = event['status']
    params = f'?status={status}'
    base_path = 'ticketsByStatus'
    path = f'{base_path}{params}'

    try:
        now = datetime.now().strftime("%Y/%m/%d/%H:%M:%S")
        result = zoho_auth_function.main(path)
        response = result['body']['data']

        s3.put_object(Body=str(json.dumps(response)),
                      Bucket=BUCKET,
                      Key=f'queue/{base_path}/{status}/{now}.json')
    except Exception as e:
        return str(e)