vapi_client/models/
gather.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 Gather {
16    #[serde(rename = "type")]
17    pub r#type: Type,
18    #[serde(rename = "output")]
19    pub output: models::JsonSchema,
20    /// This is whether or not the workflow should read back the gathered data to the user, and ask about its correctness.
21    #[serde(rename = "confirmContent", skip_serializing_if = "Option::is_none")]
22    pub confirm_content: Option<bool>,
23    /// This is a list of hooks for a task. Each hook is a list of tasks to run on a trigger (such as on start, on failure, etc). Only Say is supported for now.
24    #[serde(rename = "hooks", skip_serializing_if = "Option::is_none")]
25    pub hooks: Option<Vec<models::Hook>>,
26    /// This is the number of times we should try to gather the information from the user before we failover to the fail path. An example of this would be a user refusing to give their phone number for privacy reasons, and then going down a different path on account of this
27    #[serde(rename = "maxRetries", skip_serializing_if = "Option::is_none")]
28    pub max_retries: Option<f64>,
29    /// This is a liquid templating string. On the first call to Gather, the template will be filled out with variables from the context, and will be spoken verbatim to the user. An example would be \"Base on your zipcode, it looks like you could be in one of these counties: {{ counties | join: \", \" }}. Which one do you live in?\"
30    #[serde(rename = "literalTemplate", skip_serializing_if = "Option::is_none")]
31    pub literal_template: Option<String>,
32    #[serde(rename = "name")]
33    pub name: String,
34    /// This is for metadata you want to store on the task.
35    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
36    pub metadata: Option<serde_json::Value>,
37}
38
39impl Gather {
40    pub fn new(r#type: Type, output: models::JsonSchema, name: String) -> Gather {
41        Gather {
42            r#type,
43            output,
44            confirm_content: None,
45            hooks: None,
46            max_retries: None,
47            literal_template: None,
48            name,
49            metadata: None,
50        }
51    }
52}
53/// 
54#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
55pub enum Type {
56    #[serde(rename = "gather")]
57    Gather,
58}
59
60impl Default for Type {
61    fn default() -> Type {
62        Self::Gather
63    }
64}
65