vapi_client/models/
webhook_credential.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct WebhookCredential {
16 #[serde(rename = "provider")]
17 pub provider: Provider,
18 #[serde(rename = "authenticationPlan")]
20 pub authentication_plan: Box<models::OAuth2AuthenticationPlan>,
21 #[serde(rename = "id")]
23 pub id: String,
24 #[serde(rename = "orgId")]
26 pub org_id: String,
27 #[serde(rename = "createdAt")]
29 pub created_at: String,
30 #[serde(rename = "updatedAt")]
32 pub updated_at: String,
33 #[serde(rename = "authenticationSession")]
35 pub authentication_session: Box<models::Oauth2AuthenticationSession>,
36 #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
38 pub name: Option<String>,
39}
40
41impl WebhookCredential {
42 pub fn new(provider: Provider, authentication_plan: models::OAuth2AuthenticationPlan, id: String, org_id: String, created_at: String, updated_at: String, authentication_session: models::Oauth2AuthenticationSession) -> WebhookCredential {
43 WebhookCredential {
44 provider,
45 authentication_plan: Box::new(authentication_plan),
46 id,
47 org_id,
48 created_at,
49 updated_at,
50 authentication_session: Box::new(authentication_session),
51 name: None,
52 }
53 }
54}
55#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
57pub enum Provider {
58 #[serde(rename = "webhook")]
59 Webhook,
60}
61
62impl Default for Provider {
63 fn default() -> Provider {
64 Self::Webhook
65 }
66}
67