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