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