Reorganize repos

This commit is contained in:
2024-07-23 09:15:03 +02:00
parent 4fcd45512d
commit e2db336dce
15 changed files with 0 additions and 0 deletions

27
hsapi_client/routes.py Normal file
View File

@ -0,0 +1,27 @@
from typing import Optional, List
from pydantic import BaseModel, Field
from .model import HSAPICall
from .schemas import v1Route
class v1ListRoutesResponse(BaseModel):
routes: Optional[List[Optional[v1Route]]] = Field(
alias="routes", default=None)
class Route(HSAPICall):
objectPath = "routes"
def list(self) -> v1ListRoutesResponse:
response = self.call('get')
return v1ListRoutesResponse(**response.json())
def delete(self, routeId: str) -> None:
self.call('delete', call_path=routeId)
def enable(self, routeId: int) -> None:
self.call('post', f'{routeId}/enable')
def disable(self, routeId: int) -> None:
self.call('post', f'{routeId}/disable')