UNPKG

ravendb

Version:
33 lines 1.08 kB
import { StringUtil } from "../../../Utility/StringUtil.js"; import { throwError } from "../../../Exceptions/index.js"; export class PutAttachmentCommandData { id; name; changeVector; type = "AttachmentPUT"; contentType; attStream; constructor(documentId, name, stream, contentType, changeVector) { if (StringUtil.isNullOrWhitespace(documentId)) { throwError("InvalidArgumentException", "DocumentId cannot be null."); } if (StringUtil.isNullOrWhitespace(name)) { 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 }; } } //# sourceMappingURL=PutAttachmentCommandData.js.map