wallaroo.wallaroo_ml_ops_api_client.models.pipelines_deploy_json_body API documentation

# wallaroo.wallaroo_ml_ops_api_client.models.pipelines_deploy_json_body

View Source

      1from typing import Any, Dict, List, Type, TypeVar, Union, cast
      2
      3import attr
      4
      5from ..models.pipelines_deploy_json_body_engine_config import \
      6    PipelinesDeployJsonBodyEngineConfig
      7from ..models.pipelines_deploy_json_body_models_item import \
      8    PipelinesDeployJsonBodyModelsItem
      9from ..types import UNSET, Unset
     10
     11T = TypeVar("T", bound="PipelinesDeployJsonBody")
     12
     13@attr.s(auto_attribs=True)
     14class PipelinesDeployJsonBody:
     15    """ Pipeline deployment request.
     16
     17    Attributes:
     18        deploy_id (str):  Deployment identifier.
     19        pipeline_version_pk_id (int):  Internal pipeline version identifier.
     20        pipeline_id (int):  Pipeline identifier.
     21        engine_config (Union[Unset, None, PipelinesDeployJsonBodyEngineConfig]):  Optional engine configuration.
     22        model_configs (Union[Unset, None, List[int]]):  Optional model configurations.
     23        model_ids (Union[Unset, None, List[int]]):  Optional model identifiers.  If model_ids are passed in, we will
     24            create model_configs for them.
     25        models (Union[Unset, None, List[PipelinesDeployJsonBodyModelsItem]]):  Optional model.  Because model_ids may
     26            not be readily available for existing pipelines, they can pass in all the data again.
     27    """
     28
     29    deploy_id: str
     30    pipeline_version_pk_id: int
     31    pipeline_id: int
     32    engine_config: Union[Unset, None, PipelinesDeployJsonBodyEngineConfig] = UNSET
     33    model_configs: Union[Unset, None, List[int]] = UNSET
     34    model_ids: Union[Unset, None, List[int]] = UNSET
     35    models: Union[Unset, None, List[PipelinesDeployJsonBodyModelsItem]] = UNSET
     36    additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
     37
     38
     39    def to_dict(self) -> Dict[str, Any]:
     40        deploy_id = self.deploy_id
     41        pipeline_version_pk_id = self.pipeline_version_pk_id
     42        pipeline_id = self.pipeline_id
     43        engine_config: Union[Unset, None, Dict[str, Any]] = UNSET
     44        if not isinstance(self.engine_config, Unset):
     45            engine_config = self.engine_config.to_dict() if self.engine_config else None
     46
     47        model_configs: Union[Unset, None, List[int]] = UNSET
     48        if not isinstance(self.model_configs, Unset):
     49            if self.model_configs is None:
     50                model_configs = None
     51            else:
     52                model_configs = self.model_configs
     53
     54
     55
     56
     57        model_ids: Union[Unset, None, List[int]] = UNSET
     58        if not isinstance(self.model_ids, Unset):
     59            if self.model_ids is None:
     60                model_ids = None
     61            else:
     62                model_ids = self.model_ids
     63
     64
     65
     66
     67        models: Union[Unset, None, List[Dict[str, Any]]] = UNSET
     68        if not isinstance(self.models, Unset):
     69            if self.models is None:
     70                models = None
     71            else:
     72                models = []
     73                for models_item_data in self.models:
     74                    models_item = models_item_data.to_dict()
     75
     76                    models.append(models_item)
     77
     78
     79
     80
     81
     82        field_dict: Dict[str, Any] = {}
     83        field_dict.update(self.additional_properties)
     84        field_dict.update({
     85            "deploy_id": deploy_id,
     86            "pipeline_version_pk_id": pipeline_version_pk_id,
     87            "pipeline_id": pipeline_id,
     88        })
     89        if engine_config is not UNSET:
     90            field_dict["engine_config"] = engine_config
     91        if model_configs is not UNSET:
     92            field_dict["model_configs"] = model_configs
     93        if model_ids is not UNSET:
     94            field_dict["model_ids"] = model_ids
     95        if models is not UNSET:
     96            field_dict["models"] = models
     97
     98        return field_dict
     99
    100
    101
    102    @classmethod
    103    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
    104        d = src_dict.copy()
    105        deploy_id = d.pop("deploy_id")
    106
    107        pipeline_version_pk_id = d.pop("pipeline_version_pk_id")
    108
    109        pipeline_id = d.pop("pipeline_id")
    110
    111        _engine_config = d.pop("engine_config", UNSET)
    112        engine_config: Union[Unset, None, PipelinesDeployJsonBodyEngineConfig]
    113        if _engine_config is None:
    114            engine_config = None
    115        elif isinstance(_engine_config,  Unset):
    116            engine_config = UNSET
    117        else:
    118            engine_config = PipelinesDeployJsonBodyEngineConfig.from_dict(_engine_config)
    119
    120
    121
    122
    123        model_configs = cast(List[int], d.pop("model_configs", UNSET))
    124
    125
    126        model_ids = cast(List[int], d.pop("model_ids", UNSET))
    127
    128
    129        models = []
    130        _models = d.pop("models", UNSET)
    131        for models_item_data in (_models or []):
    132            models_item = PipelinesDeployJsonBodyModelsItem.from_dict(models_item_data)
    133
    134
    135
    136            models.append(models_item)
    137
    138
    139        pipelines_deploy_json_body = cls(
    140            deploy_id=deploy_id,
    141            pipeline_version_pk_id=pipeline_version_pk_id,
    142            pipeline_id=pipeline_id,
    143            engine_config=engine_config,
    144            model_configs=model_configs,
    145            model_ids=model_ids,
    146            models=models,
    147        )
    148
    149        pipelines_deploy_json_body.additional_properties = d
    150        return pipelines_deploy_json_body
    151
    152    @property
    153    def additional_keys(self) -> List[str]:
    154        return list(self.additional_properties.keys())
    155
    156    def __getitem__(self, key: str) -> Any:
    157        return self.additional_properties[key]
    158
    159    def __setitem__(self, key: str, value: Any) -> None:
    160        self.additional_properties[key] = value
    161
    162    def __delitem__(self, key: str) -> None:
    163        del self.additional_properties[key]
    164
    165    def __contains__(self, key: str) -> bool:
    166        return key in self.additional_properties

