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: ProviderTrue,
18 #[serde(rename = "authenticationPlan")]
20 pub authentication_plan: 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: 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(
43 provider: ProviderTrue,
44 authentication_plan: models::OAuth2AuthenticationPlan,
45 id: String,
46 org_id: String,
47 created_at: String,
48 updated_at: String,
49 authentication_session: models::Oauth2AuthenticationSession,
50 ) -> WebhookCredential {
51 WebhookCredential {
52 provider,
53 authentication_plan,
54 id,
55 org_id,
56 created_at,
57 updated_at,
58 authentication_session,
59 name: None,
60 }
61 }
62}
63#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
65pub enum ProviderTrue {
66 #[serde(rename = "webhook")]
67 Webhook,
68}
69
70impl Default for ProviderTrue {
71 fn default() -> ProviderTrue {
72 Self::Webhook
73 }
74}