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: ProviderTrue,
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(
38 rename = "authenticationSession",
39 skip_serializing_if = "Option::is_none"
40 )]
41 pub authentication_session: Option<models::Oauth2AuthenticationSession>,
42 #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
44 pub name: Option<String>,
45}
46
47impl CustomLlmCredential {
48 pub fn new(
49 provider: ProviderTrue,
50 api_key: String,
51 id: String,
52 org_id: String,
53 created_at: String,
54 updated_at: String,
55 ) -> CustomLlmCredential {
56 CustomLlmCredential {
57 provider,
58 api_key,
59 authentication_plan: None,
60 id,
61 org_id,
62 created_at,
63 updated_at,
64 authentication_session: None,
65 name: None,
66 }
67 }
68}
69#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
71pub enum ProviderTrue {
72 #[serde(rename = "custom-llm")]
73 CustomLlm,
74}
75
76impl Default for ProviderTrue {
77 fn default() -> ProviderTrue {
78 Self::CustomLlm
79 }
80}