vapi_client/models/
token_restrictions.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 TokenRestrictions {
19    /// This determines whether the token is enabled or disabled. Default is true, it's enabled.
20    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
21    pub enabled: Option<bool>,
22    /// This determines the allowed origins for this token. Validates the `Origin` header. Default is any origin.  Only relevant for `public` tokens.
23    #[serde(rename = "allowedOrigins", skip_serializing_if = "Option::is_none")]
24    pub allowed_origins: Option<Vec<String>>,
25    /// This determines which assistantIds can be used when creating a call. Default is any assistantId.  Only relevant for `public` tokens.
26    #[serde(
27        rename = "allowedAssistantIds",
28        skip_serializing_if = "Option::is_none"
29    )]
30    pub allowed_assistant_ids: Option<Vec<String>>,
31    /// This determines whether transient assistants can be used when creating a call. Default is true.  If `allowedAssistantIds` is provided, this is automatically false.  Only relevant for `public` tokens.
32    #[serde(
33        rename = "allowTransientAssistant",
34        skip_serializing_if = "Option::is_none"
35    )]
36    pub allow_transient_assistant: Option<bool>,
37}
38
39impl TokenRestrictions {
40    pub fn new() -> TokenRestrictions {
41        TokenRestrictions {
42            enabled: None,
43            allowed_origins: None,
44            allowed_assistant_ids: None,
45            allow_transient_assistant: None,
46        }
47    }
48}