diffusion
Version:
Diffusion JavaScript client
58 lines (57 loc) • 2.98 kB
JavaScript
;
/**
* @module Services.TopicUpdate
*/
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.UpdateStreamAddTopicResponseSerialiser = exports.UpdateStreamAddTopicResponseSerialiserClass = void 0;
var Codec = require("./../../io/codec");
var serialiser_1 = require("./../../serialisers/serialiser");
var add_topic_result_serialiser_1 = require("./add-topic-result-serialiser");
var update_stream_add_topic_response_1 = require("./update-stream-add-topic-response");
var update_stream_id_serialiser_1 = require("./update-stream-id-serialiser");
/**
* Serialiser for {@link UpdateStreamAddTopicResponse}
*/
var UpdateStreamAddTopicResponseSerialiserClass = /** @class */ (function (_super) {
__extends(UpdateStreamAddTopicResponseSerialiserClass, _super);
function UpdateStreamAddTopicResponseSerialiserClass() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**
* Read a {@link UpdateStreamAddTopicResponse} from the stream
*
* @param bis the input stream
* @return the {@link UpdateStreamAddTopicResponse} that was read
*/
UpdateStreamAddTopicResponseSerialiserClass.prototype.read = function (bis) {
var creationResult = add_topic_result_serialiser_1.AddTopicResultSerialiser.read(bis);
var streamId = update_stream_id_serialiser_1.UpdateStreamIdSerialiser.read(bis);
var flags = Codec.readByte(bis);
// eslint-disable-next-line no-bitwise
var retainsValue = (flags & 1) > 0;
// eslint-disable-next-line no-bitwise
var supportsConflation = (flags & 2) > 0;
return new update_stream_add_topic_response_1.UpdateStreamAddTopicResponse(creationResult.result, streamId, retainsValue, supportsConflation);
};
return UpdateStreamAddTopicResponseSerialiserClass;
}(serialiser_1.AbstractSerialiser));
exports.UpdateStreamAddTopicResponseSerialiserClass = UpdateStreamAddTopicResponseSerialiserClass;
/**
* The {@link UpdateStreamAddTopicResponseSerialiser} singleton
*/ // eslint-disable-next-line @typescript-eslint/naming-convention
exports.UpdateStreamAddTopicResponseSerialiser = new UpdateStreamAddTopicResponseSerialiserClass();