vapi_client/models/
create_token_dto.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 CreateTokenDto {
17    /// This is the tag for the token. It represents its scope.
18    #[serde(rename = "tag", skip_serializing_if = "Option::is_none")]
19    pub tag: Option<Tag>,
20    /// This is the name of the token. This is just for your own reference.
21    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
22    pub name: Option<String>,
23    /// This are the restrictions for the token.
24    #[serde(rename = "restrictions", skip_serializing_if = "Option::is_none")]
25    pub restrictions: Option<models::TokenRestrictions>,
26}
27
28impl CreateTokenDto {
29    pub fn new() -> CreateTokenDto {
30        CreateTokenDto {
31            tag: None,
32            name: None,
33            restrictions: None,
34        }
35    }
36}
37/// This is the tag for the token. It represents its scope.
38#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
39pub enum Tag {
40    #[serde(rename = "private")]
41    Private,
42    #[serde(rename = "public")]
43    Public,
44}
45
46impl Default for Tag {
47    fn default() -> Tag {
48        Self::Private
49    }
50}