@attr.s(auto_attribs=True)
class PipelinesDeployJsonBody: View Source

     14@attr.s(auto_attribs=True)
     15class PipelinesDeployJsonBody:
     16    """ Pipeline deployment request.
     17
     18    Attributes:
     19        deploy_id (str):  Deployment identifier.
     20        pipeline_version_pk_id (int):  Internal pipeline version identifier.
     21        pipeline_id (int):  Pipeline identifier.
     22        engine_config (Union[Unset, None, PipelinesDeployJsonBodyEngineConfig]):  Optional engine configuration.
     23        model_configs (Union[Unset, None, List[int]]):  Optional model configurations.
     24        model_ids (Union[Unset, None, List[int]]):  Optional model identifiers.  If model_ids are passed in, we will
     25            create model_configs for them.
     26        models (Union[Unset, None, List[PipelinesDeployJsonBodyModelsItem]]):  Optional model.  Because model_ids may
     27            not be readily available for existing pipelines, they can pass in all the data again.
     28    """
     29
     30    deploy_id: str
     31    pipeline_version_pk_id: int
     32    pipeline_id: int
     33    engine_config: Union[Unset, None, PipelinesDeployJsonBodyEngineConfig] = UNSET
     34    model_configs: Union[Unset, None, List[int]] = UNSET
     35    model_ids: Union[Unset, None, List[int]] = UNSET
     36    models: Union[Unset, None, List[PipelinesDeployJsonBodyModelsItem]] = UNSET
     37    additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
     38
     39
     40    def to_dict(self) -> Dict[str, Any]:
     41        deploy_id = self.deploy_id
     42        pipeline_version_pk_id = self.pipeline_version_pk_id
     43        pipeline_id = self.pipeline_id
     44        engine_config: Union[Unset, None, Dict[str, Any]] = UNSET
     45        if not isinstance(self.engine_config, Unset):
     46            engine_config = self.engine_config.to_dict() if self.engine_config else None
     47
     48        model_configs: Union[Unset, None, List[int]] = UNSET
     49        if not isinstance(self.model_configs, Unset):
     50            if self.model_configs is None:
     51                model_configs = None
     52            else:
     53                model_configs = self.model_configs
     54
     55
     56
     57
     58        model_ids: Union[Unset, None, List[int]] = UNSET
     59        if not isinstance(self.model_ids, Unset):
     60            if self.model_ids is None:
     61                model_ids = None
     62            else:
     63                model_ids = self.model_ids
     64
     65
     66
     67
     68        models: Union[Unset, None, List[Dict[str, Any]]] = UNSET
     69        if not isinstance(self.models, Unset):
     70            if self.models is None:
     71                models = None
     72            else:
     73                models = []
     74                for models_item_data in self.models:
     75                    models_item = models_item_data.to_dict()
     76
     77                    models.append(models_item)
     78
     79
     80
     81
     82
     83        field_dict: Dict[str, Any] = {}
     84        field_dict.update(self.additional_properties)
     85        field_dict.update({
     86            "deploy_id": deploy_id,
     87            "pipeline_version_pk_id": pipeline_version_pk_id,
     88            "pipeline_id": pipeline_id,
     89        })
     90        if engine_config is not UNSET:
     91            field_dict["engine_config"] = engine_config
     92        if model_configs is not UNSET:
     93            field_dict["model_configs"] = model_configs
     94        if model_ids is not UNSET:
     95            field_dict["model_ids"] = model_ids
     96        if models is not UNSET:
     97            field_dict["models"] = models
     98
     99        return field_dict
    100
    101
    102
    103    @classmethod
    104    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
    105        d = src_dict.copy()
    106        deploy_id = d.pop("deploy_id")
    107
    108        pipeline_version_pk_id = d.pop("pipeline_version_pk_id")
    109
    110        pipeline_id = d.pop("pipeline_id")
    111
    112        _engine_config = d.pop("engine_config", UNSET)
    113        engine_config: Union[Unset, None, PipelinesDeployJsonBodyEngineConfig]
    114        if _engine_config is None:
    115            engine_config = None
    116        elif isinstance(_engine_config,  Unset):
    117            engine_config = UNSET
    118        else:
    119            engine_config = PipelinesDeployJsonBodyEngineConfig.from_dict(_engine_config)
    120
    121
    122
    123
    124        model_configs = cast(List[int], d.pop("model_configs", UNSET))
    125
    126
    127        model_ids = cast(List[int], d.pop("model_ids", UNSET))
    128
    129
    130        models = []
    131        _models = d.pop("models", UNSET)
    132        for models_item_data in (_models or []):
    133            models_item = PipelinesDeployJsonBodyModelsItem.from_dict(models_item_data)
    134
    135
    136
    137            models.append(models_item)
    138
    139
    140        pipelines_deploy_json_body = cls(
    141            deploy_id=deploy_id,
    142            pipeline_version_pk_id=pipeline_version_pk_id,
    143            pipeline_id=pipeline_id,
    144            engine_config=engine_config,
    145            model_configs=model_configs,
    146            model_ids=model_ids,
    147            models=models,
    148        )
    149
    150        pipelines_deploy_json_body.additional_properties = d
    151        return pipelines_deploy_json_body
    152
    153    @property
    154    def additional_keys(self) -> List[str]:
    155        return list(self.additional_properties.keys())
    156
    157    def __getitem__(self, key: str) -> Any:
    158        return self.additional_properties[key]
    159
    160    def __setitem__(self, key: str, value: Any) -> None:
    161        self.additional_properties[key] = value
    162
    163    def __delitem__(self, key: str) -> None:
    164        del self.additional_properties[key]
    165
    166    def __contains__(self, key: str) -> bool:
    167        return key in self.additional_properties

