ravendb
Version:
RavenDB client for Node.js
49 lines • 1.91 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.MoveAttachmentCommandData = void 0;
const StringUtil_js_1 = require("../../../Utility/StringUtil.js");
const index_js_1 = require("../../../Exceptions/index.js");
class MoveAttachmentCommandData {
id;
changeVector;
name;
_destinationId;
_destinationName;
get type() {
return "AttachmentMOVE";
}
constructor(documentId, name, destinationDocumentId, destinationName, changeVector) {
if (StringUtil_js_1.StringUtil.isNullOrWhitespace(documentId)) {
(0, index_js_1.throwError)("InvalidArgumentException", "DocumentId is required.");
}
if (StringUtil_js_1.StringUtil.isNullOrWhitespace(name)) {
(0, index_js_1.throwError)("InvalidArgumentException", "Name is required.");
}
if (StringUtil_js_1.StringUtil.isNullOrWhitespace(destinationDocumentId)) {
(0, index_js_1.throwError)("InvalidArgumentException", "DestinationDocumentId is required.");
}
if (StringUtil_js_1.StringUtil.isNullOrWhitespace(destinationName)) {
(0, index_js_1.throwError)("InvalidArgumentException", "DestinationName is required.");
}
this.id = documentId;
this.name = name;
this.changeVector = changeVector;
this._destinationId = destinationDocumentId;
this._destinationName = destinationName;
}
getType() {
return "AttachmentMOVE";
}
serialize(conventions) {
return {
Id: this.id,
Name: this.name,
DestinationId: this._destinationId,
DestinationName: this._destinationName,
ChangeVector: this.changeVector,
Type: "AttachmentMOVE"
};
}
}
exports.MoveAttachmentCommandData = MoveAttachmentCommandData;
//# sourceMappingURL=MoveAttachmentCommandData.js.map