11"""Execution related enums (types, states and subtypes)."""
22
3- import logging
43from enum import StrEnum , unique
54
6- _LOGGER = logging . getLogger ( __name__ )
5+ from pyoverkiz . enums . base import UnknownEnumMixin
76
87
98@unique
10- class ExecutionType (StrEnum ):
9+ class ExecutionType (UnknownEnumMixin , StrEnum ):
1110 """High-level execution categories returned by the API."""
1211
1312 UNKNOWN = "UNKNOWN"
@@ -18,14 +17,9 @@ class ExecutionType(StrEnum):
1817 RAW_TRIGGER_SERVER = "Raw trigger (Server)"
1918 RAW_TRIGGER_GATEWAY = "Raw trigger (Gateway)"
2019
21- @classmethod
22- def _missing_ (cls , value ): # type: ignore
23- _LOGGER .warning (f"Unsupported value { value } has been returned for { cls } " )
24- return cls .UNKNOWN
25-
2620
2721@unique
28- class ExecutionState (StrEnum ):
22+ class ExecutionState (UnknownEnumMixin , StrEnum ):
2923 """Execution lifecycle states."""
3024
3125 UNKNOWN = "UNKNOWN"
@@ -38,14 +32,9 @@ class ExecutionState(StrEnum):
3832 QUEUED_GATEWAY_SIDE = "QUEUED_GATEWAY_SIDE"
3933 QUEUED_SERVER_SIDE = "QUEUED_SERVER_SIDE"
4034
41- @classmethod
42- def _missing_ (cls , value ): # type: ignore
43- _LOGGER .warning (f"Unsupported value { value } has been returned for { cls } " )
44- return cls .UNKNOWN
45-
4635
4736@unique
48- class ExecutionSubType (StrEnum ):
37+ class ExecutionSubType (UnknownEnumMixin , StrEnum ):
4938 """Subtypes for execution reasons or sources."""
5039
5140 UNKNOWN = "UNKNOWN"
@@ -63,8 +52,3 @@ class ExecutionSubType(StrEnum):
6352 NO_ERROR = "NO_ERROR"
6453 P2P_COMMAND_REGULATION = "P2P_COMMAND_REGULATION"
6554 TIME_TRIGGER = "TIME_TRIGGER"
66-
67- @classmethod
68- def _missing_ (cls , value ): # type: ignore
69- _LOGGER .warning (f"Unsupported value { value } has been returned for { cls } " )
70- return cls .UNKNOWN
0 commit comments