def get_notification_by_id(python_client, id, notification_type):
    response = python_client.get_notification_by_id(id)

    if notification_type == 'email':
        validate(response, 'GET_notification_return_email.json')
    elif notification_type == 'sms':
        validate(response, 'GET_notification_return_sms.json')
    else:
        raise KeyError("notification type should be email|sms")
def send_sms_notification_test_response(python_client):
    mobile_number = os.environ['FUNCTIONAL_TEST_NUMBER']
    template_id = os.environ['SMS_TEMPLATE_ID']
    unique_name = str(uuid.uuid4())
    personalisation = {'name': unique_name}
    response = python_client.send_sms_notification(to=mobile_number,
                                                   template_id=template_id,
                                                   personalisation=personalisation)
    validate(response, 'POST_notification_return_sms.json')
    return response['data']['notification']['id']
def send_email_notification_test_response(python_client):
    email_address = os.environ['FUNCTIONAL_TEST_EMAIL']
    template_id = os.environ['EMAIL_TEMPLATE_ID']
    unique_name = str(uuid.uuid4())
    personalisation = {'name': unique_name}
    response = python_client.send_email_notification(to=email_address,
                                                     template_id=template_id,
                                                     personalisation=personalisation)
    validate(response, 'POST_notification_return_email.json')
    return response['data']['notification']['id']
def get_all_notifications(client):
    response = client.get_all_notifications()
    validate(response, 'GET_notifications_return.json')