pub enum HookAction {
Show 38 variants
CreateCalendarEvent {
calendar_id: String,
title: String,
start: String,
end: String,
description: Option<String>,
attendees: Option<Vec<String>>,
location: Option<String>,
},
SendEmail {
account: String,
to: Vec<String>,
subject: String,
body: String,
attachments: Option<Vec<String>>,
},
CreateNote {
app: String,
title: String,
content: String,
folder: Option<String>,
tags: Option<Vec<String>>,
},
CreateTask {
app: String,
title: String,
description: Option<String>,
due_date: Option<String>,
priority: Option<u8>,
project: Option<String>,
},
SlackMessage {
channel: String,
text: String,
thread_ts: Option<String>,
},
DiscordMessage {
channel_id: String,
content: String,
},
TeamsMessage {
channel: String,
content: String,
},
TelegramMessage {
chat_id: String,
text: String,
},
SendSms {
to: String,
message: String,
},
Notification {
title: String,
body: String,
sound: Option<String>,
actions: Option<Vec<String>>,
},
OpenUrl {
url: String,
browser: Option<String>,
},
BrowserAutomation {
script: String,
headless: bool,
},
ScrapeWebpage {
url: String,
selectors: HashMap<String, String>,
},
FillForm {
url: String,
fields: HashMap<String, String>,
submit: bool,
},
RunCommand {
command: String,
args: Vec<String>,
cwd: Option<String>,
env: Option<HashMap<String, String>>,
},
GitOperation {
repo: String,
operation: String,
args: HashMap<String, String>,
},
CreateGitHubIssue {
repo: String,
title: String,
body: String,
labels: Option<Vec<String>>,
},
DockerCommand {
command: String,
container: Option<String>,
args: Vec<String>,
},
ControlDevice {
device_id: String,
action: String,
parameters: Option<HashMap<String, Value>>,
},
SetScene {
scene_id: String,
},
HomeAssistantService {
domain: String,
service: String,
data: Option<Value>,
},
CopyFile {
source: String,
destination: String,
},
MoveFile {
source: String,
destination: String,
},
CreateFile {
path: String,
content: String,
},
DeleteFile {
path: String,
},
SyncFolder {
source: String,
destination: String,
delete_extra: bool,
},
HttpRequest {
method: String,
url: String,
headers: Option<HashMap<String, String>>,
body: Option<String>,
},
StoreData {
key: String,
value: Value,
ttl_seconds: Option<u64>,
},
QueryDatabase {
connection: String,
query: String,
params: Option<Vec<Value>>,
},
RunAgent {
agent_name: String,
input: String,
context: Option<HashMap<String, Value>>,
},
Summarize {
content: String,
max_length: Option<u32>,
},
Classify {
content: String,
categories: Vec<String>,
},
ExtractData {
content: String,
schema: Value,
},
ChainHook {
hook_id: String,
data: Option<Value>,
},
Conditional {
condition: String,
if_true: Box<HookAction>,
if_false: Option<Box<HookAction>>,
},
Parallel {
actions: Vec<HookAction>,
},
Delay {
seconds: u64,
},
Log {
level: String,
message: String,
},
}Expand description
Action to execute when hook triggers
Variants§
CreateCalendarEvent
Create calendar event
Fields
SendEmail
Send email
Fields
CreateNote
Create note
CreateTask
Create task
Fields
SlackMessage
Send Slack message
DiscordMessage
Send Discord message
TeamsMessage
Send Teams message
TelegramMessage
Send Telegram message
SendSms
Send SMS
Notification
Send notification
OpenUrl
Open URL
BrowserAutomation
Run browser automation
ScrapeWebpage
Scrape webpage
FillForm
Fill form
RunCommand
Run shell command
GitOperation
Git operation
CreateGitHubIssue
Create GitHub issue
DockerCommand
Run Docker command
ControlDevice
Control device
SetScene
Set scene
HomeAssistantService
Home Assistant service call
CopyFile
Copy file
MoveFile
Move file
CreateFile
Create file
DeleteFile
Delete file
SyncFolder
Sync folder
HttpRequest
HTTP request
StoreData
Store data
QueryDatabase
Query database
RunAgent
Run agent
Summarize
Summarize content
Classify
Classify content
ExtractData
Extract data
ChainHook
Chain to another hook
Conditional
Conditional branch
Parallel
Parallel execution
Fields
§
actions: Vec<HookAction>Delay
Delay
Log
Log message
Trait Implementations§
Source§impl Clone for HookAction
impl Clone for HookAction
Source§fn clone(&self) -> HookAction
fn clone(&self) -> HookAction
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HookAction
impl Debug for HookAction
Source§impl<'de> Deserialize<'de> for HookAction
impl<'de> Deserialize<'de> for HookAction
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for HookAction
impl RefUnwindSafe for HookAction
impl Send for HookAction
impl Sync for HookAction
impl Unpin for HookAction
impl UnwindSafe for HookAction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more