wallaroo.wallaroo_ml_ops_api_client.models.v1_model_get_config_response_200 API documentation

# wallaroo.wallaroo_ml_ops_api_client.models.v1_model_get_config_response_200

View Source

     1from typing import Any, Dict, List, Type, TypeVar, Union
     2
     3import attr
     4
     5from ..models.v1_model_get_config_response_200_model_config import \
     6    V1ModelGetConfigResponse200ModelConfig
     7from ..types import UNSET, Unset
     8
     9T = TypeVar("T", bound="V1ModelGetConfigResponse200")
    10
    11@attr.s(auto_attribs=True)
    12class V1ModelGetConfigResponse200:
    13    """ Response body of /models/get_config_by_id
    14
    15    Attributes:
    16        model_config (Union[Unset, None, V1ModelGetConfigResponse200ModelConfig]):  An optional Model Configuration
    17    """
    18
    19    model_config: Union[Unset, None, V1ModelGetConfigResponse200ModelConfig] = UNSET
    20    additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
    21
    22
    23    def to_dict(self) -> Dict[str, Any]:
    24        model_config: Union[Unset, None, Dict[str, Any]] = UNSET
    25        if not isinstance(self.model_config, Unset):
    26            model_config = self.model_config.to_dict() if self.model_config else None
    27
    28
    29        field_dict: Dict[str, Any] = {}
    30        field_dict.update(self.additional_properties)
    31        field_dict.update({
    32        })
    33        if model_config is not UNSET:
    34            field_dict["model_config"] = model_config
    35
    36        return field_dict
    37
    38
    39
    40    @classmethod
    41    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
    42        d = src_dict.copy()
    43        _model_config = d.pop("model_config", UNSET)
    44        model_config: Union[Unset, None, V1ModelGetConfigResponse200ModelConfig]
    45        if _model_config is None:
    46            model_config = None
    47        elif isinstance(_model_config,  Unset):
    48            model_config = UNSET
    49        else:
    50            model_config = V1ModelGetConfigResponse200ModelConfig.from_dict(_model_config)
    51
    52
    53
    54
    55        v1_model_get_config_response_200 = cls(
    56            model_config=model_config,
    57        )
    58
    59        v1_model_get_config_response_200.additional_properties = d
    60        return v1_model_get_config_response_200
    61
    62    @property
    63    def additional_keys(self) -> List[str]:
    64        return list(self.additional_properties.keys())
    65
    66    def __getitem__(self, key: str) -> Any:
    67        return self.additional_properties[key]
    68
    69    def __setitem__(self, key: str, value: Any) -> None:
    70        self.additional_properties[key] = value
    71
    72    def __delitem__(self, key: str) -> None:
    73        del self.additional_properties[key]
    74
    75    def __contains__(self, key: str) -> bool:
    76        return key in self.additional_properties

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

    12@attr.s(auto_attribs=True)
    13class V1ModelGetConfigResponse200:
    14    """ Response body of /models/get_config_by_id
    15
    16    Attributes:
    17        model_config (Union[Unset, None, V1ModelGetConfigResponse200ModelConfig]):  An optional Model Configuration
    18    """
    19
    20    model_config: Union[Unset, None, V1ModelGetConfigResponse200ModelConfig] = UNSET
    21    additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
    22
    23
    24    def to_dict(self) -> Dict[str, Any]:
    25        model_config: Union[Unset, None, Dict[str, Any]] = UNSET
    26        if not isinstance(self.model_config, Unset):
    27            model_config = self.model_config.to_dict() if self.model_config else None
    28
    29
    30        field_dict: Dict[str, Any] = {}
    31        field_dict.update(self.additional_properties)
    32        field_dict.update({
    33        })
    34        if model_config is not UNSET:
    35            field_dict["model_config"] = model_config
    36
    37        return field_dict
    38
    39
    40
    41    @classmethod
    42    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
    43        d = src_dict.copy()
    44        _model_config = d.pop("model_config", UNSET)
    45        model_config: Union[Unset, None, V1ModelGetConfigResponse200ModelConfig]
    46        if _model_config is None:
    47            model_config = None
    48        elif isinstance(_model_config,  Unset):
    49            model_config = UNSET
    50        else:
    51            model_config = V1ModelGetConfigResponse200ModelConfig.from_dict(_model_config)
    52
    53
    54
    55
    56        v1_model_get_config_response_200 = cls(
    57            model_config=model_config,
    58        )
    59
    60        v1_model_get_config_response_200.additional_properties = d
    61        return v1_model_get_config_response_200
    62
    63    @property
    64    def additional_keys(self) -> List[str]:
    65        return list(self.additional_properties.keys())
    66
    67    def __getitem__(self, key: str) -> Any:
    68        return self.additional_properties[key]
    69
    70    def __setitem__(self, key: str, value: Any) -> None:
    71        self.additional_properties[key] = value
    72
    73    def __delitem__(self, key: str) -> None:
    74        del self.additional_properties[key]
    75
    76    def __contains__(self, key: str) -> bool:
    77        return key in self.additional_properties

Response body of /models/get_config_by_id

Attributes: model_config (Union[Unset, None, V1ModelGetConfigResponse200ModelConfig]): An optional Model Configuration

V1ModelGetConfigResponse200( model_config: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, wallaroo.wallaroo_ml_ops_api_client.models.v1_model_get_config_response_200_model_config.V1ModelGetConfigResponse200ModelConfig] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>) View Source

    2def __init__(self, model_config=attr_dict['model_config'].default):
    3    self.model_config = model_config
    4    self.additional_properties = __attr_factory_additional_properties()

Method generated by attrs for class V1ModelGetConfigResponse200.

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

    24    def to_dict(self) -> Dict[str, Any]:
    25        model_config: Union[Unset, None, Dict[str, Any]] = UNSET
    26        if not isinstance(self.model_config, Unset):
    27            model_config = self.model_config.to_dict() if self.model_config else None
    28
    29
    30        field_dict: Dict[str, Any] = {}
    31        field_dict.update(self.additional_properties)
    32        field_dict.update({
    33        })
    34        if model_config is not UNSET:
    35            field_dict["model_config"] = model_config
    36
    37        return field_dict

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

    41    @classmethod
    42    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
    43        d = src_dict.copy()
    44        _model_config = d.pop("model_config", UNSET)
    45        model_config: Union[Unset, None, V1ModelGetConfigResponse200ModelConfig]
    46        if _model_config is None:
    47            model_config = None
    48        elif isinstance(_model_config,  Unset):
    49            model_config = UNSET
    50        else:
    51            model_config = V1ModelGetConfigResponse200ModelConfig.from_dict(_model_config)
    52
    53
    54
    55
    56        v1_model_get_config_response_200 = cls(
    57            model_config=model_config,
    58        )
    59
    60        v1_model_get_config_response_200.additional_properties = d
    61        return v1_model_get_config_response_200

additional_keys: List[str]