-
Notifications
You must be signed in to change notification settings - Fork 8
/
OnmsSeverity.ts
39 lines (35 loc) · 1023 Bytes
/
OnmsSeverity.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 {IHasUrlValue} from '../api/IHasUrlValue';
import {OnmsEnum, forId, forLabel} from '../internal/OnmsEnum';
/**
* Represents an OpenNMS severity.
* @category Model
*/
export class OnmsSeverity extends OnmsEnum<number> implements IHasUrlValue {
/** @inheritdoc */
public static forId(id?: string) {
return forId(Severities, id);
}
/** @inheritdoc */
public static forLabel(label?: string) {
return forLabel(Severities, label);
}
/** @inheritdoc */
public get urlValue() {
return this.label;
}
}
/* tslint:disable:object-literal-sort-keys */
/**
* Contains constant instances of all severities.
* @category Model
*/
export const Severities = {
INDETERMINATE: new OnmsSeverity(1, 'INDETERMINATE'),
CLEARED: new OnmsSeverity(2, 'CLEARED'),
NORMAL: new OnmsSeverity(3, 'NORMAL'),
WARNING: new OnmsSeverity(4, 'WARNING'),
MINOR: new OnmsSeverity(5, 'MINOR'),
MAJOR: new OnmsSeverity(6, 'MAJOR'),
CRITICAL: new OnmsSeverity(7, 'CRITICAL'),
};
Object.freeze(Severities);