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