vapi_client/models/
custom_llm_credential.rs1use 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 #[serde(rename = "apiKey")]
23 pub api_key: String,
24 #[serde(rename = "authenticationPlan", skip_serializing_if = "Option::is_none")]
26 pub authentication_plan: Option<models::OAuth2AuthenticationPlan>,
27 #[serde(rename = "id")]
29 pub id: String,
30 #[serde(rename = "orgId")]
32 pub org_id: String,
33 #[serde(rename = "createdAt")]
35 pub created_at: String,
36 #[serde(rename = "updatedAt")]
38 pub updated_at: String,
39 #[serde(
41 rename = "authenticationSession",
42 skip_serializing_if = "Option::is_none"
43 )]
44 pub authentication_session: Option<models::Oauth2AuthenticationSession>,
45 #[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#[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}