-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocuments.ts
More file actions
58 lines (50 loc) · 1.53 KB
/
documents.ts
File metadata and controls
58 lines (50 loc) · 1.53 KB
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
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../../core/resource';
import * as DocumentsAPI from '../documents';
import { APIPromise } from '../../core/api-promise';
import { RequestOptions } from '../../internal/request-options';
import { path } from '../../internal/utils/path';
export class Documents extends APIResource {
/**
* Add a document to a folder.
*/
add(
documentID: string,
params: DocumentAddParams,
options?: RequestOptions,
): APIPromise<DocumentAddResponse> {
const { folder_id_or_name } = params;
return this._client.post(path`/folders/${folder_id_or_name}/documents/${documentID}`, options);
}
/**
* Remove a document from a folder.
*/
remove(
documentID: string,
params: DocumentRemoveParams,
options?: RequestOptions,
): APIPromise<DocumentsAPI.DocumentDeleteResponse> {
const { folder_id_or_name } = params;
return this._client.delete(path`/folders/${folder_id_or_name}/documents/${documentID}`, options);
}
}
/**
* Response for adding document to folder endpoint
*/
export interface DocumentAddResponse {
message: string;
status: string;
}
export interface DocumentAddParams {
folder_id_or_name: string;
}
export interface DocumentRemoveParams {
folder_id_or_name: string;
}
export declare namespace Documents {
export {
type DocumentAddResponse as DocumentAddResponse,
type DocumentAddParams as DocumentAddParams,
type DocumentRemoveParams as DocumentRemoveParams,
};
}