Coverage for src/hush_hush/_generated/models/auth_status.py: 54%
37 statements
« prev ^ index » next coverage.py v7.16.0, created at 2026-10-16 16:01 +0000
« prev ^ index » next coverage.py v7.16.0, created at 2026-10-16 16:01 +0000
1# Code generated by openapi-python-client from hush-hush/api/openapi.yaml; DO NOT EDIT.
3from __future__ import annotations
5from collections.abc import Mapping
6from typing import Any, TypeVar
8from attrs import define as _attrs_define
9from attrs import field as _attrs_field
11T = TypeVar("T", bound="AuthStatus")
14@_attrs_define
15class AuthStatus:
16 """
17 Attributes:
18 bootstrapped (bool): Whether an admin account has been created yet.
19 authenticated (bool): Whether the request carries a valid, unexpired session cookie.
20 False for no cookie, an expired one or one that doesn't match a
21 session - still a 200, so a client can ask without being
22 answered with a 401.
23 """
25 bootstrapped: bool
26 authenticated: bool
27 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
29 def to_dict(self) -> dict[str, Any]:
30 bootstrapped = self.bootstrapped
32 authenticated = self.authenticated
34 field_dict: dict[str, Any] = {}
35 field_dict.update(self.additional_properties)
36 field_dict.update(
37 {
38 "bootstrapped": bootstrapped,
39 "authenticated": authenticated,
40 }
41 )
43 return field_dict
45 @classmethod
46 def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
47 d = dict(src_dict)
48 bootstrapped = d.pop("bootstrapped")
50 authenticated = d.pop("authenticated")
52 auth_status = cls(
53 bootstrapped=bootstrapped,
54 authenticated=authenticated,
55 )
57 auth_status.additional_properties = d
58 return auth_status
60 @property
61 def additional_keys(self) -> list[str]:
62 return list(self.additional_properties.keys())
64 def __getitem__(self, key: str) -> Any:
65 return self.additional_properties[key]
67 def __setitem__(self, key: str, value: Any) -> None:
68 self.additional_properties[key] = value
70 def __delitem__(self, key: str) -> None:
71 del self.additional_properties[key]
73 def __contains__(self, key: str) -> bool:
74 return key in self.additional_properties