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