/* Copyright CloudLinux Zug GmbH 2010-2017 All Rights Reserved
 *
 * Licensed under CLOUD LINUX LICENSE AGREEMENT
 * http://cloudlinux.com/docs/LICENSE.TXT
 */

export interface Config {
    options: OptionResponse;
    result: string;
    timestamp: number;
}

export interface OptionResponse {
    faultsNotification: FaultsNotification;

}

export interface FaultsNotification {
    notifyAdmin?: boolean;
    notifyResellers?: boolean;
    notifyCustomers?: boolean;
    notifyResellerCustomers?: boolean;
    notifyReseller?: boolean;
    notifyResellerOnCustomers?: boolean;
    faultsToInclude: FaultsToInclude;
    minimumNumberOfFaultsToNotify?: MinimumNumberOfFaultsToNotify;
    notify?: Notify;
}

interface FaultsToInclude {
    concurrentConnections: boolean;
    cpu: boolean;
    io?: boolean;
    iops?: boolean;
    mem: boolean;
    nproc: boolean;
}

interface MinimumNumberOfFaultsToNotify {
    admin?: number;
    user?: number;
    customer?: number;
    reseller?: number;
}

interface Notify {
    admin?: DetailsNotify;
    user?: DetailsNotify;
    customer?: DetailsNotify;
    reseller?: DetailsNotify;
}

type Period = 'seconds' | 'minutes' | 'hours' | 'days';

interface DetailsNotify {
    period: number;
    unitOfTime: Period;
}
