|
1 | 1 | // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. |
2 | 2 |
|
3 | 3 | import { APIResource } from '../../core/resource'; |
| 4 | +import * as Shared from '../shared'; |
4 | 5 | import * as BulkAPI from './bulk'; |
5 | 6 | import { |
6 | 7 | Bulk, |
@@ -102,7 +103,7 @@ export class Files extends APIResource { |
102 | 103 | * const file = await client.files.get('fileId'); |
103 | 104 | * ``` |
104 | 105 | */ |
105 | | - get(fileID: string, options?: RequestOptions): APIPromise<File> { |
| 106 | + get(fileID: string, options?: RequestOptions): APIPromise<Shared.File> { |
106 | 107 | return this._client.get(path`/v1/files/${fileID}/details`, options); |
107 | 108 | } |
108 | 109 |
|
@@ -191,201 +192,6 @@ export class Files extends APIResource { |
191 | 192 | } |
192 | 193 | } |
193 | 194 |
|
194 | | -/** |
195 | | - * Object containing details of a file or file version. |
196 | | - */ |
197 | | -export interface File { |
198 | | - /** |
199 | | - * An array of tags assigned to the file by auto tagging. |
200 | | - */ |
201 | | - AITags?: Array<File.AITag> | null; |
202 | | - |
203 | | - /** |
204 | | - * Date and time when the file was uploaded. The date and time is in ISO8601 |
205 | | - * format. |
206 | | - */ |
207 | | - createdAt?: string; |
208 | | - |
209 | | - /** |
210 | | - * An string with custom coordinates of the file. |
211 | | - */ |
212 | | - customCoordinates?: string | null; |
213 | | - |
214 | | - /** |
215 | | - * An object with custom metadata for the file. |
216 | | - */ |
217 | | - customMetadata?: { [key: string]: unknown }; |
218 | | - |
219 | | - /** |
220 | | - * Optional text to describe the contents of the file. Can be set by the user or |
221 | | - * the ai-auto-description extension. |
222 | | - */ |
223 | | - description?: string; |
224 | | - |
225 | | - /** |
226 | | - * Unique identifier of the asset. |
227 | | - */ |
228 | | - fileId?: string; |
229 | | - |
230 | | - /** |
231 | | - * Path of the file. This is the path you would use in the URL to access the file. |
232 | | - * For example, if the file is at the root of the media library, the path will be |
233 | | - * `/file.jpg`. If the file is inside a folder named `images`, the path will be |
234 | | - * `/images/file.jpg`. |
235 | | - */ |
236 | | - filePath?: string; |
237 | | - |
238 | | - /** |
239 | | - * Type of the file. Possible values are `image`, `non-image`. |
240 | | - */ |
241 | | - fileType?: string; |
242 | | - |
243 | | - /** |
244 | | - * Specifies if the image has an alpha channel. |
245 | | - */ |
246 | | - hasAlpha?: boolean; |
247 | | - |
248 | | - /** |
249 | | - * Height of the file. |
250 | | - */ |
251 | | - height?: number; |
252 | | - |
253 | | - /** |
254 | | - * Specifies if the file is private or not. |
255 | | - */ |
256 | | - isPrivateFile?: boolean; |
257 | | - |
258 | | - /** |
259 | | - * Specifies if the file is published or not. |
260 | | - */ |
261 | | - isPublished?: boolean; |
262 | | - |
263 | | - /** |
264 | | - * MIME type of the file. |
265 | | - */ |
266 | | - mime?: string; |
267 | | - |
268 | | - /** |
269 | | - * Name of the asset. |
270 | | - */ |
271 | | - name?: string; |
272 | | - |
273 | | - /** |
274 | | - * Size of the file in bytes. |
275 | | - */ |
276 | | - size?: number; |
277 | | - |
278 | | - /** |
279 | | - * An array of tags assigned to the file. Tags are used to search files in the |
280 | | - * media library. |
281 | | - */ |
282 | | - tags?: Array<string> | null; |
283 | | - |
284 | | - /** |
285 | | - * URL of the thumbnail image. This URL is used to access the thumbnail image of |
286 | | - * the file in the media library. |
287 | | - */ |
288 | | - thumbnail?: string; |
289 | | - |
290 | | - /** |
291 | | - * Type of the asset. |
292 | | - */ |
293 | | - type?: 'file' | 'file-version'; |
294 | | - |
295 | | - /** |
296 | | - * Date and time when the file was last updated. The date and time is in ISO8601 |
297 | | - * format. |
298 | | - */ |
299 | | - updatedAt?: string; |
300 | | - |
301 | | - /** |
302 | | - * URL of the file. |
303 | | - */ |
304 | | - url?: string; |
305 | | - |
306 | | - /** |
307 | | - * An object with details of the file version. |
308 | | - */ |
309 | | - versionInfo?: File.VersionInfo; |
310 | | - |
311 | | - /** |
312 | | - * Width of the file. |
313 | | - */ |
314 | | - width?: number; |
315 | | -} |
316 | | - |
317 | | -export namespace File { |
318 | | - export interface AITag { |
319 | | - /** |
320 | | - * Confidence score of the tag. |
321 | | - */ |
322 | | - confidence?: number; |
323 | | - |
324 | | - /** |
325 | | - * Name of the tag. |
326 | | - */ |
327 | | - name?: string; |
328 | | - |
329 | | - /** |
330 | | - * Source of the tag. Possible values are `google-auto-tagging` and |
331 | | - * `aws-auto-tagging`. |
332 | | - */ |
333 | | - source?: string; |
334 | | - } |
335 | | - |
336 | | - /** |
337 | | - * An object with details of the file version. |
338 | | - */ |
339 | | - export interface VersionInfo { |
340 | | - /** |
341 | | - * Unique identifier of the file version. |
342 | | - */ |
343 | | - id?: string; |
344 | | - |
345 | | - /** |
346 | | - * Name of the file version. |
347 | | - */ |
348 | | - name?: string; |
349 | | - } |
350 | | -} |
351 | | - |
352 | | -export interface Folder { |
353 | | - /** |
354 | | - * Date and time when the folder was created. The date and time is in ISO8601 |
355 | | - * format. |
356 | | - */ |
357 | | - createdAt?: string; |
358 | | - |
359 | | - /** |
360 | | - * Unique identifier of the asset. |
361 | | - */ |
362 | | - folderId?: string; |
363 | | - |
364 | | - /** |
365 | | - * Path of the folder. This is the path you would use in the URL to access the |
366 | | - * folder. For example, if the folder is at the root of the media library, the path |
367 | | - * will be /folder. If the folder is inside another folder named images, the path |
368 | | - * will be /images/folder. |
369 | | - */ |
370 | | - folderPath?: string; |
371 | | - |
372 | | - /** |
373 | | - * Name of the asset. |
374 | | - */ |
375 | | - name?: string; |
376 | | - |
377 | | - /** |
378 | | - * Type of the asset. |
379 | | - */ |
380 | | - type?: 'folder'; |
381 | | - |
382 | | - /** |
383 | | - * Date and time when the folder was last updated. The date and time is in ISO8601 |
384 | | - * format. |
385 | | - */ |
386 | | - updatedAt?: string; |
387 | | -} |
388 | | - |
389 | 195 | /** |
390 | 196 | * JSON object containing metadata. |
391 | 197 | */ |
@@ -611,7 +417,7 @@ export namespace Metadata { |
611 | 417 | /** |
612 | 418 | * Object containing details of a file or file version. |
613 | 419 | */ |
614 | | -export interface FileUpdateResponse extends File { |
| 420 | +export interface FileUpdateResponse extends Shared.File { |
615 | 421 | extensionStatus?: FileUpdateResponse.ExtensionStatus; |
616 | 422 | } |
617 | 423 |
|
@@ -1436,8 +1242,6 @@ Files.Versions = Versions; |
1436 | 1242 |
|
1437 | 1243 | export declare namespace Files { |
1438 | 1244 | export { |
1439 | | - type File as File, |
1440 | | - type Folder as Folder, |
1441 | 1245 | type Metadata as Metadata, |
1442 | 1246 | type FileUpdateResponse as FileUpdateResponse, |
1443 | 1247 | type FileCopyResponse as FileCopyResponse, |
|
0 commit comments