wallaroo.wallaroo_ml_ops_api_client.models.pipelines_copy_pipeline_response_200

 1from typing import Any, Dict, List, Type, TypeVar, Union
 2
 3import attr
 4
 5from ..models.pipelines_copy_pipeline_response_200_deployment import \
 6    PipelinesCopyPipelineResponse200Deployment
 7from ..types import UNSET, Unset
 8
 9T = TypeVar("T", bound="PipelinesCopyPipelineResponse200")
10
11@attr.s(auto_attribs=True)
12class PipelinesCopyPipelineResponse200:
13    """ Successful response to pipeline copy request.
14
15    Attributes:
16        pipeline_pk_id (int):  Internal pipeline identifier.
17        pipeline_variant_pk_id (int):  Internal pipeline variant identifier.
18        pipeline_version (Union[Unset, None, str]):  Pipeline version created.
19        deployment (Union[Unset, None, PipelinesCopyPipelineResponse200Deployment]):  Pipeline deployment response.
20    """
21
22    pipeline_pk_id: int
23    pipeline_variant_pk_id: int
24    pipeline_version: Union[Unset, None, str] = UNSET
25    deployment: Union[Unset, None, PipelinesCopyPipelineResponse200Deployment] = UNSET
26    additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
27
28
29    def to_dict(self) -> Dict[str, Any]:
30        pipeline_pk_id = self.pipeline_pk_id
31        pipeline_variant_pk_id = self.pipeline_variant_pk_id
32        pipeline_version = self.pipeline_version
33        deployment: Union[Unset, None, Dict[str, Any]] = UNSET
34        if not isinstance(self.deployment, Unset):
35            deployment = self.deployment.to_dict() if self.deployment else None
36
37
38        field_dict: Dict[str, Any] = {}
39        field_dict.update(self.additional_properties)
40        field_dict.update({
41            "pipeline_pk_id": pipeline_pk_id,
42            "pipeline_variant_pk_id": pipeline_variant_pk_id,
43        })
44        if pipeline_version is not UNSET:
45            field_dict["pipeline_version"] = pipeline_version
46        if deployment is not UNSET:
47            field_dict["deployment"] = deployment
48
49        return field_dict
50
51
52
53    @classmethod
54    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
55        d = src_dict.copy()
56        pipeline_pk_id = d.pop("pipeline_pk_id")
57
58        pipeline_variant_pk_id = d.pop("pipeline_variant_pk_id")
59
60        pipeline_version = d.pop("pipeline_version", UNSET)
61
62        _deployment = d.pop("deployment", UNSET)
63        deployment: Union[Unset, None, PipelinesCopyPipelineResponse200Deployment]
64        if _deployment is None:
65            deployment = None
66        elif isinstance(_deployment,  Unset):
67            deployment = UNSET
68        else:
69            deployment = PipelinesCopyPipelineResponse200Deployment.from_dict(_deployment)
70
71
72
73
74        pipelines_copy_pipeline_response_200 = cls(
75            pipeline_pk_id=pipeline_pk_id,
76            pipeline_variant_pk_id=pipeline_variant_pk_id,
77            pipeline_version=pipeline_version,
78            deployment=deployment,
79        )
80
81        pipelines_copy_pipeline_response_200.additional_properties = d
82        return pipelines_copy_pipeline_response_200
83
84    @property
85    def additional_keys(self) -> List[str]:
86        return list(self.additional_properties.keys())
87
88    def __getitem__(self, key: str) -> Any:
89        return self.additional_properties[key]
90
91    def __setitem__(self, key: str, value: Any) -> None:
92        self.additional_properties[key] = value
93
94    def __delitem__(self, key: str) -> None:
95        del self.additional_properties[key]
96
97    def __contains__(self, key: str) -> bool:
98        return key in self.additional_properties
@attr.s(auto_attribs=True)
class PipelinesCopyPipelineResponse200:
12@attr.s(auto_attribs=True)
13class PipelinesCopyPipelineResponse200:
14    """ Successful response to pipeline copy request.
15
16    Attributes:
17        pipeline_pk_id (int):  Internal pipeline identifier.
18        pipeline_variant_pk_id (int):  Internal pipeline variant identifier.
19        pipeline_version (Union[Unset, None, str]):  Pipeline version created.
20        deployment (Union[Unset, None, PipelinesCopyPipelineResponse200Deployment]):  Pipeline deployment response.
21    """
22
23    pipeline_pk_id: int
24    pipeline_variant_pk_id: int
25    pipeline_version: Union[Unset, None, str] = UNSET
26    deployment: Union[Unset, None, PipelinesCopyPipelineResponse200Deployment] = UNSET
27    additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
28
29
30    def to_dict(self) -> Dict[str, Any]:
31        pipeline_pk_id = self.pipeline_pk_id
32        pipeline_variant_pk_id = self.pipeline_variant_pk_id
33        pipeline_version = self.pipeline_version
34        deployment: Union[Unset, None, Dict[str, Any]] = UNSET
35        if not isinstance(self.deployment, Unset):
36            deployment = self.deployment.to_dict() if self.deployment else None
37
38
39        field_dict: Dict[str, Any] = {}
40        field_dict.update(self.additional_properties)
41        field_dict.update({
42            "pipeline_pk_id": pipeline_pk_id,
43            "pipeline_variant_pk_id": pipeline_variant_pk_id,
44        })
45        if pipeline_version is not UNSET:
46            field_dict["pipeline_version"] = pipeline_version
47        if deployment is not UNSET:
48            field_dict["deployment"] = deployment
49
50        return field_dict
51
52
53
54    @classmethod
55    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
56        d = src_dict.copy()
57        pipeline_pk_id = d.pop("pipeline_pk_id")
58
59        pipeline_variant_pk_id = d.pop("pipeline_variant_pk_id")
60
61        pipeline_version = d.pop("pipeline_version", UNSET)
62
63        _deployment = d.pop("deployment", UNSET)
64        deployment: Union[Unset, None, PipelinesCopyPipelineResponse200Deployment]
65        if _deployment is None:
66            deployment = None
67        elif isinstance(_deployment,  Unset):
68            deployment = UNSET
69        else:
70            deployment = PipelinesCopyPipelineResponse200Deployment.from_dict(_deployment)
71
72
73
74
75        pipelines_copy_pipeline_response_200 = cls(
76            pipeline_pk_id=pipeline_pk_id,
77            pipeline_variant_pk_id=pipeline_variant_pk_id,
78            pipeline_version=pipeline_version,
79            deployment=deployment,
80        )
81
82        pipelines_copy_pipeline_response_200.additional_properties = d
83        return pipelines_copy_pipeline_response_200
84
85    @property
86    def additional_keys(self) -> List[str]:
87        return list(self.additional_properties.keys())
88
89    def __getitem__(self, key: str) -> Any:
90        return self.additional_properties[key]
91
92    def __setitem__(self, key: str, value: Any) -> None:
93        self.additional_properties[key] = value
94
95    def __delitem__(self, key: str) -> None:
96        del self.additional_properties[key]
97
98    def __contains__(self, key: str) -> bool:
99        return key in self.additional_properties

