import type { IAlarm, IAlarmRule } from './alarm-base'; import type { IAlarmRef } from '../../interfaces/generated/aws-cloudwatch-interfaces.generated'; /** * Enumeration indicates state of Alarm used in building Alarm Rule. */ export declare enum AlarmState { /** * State indicates resource is in ALARM */ ALARM = "ALARM", /** * State indicates resource is not in ALARM */ OK = "OK", /** * State indicates there is not enough data to determine is resource is in ALARM */ INSUFFICIENT_DATA = "INSUFFICIENT_DATA" } /** * Options for the AT_LEAST AlarmRule wrapper function. */ export interface AtLeastOptions { /** * Alarms to evaluate in the AT_LEAST expression. * * Must contain at least one alarm. */ readonly operands: IAlarm[]; /** * Threshold for the AT_LEAST expression. * * Use `AtLeastThreshold.count()` for an absolute number * or `AtLeastThreshold.percentage()` for a percentage. */ readonly threshold: AtLeastThreshold; } /** * Internal configuration returned by threshold binding. */ interface AtLeastThresholdConfig { /** * The threshold as a string for the AT_LEAST expression. * * Either a number (e.g. "2") or a percentage (e.g. "60%"). */ readonly threshold: string; } /** * Threshold configuration for the AT_LEAST composite alarm rule expression. * * Use `AtLeastThreshold.count()` for an absolute number or * `AtLeastThreshold.percentage()` for a percentage-based threshold. */ export declare abstract class AtLeastThreshold { /** * Creates a count-based threshold for the AT_LEAST expression. * * The count must be a positive integer between 1 and the number of operands. * * @param count the minimum number of alarms that must be in the specified state */ static count(count: number): AtLeastThreshold; /** * Creates a percentage-based threshold for the AT_LEAST expression. * * The percentage must be an integer between 1 and 100. * * @param percentage the minimum percentage of alarms that must be in the specified state */ static percentage(percentage: number): AtLeastThreshold; /** * Called when the alarm rule is rendered to bind the threshold and validate. * * @internal */ abstract _bind(operands: IAlarm[]): AtLeastThresholdConfig; } /** * Class with static functions to build AlarmRule for Composite Alarms. */ export declare class AlarmRule { /** * function to join all provided AlarmRules with AND operator. * * @param operands IAlarmRules to be joined with AND operator. */ static allOf(...operands: IAlarmRule[]): IAlarmRule; /** * function to join all provided AlarmRules with OR operator. * * @param operands IAlarmRules to be joined with OR operator. */ static anyOf(...operands: IAlarmRule[]): IAlarmRule; /** * function to wrap provided AlarmRule in NOT operator. * * @param operand IAlarmRule to be wrapped in NOT operator. */ static not(operand: IAlarmRule): IAlarmRule; /** * function to create an AT_LEAST expression for the given alarm state. * * @param alarmState the alarm state to evaluate against. * @param options operands and threshold for the AT_LEAST expression. */ static atLeast(alarmState: AlarmState, options: AtLeastOptions): IAlarmRule; /** * function to create an AT_LEAST expression for the negated alarm state. * * @param alarmState the alarm state to negate and evaluate against. * @param options operands and threshold for the AT_LEAST expression. */ static atLeastNot(alarmState: AlarmState, options: AtLeastOptions): IAlarmRule; /** * function to build TRUE/FALSE intent for Rule Expression. * * @param value boolean value to be used in rule expression. */ static fromBoolean(value: boolean): IAlarmRule; /** * function to build Rule Expression for given IAlarm and AlarmState. * * @param alarm IAlarm to be used in Rule Expression. * @param alarmState AlarmState to be used in Rule Expression. */ static fromAlarm(alarm: IAlarmRef, alarmState: AlarmState): IAlarmRule; /** * function to build Rule Expression for given Alarm Rule string. * * @param alarmRule string to be used in Rule Expression. */ static fromString(alarmRule: string): IAlarmRule; private static concat; private static renderAtLeast; } export {};