"use strict";
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
Object.defineProperty(exports, "__esModule", { value: true });
exports.OperationTypeConvertor = exports.cdmOperationType = void 0;
const internal_1 = require("../internal");
/**
 * Enumeration of operation types
 */
var cdmOperationType;
(function (cdmOperationType) {
    cdmOperationType[cdmOperationType["error"] = 0] = "error";
    cdmOperationType[cdmOperationType["addCountAttribute"] = 1] = "addCountAttribute";
    cdmOperationType[cdmOperationType["addSupportingAttribute"] = 2] = "addSupportingAttribute";
    cdmOperationType[cdmOperationType["addTypeAttribute"] = 3] = "addTypeAttribute";
    cdmOperationType[cdmOperationType["excludeAttributes"] = 4] = "excludeAttributes";
    cdmOperationType[cdmOperationType["arrayExpansion"] = 5] = "arrayExpansion";
    cdmOperationType[cdmOperationType["combineAttributes"] = 6] = "combineAttributes";
    cdmOperationType[cdmOperationType["renameAttributes"] = 7] = "renameAttributes";
    cdmOperationType[cdmOperationType["replaceAsForeignKey"] = 8] = "replaceAsForeignKey";
    cdmOperationType[cdmOperationType["includeAttributes"] = 9] = "includeAttributes";
    cdmOperationType[cdmOperationType["addAttributeGroup"] = 10] = "addAttributeGroup";
    cdmOperationType[cdmOperationType["alterTraits"] = 11] = "alterTraits";
    cdmOperationType[cdmOperationType["addArtifactAttribute"] = 12] = "addArtifactAttribute";
})(cdmOperationType = exports.cdmOperationType || (exports.cdmOperationType = {}));
/**
 * @internal
 */
class OperationTypeConvertor {
    /**
     * @internal
     */
    static operationTypeToString(opType) {
        switch (opType) {
            case cdmOperationType.addCountAttribute:
                return 'addCountAttribute';
            case cdmOperationType.addSupportingAttribute:
                return 'addSupportingAttribute';
            case cdmOperationType.addTypeAttribute:
                return 'addTypeAttribute';
            case cdmOperationType.excludeAttributes:
                return 'excludeAttributes';
            case cdmOperationType.arrayExpansion:
                return 'arrayExpansion';
            case cdmOperationType.combineAttributes:
                return 'combineAttributes';
            case cdmOperationType.renameAttributes:
                return 'renameAttributes';
            case cdmOperationType.replaceAsForeignKey:
                return 'replaceAsForeignKey';
            case cdmOperationType.includeAttributes:
                return 'includeAttributes';
            case cdmOperationType.addAttributeGroup:
                return 'addAttributeGroup';
            case cdmOperationType.alterTraits:
                return 'alterTraits';
            case cdmOperationType.addArtifactAttribute:
                return 'addArtifactAttribute';
            case cdmOperationType.error:
            default:
                throw new Error('Invalid operation.');
        }
    }
    /**
     * @internal
     * Gets the operation type from the object type.
     */
    static fromObjectType(objectType) {
        switch (objectType) {
            case internal_1.cdmObjectType.operationAddAttributeGroupDef:
                return cdmOperationType.addAttributeGroup;
            case internal_1.cdmObjectType.operationAddCountAttributeDef:
                return cdmOperationType.addCountAttribute;
            case internal_1.cdmObjectType.operationAddSupportingAttributeDef:
                return cdmOperationType.addSupportingAttribute;
            case internal_1.cdmObjectType.operationAddTypeAttributeDef:
                return cdmOperationType.addTypeAttribute;
            case internal_1.cdmObjectType.operationArrayExpansionDef:
                return cdmOperationType.arrayExpansion;
            case internal_1.cdmObjectType.operationCombineAttributesDef:
                return cdmOperationType.combineAttributes;
            case internal_1.cdmObjectType.operationExcludeAttributesDef:
                return cdmOperationType.excludeAttributes;
            case internal_1.cdmObjectType.operationIncludeAttributesDef:
                return cdmOperationType.includeAttributes;
            case internal_1.cdmObjectType.operationRenameAttributesDef:
                return cdmOperationType.renameAttributes;
            case internal_1.cdmObjectType.operationReplaceAsForeignKeyDef:
                return cdmOperationType.replaceAsForeignKey;
            case internal_1.cdmObjectType.operationAlterTraitsDef:
                return cdmOperationType.alterTraits;
            case internal_1.cdmObjectType.operationAddArtifactAttributeDef:
                return cdmOperationType.addArtifactAttribute;
        }
    }
}
exports.OperationTypeConvertor = OperationTypeConvertor;
//# sourceMappingURL=cdmOperationType.js.map