"""Account router""" from fastapi import APIRouter, Depends from typing import List from vultr_api import VultrClient from deps import get_client router = APIRouter() @router.get("") async def get_account(client: VultrClient = Depends(get_client)): """Get account information""" return client.account.get() @router.get("/acl") async def get_acl(client: VultrClient = Depends(get_client)): """Get account ACL (IP access control list)""" return client.account.get_acl() @router.put("/acl") async def set_acl(acls: List[str], client: VultrClient = Depends(get_client)): """Set account ACL""" return client.account.set_acl(acls) @router.post("/acl") async def add_acl(ip: str, client: VultrClient = Depends(get_client)): """Add IP to ACL""" return client.account.add_acl(ip) @router.delete("/acl/{ip}") async def remove_acl(ip: str, client: VultrClient = Depends(get_client)): """Remove IP from ACL""" return client.account.remove_acl(ip)