vapi_client/models/
custom_llm_credential.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct CustomLlmCredential {
16 #[serde(rename = "provider")]
17 pub provider: Provider,
18 #[serde(rename = "apiKey")]
20 pub api_key: String,
21 #[serde(rename = "authenticationPlan", skip_serializing_if = "Option::is_none")]
23 pub authentication_plan: Option<models::OAuth2AuthenticationPlan>,
24 #[serde(rename = "id")]
26 pub id: String,
27 #[serde(rename = "orgId")]
29 pub org_id: String,
30 #[serde(rename = "createdAt")]
32 pub created_at: String,
33 #[serde(rename = "updatedAt")]
35 pub updated_at: String,
36 #[serde(rename = "authenticationSession", skip_serializing_if = "Option::is_none")]
38 pub authentication_session: Option<models::Oauth2AuthenticationSession>,
39 #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
41 pub name: Option<String>,
42}
43
44impl CustomLlmCredential {
45 pub fn new(provider: Provider, api_key: String, id: String, org_id: String, created_at: String, updated_at: String) -> CustomLlmCredential {
46 CustomLlmCredential {
47 provider,
48 api_key,
49 authentication_plan: None,
50 id,
51 org_id,
52 created_at,
53 updated_at,
54 authentication_session: None,
55 name: None,
56 }
57 }
58}
59#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
61pub enum Provider {
62 #[serde(rename = "custom-llm")]
63 CustomLlm,
64}
65
66impl Default for Provider {
67 fn default() -> Provider {
68 Self::CustomLlm
69 }
70}
71