vapi_client/models/
o_auth2_authentication_plan.rs1use 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 #[serde(rename = "url")]
21 pub url: String,
22 #[serde(rename = "clientId")]
24 pub client_id: String,
25 #[serde(rename = "clientSecret")]
27 pub client_secret: String,
28 #[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#[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}