Coverage for src/hush_hush/_generated/models/owner_identity.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
11from ..types import UNSET, Unset
13T = TypeVar("T", bound="OwnerIdentity")
16@_attrs_define
17class OwnerIdentity:
18 """
19 Attributes:
20 public_key (str | Unset): The session's user's escrowed writer identity public key (an
21 age recipient string), absent if that user hasn't completed a
22 first registration yet.
23 """
25 public_key: str | Unset = UNSET
26 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
28 def to_dict(self) -> dict[str, Any]:
29 public_key = self.public_key
31 field_dict: dict[str, Any] = {}
32 field_dict.update(self.additional_properties)
33 field_dict.update({})
34 if public_key is not UNSET:
35 field_dict["public_key"] = public_key
37 return field_dict
39 @classmethod
40 def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
41 d = dict(src_dict)
42 public_key = d.pop("public_key", UNSET)
44 owner_identity = cls(
45 public_key=public_key,
46 )
48 owner_identity.additional_properties = d
49 return owner_identity
51 @property
52 def additional_keys(self) -> list[str]:
53 return list(self.additional_properties.keys())
55 def __getitem__(self, key: str) -> Any:
56 return self.additional_properties[key]
58 def __setitem__(self, key: str, value: Any) -> None:
59 self.additional_properties[key] = value
61 def __delitem__(self, key: str) -> None:
62 del self.additional_properties[key]
64 def __contains__(self, key: str) -> bool:
65 return key in self.additional_properties