示例#1
0
def get(event, context):
    '''
        AWS Serverless Handler
        -
        :param event: AWS event
        :param context: AWS Lambda Context
    '''
    consultants_model = get_consultants_provider()
    online_status_model = get_online_statuses_provider()
    requests_client = get_requests_provider()

    run(event, context, consultants_model, online_status_model,
        requests_client)
def signup(event, context):
    '''
        AWS Lambda Handler
        -
        :param event: AWS Event
        :param context: AWS Lambda context
    '''
    print("context: ", context)
    print("event: ", event['body'])
    requests = get_requests_provider()
    consultant_model = get_consultants_provider()
    command = register(event, requests, consultant_model)
    return command
示例#3
0
def sub(event, context):
    '''
        AWS Serverless Handler
        -
        :param event: AWS event
        :param context: AWS Lambda context
    '''
    sqs_client = get_sqs_provider()
    consultants_model = get_consultants_provider()
    requests_client = get_requests_provider()

    make_prediction(event, context, sqs_client, consultants_model,
                    requests_client)
def process(event, context):
    '''
        AWS Serverless Handler
        -
        :param event: AWS event
        :param context: AWS Lambda context
    '''
    print(event)
    print(context)

    requests_client = get_requests_provider()
    consultant_model = get_consultants_provider()

    return proccess_request(event, requests_client, consultant_model)
示例#5
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)
示例#6
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)
示例#7
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)
示例#8
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)
示例#9
0
def step_impl(context):
    context.request = get_requests_provider(test=True)
    context.consultant_model = get_consultants_provider(test=True)
    pass
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