-
-
Notifications
You must be signed in to change notification settings - Fork 301
/
Copy pathUserCustomAttributes.ts
44 lines (39 loc) · 1.46 KB
/
UserCustomAttributes.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
import type { BaseResourceOptions } from '@gitbeaker/requester-utils';
import { ResourceCustomAttributes } from '../templates';
import type { CustomAttributeSchema } from '../templates/ResourceCustomAttributes';
import type {
GitlabAPIResponse,
PaginationRequestOptions,
PaginationTypes,
ShowExpanded,
Sudo,
} from '../infrastructure';
export interface UserCustomAttributes<C extends boolean = false>
extends ResourceCustomAttributes<C> {
all<E extends boolean = false, P extends PaginationTypes = 'offset'>(
userId: string | number,
options?: PaginationRequestOptions<P> & Sudo & ShowExpanded<E>,
): Promise<GitlabAPIResponse<CustomAttributeSchema[], C, E, P>>;
remove<E extends boolean = false>(
userId: string | number,
customAttributeId: string,
options?: Sudo,
): Promise<GitlabAPIResponse<void, C, E, void>>;
set<E extends boolean = false>(
userId: string | number,
customAttributeId: string,
value: string,
options?: Sudo & ShowExpanded<E>,
): Promise<GitlabAPIResponse<CustomAttributeSchema, C, E, void>>;
show<E extends boolean = false>(
userId: string | number,
customAttributeId: string,
options?: Sudo & ShowExpanded<E>,
): Promise<GitlabAPIResponse<CustomAttributeSchema, C, E, void>>;
}
export class UserCustomAttributes<C extends boolean = false> extends ResourceCustomAttributes<C> {
constructor(options: BaseResourceOptions<C>) {
/* istanbul ignore next */
super('users', options);
}
}