Coverage for src/hush_hush/_generated/models/error.py: 71%
34 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="Error")
14@_attrs_define
15class Error:
16 """
17 Attributes:
18 error (str): What went wrong, in terms safe to show a caller. Nothing here
19 handles authentication with a detail worth holding back.
20 """
22 error: str
23 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
25 def to_dict(self) -> dict[str, Any]:
26 error = self.error
28 field_dict: dict[str, Any] = {}
29 field_dict.update(self.additional_properties)
30 field_dict.update(
31 {
32 "error": error,
33 }
34 )
36 return field_dict
38 @classmethod
39 def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
40 d = dict(src_dict)
41 error = d.pop("error")
43 error = cls(
44 error=error,
45 )
47 error.additional_properties = d
48 return error
50 @property
51 def additional_keys(self) -> list[str]:
52 return list(self.additional_properties.keys())
54 def __getitem__(self, key: str) -> Any:
55 return self.additional_properties[key]
57 def __setitem__(self, key: str, value: Any) -> None:
58 self.additional_properties[key] = value
60 def __delitem__(self, key: str) -> None:
61 del self.additional_properties[key]
63 def __contains__(self, key: str) -> bool:
64 return key in self.additional_properties