"use strict";
/* tslint:disable class-name */
Object.defineProperty(exports, "__esModule", { value: true });
const ExpirationDateRule_1 = require("../../../../rules/ExpirationDateRule");
const ValidationException_1 = require("../../../../validation/ValidationException");
function wise_rule_expiration_date_encode(r) {
    if (!Date.parse(r.date))
        throw new ValidationException_1.ValidationException("ExpirationDateRule: date should be "
            + "formatted in one of the following formats: ISO 8601, IETF");
    const out = {
        rule: "expiration_date",
        date: r.date
    };
    return out;
}
exports.wise_rule_expiration_date_encode = wise_rule_expiration_date_encode;
function wise_rule_expiration_date_decode(r) {
    if (!Date.parse(r.date))
        throw new ValidationException_1.ValidationException("ExpirationDateRule: date should be "
            + "formatted in one of the following formats: ISO 8601, IETF");
    return new ExpirationDateRule_1.ExpirationDateRule(r.date);
}
exports.wise_rule_expiration_date_decode = wise_rule_expiration_date_decode;
//# sourceMappingURL=rule-expiration-date.js.map