Pipeline deployment request.

Attributes: deploy_id (str): Deployment identifier. pipeline_version_pk_id (int): Internal pipeline version identifier. pipeline_id (int): Pipeline identifier. engine_config (Union[Unset, None, PipelinesDeployJsonBodyEngineConfig]): Optional engine configuration. model_configs (Union[Unset, None, List[int]]): Optional model configurations. model_ids (Union[Unset, None, List[int]]): Optional model identifiers. If model_ids are passed in, we will create model_configs for them. models (Union[Unset, None, List[PipelinesDeployJsonBodyModelsItem]]): Optional model. Because model_ids may not be readily available for existing pipelines, they can pass in all the data again.

PipelinesDeployJsonBody( deploy_id: str, pipeline_version_pk_id: int, pipeline_id: int, engine_config: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, wallaroo.wallaroo_ml_ops_api_client.models.pipelines_deploy_json_body_engine_config.PipelinesDeployJsonBodyEngineConfig] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>, model_configs: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, List[int]] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>, model_ids: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, List[int]] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>, models: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, List[wallaroo.wallaroo_ml_ops_api_client.models.pipelines_deploy_json_body_models_item.PipelinesDeployJsonBodyModelsItem]] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>) View Source

     2def __init__(self, deploy_id, pipeline_version_pk_id, pipeline_id, engine_config=attr_dict['engine_config'].default, model_configs=attr_dict['model_configs'].default, model_ids=attr_dict['model_ids'].default, models=attr_dict['models'].default):
     3    self.deploy_id = deploy_id
     4    self.pipeline_version_pk_id = pipeline_version_pk_id
     5    self.pipeline_id = pipeline_id
     6    self.engine_config = engine_config
     7    self.model_configs = model_configs
     8    self.model_ids = model_ids
     9    self.models = models
    10    self.additional_properties = __attr_factory_additional_properties()

