"""
Predefined SelectionSets for Alert entity.
Based on the Alert GraphQL schema output types:
AlertDetail, AlertAffectedEntity, CreateAlertsOutput,
AddEntitiesToAlertOutput, DeleteAlertsOutput, RemoveAffectedEntitiesOutput
"""
from ace.core.graphql import SelectionSet
[docs]
class AlertAffectedEntitySelections:
"""Reusable selection sets for AlertAffectedEntity fields."""
STANDARD = SelectionSet(
"entityTypeId",
"entityTypeName",
"ids",
)
[docs]
class AlertSelections:
"""Reusable selection sets for Alert fields."""
MINIMAL = SelectionSet(
"alertId",
)
STANDARD = SelectionSet(
"alertId",
"alertTypeId",
"entityId",
"entityTypeId",
"entityTypeName",
)
FULL = SelectionSet(
"alertId",
"alertTypeId",
"entityId",
"entityTypeId",
"entityTypeName",
nested={
"alertAffectedEntities": AlertAffectedEntitySelections.STANDARD,
}
)
# Kept for backward compatibility
WITH_AFFECTED_ENTITIES = FULL