-
-
Notifications
You must be signed in to change notification settings - Fork 301
/
Copy pathGroupSAMLIdentities.ts
39 lines (36 loc) · 1.11 KB
/
GroupSAMLIdentities.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
import { BaseResource } from '@gitbeaker/requester-utils';
import { RequestHelper, endpoint } from '../infrastructure';
import type {
GitlabAPIResponse,
PaginationRequestOptions,
PaginationTypes,
ShowExpanded,
Sudo,
} from '../infrastructure';
export interface IdentitySchema extends Record<string, unknown> {
extern_uid: string;
user_id: number;
}
export class GroupSAMLIdentities<C extends boolean = false> extends BaseResource<C> {
all<E extends boolean = false, P extends PaginationTypes = 'offset'>(
groupId: string | number,
options: PaginationRequestOptions<P> & Sudo & ShowExpanded<E>,
): Promise<GitlabAPIResponse<IdentitySchema[], C, E, P>> {
return RequestHelper.get<IdentitySchema[]>()(
this,
endpoint`groups/${groupId}/saml/identities`,
options,
);
}
edit<E extends boolean = false>(
groupId: string | number,
identityId: string,
options: Sudo & ShowExpanded<E>,
): Promise<GitlabAPIResponse<void, C, E, void>> {
return RequestHelper.patch<void>()(
this,
endpoint`groups/${groupId}/saml/${identityId}`,
options,
);
}
}