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/EventRules.ts

27 lines
662 B
TypeScript
Raw Normal View History

2021-02-09 16:04:55 +00:00
import { DefaultClient, QueryArguments, AKResponse } from "./Client";
2021-01-15 15:23:27 +00:00
import { Group } from "./Groups";
export class Rule {
pk: string;
name: string;
transports: string[];
severity: string;
group?: Group;
constructor() {
throw Error();
}
static get(pk: string): Promise<Rule> {
return DefaultClient.fetch<Rule>(["events", "rules", pk]);
}
2021-02-09 16:04:55 +00:00
static list(filter?: QueryArguments): Promise<AKResponse<Rule>> {
return DefaultClient.fetch<AKResponse<Rule>>(["events", "rules"], filter);
2021-01-15 15:23:27 +00:00
}
static adminUrl(rest: string): string {
return `/administration/events/rules/${rest}`;
}
}