UNPKG

ravendb

Version:
45 lines 1.6 kB
import { StringUtil } from "../../../Utility/StringUtil.js"; import { throwError } from "../../../Exceptions/index.js"; export class CopyAttachmentCommandData { id; changeVector; name; _destinationId; _destinationName; get type() { return "AttachmentCOPY"; } 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: "AttachmentCOPY" }; } } //# sourceMappingURL=CopyAttachmentCommandData.js.map