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

1# Code generated by openapi-python-client from hush-hush/api/openapi.yaml; DO NOT EDIT. 

2 

3from __future__ import annotations 

4 

5from collections.abc import Mapping 

6from typing import Any, TypeVar 

7 

8from attrs import define as _attrs_define 

9from attrs import field as _attrs_field 

10 

11from ..types import UNSET, Unset 

12 

13T = TypeVar("T", bound="OwnerIdentity") 

14 

15 

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 """ 

24 

25 public_key: str | Unset = UNSET 

26 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) 

27 

28 def to_dict(self) -> dict[str, Any]: 

29 public_key = self.public_key 

30 

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 

36 

37 return field_dict 

38 

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) 

43 

44 owner_identity = cls( 

45 public_key=public_key, 

46 ) 

47 

48 owner_identity.additional_properties = d 

49 return owner_identity 

50 

51 @property 

52 def additional_keys(self) -> list[str]: 

53 return list(self.additional_properties.keys()) 

54 

55 def __getitem__(self, key: str) -> Any: 

56 return self.additional_properties[key] 

57 

58 def __setitem__(self, key: str, value: Any) -> None: 

59 self.additional_properties[key] = value 

60 

61 def __delitem__(self, key: str) -> None: 

62 del self.additional_properties[key] 

63 

64 def __contains__(self, key: str) -> bool: 

65 return key in self.additional_properties