vapi_client/models/
create_webhook_credential_dto.rs

1/*
2 * Vapi API
3 *
4 * Voice AI for developers.
5 *
6 * The version of the OpenAPI document: 1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct CreateWebhookCredentialDto {
16    #[serde(rename = "provider")]
17    pub provider: ProviderTrue,
18    /// This is the authentication plan. Currently supports OAuth2 RFC 6749.
19    #[serde(rename = "authenticationPlan")]
20    pub authentication_plan: models::OAuth2AuthenticationPlan,
21    /// This is the name of credential. This is just for your reference.
22    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
23    pub name: Option<String>,
24}
25
26impl CreateWebhookCredentialDto {
27    pub fn new(
28        provider: ProviderTrue,
29        authentication_plan: models::OAuth2AuthenticationPlan,
30    ) -> CreateWebhookCredentialDto {
31        CreateWebhookCredentialDto {
32            provider,
33            authentication_plan,
34            name: None,
35        }
36    }
37}
38///
39#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
40pub enum ProviderTrue {
41    #[serde(rename = "webhook")]
42    Webhook,
43}
44
45impl Default for ProviderTrue {
46    fn default() -> ProviderTrue {
47        Self::Webhook
48    }
49}