node-nats-streaming
Version:
Node.js client for NATS Streaming, a lightweight, high-performance cloud native messaging system
1,826 lines (1,610 loc) • 92.2 kB
JavaScript
// source: lib/pb/protocol.proto
/**
* @fileoverview
* @enhanceable
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
var jspb = require('google-protobuf');
var goog = jspb;
var proto = {};
goog.exportSymbol('pb.Ack', null, proto);
goog.exportSymbol('pb.CloseRequest', null, proto);
goog.exportSymbol('pb.CloseResponse', null, proto);
goog.exportSymbol('pb.ConnectRequest', null, proto);
goog.exportSymbol('pb.ConnectResponse', null, proto);
goog.exportSymbol('pb.MsgProto', null, proto);
goog.exportSymbol('pb.Ping', null, proto);
goog.exportSymbol('pb.PingResponse', null, proto);
goog.exportSymbol('pb.PubAck', null, proto);
goog.exportSymbol('pb.PubMsg', null, proto);
goog.exportSymbol('pb.StartPosition', null, proto);
goog.exportSymbol('pb.SubscriptionRequest', null, proto);
goog.exportSymbol('pb.SubscriptionResponse', null, proto);
goog.exportSymbol('pb.UnsubscribeRequest', null, proto);
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.pb.PubMsg = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.pb.PubMsg, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.pb.PubMsg.displayName = 'proto.pb.PubMsg';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.pb.PubAck = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.pb.PubAck, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.pb.PubAck.displayName = 'proto.pb.PubAck';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.pb.MsgProto = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.pb.MsgProto, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.pb.MsgProto.displayName = 'proto.pb.MsgProto';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.pb.Ack = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.pb.Ack, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.pb.Ack.displayName = 'proto.pb.Ack';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.pb.ConnectRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.pb.ConnectRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.pb.ConnectRequest.displayName = 'proto.pb.ConnectRequest';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.pb.ConnectResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.pb.ConnectResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.pb.ConnectResponse.displayName = 'proto.pb.ConnectResponse';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.pb.Ping = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.pb.Ping, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.pb.Ping.displayName = 'proto.pb.Ping';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.pb.PingResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.pb.PingResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.pb.PingResponse.displayName = 'proto.pb.PingResponse';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.pb.SubscriptionRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.pb.SubscriptionRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.pb.SubscriptionRequest.displayName = 'proto.pb.SubscriptionRequest';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.pb.SubscriptionResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.pb.SubscriptionResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.pb.SubscriptionResponse.displayName = 'proto.pb.SubscriptionResponse';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.pb.UnsubscribeRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.pb.UnsubscribeRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.pb.UnsubscribeRequest.displayName = 'proto.pb.UnsubscribeRequest';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.pb.CloseRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.pb.CloseRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.pb.CloseRequest.displayName = 'proto.pb.CloseRequest';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.pb.CloseResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.pb.CloseResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.pb.CloseResponse.displayName = 'proto.pb.CloseResponse';
}
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.pb.PubMsg.prototype.toObject = function(opt_includeInstance) {
return proto.pb.PubMsg.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.pb.PubMsg} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pb.PubMsg.toObject = function(includeInstance, msg) {
var f, obj = {
clientId: jspb.Message.getFieldWithDefault(msg, 1, ""),
guid: jspb.Message.getFieldWithDefault(msg, 2, ""),
subject: jspb.Message.getFieldWithDefault(msg, 3, ""),
reply: jspb.Message.getFieldWithDefault(msg, 4, ""),
data: msg.getData_asB64(),
connId: msg.getConnId_asB64(),
sha256: msg.getSha256_asB64()
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.pb.PubMsg}
*/
proto.pb.PubMsg.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.pb.PubMsg;
return proto.pb.PubMsg.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.pb.PubMsg} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.pb.PubMsg}
*/
proto.pb.PubMsg.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setClientId(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setGuid(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setSubject(value);
break;
case 4:
var value = /** @type {string} */ (reader.readString());
msg.setReply(value);
break;
case 5:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setData(value);
break;
case 6:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setConnId(value);
break;
case 10:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setSha256(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.pb.PubMsg.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.pb.PubMsg.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.pb.PubMsg} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pb.PubMsg.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getClientId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getGuid();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getSubject();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
f = message.getReply();
if (f.length > 0) {
writer.writeString(
4,
f
);
}
f = message.getData_asU8();
if (f.length > 0) {
writer.writeBytes(
5,
f
);
}
f = message.getConnId_asU8();
if (f.length > 0) {
writer.writeBytes(
6,
f
);
}
f = message.getSha256_asU8();
if (f.length > 0) {
writer.writeBytes(
10,
f
);
}
};
/**
* optional string client_id = 1;
* @return {string}
*/
proto.pb.PubMsg.prototype.getClientId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.pb.PubMsg} returns this
*/
proto.pb.PubMsg.prototype.setClientId = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string guid = 2;
* @return {string}
*/
proto.pb.PubMsg.prototype.getGuid = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.pb.PubMsg} returns this
*/
proto.pb.PubMsg.prototype.setGuid = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional string subject = 3;
* @return {string}
*/
proto.pb.PubMsg.prototype.getSubject = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/**
* @param {string} value
* @return {!proto.pb.PubMsg} returns this
*/
proto.pb.PubMsg.prototype.setSubject = function(value) {
return jspb.Message.setProto3StringField(this, 3, value);
};
/**
* optional string reply = 4;
* @return {string}
*/
proto.pb.PubMsg.prototype.getReply = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
};
/**
* @param {string} value
* @return {!proto.pb.PubMsg} returns this
*/
proto.pb.PubMsg.prototype.setReply = function(value) {
return jspb.Message.setProto3StringField(this, 4, value);
};
/**
* optional bytes data = 5;
* @return {!(string|Uint8Array)}
*/
proto.pb.PubMsg.prototype.getData = function() {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
};
/**
* optional bytes data = 5;
* This is a type-conversion wrapper around `getData()`
* @return {string}
*/
proto.pb.PubMsg.prototype.getData_asB64 = function() {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getData()));
};
/**
* optional bytes data = 5;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getData()`
* @return {!Uint8Array}
*/
proto.pb.PubMsg.prototype.getData_asU8 = function() {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getData()));
};
/**
* @param {!(string|Uint8Array)} value
* @return {!proto.pb.PubMsg} returns this
*/
proto.pb.PubMsg.prototype.setData = function(value) {
return jspb.Message.setProto3BytesField(this, 5, value);
};
/**
* optional bytes conn_id = 6;
* @return {!(string|Uint8Array)}
*/
proto.pb.PubMsg.prototype.getConnId = function() {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 6, ""));
};
/**
* optional bytes conn_id = 6;
* This is a type-conversion wrapper around `getConnId()`
* @return {string}
*/
proto.pb.PubMsg.prototype.getConnId_asB64 = function() {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getConnId()));
};
/**
* optional bytes conn_id = 6;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getConnId()`
* @return {!Uint8Array}
*/
proto.pb.PubMsg.prototype.getConnId_asU8 = function() {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getConnId()));
};
/**
* @param {!(string|Uint8Array)} value
* @return {!proto.pb.PubMsg} returns this
*/
proto.pb.PubMsg.prototype.setConnId = function(value) {
return jspb.Message.setProto3BytesField(this, 6, value);
};
/**
* optional bytes sha256 = 10;
* @return {!(string|Uint8Array)}
*/
proto.pb.PubMsg.prototype.getSha256 = function() {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 10, ""));
};
/**
* optional bytes sha256 = 10;
* This is a type-conversion wrapper around `getSha256()`
* @return {string}
*/
proto.pb.PubMsg.prototype.getSha256_asB64 = function() {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getSha256()));
};
/**
* optional bytes sha256 = 10;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getSha256()`
* @return {!Uint8Array}
*/
proto.pb.PubMsg.prototype.getSha256_asU8 = function() {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getSha256()));
};
/**
* @param {!(string|Uint8Array)} value
* @return {!proto.pb.PubMsg} returns this
*/
proto.pb.PubMsg.prototype.setSha256 = function(value) {
return jspb.Message.setProto3BytesField(this, 10, value);
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.pb.PubAck.prototype.toObject = function(opt_includeInstance) {
return proto.pb.PubAck.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.pb.PubAck} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pb.PubAck.toObject = function(includeInstance, msg) {
var f, obj = {
guid: jspb.Message.getFieldWithDefault(msg, 1, ""),
error: jspb.Message.getFieldWithDefault(msg, 2, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.pb.PubAck}
*/
proto.pb.PubAck.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.pb.PubAck;
return proto.pb.PubAck.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.pb.PubAck} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.pb.PubAck}
*/
proto.pb.PubAck.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setGuid(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setError(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.pb.PubAck.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.pb.PubAck.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.pb.PubAck} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pb.PubAck.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getGuid();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getError();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
};
/**
* optional string guid = 1;
* @return {string}
*/
proto.pb.PubAck.prototype.getGuid = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.pb.PubAck} returns this
*/
proto.pb.PubAck.prototype.setGuid = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string error = 2;
* @return {string}
*/
proto.pb.PubAck.prototype.getError = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.pb.PubAck} returns this
*/
proto.pb.PubAck.prototype.setError = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.pb.MsgProto.prototype.toObject = function(opt_includeInstance) {
return proto.pb.MsgProto.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.pb.MsgProto} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pb.MsgProto.toObject = function(includeInstance, msg) {
var f, obj = {
sequence: jspb.Message.getFieldWithDefault(msg, 1, 0),
subject: jspb.Message.getFieldWithDefault(msg, 2, ""),
reply: jspb.Message.getFieldWithDefault(msg, 3, ""),
data: msg.getData_asB64(),
timestamp: jspb.Message.getFieldWithDefault(msg, 5, 0),
redelivered: jspb.Message.getBooleanFieldWithDefault(msg, 6, false),
redeliveryCount: jspb.Message.getFieldWithDefault(msg, 7, 0),
crc32: jspb.Message.getFieldWithDefault(msg, 10, 0)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.pb.MsgProto}
*/
proto.pb.MsgProto.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.pb.MsgProto;
return proto.pb.MsgProto.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.pb.MsgProto} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.pb.MsgProto}
*/
proto.pb.MsgProto.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {number} */ (reader.readUint64());
msg.setSequence(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setSubject(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setReply(value);
break;
case 4:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setData(value);
break;
case 5:
var value = /** @type {number} */ (reader.readInt64());
msg.setTimestamp(value);
break;
case 6:
var value = /** @type {boolean} */ (reader.readBool());
msg.setRedelivered(value);
break;
case 7:
var value = /** @type {number} */ (reader.readUint32());
msg.setRedeliveryCount(value);
break;
case 10:
var value = /** @type {number} */ (reader.readUint32());
msg.setCrc32(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.pb.MsgProto.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.pb.MsgProto.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.pb.MsgProto} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pb.MsgProto.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getSequence();
if (f !== 0) {
writer.writeUint64(
1,
f
);
}
f = message.getSubject();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getReply();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
f = message.getData_asU8();
if (f.length > 0) {
writer.writeBytes(
4,
f
);
}
f = message.getTimestamp();
if (f !== 0) {
writer.writeInt64(
5,
f
);
}
f = message.getRedelivered();
if (f) {
writer.writeBool(
6,
f
);
}
f = message.getRedeliveryCount();
if (f !== 0) {
writer.writeUint32(
7,
f
);
}
f = message.getCrc32();
if (f !== 0) {
writer.writeUint32(
10,
f
);
}
};
/**
* optional uint64 sequence = 1;
* @return {number}
*/
proto.pb.MsgProto.prototype.getSequence = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
};
/**
* @param {number} value
* @return {!proto.pb.MsgProto} returns this
*/
proto.pb.MsgProto.prototype.setSequence = function(value) {
return jspb.Message.setProto3IntField(this, 1, value);
};
/**
* optional string subject = 2;
* @return {string}
*/
proto.pb.MsgProto.prototype.getSubject = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.pb.MsgProto} returns this
*/
proto.pb.MsgProto.prototype.setSubject = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional string reply = 3;
* @return {string}
*/
proto.pb.MsgProto.prototype.getReply = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/**
* @param {string} value
* @return {!proto.pb.MsgProto} returns this
*/
proto.pb.MsgProto.prototype.setReply = function(value) {
return jspb.Message.setProto3StringField(this, 3, value);
};
/**
* optional bytes data = 4;
* @return {!(string|Uint8Array)}
*/
proto.pb.MsgProto.prototype.getData = function() {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
};
/**
* optional bytes data = 4;
* This is a type-conversion wrapper around `getData()`
* @return {string}
*/
proto.pb.MsgProto.prototype.getData_asB64 = function() {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getData()));
};
/**
* optional bytes data = 4;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getData()`
* @return {!Uint8Array}
*/
proto.pb.MsgProto.prototype.getData_asU8 = function() {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getData()));
};
/**
* @param {!(string|Uint8Array)} value
* @return {!proto.pb.MsgProto} returns this
*/
proto.pb.MsgProto.prototype.setData = function(value) {
return jspb.Message.setProto3BytesField(this, 4, value);
};
/**
* optional int64 timestamp = 5;
* @return {number}
*/
proto.pb.MsgProto.prototype.getTimestamp = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0));
};
/**
* @param {number} value
* @return {!proto.pb.MsgProto} returns this
*/
proto.pb.MsgProto.prototype.setTimestamp = function(value) {
return jspb.Message.setProto3IntField(this, 5, value);
};
/**
* optional bool redelivered = 6;
* @return {boolean}
*/
proto.pb.MsgProto.prototype.getRedelivered = function() {
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 6, false));
};
/**
* @param {boolean} value
* @return {!proto.pb.MsgProto} returns this
*/
proto.pb.MsgProto.prototype.setRedelivered = function(value) {
return jspb.Message.setProto3BooleanField(this, 6, value);
};
/**
* optional uint32 redelivery_count = 7;
* @return {number}
*/
proto.pb.MsgProto.prototype.getRedeliveryCount = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0));
};
/**
* @param {number} value
* @return {!proto.pb.MsgProto} returns this
*/
proto.pb.MsgProto.prototype.setRedeliveryCount = function(value) {
return jspb.Message.setProto3IntField(this, 7, value);
};
/**
* optional uint32 CRC32 = 10;
* @return {number}
*/
proto.pb.MsgProto.prototype.getCrc32 = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 0));
};
/**
* @param {number} value
* @return {!proto.pb.MsgProto} returns this
*/
proto.pb.MsgProto.prototype.setCrc32 = function(value) {
return jspb.Message.setProto3IntField(this, 10, value);
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.pb.Ack.prototype.toObject = function(opt_includeInstance) {
return proto.pb.Ack.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.pb.Ack} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pb.Ack.toObject = function(includeInstance, msg) {
var f, obj = {
subject: jspb.Message.getFieldWithDefault(msg, 1, ""),
sequence: jspb.Message.getFieldWithDefault(msg, 2, 0)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.pb.Ack}
*/
proto.pb.Ack.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.pb.Ack;
return proto.pb.Ack.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.pb.Ack} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.pb.Ack}
*/
proto.pb.Ack.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setSubject(value);
break;
case 2:
var value = /** @type {number} */ (reader.readUint64());
msg.setSequence(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.pb.Ack.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.pb.Ack.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.pb.Ack} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pb.Ack.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getSubject();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getSequence();
if (f !== 0) {
writer.writeUint64(
2,
f
);
}
};
/**
* optional string subject = 1;
* @return {string}
*/
proto.pb.Ack.prototype.getSubject = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.pb.Ack} returns this
*/
proto.pb.Ack.prototype.setSubject = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional uint64 sequence = 2;
* @return {number}
*/
proto.pb.Ack.prototype.getSequence = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
};
/**
* @param {number} value
* @return {!proto.pb.Ack} returns this
*/
proto.pb.Ack.prototype.setSequence = function(value) {
return jspb.Message.setProto3IntField(this, 2, value);
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.pb.ConnectRequest.prototype.toObject = function(opt_includeInstance) {
return proto.pb.ConnectRequest.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.pb.ConnectRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pb.ConnectRequest.toObject = function(includeInstance, msg) {
var f, obj = {
clientId: jspb.Message.getFieldWithDefault(msg, 1, ""),
heartbeatInbox: jspb.Message.getFieldWithDefault(msg, 2, ""),
protocol: jspb.Message.getFieldWithDefault(msg, 3, 0),
connId: msg.getConnId_asB64(),
pingInterval: jspb.Message.getFieldWithDefault(msg, 5, 0),
pingMaxOut: jspb.Message.getFieldWithDefault(msg, 6, 0)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.pb.ConnectRequest}
*/
proto.pb.ConnectRequest.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.pb.ConnectRequest;
return proto.pb.ConnectRequest.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.pb.ConnectRequest} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.pb.ConnectRequest}
*/
proto.pb.ConnectRequest.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setClientId(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setHeartbeatInbox(value);
break;
case 3:
var value = /** @type {number} */ (reader.readInt32());
msg.setProtocol(value);
break;
case 4:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setConnId(value);
break;
case 5:
var value = /** @type {number} */ (reader.readInt32());
msg.setPingInterval(value);
break;
case 6:
var value = /** @type {number} */ (reader.readInt32());
msg.setPingMaxOut(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.pb.ConnectRequest.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.pb.ConnectRequest.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.pb.ConnectRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pb.ConnectRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getClientId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getHeartbeatInbox();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getProtocol();
if (f !== 0) {
writer.writeInt32(
3,
f
);
}
f = message.getConnId_asU8();
if (f.length > 0) {
writer.writeBytes(
4,
f
);
}
f = message.getPingInterval();
if (f !== 0) {
writer.writeInt32(
5,
f
);
}
f = message.getPingMaxOut();
if (f !== 0) {
writer.writeInt32(
6,
f
);
}
};
/**
* optional string client_id = 1;
* @return {string}
*/
proto.pb.ConnectRequest.prototype.getClientId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.pb.ConnectRequest} returns this
*/
proto.pb.ConnectRequest.prototype.setClientId = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string heartbeat_inbox = 2;
* @return {string}
*/
proto.pb.ConnectRequest.prototype.getHeartbeatInbox = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.pb.ConnectRequest} returns this
*/
proto.pb.ConnectRequest.prototype.setHeartbeatInbox = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional int32 protocol = 3;
* @return {number}
*/
proto.pb.ConnectRequest.prototype.getProtocol = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
};
/**
* @param {number} value
* @return {!proto.pb.ConnectRequest} returns this
*/
proto.pb.ConnectRequest.prototype.setProtocol = function(value) {
return jspb.Message.setProto3IntField(this, 3, value);
};
/**
* optional bytes conn_id = 4;
* @return {!(string|Uint8Array)}
*/
proto.pb.ConnectRequest.prototype.getConnId = function() {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
};
/**
* optional bytes conn_id = 4;
* This is a type-conversion wrapper around `getConnId()`
* @return {string}
*/
proto.pb.ConnectRequest.prototype.getConnId_asB64 = function() {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getConnId()));
};
/**
* optional bytes conn_id = 4;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getConnId()`
* @return {!Uint8Array}
*/
proto.pb.ConnectRequest.prototype.getConnId_asU8 = function() {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getConnId()));
};
/**
* @param {!(string|Uint8Array)} value
* @return {!proto.pb.ConnectRequest} returns this
*/
proto.pb.ConnectRequest.prototype.setConnId = function(value) {
return jspb.Message.setProto3BytesField(this, 4, value);
};
/**
* optional int32 ping_interval = 5;
* @return {number}
*/
proto.pb.ConnectRequest.prototype.getPingInterval = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0));
};
/**
* @param {number} value
* @return {!proto.pb.ConnectRequest} returns this
*/
proto.pb.ConnectRequest.prototype.setPingInterval = function(value) {
return jspb.Message.setProto3IntField(this, 5, value);
};
/**
* optional int32 ping_max_out = 6;
* @return {number}
*/
proto.pb.ConnectRequest.prototype.getPingMaxOut = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0));
};
/**
* @param {number} value
* @return {!proto.pb.ConnectRequest} returns this
*/
proto.pb.ConnectRequest.prototype.setPingMaxOut = function(value) {
return jspb.Message.setProto3IntField(this, 6, value);
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.pb.ConnectResponse.prototype.toObject = function(opt_includeInstance) {
return proto.pb.ConnectResponse.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.pb.ConnectResponse} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pb.ConnectResponse.toObject = function(includeInstance, msg) {
var f, obj = {
pubPrefix: jspb.Message.getFieldWithDefault(msg, 1, ""),
subRequests: jspb.Message.getFieldWithDefault(msg, 2, ""),
unsubRequests: jspb.Message.getFieldWithDefault(msg, 3, ""),
closeRequests: jspb.Message.getFieldWithDefault(msg, 4, ""),
error: jspb.Message.getFieldWithDefault(msg, 5, ""),
subCloseRequests: jspb.Message.getFieldWithDefault(msg, 6, ""),
pingRequests: jspb.Message.getFieldWithDefault(msg, 7, ""),
pingInterval: jspb.Message.getFieldWithDefault(msg, 8, 0),
pingMaxOut: jspb.Message.getFieldWithDefault(msg, 9, 0),
protocol: jspb.Message.getFieldWithDefault(msg, 10, 0),
publicKey: jspb.Message.getFieldWithDefault(msg, 100, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.pb.ConnectResponse}
*/
proto.pb.ConnectResponse.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.pb.ConnectResponse;
return proto.pb.ConnectResponse.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.pb.ConnectResponse} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.pb.ConnectResponse}
*/
proto.pb.ConnectResponse.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setPubPrefix(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setSubRequests(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setUnsubRequests(value);
break;
case 4:
var value = /** @type {string} */ (reader.readString());
msg.setCloseRequests(value);
break;
case 5:
var value = /** @type {string} */ (reader.readString());
msg.setError(value);
break;
case 6:
var value = /** @type {string} */ (reader.readString());
msg.setSubCloseRequests(value);
break;
case 7:
var value = /** @type {string} */ (reader.readString());
msg.setPingRequests(value);
break;
case 8:
var value = /** @type {number} */ (reader.readInt32());
msg.setPingInterval(value);
break;
case 9:
var value = /** @type {number} */ (reader.readInt32());
msg.setPingMaxOut(value);
break;
case 10:
var value = /** @type {number} */ (reader.readInt32());
msg.setProtocol(value);
break;
case 100:
var value = /** @type {string} */ (reader.readString());
msg.setPublicKey(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.pb.ConnectResponse.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.pb.ConnectResponse.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.pb.ConnectResponse} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pb.ConnectResponse.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getPubPrefix();
if (f.length > 0) {
write