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: TypeTrue,
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(
34        r#type: TypeTrue,
35        url: String,
36        client_id: String,
37        client_secret: String,
38    ) -> OAuth2AuthenticationPlan {
39        OAuth2AuthenticationPlan {
40            r#type,
41            url,
42            client_id,
43            client_secret,
44            scope: None,
45        }
46    }
47}
48///
49#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
50pub enum TypeTrue {
51    #[serde(rename = "oauth2")]
52    Oauth2,
53    #[serde(rename = "aws-sts")]
54    AwsSts,
55}
56
57impl Default for TypeTrue {
58    fn default() -> TypeTrue {
59        Self::Oauth2
60    }
61}