Method generated by attrs for class PipelinesDeployJsonBody.

def to_dict(self) -> Dict[str, Any]: View Source

    40    def to_dict(self) -> Dict[str, Any]:
    41        deploy_id = self.deploy_id
    42        pipeline_version_pk_id = self.pipeline_version_pk_id
    43        pipeline_id = self.pipeline_id
    44        engine_config: Union[Unset, None, Dict[str, Any]] = UNSET
    45        if not isinstance(self.engine_config, Unset):
    46            engine_config = self.engine_config.to_dict() if self.engine_config else None
    47
    48        model_configs: Union[Unset, None, List[int]] = UNSET
    49        if not isinstance(self.model_configs, Unset):
    50            if self.model_configs is None:
    51                model_configs = None
    52            else:
    53                model_configs = self.model_configs
    54
    55
    56
    57
    58        model_ids: Union[Unset, None, List[int]] = UNSET
    59        if not isinstance(self.model_ids, Unset):
    60            if self.model_ids is None:
    61                model_ids = None
    62            else:
    63                model_ids = self.model_ids
    64
    65
    66
    67
    68        models: Union[Unset, None, List[Dict[str, Any]]] = UNSET
    69        if not isinstance(self.models, Unset):
    70            if self.models is None:
    71                models = None
    72            else:
    73                models = []
    74                for models_item_data in self.models:
    75                    models_item = models_item_data.to_dict()
    76
    77                    models.append(models_item)
    78
    79
    80
    81
    82
    83        field_dict: Dict[str, Any] = {}
    84        field_dict.update(self.additional_properties)
    85        field_dict.update({
    86            "deploy_id": deploy_id,
    87            "pipeline_version_pk_id": pipeline_version_pk_id,
    88            "pipeline_id": pipeline_id,
    89        })
    90        if engine_config is not UNSET:
    91            field_dict["engine_config"] = engine_config
    92        if model_configs is not UNSET:
    93            field_dict["model_configs"] = model_configs
    94        if model_ids is not UNSET:
    95            field_dict["model_ids"] = model_ids
    96        if models is not UNSET:
    97            field_dict["models"] = models
    98
    99        return field_dict

@classmethod
def from_dict(cls: Type[~T], src_dict: Dict[str, Any]) -> ~T: View Source

    103    @classmethod
    104    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
    105        d = src_dict.copy()
    106        deploy_id = d.pop("deploy_id")
    107
    108        pipeline_version_pk_id = d.pop("pipeline_version_pk_id")
    109
    110        pipeline_id = d.pop("pipeline_id")
    111
    112        _engine_config = d.pop("engine_config", UNSET)
    113        engine_config: Union[Unset, None, PipelinesDeployJsonBodyEngineConfig]
    114        if _engine_config is None:
    115            engine_config = None
    116        elif isinstance(_engine_config,  Unset):
    117            engine_config = UNSET
    118        else:
    119            engine_config = PipelinesDeployJsonBodyEngineConfig.from_dict(_engine_config)
    120
    121
    122
    123
    124        model_configs = cast(List[int], d.pop("model_configs", UNSET))
    125
    126
    127        model_ids = cast(List[int], d.pop("model_ids", UNSET))
    128
    129
    130        models = []
    131        _models = d.pop("models", UNSET)
    132        for models_item_data in (_models or []):
    133            models_item = PipelinesDeployJsonBodyModelsItem.from_dict(models_item_data)
    134
    135
    136
    137            models.append(models_item)
    138
    139
    140        pipelines_deploy_json_body = cls(
    141            deploy_id=deploy_id,
    142            pipeline_version_pk_id=pipeline_version_pk_id,
    143            pipeline_id=pipeline_id,
    144            engine_config=engine_config,
    145            model_configs=model_configs,
    146            model_ids=model_ids,
    147            models=models,
    148        )
    149
    150        pipelines_deploy_json_body.additional_properties = d
    151        return pipelines_deploy_json_body

additional_keys: List[str]