diffusion
Version:
Diffusion JavaScript client
65 lines (64 loc) • 2.83 kB
JavaScript
;
/**
* @module Services.Control
*/
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.SetSessionPropertiesResultSerialiser = exports.SetSessionPropertiesResultSerialiserClass = void 0;
var Codec = require("./../../io/codec");
var serialiser_1 = require("./../../serialisers/serialiser");
var set_session_properties_result_1 = require("./set-session-properties-result");
/**
* Serialiser for {@link SetSessionPropertiesResult}
*/
var SetSessionPropertiesResultSerialiserClass = /** @class */ (function (_super) {
__extends(SetSessionPropertiesResultSerialiserClass, _super);
function SetSessionPropertiesResultSerialiserClass() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**
* Read a {@link SetSessionPropertiesResult} from the stream
*
* @param bis the input stream
* @return the {@link SetSessionPropertiesResult} that was read
*/
SetSessionPropertiesResultSerialiserClass.prototype.read = function (bis) {
var changedProperties;
var newProperties;
var mapOption = Codec.readByte(bis);
if (mapOption === 0) {
changedProperties = {};
}
else {
changedProperties = Codec.readDictionary(bis, Codec.readString);
}
var listOption = Codec.readByte(bis);
if (listOption === 0) {
newProperties = [];
}
else {
newProperties = Codec.readCollection(bis, Codec.readString);
}
return new set_session_properties_result_1.SetSessionPropertiesResult(changedProperties, newProperties);
};
return SetSessionPropertiesResultSerialiserClass;
}(serialiser_1.AbstractSerialiser));
exports.SetSessionPropertiesResultSerialiserClass = SetSessionPropertiesResultSerialiserClass;
/**
* The {@link SetSessionPropertiesResultSerialiser} singleton
*/ // eslint-disable-next-line @typescript-eslint/naming-convention
exports.SetSessionPropertiesResultSerialiser = new SetSessionPropertiesResultSerialiserClass();