"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.ImportPersistence = void 0;
const internal_1 = require("../../internal");
class ImportPersistence {
    static fromData(ctx, object) {
        const imp = ctx.corpus.MakeObject(internal_1.cdmObjectType.import);
        let corpusPath = object.corpusPath;
        if (internal_1.StringUtils.isBlankByCdmStandard(corpusPath)) {
            corpusPath = object.uri;
        }
        imp.corpusPath = corpusPath;
        imp.moniker = object.moniker;
        return imp;
    }
    static toData(instance, resOpt, options) {
        const result = {
            corpusPath: instance.corpusPath
        };
        if (!internal_1.StringUtils.isBlankByCdmStandard(instance.moniker)) {
            result.moniker = instance.moniker;
        }
        return result;
    }
}
exports.ImportPersistence = ImportPersistence;
//# sourceMappingURL=ImportPersistence.js.map