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