flip_api.trusts_services.admin_get_trusts ========================================= .. py:module:: flip_api.trusts_services.admin_get_trusts Attributes ---------- .. autoapisummary:: flip_api.trusts_services.admin_get_trusts.router Functions --------- .. autoapisummary:: flip_api.trusts_services.admin_get_trusts._as_utc_iso flip_api.trusts_services.admin_get_trusts.admin_get_trusts Module Contents --------------- .. py:data:: router .. py:function:: _as_utc_iso(value: datetime.datetime | None) -> str | None Serialise a naive UTC datetime as an ISO-8601 string with a `Z` marker. The Trust columns are `timestamp without time zone` but values are written via `datetime.now(timezone.utc)` — so they're already UTC, the timezone is just stripped on persist. Tagging the wire format prevents the browser from treating the naive ISO as local time. .. py:function:: admin_get_trusts(db: sqlmodel.Session = Depends(get_session), token_id: uuid.UUID = Depends(verify_token)) -> list[flip_api.domain.interfaces.trust.IAdminTrust] List every trust with admin-level fields. :param db: Database session. :type db: Session :param token_id: Authenticated user ID, used for the admin permission check. :type token_id: UUID :returns: Every trust with name, created_at, last_heartbeat, and project_count (count of rows in ``project_trust_intersect``). :rtype: list[IAdminTrust] :raises HTTPException: 403 if the caller lacks ``CAN_ACCESS_ADMIN_PANEL``; 500 on database error.