sym.sdk.event¶
Triggers for the various steps of a Flow
.
Classes
The |
|
The |
|
Contains metadata about an |
|
The |
- class sym.sdk.event.Channel(srn: Union[sym.sdk.resource.SRN, str])¶
Bases:
sym.sdk.resource.SymResource
The
Channel
object contains information about the channel from which an event was sent.- dict()¶
Represent this resource as a dictionary.
- property identifier¶
The identifier of the channel (e.g.,
#general
for a Slack channel).Note that, if the event originated from a Slack shortcut (as opposed to a slash command), identifier will be
None
. This is because shortcuts are global and not linked to any specific channel.
- property type¶
The channel type (e.g.,
slack
orsym
).
- class sym.sdk.event.Event(srn: Union[sym.sdk.resource.SRN, str])¶
Bases:
sym.sdk.resource.SymResource
The
Event
class contains information on an event which has been received by Sym, routed to aRun
of aFlow
, and is triggering specific user-defined Handlers.Each Handler will be invoked with a single argument, which is an instance of this class. This
Event
instance will describe the current execution state, and can be used to dynamically alter the behavior and control flow of Templates.Read more about Handlers.
- property channel¶
A
Channel
object indicating the channel the currentEvent
instance is coming from.
- dict()¶
Represent this resource as a dictionary.
- get_actor(event_name: str) Optional[sym.sdk.user.User] ¶
Retrieve the
User
who triggered a specificEvent
.For example, for a
Run
using theApprovalTemplate
, to get the approver:approver = event.get_actor("approve")
For a list of event names, see the relevant template’s Enum (e.g.
ApprovalTemplateStep
).Note that, for the
ApprovalTemplate
, theescalate
anddeescalate
actors will be the same as theapprove
actor, because those events are automatically triggered by theapprove
event.
- get_context(event_name: str) Optional[Dict[str, Any]] ¶
Retrieve a dict containing the context values attached to a specific
Event
.For example, for a
Run
using theApprovalTemplate
, to get the context attached to the initial requestEvent
:context = event.get_context("request")
For a list of event names, see the relevant template’s Enum (e.g.
ApprovalTemplateStep
).
- class sym.sdk.event.EventMeta(srn: Union[sym.sdk.resource.SRN, str])¶
Bases:
sym.sdk.resource.SymResource
Contains metadata about an
Event
instance.- dict()¶
Represent this resource as a dictionary.
- class sym.sdk.event.Payload(srn: Union[sym.sdk.resource.SRN, str])¶
Bases:
sym.sdk.resource.SymResource
The
Payload
object contains the data of theEvent
.- dict()¶
Represent this resource as a dictionary.
- property fields¶
A dict containing the values submitted by the user who created the
Event
- property timestamp¶
A datetime object indicating when the
Event
was created.