com.envoy.events
Version:
Event Data Model Definition in Envoy
130 lines • 4.72 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Location = exports.Room = exports.protobufPackage = void 0;
/* eslint-disable */
const _m0 = require("protobufjs/minimal");
exports.protobufPackage = "com.envoy.events.core.rooms";
function createBaseRoom() {
return { id: 0, name: "", location: undefined };
}
exports.Room = {
encode(message, writer = _m0.Writer.create()) {
if (message.id !== 0) {
writer.uint32(8).int32(message.id);
}
if (message.name !== "") {
writer.uint32(18).string(message.name);
}
if (message.location !== undefined) {
exports.Location.encode(message.location, writer.uint32(26).fork()).ldelim();
}
return writer;
},
decode(input, length) {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseRoom();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.id = reader.int32();
break;
case 2:
message.name = reader.string();
break;
case 3:
message.location = exports.Location.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
id: isSet(object.id) ? Number(object.id) : 0,
name: isSet(object.name) ? String(object.name) : "",
location: isSet(object.location) ? exports.Location.fromJSON(object.location) : undefined,
};
},
toJSON(message) {
const obj = {};
message.id !== undefined && (obj.id = Math.round(message.id));
message.name !== undefined && (obj.name = message.name);
message.location !== undefined && (obj.location = message.location ? exports.Location.toJSON(message.location) : undefined);
return obj;
},
create(base) {
return exports.Room.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a, _b;
const message = createBaseRoom();
message.id = (_a = object.id) !== null && _a !== void 0 ? _a : 0;
message.name = (_b = object.name) !== null && _b !== void 0 ? _b : "";
message.location = (object.location !== undefined && object.location !== null)
? exports.Location.fromPartial(object.location)
: undefined;
return message;
},
};
function createBaseLocation() {
return { id: 0, name: "" };
}
exports.Location = {
encode(message, writer = _m0.Writer.create()) {
if (message.id !== 0) {
writer.uint32(8).int32(message.id);
}
if (message.name !== "") {
writer.uint32(18).string(message.name);
}
return writer;
},
decode(input, length) {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseLocation();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.id = reader.int32();
break;
case 2:
message.name = reader.string();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return { id: isSet(object.id) ? Number(object.id) : 0, name: isSet(object.name) ? String(object.name) : "" };
},
toJSON(message) {
const obj = {};
message.id !== undefined && (obj.id = Math.round(message.id));
message.name !== undefined && (obj.name = message.name);
return obj;
},
create(base) {
return exports.Location.fromPartial(base !== null && base !== void 0 ? base : {});
},
fromPartial(object) {
var _a, _b;
const message = createBaseLocation();
message.id = (_a = object.id) !== null && _a !== void 0 ? _a : 0;
message.name = (_b = object.name) !== null && _b !== void 0 ? _b : "";
return message;
},
};
function isSet(value) {
return value !== null && value !== undefined;
}
//# sourceMappingURL=rooms.js.map