def lambda_handler()

in blog/account-c-invoice-processing/invoice_processing/invoice_processing_function/app.py [0:0]


def lambda_handler(event, context):
    """Sample Lambda function reacting to EventBridge events

    Parameters
    ----------
    event: dict, required
        Event Bridge Events Format

        Event doc: https://docs.aws.amazon.com/eventbridge/latest/userguide/event-types.html

    context: object, required
        Lambda Context runtime methods and attributes

        Context doc: https://docs.aws.amazon.com/lambda/latest/dg/python-context-object.html

    Returns
    ------
        The same input event file
    """
    print(event)
    
    #Deserialize event into strongly typed object
    awsEvent:AWSEvent = Marshaller.unmarshall(event, AWSEvent)
    detail:NewOrderCreated = awsEvent.detail

    #Execute business logic
    print(f"Invoice Processing function processed event {awsEvent.detail_type}")

    #Return event for further processing
    return Marshaller.marshall(awsEvent)