mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-27 06:21:28 +00:00
31 lines
501 B
Python
31 lines
501 B
Python
"""Common types and enums used by different types of queries."""
|
|
from enum import Enum
|
|
import datetime
|
|
import typing
|
|
import strawberry
|
|
|
|
|
|
@strawberry.enum
|
|
class Severity(Enum):
|
|
"""
|
|
Severity of an alert.
|
|
"""
|
|
|
|
INFO = "INFO"
|
|
WARNING = "WARNING"
|
|
ERROR = "ERROR"
|
|
CRITICAL = "CRITICAL"
|
|
SUCCESS = "SUCCESS"
|
|
|
|
|
|
@strawberry.type
|
|
class Alert:
|
|
"""
|
|
Alert type.
|
|
"""
|
|
|
|
severity: Severity
|
|
title: str
|
|
message: str
|
|
timestamp: typing.Optional[datetime.datetime]
|