-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlist_site_response_errors.py
More file actions
43 lines (29 loc) · 1.28 KB
/
list_site_response_errors.py
File metadata and controls
43 lines (29 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from typing import Any, Dict, List, Type, TypeVar
from attrs import define as _attrs_define
from attrs import field as _attrs_field
T = TypeVar("T", bound="ListSiteResponseErrors")
@_attrs_define
class ListSiteResponseErrors:
"""If there is an error accessing a vendor API then error details are provided"""
additional_properties: Dict[str, str] = _attrs_field(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
return field_dict
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
d = src_dict.copy()
list_site_response_errors = cls()
list_site_response_errors.additional_properties = d
return list_site_response_errors
@property
def additional_keys(self) -> List[str]:
return list(self.additional_properties.keys())
def __getitem__(self, key: str) -> str:
return self.additional_properties[key]
def __setitem__(self, key: str, value: str) -> None:
self.additional_properties[key] = value
def __delitem__(self, key: str) -> None:
del self.additional_properties[key]
def __contains__(self, key: str) -> bool:
return key in self.additional_properties