Skip to main content

openai_types/containers/
_gen.rs

1// AUTO-GENERATED by py2rust — do not edit.
2// Re-generate: python3 scripts/py2rust.py sync <python_dir> <rust_dir>
3// Domain: containers
4
5use serde::{Deserialize, Serialize};
6
7#[derive(Debug, Clone, Serialize, Deserialize)]
8#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
9pub struct FileCreateParams {
10    /// The File object (not file name) to be uploaded.
11    #[serde(skip_serializing_if = "Option::is_none", default)]
12    pub file: Option<serde_json::Value>,
13    /// Name of the file to create.
14    #[serde(skip_serializing_if = "Option::is_none", default)]
15    pub file_id: Option<String>,
16}
17
18#[derive(Debug, Clone, Serialize, Deserialize)]
19#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
20pub struct FileCreateResponse {
21    /// Unique identifier for the file.
22    pub id: String,
23    /// Size of the file in bytes.
24    pub bytes: i64,
25    /// The container this file belongs to.
26    pub container_id: String,
27    /// Unix timestamp (in seconds) when the file was created.
28    pub created_at: i64,
29    /// The type of this object (`container.file`).
30    pub object: String,
31    /// Path of the file in the container.
32    pub path: String,
33    /// Source of the file (e.g., `user`, `assistant`).
34    pub source: String,
35}
36
37#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
38#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
39#[non_exhaustive]
40pub enum FileListParamsOrder {
41    #[serde(rename = "asc")]
42    Asc,
43    #[serde(rename = "desc")]
44    Desc,
45}
46
47#[derive(Debug, Clone, Serialize, Deserialize)]
48#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
49pub struct FileListParams {
50    /// A cursor for use in pagination.
51    #[serde(skip_serializing_if = "Option::is_none", default)]
52    pub after: Option<String>,
53    /// A limit on the number of objects to be returned.
54    #[serde(skip_serializing_if = "Option::is_none", default)]
55    pub limit: Option<i64>,
56    /// Sort order by the `created_at` timestamp of the objects.
57    #[serde(skip_serializing_if = "Option::is_none", default)]
58    pub order: Option<FileListParamsOrder>,
59}
60
61#[derive(Debug, Clone, Serialize, Deserialize)]
62#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
63pub struct FileListResponse {
64    /// Unique identifier for the file.
65    pub id: String,
66    /// Size of the file in bytes.
67    pub bytes: i64,
68    /// The container this file belongs to.
69    pub container_id: String,
70    /// Unix timestamp (in seconds) when the file was created.
71    pub created_at: i64,
72    /// The type of this object (`container.file`).
73    pub object: String,
74    /// Path of the file in the container.
75    pub path: String,
76    /// Source of the file (e.g., `user`, `assistant`).
77    pub source: String,
78}
79
80#[derive(Debug, Clone, Serialize, Deserialize)]
81#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
82pub struct FileRetrieveResponse {
83    /// Unique identifier for the file.
84    pub id: String,
85    /// Size of the file in bytes.
86    pub bytes: i64,
87    /// The container this file belongs to.
88    pub container_id: String,
89    /// Unix timestamp (in seconds) when the file was created.
90    pub created_at: i64,
91    /// The type of this object (`container.file`).
92    pub object: String,
93    /// Path of the file in the container.
94    pub path: String,
95    /// Source of the file (e.g., `user`, `assistant`).
96    pub source: String,
97}
98
99#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
100#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
101#[non_exhaustive]
102pub enum ContainerCreateParamsMemoryLimit {
103    #[serde(rename = "1g")]
104    V1g,
105    #[serde(rename = "4g")]
106    V4g,
107    #[serde(rename = "16g")]
108    V16g,
109    #[serde(rename = "64g")]
110    V64g,
111}
112
113#[derive(Debug, Clone, Serialize, Deserialize)]
114#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
115pub struct ContainerCreateParams {
116    /// Name of the container to create.
117    pub name: String,
118    /// Container expiration time in seconds relative to the 'anchor' time.
119    #[serde(skip_serializing_if = "Option::is_none", default)]
120    pub expires_after: Option<ExpiresAfter>,
121    /// IDs of files to copy to the container.
122    #[serde(skip_serializing_if = "Option::is_none", default)]
123    pub file_ids: Option<serde_json::Value>,
124    /// Optional memory limit for the container. Defaults to "1g".
125    #[serde(skip_serializing_if = "Option::is_none", default)]
126    pub memory_limit: Option<ContainerCreateParamsMemoryLimit>,
127    /// Network access policy for the container.
128    #[serde(skip_serializing_if = "Option::is_none", default)]
129    pub network_policy: Option<NetworkPolicy>,
130    /// An optional list of skills referenced by id or inline data.
131    #[serde(skip_serializing_if = "Option::is_none", default)]
132    pub skills: Option<Vec<Skill>>,
133}
134
135/// Container expiration time in seconds relative to the 'anchor' time.
136#[derive(Debug, Clone, Serialize, Deserialize)]
137#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
138pub struct ExpiresAfter {
139    /// Time anchor for the expiration time.
140    pub anchor: String,
141    pub minutes: i64,
142}
143
144pub type NetworkPolicy = serde_json::Value;
145
146pub type Skill = serde_json::Value;
147
148#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
149#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
150#[non_exhaustive]
151pub enum NetworkPolicyType {
152    #[serde(rename = "allowlist")]
153    Allowlist,
154    #[serde(rename = "disabled")]
155    Disabled,
156}
157
158#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
159#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
160#[non_exhaustive]
161pub enum ContainerCreateResponseMemoryLimit {
162    #[serde(rename = "1g")]
163    V1g,
164    #[serde(rename = "4g")]
165    V4g,
166    #[serde(rename = "16g")]
167    V16g,
168    #[serde(rename = "64g")]
169    V64g,
170}
171
172#[derive(Debug, Clone, Serialize, Deserialize)]
173#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
174pub struct ContainerCreateResponse {
175    /// Unique identifier for the container.
176    pub id: String,
177    /// Unix timestamp (in seconds) when the container was created.
178    pub created_at: i64,
179    /// Name of the container.
180    pub name: String,
181    /// The type of this object.
182    pub object: String,
183    /// Status of the container (e.g., active, deleted).
184    pub status: String,
185    /// The container will expire after this time period. The anchor is the reference
186    #[serde(skip_serializing_if = "Option::is_none", default)]
187    pub expires_after: Option<ExpiresAfter>,
188    /// Unix timestamp (in seconds) when the container was last active.
189    #[serde(skip_serializing_if = "Option::is_none", default)]
190    pub last_active_at: Option<i64>,
191    /// The memory limit configured for the container.
192    #[serde(skip_serializing_if = "Option::is_none", default)]
193    pub memory_limit: Option<ContainerCreateResponseMemoryLimit>,
194    /// Network access policy for the container.
195    #[serde(skip_serializing_if = "Option::is_none", default)]
196    pub network_policy: Option<NetworkPolicy>,
197}
198
199#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
200#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
201#[non_exhaustive]
202pub enum ContainerListParamsOrder {
203    #[serde(rename = "asc")]
204    Asc,
205    #[serde(rename = "desc")]
206    Desc,
207}
208
209#[derive(Debug, Clone, Serialize, Deserialize)]
210#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
211pub struct ContainerListParams {
212    /// A cursor for use in pagination.
213    #[serde(skip_serializing_if = "Option::is_none", default)]
214    pub after: Option<String>,
215    /// A limit on the number of objects to be returned.
216    #[serde(skip_serializing_if = "Option::is_none", default)]
217    pub limit: Option<i64>,
218    /// Filter results by container name.
219    #[serde(skip_serializing_if = "Option::is_none", default)]
220    pub name: Option<String>,
221    /// Sort order by the `created_at` timestamp of the objects.
222    #[serde(skip_serializing_if = "Option::is_none", default)]
223    pub order: Option<ContainerListParamsOrder>,
224}
225
226#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
227#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
228#[non_exhaustive]
229pub enum ContainerListResponseMemoryLimit {
230    #[serde(rename = "1g")]
231    V1g,
232    #[serde(rename = "4g")]
233    V4g,
234    #[serde(rename = "16g")]
235    V16g,
236    #[serde(rename = "64g")]
237    V64g,
238}
239
240#[derive(Debug, Clone, Serialize, Deserialize)]
241#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
242pub struct ContainerListResponse {
243    /// Unique identifier for the container.
244    pub id: String,
245    /// Unix timestamp (in seconds) when the container was created.
246    pub created_at: i64,
247    /// Name of the container.
248    pub name: String,
249    /// The type of this object.
250    pub object: String,
251    /// Status of the container (e.g., active, deleted).
252    pub status: String,
253    /// The container will expire after this time period. The anchor is the reference
254    #[serde(skip_serializing_if = "Option::is_none", default)]
255    pub expires_after: Option<ExpiresAfter>,
256    /// Unix timestamp (in seconds) when the container was last active.
257    #[serde(skip_serializing_if = "Option::is_none", default)]
258    pub last_active_at: Option<i64>,
259    /// The memory limit configured for the container.
260    #[serde(skip_serializing_if = "Option::is_none", default)]
261    pub memory_limit: Option<ContainerListResponseMemoryLimit>,
262    /// Network access policy for the container.
263    #[serde(skip_serializing_if = "Option::is_none", default)]
264    pub network_policy: Option<NetworkPolicy>,
265}
266
267#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
268#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
269#[non_exhaustive]
270pub enum ContainerRetrieveResponseMemoryLimit {
271    #[serde(rename = "1g")]
272    V1g,
273    #[serde(rename = "4g")]
274    V4g,
275    #[serde(rename = "16g")]
276    V16g,
277    #[serde(rename = "64g")]
278    V64g,
279}
280
281#[derive(Debug, Clone, Serialize, Deserialize)]
282#[cfg_attr(feature = "structured", derive(schemars::JsonSchema))]
283pub struct ContainerRetrieveResponse {
284    /// Unique identifier for the container.
285    pub id: String,
286    /// Unix timestamp (in seconds) when the container was created.
287    pub created_at: i64,
288    /// Name of the container.
289    pub name: String,
290    /// The type of this object.
291    pub object: String,
292    /// Status of the container (e.g., active, deleted).
293    pub status: String,
294    /// The container will expire after this time period. The anchor is the reference
295    #[serde(skip_serializing_if = "Option::is_none", default)]
296    pub expires_after: Option<ExpiresAfter>,
297    /// Unix timestamp (in seconds) when the container was last active.
298    #[serde(skip_serializing_if = "Option::is_none", default)]
299    pub last_active_at: Option<i64>,
300    /// The memory limit configured for the container.
301    #[serde(skip_serializing_if = "Option::is_none", default)]
302    pub memory_limit: Option<ContainerRetrieveResponseMemoryLimit>,
303    /// Network access policy for the container.
304    #[serde(skip_serializing_if = "Option::is_none", default)]
305    pub network_policy: Option<NetworkPolicy>,
306}