openai-client-base 0.12.0

Auto-generated Rust client for the OpenAI API
/*
 * OpenAI API
 *
 * The OpenAI REST API. Please see https://platform.openai.com/docs/api-reference for more details.
 *
 * The version of the OpenAPI document: 2.3.0
 *
 * Generated by: https://openapi-generator.tech
 */

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

/// InlineSkillSourceParam : Inline skill payload
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct InlineSkillSourceParam {
    /// The type of the inline skill source. Must be `base64`.
    #[serde(rename = "type")]
    pub r#type: Type,
    /// The media type of the inline skill payload. Must be `application/zip`.
    #[serde(rename = "media_type")]
    pub media_type: MediaType,
    /// Base64-encoded skill zip bundle.
    #[serde(rename = "data")]
    pub data: String,
}

impl InlineSkillSourceParam {
    /// Inline skill payload
    pub fn new(r#type: Type, media_type: MediaType, data: String) -> InlineSkillSourceParam {
        InlineSkillSourceParam {
            r#type,
            media_type,
            data,
        }
    }
}
/// The type of the inline skill source. Must be `base64`.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "base64")]
    Base64,
}

impl Default for Type {
    fn default() -> Type {
        Self::Base64
    }
}
/// The media type of the inline skill payload. Must be `application/zip`.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum MediaType {
    #[serde(rename = "application/zip")]
    ApplicationSlashZip,
}

impl Default for MediaType {
    fn default() -> MediaType {
        Self::ApplicationSlashZip
    }
}

impl std::fmt::Display for InlineSkillSourceParam {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match serde_json::to_string(self) {
            Ok(s) => write!(f, "{}", s),
            Err(_) => Err(std::fmt::Error),
        }
    }
}