vapi_client/models/
create_custom_llm_credential_dto.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 CreateCustomLlmCredentialDto {
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 name of credential. This is just for your reference.
28    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
29    pub name: Option<String>,
30}
31
32impl CreateCustomLlmCredentialDto {
33    pub fn new(provider: Provider, api_key: String) -> CreateCustomLlmCredentialDto {
34        CreateCustomLlmCredentialDto {
35            provider,
36            api_key,
37            authentication_plan: None,
38            name: None,
39        }
40    }
41}
42///
43#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, ToSchema)]
44pub enum Provider {
45    #[serde(rename = "custom-llm")]
46    CustomLlm,
47}
48
49impl Default for Provider {
50    fn default() -> Provider {
51        Self::CustomLlm
52    }
53}