@_attrs_define
class ConditionGroupV2:
"""
Example:
{'conditions': [{'operation': {'label': 'Lawrence Jones', 'value': '01FCQSP07Z74QMMYPDDGQB9FTG'},
'param_bindings': [{'array_value': [{'label': 'Lawrence Jones', 'literal': 'SEV123', 'reference':
'incident.severity'}], 'value': {'label': 'Lawrence Jones', 'literal': 'SEV123', 'reference':
'incident.severity'}}], 'subject': {'label': 'Incident Severity', 'reference': 'incident.severity'}}]}
Attributes:
conditions (List['ConditionV2']): All conditions in this list must be satisfied for the group to be satisfied
Example: [{'operation': {'label': 'Lawrence Jones', 'value': '01FCQSP07Z74QMMYPDDGQB9FTG'}, 'param_bindings':
[{'array_value': [{'label': 'Lawrence Jones', 'literal': 'SEV123', 'reference': 'incident.severity'}], 'value':
{'label': 'Lawrence Jones', 'literal': 'SEV123', 'reference': 'incident.severity'}}], 'subject': {'label':
'Incident Severity', 'reference': 'incident.severity'}}].
"""
conditions: List["ConditionV2"]
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
conditions = []
for conditions_item_data in self.conditions:
conditions_item = conditions_item_data.to_dict()
conditions.append(conditions_item)
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update(
{
"conditions": conditions,
}
)
return field_dict
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
from ..models.condition_v2 import ConditionV2
d = src_dict.copy()
conditions = []
_conditions = d.pop("conditions")
for conditions_item_data in _conditions:
conditions_item = ConditionV2.from_dict(conditions_item_data)
conditions.append(conditions_item)
condition_group_v2 = cls(
conditions=conditions,
)
condition_group_v2.additional_properties = d
return condition_group_v2
@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