wallaroo.wallaroo_ml_ops_api_client.models.v1_model_get_model_by_id_response_200

  1from typing import Any, Dict, List, Type, TypeVar, Union
  2
  3import attr
  4
  5from ..models.v1_model_get_model_by_id_response_200_model_config import \
  6    V1ModelGetModelByIdResponse200ModelConfig
  7from ..types import UNSET, Unset
  8
  9T = TypeVar("T", bound="V1ModelGetModelByIdResponse200")
 10
 11@attr.s(auto_attribs=True)
 12class V1ModelGetModelByIdResponse200:
 13    """ Response type for /models/get_by_id
 14
 15    Attributes:
 16        id (int):  The primary model ID
 17        owner_id (str):  The user id who created and owns the model.
 18        name (str):  The name of the model.
 19        workspace_id (Union[Unset, None, int]):  Workspace Primary id, which the model belongs too.
 20        updated_at (Union[Unset, None, str]):  When the model was last updated.
 21        created_at (Union[Unset, None, str]):  When the model was first created.
 22        model_config (Union[Unset, None, V1ModelGetModelByIdResponse200ModelConfig]):  A possible Model Configuration
 23    """
 24
 25    id: int
 26    owner_id: str
 27    name: str
 28    workspace_id: Union[Unset, None, int] = UNSET
 29    updated_at: Union[Unset, None, str] = UNSET
 30    created_at: Union[Unset, None, str] = UNSET
 31    model_config: Union[Unset, None, V1ModelGetModelByIdResponse200ModelConfig] = UNSET
 32    additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
 33
 34
 35    def to_dict(self) -> Dict[str, Any]:
 36        id = self.id
 37        owner_id = self.owner_id
 38        name = self.name
 39        workspace_id = self.workspace_id
 40        updated_at = self.updated_at
 41        created_at = self.created_at
 42        model_config: Union[Unset, None, Dict[str, Any]] = UNSET
 43        if not isinstance(self.model_config, Unset):
 44            model_config = self.model_config.to_dict() if self.model_config else None
 45
 46
 47        field_dict: Dict[str, Any] = {}
 48        field_dict.update(self.additional_properties)
 49        field_dict.update({
 50            "id": id,
 51            "owner_id": owner_id,
 52            "name": name,
 53        })
 54        if workspace_id is not UNSET:
 55            field_dict["workspace_id"] = workspace_id
 56        if updated_at is not UNSET:
 57            field_dict["updated_at"] = updated_at
 58        if created_at is not UNSET:
 59            field_dict["created_at"] = created_at
 60        if model_config is not UNSET:
 61            field_dict["model_config"] = model_config
 62
 63        return field_dict
 64
 65
 66
 67    @classmethod
 68    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
 69        d = src_dict.copy()
 70        id = d.pop("id")
 71
 72        owner_id = d.pop("owner_id")
 73
 74        name = d.pop("name")
 75
 76        workspace_id = d.pop("workspace_id", UNSET)
 77
 78        updated_at = d.pop("updated_at", UNSET)
 79
 80        created_at = d.pop("created_at", UNSET)
 81
 82        _model_config = d.pop("model_config", UNSET)
 83        model_config: Union[Unset, None, V1ModelGetModelByIdResponse200ModelConfig]
 84        if _model_config is None:
 85            model_config = None
 86        elif isinstance(_model_config,  Unset):
 87            model_config = UNSET
 88        else:
 89            model_config = V1ModelGetModelByIdResponse200ModelConfig.from_dict(_model_config)
 90
 91
 92
 93
 94        v1_model_get_model_by_id_response_200 = cls(
 95            id=id,
 96            owner_id=owner_id,
 97            name=name,
 98            workspace_id=workspace_id,
 99            updated_at=updated_at,
100            created_at=created_at,
101            model_config=model_config,
102        )
103
104        v1_model_get_model_by_id_response_200.additional_properties = d
105        return v1_model_get_model_by_id_response_200
106
107    @property
108    def additional_keys(self) -> List[str]:
109        return list(self.additional_properties.keys())
110
111    def __getitem__(self, key: str) -> Any:
112        return self.additional_properties[key]
113
114    def __setitem__(self, key: str, value: Any) -> None:
115        self.additional_properties[key] = value
116
117    def __delitem__(self, key: str) -> None:
118        del self.additional_properties[key]
119
120    def __contains__(self, key: str) -> bool:
121        return key in self.additional_properties
@attr.s(auto_attribs=True)
class V1ModelGetModelByIdResponse200:
 12@attr.s(auto_attribs=True)
 13class V1ModelGetModelByIdResponse200:
 14    """ Response type for /models/get_by_id
 15
 16    Attributes:
 17        id (int):  The primary model ID
 18        owner_id (str):  The user id who created and owns the model.
 19        name (str):  The name of the model.
 20        workspace_id (Union[Unset, None, int]):  Workspace Primary id, which the model belongs too.
 21        updated_at (Union[Unset, None, str]):  When the model was last updated.
 22        created_at (Union[Unset, None, str]):  When the model was first created.
 23        model_config (Union[Unset, None, V1ModelGetModelByIdResponse200ModelConfig]):  A possible Model Configuration
 24    """
 25
 26    id: int
 27    owner_id: str
 28    name: str
 29    workspace_id: Union[Unset, None, int] = UNSET
 30    updated_at: Union[Unset, None, str] = UNSET
 31    created_at: Union[Unset, None, str] = UNSET
 32    model_config: Union[Unset, None, V1ModelGetModelByIdResponse200ModelConfig] = UNSET
 33    additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
 34
 35
 36    def to_dict(self) -> Dict[str, Any]:
 37        id = self.id
 38        owner_id = self.owner_id
 39        name = self.name
 40        workspace_id = self.workspace_id
 41        updated_at = self.updated_at
 42        created_at = self.created_at
 43        model_config: Union[Unset, None, Dict[str, Any]] = UNSET
 44        if not isinstance(self.model_config, Unset):
 45            model_config = self.model_config.to_dict() if self.model_config else None
 46
 47
 48        field_dict: Dict[str, Any] = {}
 49        field_dict.update(self.additional_properties)
 50        field_dict.update({
 51            "id": id,
 52            "owner_id": owner_id,
 53            "name": name,
 54        })
 55        if workspace_id is not UNSET:
 56            field_dict["workspace_id"] = workspace_id
 57        if updated_at is not UNSET:
 58            field_dict["updated_at"] = updated_at
 59        if created_at is not UNSET:
 60            field_dict["created_at"] = created_at
 61        if model_config is not UNSET:
 62            field_dict["model_config"] = model_config
 63
 64        return field_dict
 65
 66
 67
 68    @classmethod
 69    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
 70        d = src_dict.copy()
 71        id = d.pop("id")
 72
 73        owner_id = d.pop("owner_id")
 74
 75        name = d.pop("name")
 76
 77        workspace_id = d.pop("workspace_id", UNSET)
 78
 79        updated_at = d.pop("updated_at", UNSET)
 80
 81        created_at = d.pop("created_at", UNSET)
 82
 83        _model_config = d.pop("model_config", UNSET)
 84        model_config: Union[Unset, None, V1ModelGetModelByIdResponse200ModelConfig]
 85        if _model_config is None:
 86            model_config = None
 87        elif isinstance(_model_config,  Unset):
 88            model_config = UNSET
 89        else:
 90            model_config = V1ModelGetModelByIdResponse200ModelConfig.from_dict(_model_config)
 91
 92
 93
 94
 95        v1_model_get_model_by_id_response_200 = cls(
 96            id=id,
 97            owner_id=owner_id,
 98            name=name,
 99            workspace_id=workspace_id,
100            updated_at=updated_at,
101            created_at=created_at,
102            model_config=model_config,
103        )
104
105        v1_model_get_model_by_id_response_200.additional_properties = d
106        return v1_model_get_model_by_id_response_200
107
108    @property
109    def additional_keys(self) -> List[str]:
110        return list(self.additional_properties.keys())
111
112    def __getitem__(self, key: str) -> Any:
113        return self.additional_properties[key]
114
115    def __setitem__(self, key: str, value: Any) -> None:
116        self.additional_properties[key] = value
117
118    def __delitem__(self, key: str) -> None:
119        del self.additional_properties[key]
120
121    def __contains__(self, key: str) -> bool:
122        return key in self.additional_properties

