/*
 * Hotdata API
 *
 * Powerful data platform API for datasets, queries, and analytics.
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: developers@hotdata.dev
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// CreateEmbeddingProviderRequest : Request body for POST /embedding-providers
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateEmbeddingProviderRequest {
    /// Inline API key. If provided, a secret is auto-created and referenced. Cannot be used together with `secret_name`.
    #[serde(
        rename = "api_key",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub api_key: Option<Option<String>>,
    #[serde(
        rename = "config",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub config: Option<Option<serde_json::Value>>,
    #[serde(rename = "name")]
    pub name: String,
    /// Provider type: \"local\" or \"service\"
    #[serde(rename = "provider_type")]
    pub provider_type: String,
    /// Reference an existing secret by name (for service providers).
    #[serde(
        rename = "secret_name",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub secret_name: Option<Option<String>>,
}

impl CreateEmbeddingProviderRequest {
    /// Request body for POST /embedding-providers
    pub fn new(name: String, provider_type: String) -> CreateEmbeddingProviderRequest {
        CreateEmbeddingProviderRequest {
            api_key: None,
            config: None,
            name,
            provider_type,
            secret_name: None,
        }
    }
}
