@_attrs_define
class ExpressionFilterOptsV2:
"""
Example:
{'condition_groups': [{'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:
condition_groups (List['ConditionGroupV2']): The condition groups to apply in this filter. Only one group needs
to be satisfied for the filter to pass. 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'}}]}].
"""
condition_groups: List["ConditionGroupV2"]
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
def to_dict(self) -> Dict[str, Any]:
condition_groups = []
for condition_groups_item_data in self.condition_groups:
condition_groups_item = condition_groups_item_data.to_dict()
condition_groups.append(condition_groups_item)
field_dict: Dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update(
{
"condition_groups": condition_groups,
}
)
return field_dict
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
from ..models.condition_group_v2 import ConditionGroupV2
d = src_dict.copy()
condition_groups = []
_condition_groups = d.pop("condition_groups")
for condition_groups_item_data in _condition_groups:
condition_groups_item = ConditionGroupV2.from_dict(condition_groups_item_data)
condition_groups.append(condition_groups_item)
expression_filter_opts_v2 = cls(
condition_groups=condition_groups,
)
expression_filter_opts_v2.additional_properties = d
return expression_filter_opts_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