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