export class MonitorStepDnssecMonitorUtil {
    static getDefault() {
        return {
            domainName: "",
            resolvers: ["1.1.1.1", "8.8.8.8", "9.9.9.9"],
            checkNameserverConsistency: true,
            signatureExpiryWarningDays: 7,
            timeout: 10000,
            retries: 3,
        };
    }
    static fromJSON(json) {
        const defaults = MonitorStepDnssecMonitorUtil.getDefault();
        const resolvers = Array.isArray(json["resolvers"])
            ? json["resolvers"].filter((value) => {
                return typeof value === "string" && value.length > 0;
            })
            : defaults.resolvers;
        return {
            domainName: json["domainName"] || "",
            resolvers: resolvers.length > 0 ? resolvers : defaults.resolvers,
            checkNameserverConsistency: typeof json["checkNameserverConsistency"] === "boolean"
                ? json["checkNameserverConsistency"]
                : defaults.checkNameserverConsistency,
            signatureExpiryWarningDays: json["signatureExpiryWarningDays"] ||
                defaults.signatureExpiryWarningDays,
            timeout: json["timeout"] || defaults.timeout,
            retries: json["retries"] || defaults.retries,
        };
    }
    static toJSON(monitor) {
        return {
            domainName: monitor.domainName,
            resolvers: monitor.resolvers,
            checkNameserverConsistency: monitor.checkNameserverConsistency,
            signatureExpiryWarningDays: monitor.signatureExpiryWarningDays,
            timeout: monitor.timeout,
            retries: monitor.retries,
        };
    }
}
//# sourceMappingURL=MonitorStepDnssecMonitor.js.map