-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfiles.ts
60 lines (43 loc) · 1.19 KB
/
files.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../resource';
import * as Core from '../core';
import * as Shared from './shared';
export class Files extends APIResource {
/**
* Create File
*/
create(body: FileCreateParams, options?: Core.RequestOptions): Core.APIPromise<File> {
return this._client.post('/files', { body, ...options });
}
/**
* Delete File
*/
delete(fileId: string, options?: Core.RequestOptions): Core.APIPromise<Shared.ResourceDeleted> {
return this._client.delete(`/files/${fileId}`, options);
}
/**
* Get File
*/
get(fileId: string, options?: Core.RequestOptions): Core.APIPromise<File> {
return this._client.get(`/files/${fileId}`, options);
}
}
export interface File {
id: string;
content: string;
created_at: string;
hash: string;
name: string;
size: number;
description?: string;
mime_type?: string | null;
}
export interface FileCreateParams {
content: string;
name: string;
description?: string;
mime_type?: string | null;
}
export declare namespace Files {
export { type File as File, type FileCreateParams as FileCreateParams };
}