mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-16 07:33:16 +00:00
32 lines
502 B
Python
32 lines
502 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]
|