Coverage for src/hush_hush/_generated/models/ready.py: 57%

35 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 ..models.ready_status import ReadyStatus 

12 

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

14 

15 

16@_attrs_define 

17class Ready: 

18 """ 

19 Attributes: 

20 status (ReadyStatus): 

21 """ 

22 

23 status: ReadyStatus 

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

25 

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

27 status = self.status.value 

28 

29 field_dict: dict[str, Any] = {} 

30 field_dict.update(self.additional_properties) 

31 field_dict.update( 

32 { 

33 "status": status, 

34 } 

35 ) 

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 status = ReadyStatus(d.pop("status")) 

43 

44 ready = cls( 

45 status=status, 

46 ) 

47 

48 ready.additional_properties = d 

49 return ready 

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