-
-
Notifications
You must be signed in to change notification settings - Fork 301
/
Copy pathGroupRelationExports.ts
45 lines (41 loc) · 1.46 KB
/
GroupRelationExports.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
import { BaseResource } from '@gitbeaker/requester-utils';
import { RequestHelper, endpoint } from '../infrastructure';
import type { BaseRequestOptions, GitlabAPIResponse, ShowExpanded, Sudo } from '../infrastructure';
export interface GroupRelationExportStatusSchema extends Record<string, unknown> {
relation: string;
status: number;
error?: string;
updated_at: string;
}
export class GroupRelationExports<C extends boolean = false> extends BaseResource<C> {
download<E extends boolean = false>(
groupId: string | number,
relation: string,
options?: Sudo & ShowExpanded<E>,
): Promise<GitlabAPIResponse<Blob, void, E, void>> {
return RequestHelper.get<Blob>()(this, endpoint`groups/${groupId}/export_relations/download`, {
searchParams: { relation },
...options,
});
}
exportStatus<E extends boolean = false>(
groupId: string | number,
options?: Sudo & ShowExpanded<E>,
): Promise<GitlabAPIResponse<GroupRelationExportStatusSchema[], C, E, void>> {
return RequestHelper.get<GroupRelationExportStatusSchema[]>()(
this,
endpoint`groups/${groupId}/export_relations`,
options,
);
}
scheduleExport<E extends boolean = false>(
groupId: string | number,
options?: BaseRequestOptions<E>,
): Promise<GitlabAPIResponse<{ message: string }, C, E, void>> {
return RequestHelper.post<{ message: string }>()(
this,
endpoint`groups/${groupId}/export_relations`,
options,
);
}
}