28 lines
907 B
Python
28 lines
907 B
Python
"""Secure Upload API module."""
|
||
from __future__ import annotations
|
||
|
||
from typing import Optional
|
||
|
||
from agravity_client.api.base import AgravityBaseApi
|
||
from agravity_client.models.secure_upload import SecureUploadEntity
|
||
|
||
|
||
class SecureUploadApi(AgravityBaseApi):
|
||
"""Covers all /secureupload endpoints."""
|
||
|
||
async def check_secure_upload(
|
||
self,
|
||
*,
|
||
token: Optional[str] = None,
|
||
) -> dict:
|
||
"""GET /secureupload – check status / retrieve upload config."""
|
||
resp = await self._get("/secureupload", params={"token": token})
|
||
return resp.json()
|
||
|
||
async def create_secure_upload(
|
||
self,
|
||
payload: Optional[dict] = None,
|
||
) -> SecureUploadEntity:
|
||
"""POST /secureupload – create a secure upload entity."""
|
||
resp = await self._post("/secureupload", json=payload)
|
||
return SecureUploadEntity.model_validate(resp.json())
|