wallaroo.wallaroo_ml_ops_api_client.models.pipelines_copy_pipeline_json_body

  1from typing import Any, Dict, List, Type, TypeVar, Union
  2
  3import attr
  4
  5from ..models.pipelines_copy_pipeline_json_body_engine_config import \
  6    PipelinesCopyPipelineJsonBodyEngineConfig
  7from ..types import UNSET, Unset
  8
  9T = TypeVar("T", bound="PipelinesCopyPipelineJsonBody")
 10
 11@attr.s(auto_attribs=True)
 12class PipelinesCopyPipelineJsonBody:
 13    """ Request to create a copy of a pipeline.
 14
 15    Attributes:
 16        name (str):  Pipeline name.
 17        workspace_id (int):  Workspace identifier.
 18        source_pipeline (int):  Source pipeline identifier.
 19        deploy (Union[Unset, None, str]):  Optional deployment indicator.
 20        engine_config (Union[Unset, None, PipelinesCopyPipelineJsonBodyEngineConfig]):  Optional engine configuration to
 21            use.
 22        pipeline_version (Union[Unset, None, str]):  Optional pipeline version to create.
 23    """
 24
 25    name: str
 26    workspace_id: int
 27    source_pipeline: int
 28    deploy: Union[Unset, None, str] = UNSET
 29    engine_config: Union[Unset, None, PipelinesCopyPipelineJsonBodyEngineConfig] = UNSET
 30    pipeline_version: Union[Unset, None, str] = UNSET
 31    additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
 32
 33
 34    def to_dict(self) -> Dict[str, Any]:
 35        name = self.name
 36        workspace_id = self.workspace_id
 37        source_pipeline = self.source_pipeline
 38        deploy = self.deploy
 39        engine_config: Union[Unset, None, Dict[str, Any]] = UNSET
 40        if not isinstance(self.engine_config, Unset):
 41            engine_config = self.engine_config.to_dict() if self.engine_config else None
 42
 43        pipeline_version = self.pipeline_version
 44
 45        field_dict: Dict[str, Any] = {}
 46        field_dict.update(self.additional_properties)
 47        field_dict.update({
 48            "name": name,
 49            "workspace_id": workspace_id,
 50            "source_pipeline": source_pipeline,
 51        })
 52        if deploy is not UNSET:
 53            field_dict["deploy"] = deploy
 54        if engine_config is not UNSET:
 55            field_dict["engine_config"] = engine_config
 56        if pipeline_version is not UNSET:
 57            field_dict["pipeline_version"] = pipeline_version
 58
 59        return field_dict
 60
 61
 62
 63    @classmethod
 64    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
 65        d = src_dict.copy()
 66        name = d.pop("name")
 67
 68        workspace_id = d.pop("workspace_id")
 69
 70        source_pipeline = d.pop("source_pipeline")
 71
 72        deploy = d.pop("deploy", UNSET)
 73
 74        _engine_config = d.pop("engine_config", UNSET)
 75        engine_config: Union[Unset, None, PipelinesCopyPipelineJsonBodyEngineConfig]
 76        if _engine_config is None:
 77            engine_config = None
 78        elif isinstance(_engine_config,  Unset):
 79            engine_config = UNSET
 80        else:
 81            engine_config = PipelinesCopyPipelineJsonBodyEngineConfig.from_dict(_engine_config)
 82
 83
 84
 85
 86        pipeline_version = d.pop("pipeline_version", UNSET)
 87
 88        pipelines_copy_pipeline_json_body = cls(
 89            name=name,
 90            workspace_id=workspace_id,
 91            source_pipeline=source_pipeline,
 92            deploy=deploy,
 93            engine_config=engine_config,
 94            pipeline_version=pipeline_version,
 95        )
 96
 97        pipelines_copy_pipeline_json_body.additional_properties = d
 98        return pipelines_copy_pipeline_json_body
 99
