2022-04-27 12:14:58 -07:00
|
|
|
from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
|
|
|
|
|
|
|
import attr
|
|
|
|
|
2022-06-11 17:26:20 -07:00
|
|
|
from ..models.cache_metadata import CacheMetadata
|
2022-04-27 12:14:58 -07:00
|
|
|
from ..models.engine_metadata import EngineMetadata
|
2022-06-11 17:26:20 -07:00
|
|
|
from ..models.environment import Environment
|
2022-07-05 15:33:51 -07:00
|
|
|
from ..models.executor_metadata import ExecutorMetadata
|
2022-04-27 12:14:58 -07:00
|
|
|
from ..models.file_system_metadata import FileSystemMetadata
|
2023-01-27 14:50:50 -08:00
|
|
|
from ..models.point_e_metadata import PointEMetadata
|
2022-06-11 17:26:20 -07:00
|
|
|
from ..models.connection import Connection
|
2022-04-27 12:14:58 -07:00
|
|
|
from ..types import UNSET, Unset
|
|
|
|
|
|
|
|
T = TypeVar("T", bound="Metadata")
|
|
|
|
|
|
|
|
|
|
|
|
@attr.s(auto_attribs=True)
|
|
|
|
class Metadata:
|
|
|
|
""" """
|
2022-06-11 17:26:20 -07:00
|
|
|
cache: Union[Unset, CacheMetadata] = UNSET
|
2022-04-27 12:14:58 -07:00
|
|
|
engine: Union[Unset, EngineMetadata] = UNSET
|
2022-06-11 17:26:20 -07:00
|
|
|
environment: Union[Unset, Environment] = UNSET
|
2022-07-05 15:33:51 -07:00
|
|
|
executor: Union[Unset, ExecutorMetadata] = UNSET
|
2022-04-27 12:14:58 -07:00
|
|
|
fs: Union[Unset, FileSystemMetadata] = UNSET
|
|
|
|
git_hash: Union[Unset, str] = UNSET
|
2023-01-27 14:50:50 -08:00
|
|
|
point_e: Union[Unset, PointEMetadata] = UNSET
|
2022-06-11 17:26:20 -07:00
|
|
|
pubsub: Union[Unset, Connection] = UNSET
|
2022-04-27 12:14:58 -07:00
|
|
|
|
|
|
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
|
|
|
|
|
|
|
def to_dict(self) -> Dict[str, Any]:
|
2022-06-11 17:26:20 -07:00
|
|
|
cache: Union[Unset, str] = UNSET
|
|
|
|
if not isinstance(self.cache, Unset):
|
|
|
|
cache = self.cache.value
|
2022-04-27 12:14:58 -07:00
|
|
|
engine: Union[Unset, str] = UNSET
|
|
|
|
if not isinstance(self.engine, Unset):
|
|
|
|
engine = self.engine.value
|
2022-06-11 17:26:20 -07:00
|
|
|
environment: Union[Unset, str] = UNSET
|
|
|
|
if not isinstance(self.environment, Unset):
|
|
|
|
environment = self.environment.value
|
2022-07-05 15:33:51 -07:00
|
|
|
executor: Union[Unset, str] = UNSET
|
|
|
|
if not isinstance(self.executor, Unset):
|
|
|
|
executor = self.executor.value
|
2022-04-27 12:14:58 -07:00
|
|
|
fs: Union[Unset, str] = UNSET
|
|
|
|
if not isinstance(self.fs, Unset):
|
|
|
|
fs = self.fs.value
|
|
|
|
git_hash = self.git_hash
|
2023-01-27 14:50:50 -08:00
|
|
|
point_e: Union[Unset, str] = UNSET
|
|
|
|
if not isinstance(self.point_e, Unset):
|
|
|
|
point_e = self.point_e.value
|
2022-06-11 17:26:20 -07:00
|
|
|
pubsub: Union[Unset, str] = UNSET
|
|
|
|
if not isinstance(self.pubsub, Unset):
|
|
|
|
pubsub = self.pubsub.value
|
2022-04-27 12:14:58 -07:00
|
|
|
|
|
|
|
field_dict: Dict[str, Any] = {}
|
|
|
|
field_dict.update(self.additional_properties)
|
|
|
|
field_dict.update({})
|
2022-06-11 17:26:20 -07:00
|
|
|
if cache is not UNSET:
|
|
|
|
field_dict['cache'] = cache
|
2022-04-27 12:14:58 -07:00
|
|
|
if engine is not UNSET:
|
|
|
|
field_dict['engine'] = engine
|
2022-06-11 17:26:20 -07:00
|
|
|
if environment is not UNSET:
|
|
|
|
field_dict['environment'] = environment
|
2022-07-05 15:33:51 -07:00
|
|
|
if executor is not UNSET:
|
|
|
|
field_dict['executor'] = executor
|
2022-04-27 12:14:58 -07:00
|
|
|
if fs is not UNSET:
|
|
|
|
field_dict['fs'] = fs
|
|
|
|
if git_hash is not UNSET:
|
|
|
|
field_dict['git_hash'] = git_hash
|
2023-01-27 14:50:50 -08:00
|
|
|
if point_e is not UNSET:
|
|
|
|
field_dict['point_e'] = point_e
|
2022-06-11 17:26:20 -07:00
|
|
|
if pubsub is not UNSET:
|
|
|
|
field_dict['pubsub'] = pubsub
|
2022-04-27 12:14:58 -07:00
|
|
|
|
|
|
|
return field_dict
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
|
|
|
|
d = src_dict.copy()
|
2022-06-11 17:26:20 -07:00
|
|
|
_cache = d.pop("cache", UNSET)
|
|
|
|
cache: Union[Unset, CacheMetadata]
|
|
|
|
if isinstance(_cache, Unset):
|
|
|
|
cache = UNSET
|
|
|
|
else:
|
|
|
|
cache = CacheMetadata(_cache)
|
|
|
|
|
2022-04-27 12:14:58 -07:00
|
|
|
_engine = d.pop("engine", UNSET)
|
|
|
|
engine: Union[Unset, EngineMetadata]
|
|
|
|
if isinstance(_engine, Unset):
|
|
|
|
engine = UNSET
|
|
|
|
else:
|
|
|
|
engine = EngineMetadata(_engine)
|
|
|
|
|
2022-06-11 17:26:20 -07:00
|
|
|
_environment = d.pop("environment", UNSET)
|
|
|
|
environment: Union[Unset, Environment]
|
|
|
|
if isinstance(_environment, Unset):
|
|
|
|
environment = UNSET
|
|
|
|
else:
|
|
|
|
environment = Environment(_environment)
|
|
|
|
|
2022-07-05 15:33:51 -07:00
|
|
|
_executor = d.pop("executor", UNSET)
|
|
|
|
executor: Union[Unset, ExecutorMetadata]
|
|
|
|
if isinstance(_executor, Unset):
|
|
|
|
executor = UNSET
|
|
|
|
else:
|
|
|
|
executor = ExecutorMetadata(_executor)
|
|
|
|
|
2022-04-27 12:14:58 -07:00
|
|
|
_fs = d.pop("fs", UNSET)
|
|
|
|
fs: Union[Unset, FileSystemMetadata]
|
|
|
|
if isinstance(_fs, Unset):
|
|
|
|
fs = UNSET
|
|
|
|
else:
|
|
|
|
fs = FileSystemMetadata(_fs)
|
|
|
|
|
|
|
|
git_hash = d.pop("git_hash", UNSET)
|
|
|
|
|
2023-01-27 14:50:50 -08:00
|
|
|
_point_e = d.pop("point_e", UNSET)
|
|
|
|
point_e: Union[Unset, PointEMetadata]
|
|
|
|
if isinstance(_point_e, Unset):
|
|
|
|
point_e = UNSET
|
|
|
|
else:
|
|
|
|
point_e = PointEMetadata(_point_e)
|
|
|
|
|
2022-06-11 17:26:20 -07:00
|
|
|
_pubsub = d.pop("pubsub", UNSET)
|
|
|
|
pubsub: Union[Unset, Connection]
|
|
|
|
if isinstance(_pubsub, Unset):
|
|
|
|
pubsub = UNSET
|
2022-04-27 12:14:58 -07:00
|
|
|
else:
|
2022-06-11 17:26:20 -07:00
|
|
|
pubsub = Connection(_pubsub)
|
2022-04-27 12:14:58 -07:00
|
|
|
|
|
|
|
metadata = cls(
|
2022-06-11 17:26:20 -07:00
|
|
|
cache=cache,
|
2022-04-27 12:14:58 -07:00
|
|
|
engine=engine,
|
2022-06-11 17:26:20 -07:00
|
|
|
environment=environment,
|
2022-07-05 15:33:51 -07:00
|
|
|
executor=executor,
|
2022-04-27 12:14:58 -07:00
|
|
|
fs=fs,
|
|
|
|
git_hash=git_hash,
|
2023-01-27 14:50:50 -08:00
|
|
|
point_e=point_e,
|
2022-06-11 17:26:20 -07:00
|
|
|
pubsub=pubsub,
|
2022-04-27 12:14:58 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
metadata.additional_properties = d
|
|
|
|
return metadata
|
|
|
|
|
|
|
|
@property
|
|
|
|
def additional_keys(self) -> List[str]:
|
|
|
|
return list(self.additional_properties.keys())
|
|
|
|
|
|
|
|
def __getitem__(self, key: str) -> Any:
|
|
|
|
return self.additional_properties[key]
|
|
|
|
|
|
|
|
def __setitem__(self, key: str, value: Any) -> 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
|