ravendb
Version:
RavenDB client for Node.js
45 lines • 1.6 kB
JavaScript
import { StringUtil } from "../../../Utility/StringUtil.js";
import { throwError } from "../../../Exceptions/index.js";
export class MoveAttachmentCommandData {
id;
changeVector;
name;
_destinationId;
_destinationName;
get type() {
return "AttachmentMOVE";
}
constructor(documentId, name, destinationDocumentId, destinationName, changeVector) {
if (StringUtil.isNullOrWhitespace(documentId)) {
throwError("InvalidArgumentException", "DocumentId is required.");
}
if (StringUtil.isNullOrWhitespace(name)) {
throwError("InvalidArgumentException", "Name is required.");
}
if (StringUtil.isNullOrWhitespace(destinationDocumentId)) {
throwError("InvalidArgumentException", "DestinationDocumentId is required.");
}
if (StringUtil.isNullOrWhitespace(destinationName)) {
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"
};
}
}
//# sourceMappingURL=MoveAttachmentCommandData.js.map