100    @property
101    def additional_keys(self) -> List[str]:
102        return list(self.additional_properties.keys())
103
104    def __getitem__(self, key: str) -> Any:
105        return self.additional_properties[key]
106
107    def __setitem__(self, key: str, value: Any) -> None:
108        self.additional_properties[key] = value
109
110    def __delitem__(self, key: str) -> None:
111        del self.additional_properties[key]
112
113    def __contains__(self, key: str) -> bool:
114        return key in self.additional_properties
@attr.s(auto_attribs=True)
class PipelinesCopyPipelineJsonBody:
 12@attr.s(auto_attribs=True)
 13class PipelinesCopyPipelineJsonBody:
 14    """ Request to create a copy of a pipeline.
 15
 16    Attributes:
 17        name (str):  Pipeline name.
 18        workspace_id (int):  Workspace identifier.
 19        source_pipeline (int):  Source pipeline identifier.
 20        deploy (Union[Unset, None, str]):  Optional deployment indicator.
 21        engine_config (Union[Unset, None, PipelinesCopyPipelineJsonBodyEngineConfig]):  Optional engine configuration to
 22            use.
 23        pipeline_version (Union[Unset, None, str]):  Optional pipeline version to create.
 24    """
 25
 26    name: str
 27    workspace_id: int
 28    source_pipeline: int
 29    deploy: Union[Unset, None, str] = UNSET
 30    engine_config: Union[Unset, None, PipelinesCopyPipelineJsonBodyEngineConfig] = UNSET
 31    pipeline_version: Union[Unset, None, str] = UNSET
 32    additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
 33
 34
 35    def to_dict(self) -> Dict[str, Any]:
 36        name = self.name
 37        workspace_id = self.workspace_id
 38        source_pipeline = self.source_pipeline
 39        deploy = self.deploy
 40        engine_config: Union[Unset, None, Dict[str, Any]] = UNSET
 41        if not isinstance(self.engine_config, Unset):
 42            engine_config = self.engine_config.to_dict() if self.engine_config else None
 43
 44        pipeline_version = self.pipeline_version
 45
 46        field_dict: Dict[str, Any] = {}
 47        field_dict.update(self.additional_properties)
 48        field_dict.update({
 49            "name": name,
 50            "workspace_id": workspace_id,
 51            "source_pipeline": source_pipeline,
 52        })
 53        if deploy is not UNSET:
 54            field_dict["deploy"] = deploy
 55        if engine_config is not UNSET:
 56            field_dict["engine_config"] = engine_config
 57        if pipeline_version is not UNSET:
 58            field_dict["pipeline_version"] = pipeline_version
 59
 60        return field_dict
 61
 62
 63
 64    @classmethod
 65    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
 66        d = src_dict.copy()
 67        name = d.pop("name")
 68
 69        workspace_id = d.pop("workspace_id")
 70
 71        source_pipeline = d.pop("source_pipeline")
 72
 73        deploy = d.pop("deploy", UNSET)
 74
 75        _engine_config = d.pop("engine_config", UNSET)
 76        engine_config: Union[Unset, None, PipelinesCopyPipelineJsonBodyEngineConfig]
 77        if _engine_config is None:
 78            engine_config = None
 79        elif isinstance(_engine_config,  Unset):
 80            engine_config = UNSET
 81        else:
 82            engine_config = PipelinesCopyPipelineJsonBodyEngineConfig.from_dict(_engine_config)
 83
 84
 85
 86
 87        pipeline_version = d.pop("pipeline_version", UNSET)
 88
 89        pipelines_copy_pipeline_json_body = cls(
 90            name=name,
 91            workspace_id=workspace_id,
 92            source_pipeline=source_pipeline,
 93            deploy=deploy,
 94            engine_config=engine_config,
 95            pipeline_version=pipeline_version,
 96        )
 97
 98        pipelines_copy_pipeline_json_body.additional_properties = d
 99        return pipelines_copy_pipeline_json_body
