| 1 |
|
| 2 |
|
| 3 |
import typing |
| 4 |
|
| 5 |
import pydantic |
| 6 |
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel |
| 7 |
from .action_binding_type_enum import ActionBindingTypeEnum |
| 8 |
from .action_trigger_compatible_trigger import ActionTriggerCompatibleTrigger |
| 9 |
from .action_trigger_type_enum import ActionTriggerTypeEnum |
| 10 |
|
| 11 |
|
| 12 |
class ActionTrigger(UniversalBaseModel): |
| 13 |
id: ActionTriggerTypeEnum |
| 14 |
version: typing.Optional[str] = pydantic.Field(default=None) |
| 15 |
""" |
| 16 |
The version of a trigger. v1, v2, etc. |
| 17 |
""" |
| 18 |
|
| 19 |
status: typing.Optional[str] = pydantic.Field(default=None) |
| 20 |
""" |
| 21 |
status points to the trigger status. |
| 22 |
""" |
| 23 |
|
| 24 |
runtimes: typing.Optional[typing.List[str]] = pydantic.Field(default=None) |
| 25 |
""" |
| 26 |
runtimes supported by this trigger. |
| 27 |
""" |
| 28 |
|
| 29 |
default_runtime: typing.Optional[str] = pydantic.Field(default=None) |
| 30 |
""" |
| 31 |
Runtime that will be used when none is specified when creating an action. |
| 32 |
""" |
| 33 |
|
| 34 |
compatible_triggers: typing.Optional[typing.List[ActionTriggerCompatibleTrigger]] = pydantic.Field(default=None) |
| 35 |
""" |
| 36 |
compatible_triggers informs which other trigger supports the same event and api. |
| 37 |
""" |
| 38 |
|
| 39 |
binding_policy: typing.Optional[ActionBindingTypeEnum] = None |
| 40 |
|
| 41 |
if IS_PYDANTIC_V2: |
| 42 |
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) |
| 43 |
else: |
| 44 |
|
| 45 |
class Config: |
| 46 |
frozen = True |
| 47 |
smart_union = True |
| 48 |
extra = pydantic.Extra.allow |