vapi_client/models/
assistant_hooks.rs

1/*
2 * Vapi API
3 *
4 * Voice AI for developers.
5 *
6 * The version of the OpenAPI document: 1.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct AssistantHooks {
16    /// This is the event that triggers this hook
17    #[serde(rename = "on")]
18    pub on: On,
19    /// This is the set of filters that must match for the hook to trigger
20    #[serde(rename = "filters", skip_serializing_if = "Option::is_none")]
21    pub filters: Option<Vec<models::AssistantHookFilter>>,
22    /// This is the set of actions to perform when the hook triggers
23    #[serde(rename = "do")]
24    pub r#do: Vec<serde_json::Value>,
25}
26
27impl AssistantHooks {
28    pub fn new(on: On, r#do: Vec<serde_json::Value>) -> AssistantHooks {
29        AssistantHooks {
30            on,
31            filters: None,
32            r#do,
33        }
34    }
35}
36/// This is the event that triggers this hook
37#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
38pub enum On {
39    #[serde(rename = "call.ending")]
40    CallPeriodEnding,
41}
42
43impl Default for On {
44    fn default() -> On {
45        Self::CallPeriodEnding
46    }
47}
48