from typing import List, Union

from fastapi import APIRouter, Request
from fastapi.exceptions import HTTPException
from sqlmodel import Session, or_, select

from ..db import ActiveSession
from ..security import (
    AdminUser,
    AuthenticatedUser,
    HashedPassword,
    User,
    UserCreate,
    UserPasswordPatch,
    UserResponse,
    get_current_user,
)

router = APIRouter()


@router.get("/", response_model=List[UserResponse], dependencies=[AdminUser])
async def list_users(*, session: Session = ActiveSession):
    users = session.exec(