openai-types 0.1.2

Typed OpenAI API models — zero dependencies beyond serde
Documentation
// AUTO-GENERATED by py2rust — do not edit.
// Re-generate: python3 scripts/py2rust.py sync <python_dir> <rust_dir>
// Domain: skills

use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DeletedSkillVersion {
    pub id: String,
    pub deleted: bool,
    pub object: String,
    /// The deleted skill version.
    pub version: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct SkillVersion {
    /// Unique identifier for the skill version.
    pub id: String,
    /// Unix timestamp (seconds) for when the version was created.
    pub created_at: i64,
    /// Description of the skill version.
    pub description: String,
    /// Name of the skill version.
    pub name: String,
    /// The object type, which is `skill.version`.
    pub object: String,
    /// Identifier of the skill for this version.
    pub skill_id: String,
    /// Version number for this skill.
    pub version: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct SkillVersionList {
    /// A list of items
    pub data: Vec<SkillVersion>,
    /// The ID of the first item in the list.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub first_id: Option<String>,
    /// Whether there are more items available.
    pub has_more: bool,
    /// The ID of the last item in the list.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub last_id: Option<String>,
    /// The type of object returned, must be `list`.
    pub object: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct VersionCreateParams {
    /// Whether to set this version as the default.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub default: Option<bool>,
    /// Skill files to upload (directory upload) or a single zip file.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub files: Option<serde_json::Value>,
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
#[non_exhaustive]
pub enum VersionListParamsOrder {
    #[serde(rename = "asc")]
    Asc,
    #[serde(rename = "desc")]
    Desc,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct VersionListParams {
    /// The skill version ID to start after.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub after: Option<String>,
    /// Number of versions to retrieve.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub limit: Option<i64>,
    /// Sort order of results by version number.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub order: Option<VersionListParamsOrder>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct DeletedSkill {
    pub id: String,
    pub deleted: bool,
    pub object: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct Skill {
    /// Unique identifier for the skill.
    pub id: String,
    /// Unix timestamp (seconds) for when the skill was created.
    pub created_at: i64,
    /// Default version for the skill.
    pub default_version: String,
    /// Description of the skill.
    pub description: String,
    /// Latest version for the skill.
    pub latest_version: String,
    /// Name of the skill.
    pub name: String,
    /// The object type, which is `skill`.
    pub object: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct SkillCreateParams {
    /// Skill files to upload (directory upload) or a single zip file.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub files: Option<serde_json::Value>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct SkillList {
    /// A list of items
    pub data: Vec<Skill>,
    /// The ID of the first item in the list.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub first_id: Option<String>,
    /// Whether there are more items available.
    pub has_more: bool,
    /// The ID of the last item in the list.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub last_id: Option<String>,
    /// The type of object returned, must be `list`.
    pub object: String,
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
#[non_exhaustive]
pub enum SkillListParamsOrder {
    #[serde(rename = "asc")]
    Asc,
    #[serde(rename = "desc")]
    Desc,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct SkillListParams {
    /// Identifier for the last item from the previous pagination request
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub after: Option<String>,
    /// Number of items to retrieve
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub limit: Option<i64>,
    /// Sort order of results by timestamp.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub order: Option<SkillListParamsOrder>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
pub struct SkillUpdateParams {
    /// The skill version number to set as default.
    pub default_version: String,
}