<reponame>BitMask-Technologies/route-lift-api<filename>routelift_api/message_templates/routers.py
from message_templates.views import (create_message_settings, create_message_template, delete_message_settings,
                                     delete_message_template,
                                     get_all_message_settings, get_all_message_templates, get_all_notification_types,
                                     retrieve_message_settings, retrieve_message_template, update_message_settings,
                                     update_message_templates, )


def notification_types_router(request):
    if request.method == 'GET':
        return get_all_notification_types(request)


def single_message_templates(request, message_template_id):
    if request.method == 'PUT':
        return update_message_templates(request, message_template_id)

    if request.method == 'GET':
        return retrieve_message_template(request, message_template_id)

    if request.method == 'DELETE':
        return delete_message_template(request, message_template_id)


def all_message_templates(request):
    if request.method == 'POST':
        return create_message_template(request)
    return get_all_message_templates(request)


def message_settings(request):
    if request.method == 'POST':
        return create_message_settings(request)

    if request.method == 'PUT':
        return update_message_settings(request)

    if request.method == 'GET':
        return retrieve_message_settings(request)

    if request.method == 'DELETE':
        return delete_message_settings(request)


def all_message_settings(request):
    return get_all_message_settings(request)

from message_templates.views import (create_message_settings, create_message_template, delete_message_settings,
                                     delete_message_template,
                                     get_all_message_settings, get_all_message_templates, get_all_notification_types,
                                     retrieve_message_settings, retrieve_message_template, update_message_settings,
                                     update_message_templates, )


def notification_types_router(request):
    if request.method == 'GET':
        return get_all_notification_types(request)


def single_message_templates(request, message_template_id):
    if request.method == 'PUT':
        return update_message_templates(request, message_template_id)

    if request.method == 'GET':
        return retrieve_message_template(request, message_template_id)

    if request.method == 'DELETE':
        return delete_message_template(request, message_template_id)


def all_message_templates(request):
    if request.method == 'POST':
        return create_message_template(request)
    return get_all_message_templates(request)


def message_settings(request):
    if request.method == 'POST':
        return create_message_settings(request)

    if request.method == 'PUT':
        return update_message_settings(request)

    if request.method == 'GET':
        return retrieve_message_settings(request)

    if request.method == 'DELETE':
        return delete_message_settings(request)


def all_message_settings(request):
    return get_all_message_settings(request)