Successful response to pipeline copy request.

Attributes: pipeline_pk_id (int): Internal pipeline identifier. pipeline_variant_pk_id (int): Internal pipeline variant identifier. pipeline_version (Union[Unset, None, str]): Pipeline version created. deployment (Union[Unset, None, PipelinesCopyPipelineResponse200Deployment]): Pipeline deployment response.

PipelinesCopyPipelineResponse200( pipeline_pk_id: int, pipeline_variant_pk_id: int, pipeline_version: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, str] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>, deployment: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, wallaroo.wallaroo_ml_ops_api_client.models.pipelines_copy_pipeline_response_200_deployment.PipelinesCopyPipelineResponse200Deployment] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>)
2def __init__(self, pipeline_pk_id, pipeline_variant_pk_id, pipeline_version=attr_dict['pipeline_version'].default, deployment=attr_dict['deployment'].default):
3    self.pipeline_pk_id = pipeline_pk_id
4    self.pipeline_variant_pk_id = pipeline_variant_pk_id
5    self.pipeline_version = pipeline_version
6    self.deployment = deployment
7    self.additional_properties = __attr_factory_additional_properties()

Method generated by attrs for class PipelinesCopyPipelineResponse200.

def to_dict(self) -> Dict[str, Any]:
30    def to_dict(self) -> Dict[str, Any]:
31        pipeline_pk_id = self.pipeline_pk_id
32        pipeline_variant_pk_id = self.pipeline_variant_pk_id
33        pipeline_version = self.pipeline_version
34        deployment: Union[Unset, None, Dict[str, Any]] = UNSET
35        if not isinstance(self.deployment, Unset):
36            deployment = self.deployment.to_dict() if self.deployment else None
37
38
39        field_dict: Dict[str, Any] = {}
40        field_dict.update(self.additional_properties)
41        field_dict.update({
42            "pipeline_pk_id": pipeline_pk_id,
43            "pipeline_variant_pk_id": pipeline_variant_pk_id,
44        })
45        if pipeline_version is not UNSET:
46            field_dict["pipeline_version"] = pipeline_version
47        if deployment is not UNSET:
48            field_dict["deployment"] = deployment
49
50        return field_dict
@classmethod
def from_dict(cls: Type[~T], src_dict: Dict[str, Any]) -> ~T:
54    @classmethod
55    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
56        d = src_dict.copy()
57        pipeline_pk_id = d.pop("pipeline_pk_id")
58
59        pipeline_variant_pk_id = d.pop("pipeline_variant_pk_id")
60
61        pipeline_version = d.pop("pipeline_version", UNSET)
62
63        _deployment = d.pop("deployment", UNSET)
64        deployment: Union[Unset, None, PipelinesCopyPipelineResponse200Deployment]
65        if _deployment is None:
66            deployment = None
67        elif isinstance(_deployment,  Unset):
68            deployment = UNSET
69        else:
70            deployment = PipelinesCopyPipelineResponse200Deployment.from_dict(_deployment)
71
72
73
74
75        pipelines_copy_pipeline_response_200 = cls(
76            pipeline_pk_id=pipeline_pk_id,
77            pipeline_variant_pk_id=pipeline_variant_pk_id,
78            pipeline_version=pipeline_version,
79            deployment=deployment,
80        )
81
82        pipelines_copy_pipeline_response_200.additional_properties = d
83        return pipelines_copy_pipeline_response_200
additional_keys: List[str]