wallaroo.wallaroo_ml_ops_api_client.models.v1_model_get_config_response_200_model_config API documentation

# wallaroo.wallaroo_ml_ops_api_client.models.v1_model_get_config_response_200_model_config

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_tensor_fields import \
     6    V1ModelGetConfigResponse200ModelConfigTensorFields
     7from ..types import UNSET, Unset
     8
     9T = TypeVar("T", bound="V1ModelGetConfigResponse200ModelConfig")
    10
    11@attr.s(auto_attribs=True)
    12class V1ModelGetConfigResponse200ModelConfig:
    13    """ An optional Model Configuration
    14
    15    Attributes:
    16        id (int):  The primary id of the model configuration.
    17        runtime (str):  The model configuration runtime.
    18        tensor_fields (Union[Unset, None, V1ModelGetConfigResponse200ModelConfigTensorFields]):  Optional Tensor Fields
    19            for the model.
    20        filter_threshold (Union[Unset, None, float]):  An optional filter threshold
    21    """
    22
    23    id: int
    24    runtime: str
    25    tensor_fields: Union[Unset, None, V1ModelGetConfigResponse200ModelConfigTensorFields] = UNSET
    26    filter_threshold: Union[Unset, None, float] = UNSET
    27    additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
    28
    29
    30    def to_dict(self) -> Dict[str, Any]:
    31        id = self.id
    32        runtime = self.runtime
    33        tensor_fields: Union[Unset, None, Dict[str, Any]] = UNSET
    34        if not isinstance(self.tensor_fields, Unset):
    35            tensor_fields = self.tensor_fields.to_dict() if self.tensor_fields else None
    36
    37        filter_threshold = self.filter_threshold
    38
    39        field_dict: Dict[str, Any] = {}
    40        field_dict.update(self.additional_properties)
    41        field_dict.update({
    42            "id": id,
    43            "runtime": runtime,
    44        })
    45        if tensor_fields is not UNSET:
    46            field_dict["tensor_fields"] = tensor_fields
    47        if filter_threshold is not UNSET:
    48            field_dict["filter_threshold"] = filter_threshold
    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        id = d.pop("id")
    58
    59        runtime = d.pop("runtime")
    60
    61        _tensor_fields = d.pop("tensor_fields", UNSET)
    62        tensor_fields: Union[Unset, None, V1ModelGetConfigResponse200ModelConfigTensorFields]
    63        if _tensor_fields is None:
    64            tensor_fields = None
    65        elif isinstance(_tensor_fields,  Unset):
    66            tensor_fields = UNSET
    67        else:
    68            tensor_fields = V1ModelGetConfigResponse200ModelConfigTensorFields.from_dict(_tensor_fields)
    69
    70
    71
    72
    73        filter_threshold = d.pop("filter_threshold", UNSET)
    74
    75        v1_model_get_config_response_200_model_config = cls(
    76            id=id,
    77            runtime=runtime,
    78            tensor_fields=tensor_fields,
    79            filter_threshold=filter_threshold,
    80        )
    81
    82        v1_model_get_config_response_200_model_config.additional_properties = d
    83        return v1_model_get_config_response_200_model_config
    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

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

     12@attr.s(auto_attribs=True)
     13class V1ModelGetConfigResponse200ModelConfig:
     14    """ An optional Model Configuration
     15
     16    Attributes:
     17        id (int):  The primary id of the model configuration.
     18        runtime (str):  The model configuration runtime.
     19        tensor_fields (Union[Unset, None, V1ModelGetConfigResponse200ModelConfigTensorFields]):  Optional Tensor Fields
     20            for the model.
     21        filter_threshold (Union[Unset, None, float]):  An optional filter threshold
     22    """
     23
     24    id: int
     25    runtime: str
     26    tensor_fields: Union[Unset, None, V1ModelGetConfigResponse200ModelConfigTensorFields] = UNSET
     27    filter_threshold: Union[Unset, None, float] = UNSET
     28    additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
     29
     30
     31    def to_dict(self) -> Dict[str, Any]:
     32        id = self.id
     33        runtime = self.runtime
     34        tensor_fields: Union[Unset, None, Dict[str, Any]] = UNSET
     35        if not isinstance(self.tensor_fields, Unset):
     36            tensor_fields = self.tensor_fields.to_dict() if self.tensor_fields else None
     37
     38        filter_threshold = self.filter_threshold
     39
     40        field_dict: Dict[str, Any] = {}
     41        field_dict.update(self.additional_properties)
     42        field_dict.update({
     43            "id": id,
     44            "runtime": runtime,
     45        })
     46        if tensor_fields is not UNSET:
     47            field_dict["tensor_fields"] = tensor_fields
     48        if filter_threshold is not UNSET:
     49            field_dict["filter_threshold"] = filter_threshold
     50
     51        return field_dict
     52
     53
     54
     55    @classmethod
     56    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
     57        d = src_dict.copy()
     58        id = d.pop("id")
     59
     60        runtime = d.pop("runtime")
     61
     62        _tensor_fields = d.pop("tensor_fields", UNSET)
     63        tensor_fields: Union[Unset, None, V1ModelGetConfigResponse200ModelConfigTensorFields]
     64        if _tensor_fields is None:
     65            tensor_fields = None
     66        elif isinstance(_tensor_fields,  Unset):
     67            tensor_fields = UNSET
     68        else:
     69            tensor_fields = V1ModelGetConfigResponse200ModelConfigTensorFields.from_dict(_tensor_fields)
     70
     71
     72
     73
     74        filter_threshold = d.pop("filter_threshold", UNSET)
     75
     76        v1_model_get_config_response_200_model_config = cls(
     77            id=id,
     78            runtime=runtime,
     79            tensor_fields=tensor_fields,
     80            filter_threshold=filter_threshold,
     81        )
     82
     83        v1_model_get_config_response_200_model_config.additional_properties = d
     84        return v1_model_get_config_response_200_model_config
     85
     86    @property
     87    def additional_keys(self) -> List[str]:
     88        return list(self.additional_properties.keys())
     89
     90    def __getitem__(self, key: str) -> Any:
     91        return self.additional_properties[key]
     92
     93    def __setitem__(self, key: str, value: Any) -> None:
     94        self.additional_properties[key] = value
     95
     96    def __delitem__(self, key: str) -> None:
     97        del self.additional_properties[key]
     98
     99    def __contains__(self, key: str) -> bool:
    100        return key in self.additional_properties

