import { metadataForClass } from '../../decorator/metadata';
import { getTableName } from '../get-table-name.function';
var BaseRequest = /** @class */ (function () {
    function BaseRequest(dynamoRx, modelClazz) {
        this.dynamoRx = dynamoRx;
        if (modelClazz === null || modelClazz === undefined) {
            throw new Error("please provide the ModelConstructor for the request, won't work otherwise");
        }
        this.modelClazz = modelClazz;
        this.metadata = metadataForClass(this.modelClazz);
        if (!this.metadata.modelOptions) {
            throw new Error('given ModelConstructor has no @Model decorator');
        }
        this.tableName = getTableName(this.metadata);
        this.params = {};
    }
    BaseRequest.prototype.returnConsumedCapacity = function (level) {
        this.params.ReturnConsumedCapacity = level;
        return this;
    };
    return BaseRequest;
}());
export { BaseRequest };
//# sourceMappingURL=base.request.js.map