vapi_client/models/
assistant_hook_call_ending.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 AssistantHookCallEnding {
16    /// This is the event that triggers this hook
17    #[serde(rename = "on")]
18    pub on: OnTrue,
19    /// This is the set of actions to perform when the hook triggers
20    #[serde(rename = "do")]
21    pub r#do: Vec<models::AssistantHookCallEndingDoInner>,
22    /// This is the set of filters that must match for the hook to trigger
23    #[serde(rename = "filters", skip_serializing_if = "Option::is_none")]
24    pub filters: Option<Vec<models::AssistantHookFilter>>,
25}
26
27impl AssistantHookCallEnding {
28    pub fn new(
29        on: OnTrue,
30        r#do: Vec<models::AssistantHookCallEndingDoInner>,
31    ) -> AssistantHookCallEnding {
32        AssistantHookCallEnding {
33            on,
34            r#do,
35            filters: None,
36        }
37    }
38}
39/// This is the event that triggers this hook
40#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
41pub enum OnTrue {
42    #[serde(rename = "call.ending")]
43    CallPeriodEnding,
44}
45
46impl Default for OnTrue {
47    fn default() -> OnTrue {
48        Self::CallPeriodEnding
49    }
50}