| 1 |
|
| 2 |
|
| 3 |
import datetime as dt |
| 4 |
import typing |
| 5 |
|
| 6 |
import pydantic |
| 7 |
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel |
| 8 |
from .action import Action |
| 9 |
from .action_trigger_type_enum import ActionTriggerTypeEnum |
| 10 |
|
| 11 |
|
| 12 |
class ActionBinding(UniversalBaseModel): |
| 13 |
""" |
| 14 |
Binding is the associative entity joining a trigger, and an action together. |
| 15 |
""" |
| 16 |
|
| 17 |
id: typing.Optional[str] = pydantic.Field(default=None) |
| 18 |
""" |
| 19 |
The unique ID of this binding. |
| 20 |
""" |
| 21 |
|
| 22 |
trigger_id: typing.Optional[ActionTriggerTypeEnum] = None |
| 23 |
display_name: typing.Optional[str] = pydantic.Field(default=None) |
| 24 |
""" |
| 25 |
The name of the binding. |
| 26 |
""" |
| 27 |
|
| 28 |
action: typing.Optional[Action] = None |
| 29 |
created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) |
| 30 |
""" |
| 31 |
The time when the binding was created. |
| 32 |
""" |
| 33 |
|
| 34 |
updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) |
| 35 |
""" |
| 36 |
The time when the binding was updated. |
| 37 |
""" |
| 38 |
|
| 39 |
if IS_PYDANTIC_V2: |
| 40 |
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) |
| 41 |
else: |
| 42 |
|
| 43 |
class Config: |
| 44 |
frozen = True |
| 45 |
smart_union = True |
| 46 |
extra = pydantic.Extra.allow |