uptime-kuma-api/scripts/notification_providers.py.j2

32 lines
866 B
Text
Raw Normal View History

2022-07-02 16:00:54 +02:00
from enum import Enum
class NotificationType(str, Enum):
{%- for notification_provider in notification_providers %}
{%- set name = notification_provider["name"] %}
{{ name.upper().replace(".", "_") }} = "{{ name }}"
{%- endfor %}
notification_provider_options = {
{%- for notification_provider in notification_providers %}
{%- set name = notification_provider["name"] %}
NotificationType.{{ name.upper().replace(".", "_") }}: [
{%- for input in notification_provider["inputs"] %}
"{{ input }}",
{%- endfor %}
],
{%- endfor %}
}
2022-09-07 13:04:16 +02:00
notification_provider_conditions = {
{%- for provider in notification_provider_conditions %}
"{{ provider }}": {
{%- for key, value in notification_provider_conditions[provider].items() %}
"{{ key }}": {{ value }},
{%- endfor %}
},
{%- endfor %}
}