Response type for /models/get_by_id

Attributes: id (int): The primary model ID owner_id (str): The user id who created and owns the model. name (str): The name of the model. workspace_id (Union[Unset, None, int]): Workspace Primary id, which the model belongs too. updated_at (Union[Unset, None, str]): When the model was last updated. created_at (Union[Unset, None, str]): When the model was first created. model_config (Union[Unset, None, V1ModelGetModelByIdResponse200ModelConfig]): A possible Model Configuration

V1ModelGetModelByIdResponse200( id: int, owner_id: str, name: str, workspace_id: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, int] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>, updated_at: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, str] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>, created_at: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, str] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>, model_config: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, wallaroo.wallaroo_ml_ops_api_client.models.v1_model_get_model_by_id_response_200_model_config.V1ModelGetModelByIdResponse200ModelConfig] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>)
 2def __init__(self, id, owner_id, name, workspace_id=attr_dict['workspace_id'].default, updated_at=attr_dict['updated_at'].default, created_at=attr_dict['created_at'].default, model_config=attr_dict['model_config'].default):
 3    self.id = id
 4    self.owner_id = owner_id
 5    self.name = name
 6    self.workspace_id = workspace_id
 7    self.updated_at = updated_at
 8    self.created_at = created_at
 9    self.model_config = model_config
