2022-04-06 20:35:34 -07:00
|
|
|
import datetime
|
2024-07-28 15:20:05 -07:00
|
|
|
from typing import Any, Dict, List, Literal, Optional, Union
|
|
|
|
from uuid import UUID
|
2022-04-06 20:35:34 -07:00
|
|
|
|
2024-07-28 15:20:05 -07:00
|
|
|
from pydantic import AnyUrl, Base64Bytes, BaseModel, ConfigDict
|
|
|
|
from pydantic_extra_types.phone_numbers import PhoneNumber
|
2022-04-06 20:35:34 -07:00
|
|
|
|
2024-07-18 12:05:04 -07:00
|
|
|
from ..models.string_uuid import StringUuid
|
2023-05-23 14:24:13 -07:00
|
|
|
from ..models.uuid import Uuid
|
2024-07-28 15:20:05 -07:00
|
|
|
from .base64data import Base64Data
|
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
|
|
|
|
|
2024-07-18 12:05:04 -07:00
|
|
|
token: StringUuid
|
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=())
|