This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
authentik/web/src/api/Groups.ts

29 lines
698 B
TypeScript
Raw Normal View History

2021-02-19 16:18:09 +00:00
import { DefaultClient, QueryArguments, AKResponse } from "./Client";
import { EventContext } from "./Events";
export class Group {
2021-02-19 16:18:09 +00:00
pk: string;
name: string;
is_superuser: boolean;
attributes: EventContext;
parent?: Group;
2021-02-19 16:18:09 +00:00
users: number[];
constructor() {
throw Error();
}
2021-02-19 16:18:09 +00:00
static get(pk: string): Promise<Group> {
return DefaultClient.fetch<Group>(["core", "groups", pk]);
}
static list(filter?: QueryArguments): Promise<AKResponse<Group>> {
return DefaultClient.fetch<AKResponse<Group>>(["core", "groups"], filter);
}
static adminUrl(rest: string): string {
return `/administration/groups/${rest}`;
}
}