vapi_client/models/
o_auth2_authentication_plan.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 OAuth2AuthenticationPlan {
16    #[serde(rename = "type")]
17    pub r#type: Type,
18    /// This is the OAuth2 URL.
19    #[serde(rename = "url")]
20    pub url: String,
21    /// This is the OAuth2 client ID.
22    #[serde(rename = "clientId")]
23    pub client_id: String,
24    /// This is the OAuth2 client secret.
25    #[serde(rename = "clientSecret")]
26    pub client_secret: String,
27    /// This is the scope of the OAuth2 token.
28    #[serde(rename = "scope", skip_serializing_if = "Option::is_none")]
29    pub scope: Option<String>,
30}
31
32impl OAuth2AuthenticationPlan {
33    pub fn new(r#type: Type, url: String, client_id: String, client_secret: String) -> OAuth2AuthenticationPlan {
34        OAuth2AuthenticationPlan {
35            r#type,
36            url,
37            client_id,
38            client_secret,
39            scope: None,
40        }
41    }
42}
43/// 
44#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
45pub enum Type {
46    #[serde(rename = "oauth2")]
47    Oauth2,
48}
49
50impl Default for Type {
51    fn default() -> Type {
52        Self::Oauth2
53    }
54}
55