-
-
Notifications
You must be signed in to change notification settings - Fork 301
/
Copy pathProjectAccessRequests.ts
42 lines (37 loc) · 1.48 KB
/
ProjectAccessRequests.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
import type { BaseResourceOptions } from '@gitbeaker/requester-utils';
import { ResourceAccessRequests } from '../templates';
import type { AccessRequestSchema } from '../templates/ResourceAccessRequests';
import type {
GitlabAPIResponse,
PaginationRequestOptions,
PaginationTypes,
ShowExpanded,
Sudo,
} from '../infrastructure';
import { AccessLevel } from '../constants';
export interface ProjectAccessRequests<C extends boolean = false>
extends ResourceAccessRequests<C> {
all<E extends boolean = false, P extends PaginationTypes = 'offset'>(
projectId: string | number,
options?: PaginationRequestOptions<P> & Sudo & ShowExpanded<E>,
): Promise<GitlabAPIResponse<AccessRequestSchema[], C, E, P>>;
request<E extends boolean = false>(
projectId: string | number,
options?: Sudo & ShowExpanded<E>,
): Promise<GitlabAPIResponse<AccessRequestSchema, C, E, void>>;
approve<E extends boolean = false>(
projectId: string | number,
userId: number,
options?: { accessLevel?: Exclude<AccessLevel, AccessLevel.ADMIN> } & Sudo & ShowExpanded<E>,
): Promise<GitlabAPIResponse<AccessRequestSchema, C, E, void>>;
deny<E extends boolean = false>(
groupId: string | number,
userId: number,
): Promise<GitlabAPIResponse<void, C, E, void>>;
}
export class ProjectAccessRequests<C extends boolean = false> extends ResourceAccessRequests<C> {
constructor(options: BaseResourceOptions<C>) {
/* istanbul ignore next */
super('projects', options);
}
}