示例#1
0
def step_impl(context):
    # Pass as the import to the lambda didn't fail
    context.sqs_client = get_sqs_provider(test=True)
    context.online_statuses_model = get_online_statuses_provider(test=True)
    context.customer_model = get_customers_provider(test=True)
    context.checkin_model = get_checkin_provider(test=True)
    pass
def step_impl(context):
    # Pass as the import to the lambda didn't fail
    context.sns_client = get_sns_provider(test=True)
    context.sfn_client = get_sfn_provider(test=True)
    context.checkin_model = get_checkin_provider(test=True)
    context.consultant_model = get_consultants_provider(test=True)
    context.request_model = get_requests_provider(test=True)
    context.customer_model = get_customers_provider(test=True)
    context.contract_model = get_contracts_provider(test=True)
    pass
def pub(event, context):
    '''
        AWS Serverless Handler
        -
        :param event: AWS event
        :param context: AWS Lambda context
    '''
    sqs_client = get_sqs_provider()
    consultants_model = get_consultants_provider()
    checkin_model = get_checkin_provider()

    run_scheduler(event, context, sqs_client, consultants_model, checkin_model)
def consume(event, context):
    '''
        AWS Serverless Handler
        -
        :param event: AWS event
        :param context: AWS Lambda Context
    '''
    consultants_model = get_consultants_provider()
    checkin_model = get_checkin_provider()
    request_client = get_requests_provider()

    consume_sqs(event, context, consultants_model, checkin_model, request_client)
def sub(event, context):
    '''
        AWS Serverless Handler
        -
        :param event: AWS event
        :param context: AWS Lambda context
    '''
    sqs_client = get_sqs_provider()
    customers_model = get_customers_provider()
    checkin_model = get_checkin_provider()
    contract_model = get_contracts_provider()
    weights_model = get_weights_provider()

    make_prediction(event, context, sqs_client, customers_model,\
                    checkin_model, contract_model, weights_model)
示例#6
0
def send(event, context):
    '''
        AWS Serverless Handler
        -
        :param event: AWS event
        :param context: AWS Lambda context
    '''
    print(event)
    print(context)
    checkin_model = get_checkin_provider()
    customers_model = get_customers_provider()
    requests_client = get_requests_provider()

    send_receipt(event['user_id'], event['checkin_id'], checkin_model,\
        customers_model, requests_client)
示例#7
0
 def __init__(self, payload: Dict, test: bool = False):
     '''
         Init for class
         -
         :param payload: Payload of the event
         :param test: true for test
     '''
     self.payload = payload
     self.metadata = read_metadata(payload)
     self.sqs_client = get_sqs_provider(test)
     self.requests_client = get_requests_provider(test)
     self.checkin_model = get_checkin_provider(test)
     self.customers_model = get_customers_provider(test)
     self.consultant_model = get_consultants_provider(test)
     self.contract_model = get_contracts_provider(test)
     self.stepfunctions_client = get_sfn_provider(test)
示例#8
0
def pub(event, context):
    '''
        AWS Serverless Handler

        :param event: AWS event
        :param context: AWS Lambda context

    '''
    print("Context: ", context)
    print("Event: ", event)

    checkin_model = get_checkin_provider()
    consultant_model = get_consultants_provider()
    customer_model = get_customers_provider()
    requests = get_requests_provider()
    create_report(checkin_model, consultant_model, customer_model, requests)
示例#9
0
def pub(event, context):
    '''
        AWS Serverless Handler
        -
        :param event: AWS event
        :param context: AWS Lambda context
    '''
    print("context:", context)
    print("event", event)

    checkin_model = get_checkin_provider()
    consultants_model = get_consultants_provider()
    customers_model = get_customers_provider()
    requests_client = get_requests_provider()

    run_scheduler(checkin_model, consultants_model, customers_model,
                  requests_client)
示例#10
0
def con(event, context):
    '''
        SQS Consume Handler

        :param event: AWS event
        :param context: AWS Lambda context
    '''
    checkin_model = get_checkin_provider()
    consultant_model = get_consultants_provider()
    sns_client = get_sns_provider()
    stepfunctions_client = get_sfn_provider()
    request_client = get_requests_provider()
    customer_model = get_customers_provider()
    contract_model = get_contracts_provider()
    checkin_consumer(event, context, sns_client,
                     stepfunctions_client, checkin_model,
                     consultant_model, request_client,
                     customer_model, contract_model)
def step_impl(context):
    # Pass as the import to the lambda didn't fail
    context.sqs_client = get_sqs_provider(test=True)
    context.consultants_model = get_consultants_provider(test=True)
    context.checkin_model = get_checkin_provider(test=True)
    pass