vapi_client/models/
create_webhook_credential_dto.rs

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