def METHOD_NAME(request, domain, case_id=None):
    if request.method == 'GET' and case_id:
        return _handle_get(request, case_id)
    if request.method == 'GET' and not case_id:
        return _handle_list_view(request)
    if request.method == 'POST' and not case_id:
        return _handle_case_update(request, is_creation=True)
    if request.method == 'PUT':
        return _handle_case_update(request, is_creation=False, case_id=case_id)
    return JsonResponse({'error': "Request method not allowed"}, status=405)