| 1 |
from __future__ import annotations |
| 2 |
|
| 3 |
import logging |
| 4 |
import typing as t |
| 5 |
|
| 6 |
from globus_sdk._missing import MISSING, MissingType |
| 7 |
from globus_sdk._payload import GlobusPayload |
| 8 |
|
| 9 |
log = logging.getLogger(__name__) |
| 10 |
|
| 11 |
|
| 12 |
class RunActivityNotificationPolicy(GlobusPayload): |
| 13 |
""" |
| 14 |
A notification policy for a run, determining when emails will be sent. |
| 15 |
|
| 16 |
:param status: A list of statuses which will trigger notifications. When |
| 17 |
the run's status changes, it is evaluated against this list. If the new |
| 18 |
status matches the policy, an email is sent. |
| 19 |
""" |
| 20 |
|
| 21 |
def __init__( |
| 22 |
self, |
| 23 |
status: ( |
| 24 |
list[t.Literal["INACTIVE", "SUCCEEDED", "FAILED"]] | MissingType |
| 25 |
) = MISSING, |
| 26 |
) -> None: |
| 27 |
super().__init__() |
| 28 |
self["status"] = status |