"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ModelConverter = /** @class */ (function () {
    function ModelConverter(_attributes) {
        this._attributes = _attributes;
    }
    ModelConverter.instanceOfBodyConverter = function (value) {
        return typeof value === "object";
    };
    ModelConverter.prototype.decode = function (body) {
        return ModelConverter.decodeData(body, this._attributes);
    };
    ModelConverter.prototype.encode = function (type) {
        throw new Error("Method not implemented.");
    };
    ModelConverter.decodeData = function (body, attributes) {
        var result = {};
        for (var attrName in attributes) {
            var converter = attributes[attrName];
            if (ModelConverter.instanceOfBodyConverter(converter)) {
                result[attrName] = converter.decode(body);
            }
            else {
                result[attrName] = converter;
            }
        }
        return result;
    };
    return ModelConverter;
}());
exports.ModelConverter = ModelConverter;
