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