"""Versioned router (v1) for {{ cookiecutter.project_name }}."""

from fastapi import APIRouter
{% if cookiecutter.use_db == "yes" %}
from fastapi import Depends

from {{ cookiecutter.project_name }}.api.v1.dependencies import check_ip_whitelist
from {{ cookiecutter.project_name }}.api.v1.routes import users
{% endif %}
{% if cookiecutter.use_auth == "yes" and cookiecutter.use_db == "yes" %}
from {{ cookiecutter.project_name }}.api.v1.routes import auth
{% endif %}

{% if cookiecutter.use_db == "yes" %}
v1_router = APIRouter(dependencies=[Depends(check_ip_whitelist)])
v1_router.include_router(users.router, prefix="/users", tags=["users"])
{% else %}
v1_router = APIRouter()
{% endif %}
{% if cookiecutter.use_auth == "yes" and cookiecutter.use_db == "yes" %}
v1_router.include_router(auth.router, prefix="/auth", tags=["auth"])
{% endif %}