100
101    @property
102    def additional_keys(self) -> List[str]:
103        return list(self.additional_properties.keys())
104
105    def __getitem__(self, key: str) -> Any:
106        return self.additional_properties[key]
107
108    def __setitem__(self, key: str, value: Any) -> None:
109        self.additional_properties[key] = value
110
111    def __delitem__(self, key: str) -> None:
112        del self.additional_properties[key]
113
114    def __contains__(self, key: str) -> bool:
115        return key in self.additional_properties

Request to create a copy of a pipeline.

Attributes: name (str): Pipeline name. workspace_id (int): Workspace identifier. source_pipeline (int): Source pipeline identifier. deploy (Union[Unset, None, str]): Optional deployment indicator. engine_config (Union[Unset, None, PipelinesCopyPipelineJsonBodyEngineConfig]): Optional engine configuration to use. pipeline_version (Union[Unset, None, str]): Optional pipeline version to create.

PipelinesCopyPipelineJsonBody( name: str, workspace_id: int, source_pipeline: int, deploy: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, str] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>, engine_config: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, wallaroo.wallaroo_ml_ops_api_client.models.pipelines_copy_pipeline_json_body_engine_config.PipelinesCopyPipelineJsonBodyEngineConfig] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>, pipeline_version: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, str] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>)
2def __init__(self, name, workspace_id, source_pipeline, deploy=attr_dict['deploy'].default, engine_config=attr_dict['engine_config'].default, pipeline_version=attr_dict['pipeline_version'].default):
3    self.name = name
4    self.workspace_id = workspace_id
5    self.source_pipeline = source_pipeline
6    self.deploy = deploy
7    self.engine_config = engine_config
8    self.pipeline_version = pipeline_version
9    self.additional_properties = __attr_factory_additional_properties()

Method generated by attrs for class PipelinesCopyPipelineJsonBody.

def to_dict(self) -> Dict[str, Any]:
35    def to_dict(self) -> Dict[str, Any]:
36        name = self.name
37        workspace_id = self.workspace_id
38        source_pipeline = self.source_pipeline
39        deploy = self.deploy
40        engine_config: Union[Unset, None, Dict[str, Any]] = UNSET
41        if not isinstance(self.engine_config, Unset):
42            engine_config = self.engine_config.to_dict() if self.engine_config else None
43
44        pipeline_version = self.pipeline_version
45
46        field_dict: Dict[str, Any] = {}
47        field_dict.update(self.additional_properties)
48        field_dict.update({
49            "name": name,
50            "workspace_id": workspace_id,
51            "source_pipeline": source_pipeline,
52        })
53        if deploy is not UNSET:
54            field_dict["deploy"] = deploy
55        if engine_config is not UNSET:
56            field_dict["engine_config"] = engine_config
57        if pipeline_version is not UNSET:
58            field_dict["pipeline_version"] = pipeline_version
59
60        return field_dict
@classmethod
def from_dict(cls: Type[~T], src_dict: Dict[str, Any]) -> ~T:
64    @classmethod
65    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
66        d = src_dict.copy()
67        name = d.pop("name")
68
69        workspace_id = d.pop("workspace_id")
70
71        source_pipeline = d.pop("source_pipeline")
72
73        deploy = d.pop("deploy", UNSET)
74
75        _engine_config = d.pop("engine_config", UNSET)
76        engine_config: Union[Unset, None, PipelinesCopyPipelineJsonBodyEngineConfig]
77        if _engine_config is None:
78            engine_config = None
79        elif isinstance(_engine_config,  Unset):
80            engine_config = UNSET
81        else:
82            engine_config = PipelinesCopyPipelineJsonBodyEngineConfig.from_dict(_engine_config)
83
84
85
86
87        pipeline_version = d.pop("pipeline_version", UNSET)
88
89        pipelines_copy_pipeline_json_body = cls(
90            name=name,
91            workspace_id=workspace_id,
92            source_pipeline=source_pipeline,
93            deploy=deploy,
94            engine_config=engine_config,
95            pipeline_version=pipeline_version,
96        )
97
98        pipelines_copy_pipeline_json_body.additional_properties = d
99        return pipelines_copy_pipeline_json_body
additional_keys: List[str]