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