Skip to main content

openai_types/skills/
_gen.rs

1// AUTO-GENERATED by py2rust — do not edit.
2// Re-generate: python3 scripts/py2rust.py sync <python_dir> <rust_dir>
3// Domain: skills
4
5use serde::{Deserialize, Serialize};
6
7#[derive(Debug, Clone, Serialize, Deserialize)]
8#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
9pub struct DeletedSkillVersion {
10    pub id: String,
11    pub deleted: bool,
12    pub object: String,
13    /// The deleted skill version.
14    pub version: String,
15}
16
17#[derive(Debug, Clone, Serialize, Deserialize)]
18#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
19pub struct SkillVersion {
20    /// Unique identifier for the skill version.
21    pub id: String,
22    /// Unix timestamp (seconds) for when the version was created.
23    pub created_at: i64,
24    /// Description of the skill version.
25    pub description: String,
26    /// Name of the skill version.
27    pub name: String,
28    /// The object type, which is `skill.version`.
29    pub object: String,
30    /// Identifier of the skill for this version.
31    pub skill_id: String,
32    /// Version number for this skill.
33    pub version: String,
34}
35
36#[derive(Debug, Clone, Serialize, Deserialize)]
37#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
38pub struct SkillVersionList {
39    /// A list of items
40    pub data: Vec<SkillVersion>,
41    /// The ID of the first item in the list.
42    #[serde(skip_serializing_if = "Option::is_none", default)]
43    pub first_id: Option<String>,
44    /// Whether there are more items available.
45    pub has_more: bool,
46    /// The ID of the last item in the list.
47    #[serde(skip_serializing_if = "Option::is_none", default)]
48    pub last_id: Option<String>,
49    /// The type of object returned, must be `list`.
50    pub object: String,
51}
52
53#[derive(Debug, Clone, Serialize, Deserialize)]
54#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
55pub struct VersionCreateParams {
56    /// Whether to set this version as the default.
57    #[serde(skip_serializing_if = "Option::is_none", default)]
58    pub default: Option<bool>,
59    /// Skill files to upload (directory upload) or a single zip file.
60    #[serde(skip_serializing_if = "Option::is_none", default)]
61    pub files: Option<serde_json::Value>,
62}
63
64#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
65#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
66#[non_exhaustive]
67pub enum VersionListParamsOrder {
68    #[serde(rename = "asc")]
69    Asc,
70    #[serde(rename = "desc")]
71    Desc,
72}
73
74#[derive(Debug, Clone, Serialize, Deserialize)]
75#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
76pub struct VersionListParams {
77    /// The skill version ID to start after.
78    #[serde(skip_serializing_if = "Option::is_none", default)]
79    pub after: Option<String>,
80    /// Number of versions to retrieve.
81    #[serde(skip_serializing_if = "Option::is_none", default)]
82    pub limit: Option<i64>,
83    /// Sort order of results by version number.
84    #[serde(skip_serializing_if = "Option::is_none", default)]
85    pub order: Option<VersionListParamsOrder>,
86}
87
88#[derive(Debug, Clone, Serialize, Deserialize)]
89#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
90pub struct DeletedSkill {
91    pub id: String,
92    pub deleted: bool,
93    pub object: String,
94}
95
96#[derive(Debug, Clone, Serialize, Deserialize)]
97#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
98pub struct Skill {
99    /// Unique identifier for the skill.
100    pub id: String,
101    /// Unix timestamp (seconds) for when the skill was created.
102    pub created_at: i64,
103    /// Default version for the skill.
104    pub default_version: String,
105    /// Description of the skill.
106    pub description: String,
107    /// Latest version for the skill.
108    pub latest_version: String,
109    /// Name of the skill.
110    pub name: String,
111    /// The object type, which is `skill`.
112    pub object: String,
113}
114
115#[derive(Debug, Clone, Serialize, Deserialize)]
116#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
117pub struct SkillCreateParams {
118    /// Skill files to upload (directory upload) or a single zip file.
119    #[serde(skip_serializing_if = "Option::is_none", default)]
120    pub files: Option<serde_json::Value>,
121}
122
123#[derive(Debug, Clone, Serialize, Deserialize)]
124#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
125pub struct SkillList {
126    /// A list of items
127    pub data: Vec<Skill>,
128    /// The ID of the first item in the list.
129    #[serde(skip_serializing_if = "Option::is_none", default)]
130    pub first_id: Option<String>,
131    /// Whether there are more items available.
132    pub has_more: bool,
133    /// The ID of the last item in the list.
134    #[serde(skip_serializing_if = "Option::is_none", default)]
135    pub last_id: Option<String>,
136    /// The type of object returned, must be `list`.
137    pub object: String,
138}
139
140#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
141#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
142#[non_exhaustive]
143pub enum SkillListParamsOrder {
144    #[serde(rename = "asc")]
145    Asc,
146    #[serde(rename = "desc")]
147    Desc,
148}
149
150#[derive(Debug, Clone, Serialize, Deserialize)]
151#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
152pub struct SkillListParams {
153    /// Identifier for the last item from the previous pagination request
154    #[serde(skip_serializing_if = "Option::is_none", default)]
155    pub after: Option<String>,
156    /// Number of items to retrieve
157    #[serde(skip_serializing_if = "Option::is_none", default)]
158    pub limit: Option<i64>,
159    /// Sort order of results by timestamp.
160    #[serde(skip_serializing_if = "Option::is_none", default)]
161    pub order: Option<SkillListParamsOrder>,
162}
163
164#[derive(Debug, Clone, Serialize, Deserialize)]
165#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
166pub struct SkillUpdateParams {
167    /// The skill version number to set as default.
168    pub default_version: String,
169}