vapi_client/models/
google_credential.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};
12
13use crate::models;
14
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct GoogleCredential {
17    /// This is the key for Gemini in Google AI Studio. Get it from here: https://aistudio.google.com/app/apikey
18    #[serde(rename = "provider")]
19    pub provider: Provider,
20    /// This is not returned in the API.
21    #[serde(rename = "apiKey")]
22    pub api_key: String,
23    /// This is the unique identifier for the credential.
24    #[serde(rename = "id")]
25    pub id: String,
26    /// This is the unique identifier for the org that this credential belongs to.
27    #[serde(rename = "orgId")]
28    pub org_id: String,
29    /// This is the ISO 8601 date-time string of when the credential was created.
30    #[serde(rename = "createdAt")]
31    pub created_at: String,
32    /// This is the ISO 8601 date-time string of when the assistant was last updated.
33    #[serde(rename = "updatedAt")]
34    pub updated_at: String,
35    /// This is the name of credential. This is just for your reference.
36    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
37    pub name: Option<String>,
38}
39
40impl GoogleCredential {
41    pub fn new(
42        provider: Provider,
43        api_key: String,
44        id: String,
45        org_id: String,
46        created_at: String,
47        updated_at: String,
48    ) -> GoogleCredential {
49        GoogleCredential {
50            provider,
51            api_key,
52            id,
53            org_id,
54            created_at,
55            updated_at,
56            name: None,
57        }
58    }
59}
60/// This is the key for Gemini in Google AI Studio. Get it from here: https://aistudio.google.com/app/apikey
61#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
62pub enum Provider {
63    #[serde(rename = "google")]
64    Google,
65}
66
67impl Default for Provider {
68    fn default() -> Provider {
69        Self::Google
70    }
71}