|
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'; |
5 | 4 | import * as BulkAPI from './bulk'; |
6 | 5 | import { |
7 | 6 | Bulk, |
@@ -103,7 +102,7 @@ export class Files extends APIResource { |
103 | 102 | * const file = await client.files.get('fileId'); |
104 | 103 | * ``` |
105 | 104 | */ |
106 | | - get(fileID: string, options?: RequestOptions): APIPromise<Shared.File> { |
| 105 | + get(fileID: string, options?: RequestOptions): APIPromise<File> { |
107 | 106 | return this._client.get(path`/v1/files/${fileID}/details`, options); |
108 | 107 | } |
109 | 108 |
|
@@ -192,6 +191,201 @@ export class Files extends APIResource { |
192 | 191 | } |
193 | 192 | } |
194 | 193 |
|
| 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 | + |
195 | 389 | /** |
196 | 390 | * JSON object containing metadata. |
197 | 391 | */ |
@@ -417,7 +611,7 @@ export namespace Metadata { |
417 | 611 | /** |
418 | 612 | * Object containing details of a file or file version. |
419 | 613 | */ |
420 | | -export interface FileUpdateResponse extends Shared.File { |
| 614 | +export interface FileUpdateResponse extends File { |
421 | 615 | extensionStatus?: FileUpdateResponse.ExtensionStatus; |
422 | 616 | } |
423 | 617 |
|
@@ -1242,6 +1436,8 @@ Files.Versions = Versions; |
1242 | 1436 |
|
1243 | 1437 | export declare namespace Files { |
1244 | 1438 | export { |
| 1439 | + type File as File, |
| 1440 | + type Folder as Folder, |
1245 | 1441 | type Metadata as Metadata, |
1246 | 1442 | type FileUpdateResponse as FileUpdateResponse, |
1247 | 1443 | type FileCopyResponse as FileCopyResponse, |
|
0 commit comments