vapi-client 0.4.2

Unofficial crate for Vapi - Voice AI for developers.
Documentation
/*
 * Vapi API
 *
 * Voice AI for developers.
 *
 * The version of the OpenAPI document: 1.0
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OAuth2AuthenticationPlan {
    #[serde(rename = "type")]
    pub r#type: TypeTrue,
    /// This is the OAuth2 URL.
    #[serde(rename = "url")]
    pub url: String,
    /// This is the OAuth2 client ID.
    #[serde(rename = "clientId")]
    pub client_id: String,
    /// This is the OAuth2 client secret.
    #[serde(rename = "clientSecret")]
    pub client_secret: String,
    /// This is the scope of the OAuth2 token.
    #[serde(rename = "scope", skip_serializing_if = "Option::is_none")]
    pub scope: Option<String>,
}

impl OAuth2AuthenticationPlan {
    pub fn new(
        r#type: TypeTrue,
        url: String,
        client_id: String,
        client_secret: String,
    ) -> OAuth2AuthenticationPlan {
        OAuth2AuthenticationPlan {
            r#type,
            url,
            client_id,
            client_secret,
            scope: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TypeTrue {
    #[serde(rename = "oauth2")]
    Oauth2,
    #[serde(rename = "aws-sts")]
    AwsSts,
}

impl Default for TypeTrue {
    fn default() -> TypeTrue {
        Self::Oauth2
    }
}