vapi_client/models/
template.rs

1/*
2 * Vapi API
3 *
4 * API for building voice assistants
5 *
6 * The version of the OpenAPI document: 1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use serde::{Deserialize, Serialize};
12
13use crate::models;
14
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Template {
17    #[serde(rename = "details", skip_serializing_if = "Option::is_none")]
18    pub details: Option<models::CreateToolTemplateDtoDetails>,
19    #[serde(rename = "providerDetails", skip_serializing_if = "Option::is_none")]
20    pub provider_details: Option<models::CreateToolTemplateDtoProviderDetails>,
21    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
22    pub metadata: Option<models::ToolTemplateMetadata>,
23    #[serde(rename = "visibility", skip_serializing_if = "Option::is_none")]
24    pub visibility: Option<Visibility>,
25    #[serde(rename = "type")]
26    pub r#type: Type,
27    /// The name of the template. This is just for your own reference.
28    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
29    pub name: Option<String>,
30    #[serde(rename = "provider", skip_serializing_if = "Option::is_none")]
31    pub provider: Option<Provider>,
32    /// The unique identifier for the template.
33    #[serde(rename = "id")]
34    pub id: String,
35    /// The unique identifier for the organization that this template belongs to.
36    #[serde(rename = "orgId")]
37    pub org_id: String,
38    /// The ISO 8601 date-time string of when the template was created.
39    #[serde(rename = "createdAt")]
40    pub created_at: String,
41    /// The ISO 8601 date-time string of when the template was last updated.
42    #[serde(rename = "updatedAt")]
43    pub updated_at: String,
44}
45
46impl Template {
47    pub fn new(
48        r#type: Type,
49        id: String,
50        org_id: String,
51        created_at: String,
52        updated_at: String,
53    ) -> Template {
54        Template {
55            details: None,
56            provider_details: None,
57            metadata: None,
58            visibility: None,
59            r#type,
60            name: None,
61            provider: None,
62            id,
63            org_id,
64            created_at,
65            updated_at,
66        }
67    }
68}
69///
70#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
71pub enum Visibility {
72    #[serde(rename = "public")]
73    Public,
74    #[serde(rename = "private")]
75    Private,
76}
77
78impl Default for Visibility {
79    fn default() -> Visibility {
80        Self::Public
81    }
82}
83///
84#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
85pub enum Type {
86    #[serde(rename = "tool")]
87    Tool,
88}
89
90impl Default for Type {
91    fn default() -> Type {
92        Self::Tool
93    }
94}
95///
96#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
97pub enum Provider {
98    #[serde(rename = "make")]
99    Make,
100    #[serde(rename = "gohighlevel")]
101    Gohighlevel,
102    #[serde(rename = "function")]
103    Function,
104}
105
106impl Default for Provider {
107    fn default() -> Provider {
108        Self::Make
109    }
110}