An optional Model Configuration

Attributes: id (int): The primary id of the model configuration. runtime (str): The model configuration runtime. tensor_fields (Union[Unset, None, V1ModelGetConfigResponse200ModelConfigTensorFields]): Optional Tensor Fields for the model. filter_threshold (Union[Unset, None, float]): An optional filter threshold

V1ModelGetConfigResponse200ModelConfig( id: int, runtime: str, tensor_fields: 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_tensor_fields.V1ModelGetConfigResponse200ModelConfigTensorFields] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>, filter_threshold: Union[wallaroo.wallaroo_ml_ops_api_client.types.Unset, NoneType, float] = <wallaroo.wallaroo_ml_ops_api_client.types.Unset object>) View Source

    2def __init__(self, id, runtime, tensor_fields=attr_dict['tensor_fields'].default, filter_threshold=attr_dict['filter_threshold'].default):
    3    self.id = id
    4    self.runtime = runtime
    5    self.tensor_fields = tensor_fields
    6    self.filter_threshold = filter_threshold
    7    self.additional_properties = __attr_factory_additional_properties()

Method generated by attrs for class V1ModelGetConfigResponse200ModelConfig.

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

    31    def to_dict(self) -> Dict[str, Any]:
    32        id = self.id
    33        runtime = self.runtime
    34        tensor_fields: Union[Unset, None, Dict[str, Any]] = UNSET
    35        if not isinstance(self.tensor_fields, Unset):
    36            tensor_fields = self.tensor_fields.to_dict() if self.tensor_fields else None
    37
    38        filter_threshold = self.filter_threshold
    39
    40        field_dict: Dict[str, Any] = {}
    41        field_dict.update(self.additional_properties)
    42        field_dict.update({
    43            "id": id,
    44            "runtime": runtime,
    45        })
    46        if tensor_fields is not UNSET:
    47            field_dict["tensor_fields"] = tensor_fields
    48        if filter_threshold is not UNSET:
    49            field_dict["filter_threshold"] = filter_threshold
    50
    51        return field_dict

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

    55    @classmethod
    56    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
    57        d = src_dict.copy()
    58        id = d.pop("id")
    59
    60        runtime = d.pop("runtime")
    61
    62        _tensor_fields = d.pop("tensor_fields", UNSET)
    63        tensor_fields: Union[Unset, None, V1ModelGetConfigResponse200ModelConfigTensorFields]
    64        if _tensor_fields is None:
    65            tensor_fields = None
    66        elif isinstance(_tensor_fields,  Unset):
    67            tensor_fields = UNSET
    68        else:
    69            tensor_fields = V1ModelGetConfigResponse200ModelConfigTensorFields.from_dict(_tensor_fields)
    70
    71
    72
    73
    74        filter_threshold = d.pop("filter_threshold", UNSET)
    75
    76        v1_model_get_config_response_200_model_config = cls(
    77            id=id,
    78            runtime=runtime,
    79            tensor_fields=tensor_fields,
    80            filter_threshold=filter_threshold,
    81        )
    82
    83        v1_model_get_config_response_200_model_config.additional_properties = d
    84        return v1_model_get_config_response_200_model_config

additional_keys: List[str]