10    self.additional_properties = __attr_factory_additional_properties()

Method generated by attrs for class V1ModelGetModelByIdResponse200.

def to_dict(self) -> Dict[str, Any]:
36    def to_dict(self) -> Dict[str, Any]:
37        id = self.id
38        owner_id = self.owner_id
39        name = self.name
40        workspace_id = self.workspace_id
41        updated_at = self.updated_at
42        created_at = self.created_at
43        model_config: Union[Unset, None, Dict[str, Any]] = UNSET
44        if not isinstance(self.model_config, Unset):
45            model_config = self.model_config.to_dict() if self.model_config else None
46
47
48        field_dict: Dict[str, Any] = {}
49        field_dict.update(self.additional_properties)
50        field_dict.update({
51            "id": id,
52            "owner_id": owner_id,
53            "name": name,
54        })
55        if workspace_id is not UNSET:
56            field_dict["workspace_id"] = workspace_id
57        if updated_at is not UNSET:
58            field_dict["updated_at"] = updated_at
59        if created_at is not UNSET:
60            field_dict["created_at"] = created_at
61        if model_config is not UNSET:
62            field_dict["model_config"] = model_config
63
64        return field_dict
@classmethod
def from_dict(cls: Type[~T], src_dict: Dict[str, Any]) -> ~T:
 68    @classmethod
 69    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
 70        d = src_dict.copy()
 71        id = d.pop("id")
 72
 73        owner_id = d.pop("owner_id")
 74
 75        name = d.pop("name")
 76
 77        workspace_id = d.pop("workspace_id", UNSET)
 78
 79        updated_at = d.pop("updated_at", UNSET)
 80
 81        created_at = d.pop("created_at", UNSET)
 82
 83        _model_config = d.pop("model_config", UNSET)
 84        model_config: Union[Unset, None, V1ModelGetModelByIdResponse200ModelConfig]
 85        if _model_config is None:
 86            model_config = None
 87        elif isinstance(_model_config,  Unset):
 88            model_config = UNSET
 89        else:
 90            model_config = V1ModelGetModelByIdResponse200ModelConfig.from_dict(_model_config)
 91
 92
 93
 94
 95        v1_model_get_model_by_id_response_200 = cls(
 96            id=id,
 97            owner_id=owner_id,
 98            name=name,
 99            workspace_id=workspace_id,
100            updated_at=updated_at,
101            created_at=created_at,
102            model_config=model_config,
103        )
104
105        v1_model_get_model_by_id_response_200.additional_properties = d
106        return v1_model_get_model_by_id_response_200
additional_keys: List[str]