Switch logic
A definition of the logic that a switch uses when determining which actions to execute when an event is triggered.
Properties
Name | Type | Description | Required |
---|---|---|---|
version | string | The Yetto format which this schema abides by. Format: "date" | yes |
events | object | The events that this switch will listen for. | yes |
Additional Properties: not allowed Example
{
"events": {}
}
events: object
The events that this switch will listen for. Must be one of the following strings:
- "conversation.created"
- "conversation.updated"
- "conversation.closed"
- "conversation.reopened"
- "conversation.assigned"
- "conversation.unassigned"
- "conversation.labeled"
- "conversation.unlabeled"
- "conversation.destroyed"
- "conversation.*"
- "inbox.created"
- "inbox.updated"
- "inbox.renamed"
- "inbox.destroyed"
- "inbox.*"
- "message.created"
- "message.updated"
- "message.destroyed"
- "message.*"
- "organization.created"
- "organization.updated"
- "organization.renamed"
- "organization.destroyed"
- "organization.*"
- "plug_installation.created"
- "plug_installation.updated"
- "plug_installation.destroyed"
- "plug_installation.*"
Additional Properties: not allowed
events object
Properties
Name | Type | Description | Required |
---|---|---|---|
conditions | object | A list of conditions that must be met for the actions to be executed. | no |
actions | object[] | Lists the actions which the switch will execute when the event is triggered. | yes |
Additional Properties: not allowed Example
{
"conditions": {},
"actions": [
{}
]
}
################################ events.*.conditions: object
A list of conditions that must be met for the actions to be executed.
Properties
Name | Type | Description | Required |
---|---|---|---|
if | string | Executes the action if the result of this logic is true. | |
unless | string | Executes the action if the result of this logic is false. |
Additional Properties: not allowed ################################ events.^*$.actions[]: array
Lists the actions which the switch will execute when the event is triggered.
Items
Item Properties
Name | Type | Description | Required |
---|---|---|---|
name | string | A name describing the action. | no |
uses | string | The name of the action to execute. Enum: "send_to_plug" , "send_to_webhook" , "apply_labels" | yes |
No properties.
IF object
- has properties, where
property uses isapply_labels
THEN
Properties
Name | Type | Description | Required |
---|---|---|---|
add | string[] | The list of label paths to add. | |
remove | The list of label paths to remove. If a string, must be * , indicating all labels should be removed. |
Either one of add
or remove
must be present.
IF property uses is send_to_plug
THEN
Properties
Name | Type | Description | Required |
---|---|---|---|
to | object | yes | |
with | object | no |
Example
{
"to": {},
"with": {}
}
IF property uses is send_to_webhook
THEN
Properties
Name | Type | Description | Required |
---|---|---|---|
to | object | yes | |
with | object | no |
Example
{
"to": {},
"with": {}
}
No properties.
0.then.add[]: array
The list of label paths to add.
Items
1.then.to: object
Properties
Name | Type | Description | Required |
---|---|---|---|
plug_id | string | yes |
1.then.with: object
No properties.
2.then.to: object
Properties
Name | Type | Description | Required |
---|---|---|---|
plug_id | string | no |
2.then.with: object
No properties.
3.then.to: object
Properties
Name | Type | Description | Required |
---|---|---|---|
plug_id | string | yes |
3.then.with: object
No properties.