UNPKG

@configurator/ravendb

Version:
32 lines 1.25 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PutAttachmentCommandData = void 0; const StringUtil_1 = require("../../../Utility/StringUtil"); const Exceptions_1 = require("../../../Exceptions"); class PutAttachmentCommandData { constructor(documentId, name, stream, contentType, changeVector) { this.type = "AttachmentPUT"; if (StringUtil_1.StringUtil.isNullOrWhitespace(documentId)) { (0, Exceptions_1.throwError)("InvalidArgumentException", "DocumentId cannot be null."); } if (StringUtil_1.StringUtil.isNullOrWhitespace(name)) { (0, Exceptions_1.throwError)("InvalidArgumentException", "Name cannot be null."); } this.id = documentId; this.name = name; this.attStream = stream; this.contentType = contentType; this.changeVector = changeVector; } serialize(conventions) { return { Id: this.id, Name: this.name, ChangeVector: this.changeVector, Type: "AttachmentPUT", ContentType: this.contentType }; } } exports.PutAttachmentCommandData = PutAttachmentCommandData; //# sourceMappingURL=PutAttachmentCommandData.js.map