2022-04-06 20:35:34 -07:00
|
|
|
import datetime
|
2024-01-16 15:04:35 -08:00
|
|
|
from typing import Optional
|
2022-04-06 20:35:34 -07:00
|
|
|
|
2024-01-06 18:32:21 -08:00
|
|
|
from pydantic import BaseModel, ConfigDict
|
2022-04-06 20:35:34 -07:00
|
|
|
|
2023-05-23 14:24:13 -07:00
|
|
|
from ..models.uuid import Uuid
|
2022-04-06 20:35:34 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
class ApiToken(BaseModel):
|
2023-11-27 16:01:20 -08:00
|
|
|
"""An API token.
|
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
These are used to authenticate users with Bearer authentication."""
|
2023-11-27 16:01:20 -08:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
created_at: datetime.datetime
|
2023-11-27 16:01:20 -08:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
id: Uuid
|
2023-11-27 16:01:20 -08:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
is_valid: bool
|
2023-11-27 16:01:20 -08:00
|
|
|
|
2024-01-16 15:04:35 -08:00
|
|
|
label: Optional[str] = None
|
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
token: Uuid
|
2023-11-27 16:01:20 -08:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
updated_at: datetime.datetime
|
2023-11-27 16:01:20 -08:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
user_id: Uuid
|
2024-01-06 18:32:21 -08:00
|
|
|
|
|
|
|
model_config = ConfigDict(protected_namespaces=())
|