vapi_client/models/
create_custom_llm_credential_dto.rs

1/*
2 * Vapi API
3 *
4 * Voice AI for developers.
5 *
6 * The version of the OpenAPI document: 1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct CreateCustomLlmCredentialDto {
16    #[serde(rename = "provider")]
17    pub provider: ProviderTrue,
18    /// This is not returned in the API.
19    #[serde(rename = "apiKey")]
20    pub api_key: String,
21    /// This is the authentication plan. Currently supports OAuth2 RFC 6749. To use Bearer authentication, use apiKey
22    #[serde(rename = "authenticationPlan", skip_serializing_if = "Option::is_none")]
23    pub authentication_plan: Option<models::OAuth2AuthenticationPlan>,
24    /// This is the name of credential. This is just for your reference.
25    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
26    pub name: Option<String>,
27}
28
29impl CreateCustomLlmCredentialDto {
30    pub fn new(provider: ProviderTrue, api_key: String) -> CreateCustomLlmCredentialDto {
31        CreateCustomLlmCredentialDto {
32            provider,
33            api_key,
34            authentication_plan: None,
35            name: None,
36        }
37    }
38}
39///
40#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
41pub enum ProviderTrue {
42    #[serde(rename = "custom-llm")]
43    CustomLlm,
44}
45
46impl Default for ProviderTrue {
47    fn default() -> ProviderTrue {
48        Self::CustomLlm
49    }
50}