Skip to content

incident_io_client.models.engine_param_binding_v2_response_body

EngineParamBindingV2ResponseBody

Example

{'array_value': [{'label': 'Lawrence Jones', 'literal': 'SEV123', 'reference': 'incident.severity'}], 'value': {'label': 'Lawrence Jones', 'literal': 'SEV123', 'reference': 'incident.severity'}}

Attributes:

Name Type Description
array_value Union[Unset, List[EngineParamBindingValueV2ResponseBody]]

If array_value is set, this helps render the values Example: [{'label': 'Lawrence Jones', 'literal': 'SEV123', 'reference': 'incident.severity'}].

value Union[Unset, EngineParamBindingValueV2ResponseBody]

Example: {'label': 'Lawrence Jones', 'literal': 'SEV123', 'reference': 'incident.severity'}.

Source code in incident_io_client/models/engine_param_binding_v2_response_body.py
@_attrs_define
class EngineParamBindingV2ResponseBody:
    """
    Example:
        {'array_value': [{'label': 'Lawrence Jones', 'literal': 'SEV123', 'reference': 'incident.severity'}], 'value':
            {'label': 'Lawrence Jones', 'literal': 'SEV123', 'reference': 'incident.severity'}}

    Attributes:
        array_value (Union[Unset, List['EngineParamBindingValueV2ResponseBody']]): If array_value is set, this helps
            render the values Example: [{'label': 'Lawrence Jones', 'literal': 'SEV123', 'reference': 'incident.severity'}].
        value (Union[Unset, EngineParamBindingValueV2ResponseBody]):  Example: {'label': 'Lawrence Jones', 'literal':
            'SEV123', 'reference': 'incident.severity'}.
    """

    array_value: Union[Unset, List["EngineParamBindingValueV2ResponseBody"]] = UNSET
    value: Union[Unset, "EngineParamBindingValueV2ResponseBody"] = UNSET
    additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)

    def to_dict(self) -> Dict[str, Any]:
        array_value: Union[Unset, List[Dict[str, Any]]] = UNSET
        if not isinstance(self.array_value, Unset):
            array_value = []
            for array_value_item_data in self.array_value:
                array_value_item = array_value_item_data.to_dict()
                array_value.append(array_value_item)

        value: Union[Unset, Dict[str, Any]] = UNSET
        if not isinstance(self.value, Unset):
            value = self.value.to_dict()

        field_dict: Dict[str, Any] = {}
        field_dict.update(self.additional_properties)
        field_dict.update({})
        if array_value is not UNSET:
            field_dict["array_value"] = array_value
        if value is not UNSET:
            field_dict["value"] = value

        return field_dict

    @classmethod
    def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
        from ..models.engine_param_binding_value_v2_response_body import (
            EngineParamBindingValueV2ResponseBody,
        )

        d = src_dict.copy()
        array_value = []
        _array_value = d.pop("array_value", UNSET)
        for array_value_item_data in _array_value or []:
            array_value_item = EngineParamBindingValueV2ResponseBody.from_dict(
                array_value_item_data
            )

            array_value.append(array_value_item)

        _value = d.pop("value", UNSET)
        value: Union[Unset, EngineParamBindingValueV2ResponseBody]
        if isinstance(_value, Unset):
            value = UNSET
        else:
            value = EngineParamBindingValueV2ResponseBody.from_dict(_value)

        engine_param_binding_v2_response_body = cls(
            array_value=array_value,
            value=value,
        )

        engine_param_binding_v2_response_body.additional_properties = d
        return engine_param_binding_v2_response_body

    @property
    def additional_keys(self) -> List[str]:
        return list(self.additional_properties.keys())

    def __getitem__(self, key: str) -> Any:
        return self.additional_properties[key]

    def __setitem__(self, key: str, value: Any) -> None:
        self.additional_properties[key] = value

    def __delitem__(self, key: str) -> None:
        del self.additional_properties[key]

    def __contains__(self, key: str) -> bool:
        return key in self.additional_properties