vapi_client/models/
custom_llm_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 CustomLlmCredential {
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 authentication plan. Currently supports OAuth2 RFC 6749. To use Bearer authentication, use apiKey
25    #[serde(rename = "authenticationPlan", skip_serializing_if = "Option::is_none")]
26    pub authentication_plan: Option<models::OAuth2AuthenticationPlan>,
27    /// This is the unique identifier for the credential.
28    #[serde(rename = "id")]
29    pub id: String,
30    /// This is the unique identifier for the org that this credential belongs to.
31    #[serde(rename = "orgId")]
32    pub org_id: String,
33    /// This is the ISO 8601 date-time string of when the credential was created.
34    #[serde(rename = "createdAt")]
35    pub created_at: String,
36    /// This is the ISO 8601 date-time string of when the assistant was last updated.
37    #[serde(rename = "updatedAt")]
38    pub updated_at: String,
39    /// This is the authentication session for the credential. Available for credentials that have an authentication plan.
40    #[serde(
41        rename = "authenticationSession",
42        skip_serializing_if = "Option::is_none"
43    )]
44    pub authentication_session: Option<models::Oauth2AuthenticationSession>,
45    /// This is the name of credential. This is just for your reference.
46    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
47    pub name: Option<String>,
48}
49
50impl CustomLlmCredential {
51    pub fn new(
52        provider: Provider,
53        api_key: String,
54        id: String,
55        org_id: String,
56        created_at: String,
57        updated_at: String,
58    ) -> CustomLlmCredential {
59        CustomLlmCredential {
60            provider,
61            api_key,
62            authentication_plan: None,
63            id,
64            org_id,
65            created_at,
66            updated_at,
67            authentication_session: None,
68            name: None,
69        }
70    }
71}
72///
73#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, ToSchema)]
74pub enum Provider {
75    #[serde(rename = "custom-llm")]
76    CustomLlm,
77}
78
79impl Default for Provider {
80    fn default() -> Provider {
81        Self::CustomLlm
82    }
83}