import { createKeyAttributes } from '../../mapper';
import { prepareAndAddUpdateExpressions } from '../expression/prepare-and-add-update-expressions.function';
import { addUpdate } from '../expression/request-expression-builder';
import { TransactBaseOperation } from './transact-base-operation';
export class TransactUpdate extends TransactBaseOperation {
    constructor(modelClazz, partitionKey, sortKey) {
        super(modelClazz);
        this.params.Key = createKeyAttributes(this.metadata, partitionKey, sortKey);
    }
    updateAttribute(attributePath) {
        return addUpdate(attributePath, this, this.metadata);
    }
    operations(...updateDefFns) {
        prepareAndAddUpdateExpressions(this.metadata, this.params, updateDefFns);
        return this;
    }
    get transactItem() {
        return {
            Update: Object.assign({}, this.params),
        };
    }
}
//# sourceMappingURL=transact-update.js.map