Source code for bacommon.restapi.v1.accounts

# Released under the MIT License. See LICENSE for details.
#
# See CLAUDE.md in this directory for contributor conventions.
"""Account response types for REST API v1."""

from __future__ import annotations

import datetime
from dataclasses import dataclass
from typing import Annotated

from efro.dataclassio import ioprepped, IOAttrs


[docs] @ioprepped @dataclass class AccountResponse: """Public info for a single account. Returned by :attr:`~bacommon.restapi.v1.Endpoint.ACCOUNT`. """ #: Unique account ID (e.g. ``'a-12345'``). id: str #: Globally unique display name for the account. tag: str #: When the account was created. create_time: datetime.datetime #: The most recent day the account was active, or ``None`` if unknown. last_active_day: datetime.date | None #: Number of distinct days the account has been active. total_active_days: int
# Docs-generation hack; import some stuff that we likely only forward-declared # in our actual source code so that docs tools can find it. from typing import (Coroutine, Any, Literal, Callable, Generator, Awaitable, Sequence, Self) import asyncio from concurrent.futures import Future from pathlib import Path from enum import Enum