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