"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var change_1 = require("../changes/change");
function enumValueRemoved(oldEnum, value) {
    return {
        criticality: {
            level: change_1.CriticalityLevel.Breaking,
            reason: "Removing an enum value will cause existing queries that use this enum value to error.",
        },
        message: "Enum value '" + value.name + "' was removed from enum '" + oldEnum.name + "'",
        path: [oldEnum.name, value.name].join('.'),
    };
}
exports.enumValueRemoved = enumValueRemoved;
function enumValueAdded(newEnum, value) {
    return {
        criticality: {
            level: change_1.CriticalityLevel.Dangerous,
            reason: "Adding an enum value may break existing clients that were not programming defensively against an added case when querying an enum.",
        },
        message: "Enum value '" + value.name + "' was added to enum '" + newEnum.name + "'",
        path: [newEnum.name, value.name].join('.'),
    };
}
exports.enumValueAdded = enumValueAdded;
function enumValueDescriptionChanged(newEnum, oldValue, newValue) {
    return {
        criticality: {
            level: change_1.CriticalityLevel.NonBreaking,
        },
        message: typeof oldValue.description === 'undefined'
            ? "Description '" + newValue.description + "' was added to enum value '" + newEnum.name + "." + newValue.name + "'"
            : "Description for enum value '" + newEnum.name + "." + newValue.name + "' changed from '" + oldValue.description + "' to '" + newValue.description + "'",
        path: [newEnum.name, oldValue.name].join('.'),
    };
}
exports.enumValueDescriptionChanged = enumValueDescriptionChanged;
function enumValueDeprecationReasonChanged(newEnum, oldValue, newValue) {
    return {
        criticality: {
            level: change_1.CriticalityLevel.NonBreaking,
        },
        message: oldValue.deprecationReason
            ? "Enum value '" + newEnum.name + "." + newValue.name + "' deprecation reason changed from '" + oldValue.deprecationReason + "' to '" + newValue.deprecationReason + "'"
            : "Enum value '" + newEnum.name + "." + newValue.name + "' was deprecated with reason '" + newValue.deprecationReason + "'",
        path: [newEnum.name, oldValue.name].join('.'),
    };
}
exports.enumValueDeprecationReasonChanged = enumValueDeprecationReasonChanged;
//# sourceMappingURL=enum.js.map