2022-04-06 23:20:20 -07:00
|
|
|
from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
2022-04-06 22:41:11 -07:00
|
|
|
|
|
|
|
import attr
|
|
|
|
|
|
|
|
from ..types import UNSET, Unset
|
|
|
|
|
2023-11-28 14:29:16 -08:00
|
|
|
KX = TypeVar("KX", bound="ImportFile")
|
2023-11-27 16:01:20 -08:00
|
|
|
|
2022-04-06 22:41:11 -07:00
|
|
|
|
|
|
|
@attr.s(auto_attribs=True)
|
2023-09-29 15:51:03 -07:00
|
|
|
class ImportFile:
|
2023-11-27 16:01:20 -08:00
|
|
|
"""File to import into the current model""" # noqa: E501
|
2023-05-04 00:58:06 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
data: Union[Unset, List[int]] = UNSET
|
|
|
|
path: Union[Unset, str] = UNSET
|
2022-04-06 22:41:11 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
2022-04-06 22:41:11 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def to_dict(self) -> Dict[str, Any]:
|
|
|
|
data: Union[Unset, List[int]] = UNSET
|
|
|
|
if not isinstance(self.data, Unset):
|
|
|
|
data = self.data
|
|
|
|
path = self.path
|
2022-04-06 22:41:11 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
field_dict: Dict[str, Any] = {}
|
|
|
|
field_dict.update(self.additional_properties)
|
|
|
|
field_dict.update({})
|
|
|
|
if data is not UNSET:
|
|
|
|
field_dict["data"] = data
|
|
|
|
if path is not UNSET:
|
|
|
|
field_dict["path"] = path
|
2022-04-06 22:41:11 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
return field_dict
|
2022-04-06 22:41:11 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
@classmethod
|
2023-11-28 14:29:16 -08:00
|
|
|
def from_dict(cls: Type[KX], src_dict: Dict[str, Any]) -> KX:
|
2023-11-27 16:01:20 -08:00
|
|
|
d = src_dict.copy()
|
|
|
|
data = cast(List[int], d.pop("data", UNSET))
|
2022-04-06 22:41:11 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
path = d.pop("path", UNSET)
|
2022-07-05 15:33:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
import_file = cls(
|
|
|
|
data=data,
|
|
|
|
path=path,
|
|
|
|
)
|
2022-04-06 22:41:11 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
import_file.additional_properties = d
|
|
|
|
return import_file
|
2022-04-06 22:41:11 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
@property
|
|
|
|
def additional_keys(self) -> List[str]:
|
|
|
|
return list(self.additional_properties.keys())
|
2022-04-06 22:41:11 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __getitem__(self, key: str) -> Any:
|
|
|
|
return self.additional_properties[key]
|
2022-04-06 22:41:11 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __setitem__(self, key: str, value: Any) -> None:
|
|
|
|
self.additional_properties[key] = value
|
2022-04-06 22:41:11 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __delitem__(self, key: str) -> None:
|
|
|
|
del self.additional_properties[key]
|
2022-04-06 22:41:11 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __contains__(self, key: str) -> bool:
|
|
|
|
return key in self.additional_properties
|