vapi_client/models/
credential_session_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 CredentialSessionDto {
16    /// The type of credential to generate a session for. Only Nango user-facing providers are supported.
17    #[serde(rename = "provider")]
18    pub provider: ProviderTrue,
19}
20
21impl CredentialSessionDto {
22    pub fn new(provider: ProviderTrue) -> CredentialSessionDto {
23        CredentialSessionDto { provider }
24    }
25}
26/// The type of credential to generate a session for. Only Nango user-facing providers are supported.
27#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
28pub enum ProviderTrue {
29    #[serde(rename = "google.calendar.oauth2-client")]
30    GooglePeriodCalendarPeriodOauth2Client,
31    #[serde(rename = "google.calendar.oauth2-authorization")]
32    GooglePeriodCalendarPeriodOauth2Authorization,
33    #[serde(rename = "google.sheets.oauth2-authorization")]
34    GooglePeriodSheetsPeriodOauth2Authorization,
35    #[serde(rename = "slack.oauth2-authorization")]
36    SlackPeriodOauth2Authorization,
37}
38
39impl Default for ProviderTrue {
40    fn default() -> ProviderTrue {
41        Self::GooglePeriodCalendarPeriodOauth2Client
42    }
43}