@toitware/api
Version:
Toitware API library
1,497 lines (1,312 loc) • 76.8 kB
JavaScript
// source: toit/api/pubsub/subscribe.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 global = Function('return this')();
var toit_model_pubsub_message_pb = require('../../../toit/model/pubsub/message_pb.js');
goog.object.extend(proto, toit_model_pubsub_message_pb);
goog.exportSymbol('proto.toit.api.pubsub.AcknowledgeRequest', null, global);
goog.exportSymbol('proto.toit.api.pubsub.AcknowledgeResponse', null, global);
goog.exportSymbol('proto.toit.api.pubsub.CreateSubscriptionRequest', null, global);
goog.exportSymbol('proto.toit.api.pubsub.CreateSubscriptionResponse', null, global);
goog.exportSymbol('proto.toit.api.pubsub.DeleteSubscriptionRequest', null, global);
goog.exportSymbol('proto.toit.api.pubsub.DeleteSubscriptionResponse', null, global);
goog.exportSymbol('proto.toit.api.pubsub.FetchRequest', null, global);
goog.exportSymbol('proto.toit.api.pubsub.FetchResponse', null, global);
goog.exportSymbol('proto.toit.api.pubsub.ListSubscriptionsRequest', null, global);
goog.exportSymbol('proto.toit.api.pubsub.ListSubscriptionsResponse', null, global);
goog.exportSymbol('proto.toit.api.pubsub.StreamRequest', null, global);
goog.exportSymbol('proto.toit.api.pubsub.StreamResponse', null, global);
goog.exportSymbol('proto.toit.api.pubsub.Subscription', null, global);
/**
* 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.toit.api.pubsub.Subscription = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.toit.api.pubsub.Subscription, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.toit.api.pubsub.Subscription.displayName = 'proto.toit.api.pubsub.Subscription';
}
/**
* 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.toit.api.pubsub.CreateSubscriptionRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.toit.api.pubsub.CreateSubscriptionRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.toit.api.pubsub.CreateSubscriptionRequest.displayName = 'proto.toit.api.pubsub.CreateSubscriptionRequest';
}
/**
* 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.toit.api.pubsub.CreateSubscriptionResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.toit.api.pubsub.CreateSubscriptionResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.toit.api.pubsub.CreateSubscriptionResponse.displayName = 'proto.toit.api.pubsub.CreateSubscriptionResponse';
}
/**
* 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.toit.api.pubsub.DeleteSubscriptionRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.toit.api.pubsub.DeleteSubscriptionRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.toit.api.pubsub.DeleteSubscriptionRequest.displayName = 'proto.toit.api.pubsub.DeleteSubscriptionRequest';
}
/**
* 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.toit.api.pubsub.DeleteSubscriptionResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.toit.api.pubsub.DeleteSubscriptionResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.toit.api.pubsub.DeleteSubscriptionResponse.displayName = 'proto.toit.api.pubsub.DeleteSubscriptionResponse';
}
/**
* 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.toit.api.pubsub.ListSubscriptionsRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.toit.api.pubsub.ListSubscriptionsRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.toit.api.pubsub.ListSubscriptionsRequest.displayName = 'proto.toit.api.pubsub.ListSubscriptionsRequest';
}
/**
* 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.toit.api.pubsub.ListSubscriptionsResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.toit.api.pubsub.ListSubscriptionsResponse.repeatedFields_, null);
};
goog.inherits(proto.toit.api.pubsub.ListSubscriptionsResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.toit.api.pubsub.ListSubscriptionsResponse.displayName = 'proto.toit.api.pubsub.ListSubscriptionsResponse';
}
/**
* 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.toit.api.pubsub.FetchRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.toit.api.pubsub.FetchRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.toit.api.pubsub.FetchRequest.displayName = 'proto.toit.api.pubsub.FetchRequest';
}
/**
* 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.toit.api.pubsub.FetchResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.toit.api.pubsub.FetchResponse.repeatedFields_, null);
};
goog.inherits(proto.toit.api.pubsub.FetchResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.toit.api.pubsub.FetchResponse.displayName = 'proto.toit.api.pubsub.FetchResponse';
}
/**
* 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.toit.api.pubsub.StreamRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.toit.api.pubsub.StreamRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.toit.api.pubsub.StreamRequest.displayName = 'proto.toit.api.pubsub.StreamRequest';
}
/**
* 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.toit.api.pubsub.StreamResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.toit.api.pubsub.StreamResponse.repeatedFields_, null);
};
goog.inherits(proto.toit.api.pubsub.StreamResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.toit.api.pubsub.StreamResponse.displayName = 'proto.toit.api.pubsub.StreamResponse';
}
/**
* 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.toit.api.pubsub.AcknowledgeRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.toit.api.pubsub.AcknowledgeRequest.repeatedFields_, null);
};
goog.inherits(proto.toit.api.pubsub.AcknowledgeRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.toit.api.pubsub.AcknowledgeRequest.displayName = 'proto.toit.api.pubsub.AcknowledgeRequest';
}
/**
* 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.toit.api.pubsub.AcknowledgeResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.toit.api.pubsub.AcknowledgeResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.toit.api.pubsub.AcknowledgeResponse.displayName = 'proto.toit.api.pubsub.AcknowledgeResponse';
}
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.toit.api.pubsub.Subscription.prototype.toObject = function(opt_includeInstance) {
return proto.toit.api.pubsub.Subscription.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.toit.api.pubsub.Subscription} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.toit.api.pubsub.Subscription.toObject = function(includeInstance, msg) {
var f, obj = {
topic: jspb.Message.getFieldWithDefault(msg, 1, ""),
name: 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.toit.api.pubsub.Subscription}
*/
proto.toit.api.pubsub.Subscription.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.toit.api.pubsub.Subscription;
return proto.toit.api.pubsub.Subscription.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.toit.api.pubsub.Subscription} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.toit.api.pubsub.Subscription}
*/
proto.toit.api.pubsub.Subscription.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.setTopic(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setName(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.toit.api.pubsub.Subscription.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.toit.api.pubsub.Subscription.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.toit.api.pubsub.Subscription} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.toit.api.pubsub.Subscription.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getTopic();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getName();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
};
/**
* optional string topic = 1;
* @return {string}
*/
proto.toit.api.pubsub.Subscription.prototype.getTopic = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.toit.api.pubsub.Subscription} returns this
*/
proto.toit.api.pubsub.Subscription.prototype.setTopic = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string name = 2;
* @return {string}
*/
proto.toit.api.pubsub.Subscription.prototype.getName = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.toit.api.pubsub.Subscription} returns this
*/
proto.toit.api.pubsub.Subscription.prototype.setName = 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.toit.api.pubsub.CreateSubscriptionRequest.prototype.toObject = function(opt_includeInstance) {
return proto.toit.api.pubsub.CreateSubscriptionRequest.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.toit.api.pubsub.CreateSubscriptionRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.toit.api.pubsub.CreateSubscriptionRequest.toObject = function(includeInstance, msg) {
var f, obj = {
subscription: (f = msg.getSubscription()) && proto.toit.api.pubsub.Subscription.toObject(includeInstance, f)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.toit.api.pubsub.CreateSubscriptionRequest}
*/
proto.toit.api.pubsub.CreateSubscriptionRequest.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.toit.api.pubsub.CreateSubscriptionRequest;
return proto.toit.api.pubsub.CreateSubscriptionRequest.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.toit.api.pubsub.CreateSubscriptionRequest} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.toit.api.pubsub.CreateSubscriptionRequest}
*/
proto.toit.api.pubsub.CreateSubscriptionRequest.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new proto.toit.api.pubsub.Subscription;
reader.readMessage(value,proto.toit.api.pubsub.Subscription.deserializeBinaryFromReader);
msg.setSubscription(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.toit.api.pubsub.CreateSubscriptionRequest.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.toit.api.pubsub.CreateSubscriptionRequest.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.toit.api.pubsub.CreateSubscriptionRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.toit.api.pubsub.CreateSubscriptionRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getSubscription();
if (f != null) {
writer.writeMessage(
1,
f,
proto.toit.api.pubsub.Subscription.serializeBinaryToWriter
);
}
};
/**
* optional Subscription subscription = 1;
* @return {?proto.toit.api.pubsub.Subscription}
*/
proto.toit.api.pubsub.CreateSubscriptionRequest.prototype.getSubscription = function() {
return /** @type{?proto.toit.api.pubsub.Subscription} */ (
jspb.Message.getWrapperField(this, proto.toit.api.pubsub.Subscription, 1));
};
/**
* @param {?proto.toit.api.pubsub.Subscription|undefined} value
* @return {!proto.toit.api.pubsub.CreateSubscriptionRequest} returns this
*/
proto.toit.api.pubsub.CreateSubscriptionRequest.prototype.setSubscription = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.toit.api.pubsub.CreateSubscriptionRequest} returns this
*/
proto.toit.api.pubsub.CreateSubscriptionRequest.prototype.clearSubscription = function() {
return this.setSubscription(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.toit.api.pubsub.CreateSubscriptionRequest.prototype.hasSubscription = function() {
return jspb.Message.getField(this, 1) != null;
};
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.toit.api.pubsub.CreateSubscriptionResponse.prototype.toObject = function(opt_includeInstance) {
return proto.toit.api.pubsub.CreateSubscriptionResponse.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.toit.api.pubsub.CreateSubscriptionResponse} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.toit.api.pubsub.CreateSubscriptionResponse.toObject = function(includeInstance, msg) {
var f, obj = {
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.toit.api.pubsub.CreateSubscriptionResponse}
*/
proto.toit.api.pubsub.CreateSubscriptionResponse.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.toit.api.pubsub.CreateSubscriptionResponse;
return proto.toit.api.pubsub.CreateSubscriptionResponse.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.toit.api.pubsub.CreateSubscriptionResponse} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.toit.api.pubsub.CreateSubscriptionResponse}
*/
proto.toit.api.pubsub.CreateSubscriptionResponse.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.toit.api.pubsub.CreateSubscriptionResponse.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.toit.api.pubsub.CreateSubscriptionResponse.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.toit.api.pubsub.CreateSubscriptionResponse} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.toit.api.pubsub.CreateSubscriptionResponse.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
};
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.toit.api.pubsub.DeleteSubscriptionRequest.prototype.toObject = function(opt_includeInstance) {
return proto.toit.api.pubsub.DeleteSubscriptionRequest.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.toit.api.pubsub.DeleteSubscriptionRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.toit.api.pubsub.DeleteSubscriptionRequest.toObject = function(includeInstance, msg) {
var f, obj = {
subscription: (f = msg.getSubscription()) && proto.toit.api.pubsub.Subscription.toObject(includeInstance, f)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.toit.api.pubsub.DeleteSubscriptionRequest}
*/
proto.toit.api.pubsub.DeleteSubscriptionRequest.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.toit.api.pubsub.DeleteSubscriptionRequest;
return proto.toit.api.pubsub.DeleteSubscriptionRequest.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.toit.api.pubsub.DeleteSubscriptionRequest} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.toit.api.pubsub.DeleteSubscriptionRequest}
*/
proto.toit.api.pubsub.DeleteSubscriptionRequest.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new proto.toit.api.pubsub.Subscription;
reader.readMessage(value,proto.toit.api.pubsub.Subscription.deserializeBinaryFromReader);
msg.setSubscription(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.toit.api.pubsub.DeleteSubscriptionRequest.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.toit.api.pubsub.DeleteSubscriptionRequest.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.toit.api.pubsub.DeleteSubscriptionRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.toit.api.pubsub.DeleteSubscriptionRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getSubscription();
if (f != null) {
writer.writeMessage(
1,
f,
proto.toit.api.pubsub.Subscription.serializeBinaryToWriter
);
}
};
/**
* optional Subscription subscription = 1;
* @return {?proto.toit.api.pubsub.Subscription}
*/
proto.toit.api.pubsub.DeleteSubscriptionRequest.prototype.getSubscription = function() {
return /** @type{?proto.toit.api.pubsub.Subscription} */ (
jspb.Message.getWrapperField(this, proto.toit.api.pubsub.Subscription, 1));
};
/**
* @param {?proto.toit.api.pubsub.Subscription|undefined} value
* @return {!proto.toit.api.pubsub.DeleteSubscriptionRequest} returns this
*/
proto.toit.api.pubsub.DeleteSubscriptionRequest.prototype.setSubscription = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.toit.api.pubsub.DeleteSubscriptionRequest} returns this
*/
proto.toit.api.pubsub.DeleteSubscriptionRequest.prototype.clearSubscription = function() {
return this.setSubscription(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.toit.api.pubsub.DeleteSubscriptionRequest.prototype.hasSubscription = function() {
return jspb.Message.getField(this, 1) != null;
};
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.toit.api.pubsub.DeleteSubscriptionResponse.prototype.toObject = function(opt_includeInstance) {
return proto.toit.api.pubsub.DeleteSubscriptionResponse.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.toit.api.pubsub.DeleteSubscriptionResponse} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.toit.api.pubsub.DeleteSubscriptionResponse.toObject = function(includeInstance, msg) {
var f, obj = {
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.toit.api.pubsub.DeleteSubscriptionResponse}
*/
proto.toit.api.pubsub.DeleteSubscriptionResponse.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.toit.api.pubsub.DeleteSubscriptionResponse;
return proto.toit.api.pubsub.DeleteSubscriptionResponse.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.toit.api.pubsub.DeleteSubscriptionResponse} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.toit.api.pubsub.DeleteSubscriptionResponse}
*/
proto.toit.api.pubsub.DeleteSubscriptionResponse.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.toit.api.pubsub.DeleteSubscriptionResponse.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.toit.api.pubsub.DeleteSubscriptionResponse.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.toit.api.pubsub.DeleteSubscriptionResponse} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.toit.api.pubsub.DeleteSubscriptionResponse.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
};
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.toit.api.pubsub.ListSubscriptionsRequest.prototype.toObject = function(opt_includeInstance) {
return proto.toit.api.pubsub.ListSubscriptionsRequest.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.toit.api.pubsub.ListSubscriptionsRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.toit.api.pubsub.ListSubscriptionsRequest.toObject = function(includeInstance, msg) {
var f, obj = {
topic: jspb.Message.getFieldWithDefault(msg, 1, ""),
offset: msg.getOffset_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.toit.api.pubsub.ListSubscriptionsRequest}
*/
proto.toit.api.pubsub.ListSubscriptionsRequest.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.toit.api.pubsub.ListSubscriptionsRequest;
return proto.toit.api.pubsub.ListSubscriptionsRequest.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.toit.api.pubsub.ListSubscriptionsRequest} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.toit.api.pubsub.ListSubscriptionsRequest}
*/
proto.toit.api.pubsub.ListSubscriptionsRequest.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.setTopic(value);
break;
case 3:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setOffset(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.toit.api.pubsub.ListSubscriptionsRequest.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.toit.api.pubsub.ListSubscriptionsRequest.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.toit.api.pubsub.ListSubscriptionsRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.toit.api.pubsub.ListSubscriptionsRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getTopic();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getOffset_asU8();
if (f.length > 0) {
writer.writeBytes(
3,
f
);
}
};
/**
* optional string topic = 1;
* @return {string}
*/
proto.toit.api.pubsub.ListSubscriptionsRequest.prototype.getTopic = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.toit.api.pubsub.ListSubscriptionsRequest} returns this
*/
proto.toit.api.pubsub.ListSubscriptionsRequest.prototype.setTopic = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional bytes offset = 3;
* @return {!(string|Uint8Array)}
*/
proto.toit.api.pubsub.ListSubscriptionsRequest.prototype.getOffset = function() {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/**
* optional bytes offset = 3;
* This is a type-conversion wrapper around `getOffset()`
* @return {string}
*/
proto.toit.api.pubsub.ListSubscriptionsRequest.prototype.getOffset_asB64 = function() {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getOffset()));
};
/**
* optional bytes offset = 3;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getOffset()`
* @return {!Uint8Array}
*/
proto.toit.api.pubsub.ListSubscriptionsRequest.prototype.getOffset_asU8 = function() {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getOffset()));
};
/**
* @param {!(string|Uint8Array)} value
* @return {!proto.toit.api.pubsub.ListSubscriptionsRequest} returns this
*/
proto.toit.api.pubsub.ListSubscriptionsRequest.prototype.setOffset = function(value) {
return jspb.Message.setProto3BytesField(this, 3, value);
};
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.toit.api.pubsub.ListSubscriptionsResponse.repeatedFields_ = [1];
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.toit.api.pubsub.ListSubscriptionsResponse.prototype.toObject = function(opt_includeInstance) {
return proto.toit.api.pubsub.ListSubscriptionsResponse.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.toit.api.pubsub.ListSubscriptionsResponse} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.toit.api.pubsub.ListSubscriptionsResponse.toObject = function(includeInstance, msg) {
var f, obj = {
subscriptionsList: jspb.Message.toObjectList(msg.getSubscriptionsList(),
proto.toit.api.pubsub.Subscription.toObject, includeInstance),
nextOffset: msg.getNextOffset_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.toit.api.pubsub.ListSubscriptionsResponse}
*/
proto.toit.api.pubsub.ListSubscriptionsResponse.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.toit.api.pubsub.ListSubscriptionsResponse;
return proto.toit.api.pubsub.ListSubscriptionsResponse.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.toit.api.pubsub.ListSubscriptionsResponse} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.toit.api.pubsub.ListSubscriptionsResponse}
*/
proto.toit.api.pubsub.ListSubscriptionsResponse.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new proto.toit.api.pubsub.Subscription;
reader.readMessage(value,proto.toit.api.pubsub.Subscription.deserializeBinaryFromReader);
msg.addSubscriptions(value);
break;
case 2:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setNextOffset(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.toit.api.pubsub.ListSubscriptionsResponse.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.toit.api.pubsub.ListSubscriptionsResponse.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.toit.api.pubsub.ListSubscriptionsResponse} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.toit.api.pubsub.ListSubscriptionsResponse.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getSubscriptionsList();
if (f.length > 0) {
writer.writeRepeatedMessage(
1,
f,
proto.toit.api.pubsub.Subscription.serializeBinaryToWriter
);
}
f = message.getNextOffset_asU8();
if (f.length > 0) {
writer.writeBytes(
2,
f
);
}
};
/**
* repeated Subscription subscriptions = 1;
* @return {!Array<!proto.toit.api.pubsub.Subscription>}
*/
proto.toit.api.pubsub.ListSubscriptionsResponse.prototype.getSubscriptionsList = function() {
return /** @type{!Array<!proto.toit.api.pubsub.Subscription>} */ (
jspb.Message.getRepeatedWrapperField(this, proto.toit.api.pubsub.Subscription, 1));
};
/**
* @param {!Array<!proto.toit.api.pubsub.Subscription>} value
* @return {!proto.toit.api.pubsub.ListSubscriptionsResponse} returns this
*/
proto.toit.api.pubsub.ListSubscriptionsResponse.prototype.setSubscriptionsList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 1, value);
};
/**
* @param {!proto.toit.api.pubsub.Subscription=} opt_value
* @param {number=} opt_index
* @return {!proto.toit.api.pubsub.Subscription}
*/
proto.toit.api.pubsub.ListSubscriptionsResponse.prototype.addSubscriptions = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.toit.api.pubsub.Subscription, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.toit.api.pubsub.ListSubscriptionsResponse} returns this
*/
proto.toit.api.pubsub.ListSubscriptionsResponse.prototype.clearSubscriptionsList = function() {
return this.setSubscriptionsList([]);
};
/**
* optional bytes next_offset = 2;
* @return {!(string|Uint8Array)}
*/
proto.toit.api.pubsub.ListSubscriptionsResponse.prototype.getNextOffset = function() {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* optional bytes next_offset = 2;
* This is a type-conversion wrapper around `getNextOffset()`
* @return {string}
*/
proto.toit.api.pubsub.ListSubscriptionsResponse.prototype.getNextOffset_asB64 = function() {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getNextOffset()));
};
/**
* optional bytes next_offset = 2;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getNextOffset()`
* @return {!Uint8Array}
*/
proto.toit.api.pubsub.ListSubscriptionsResponse.prototype.getNextOffset_asU8 = function() {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getNextOffset()));
};
/**
* @param {!(string|Uint8Array)} value
* @return {!proto.toit.api.pubsub.ListSubscriptionsResponse} returns this
*/
proto.toit.api.pubsub.ListSubscriptionsResponse.prototype.setNextOffset = function(value) {
return jspb.Message.setProto3BytesField(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.toit.api.pubsub.FetchRequest.prototype.toObject = function(opt_includeInstance) {
return proto.toit.api.pubsub.FetchRequest.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.toit.api.pubsub.FetchRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.toit.api.pubsub.FetchRequest.toObject = function(includeInstance, msg) {
var f, obj = {
subscription: (f = msg.getSubscription()) && proto.toit.api.pubsub.Subscription.toObject(includeInstance, f),
limit: 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.toit.api.pubsub.FetchRequest}
*/
proto.toit.api.pubsub.FetchRequest.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.toit.api.pubsub.FetchRequest;
return proto.toit.api.pubsub.FetchRequest.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.toit.api.pubsub.FetchRequest} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.toit.api.pubsub.FetchRequest}
*/
proto.toit.api.pubsub.FetchRequest.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new proto.toit.api.pubsub.Subscription;
reader.readMessage(value,proto.toit.api.pubsub.Subscription.deserializeBinaryFromReader);
msg.setSubscription(value);
break;
case 2:
var value = /** @type {number} */ (reader.readInt32());
msg.setLimit(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.toit.api.pubsub.FetchRequest.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.toit.api.pubsub.FetchRequest.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.toit.api.pubsub.FetchRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.toit.api.pubsub.FetchRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getSubscription();
if (f != null) {
writer.writeMessage(
1,
f,
proto.toit.api.pubsub.Subscription.serializeBinaryToWriter
);
}
f = message.getLimit();
if (f !== 0) {
writer.writeInt32(
2,
f
);
}
};
/**
* optional Subscription subscription = 1;
* @return {?proto.toit.api.pubsub.Subscription}
*/
proto.toit.api.pubsub.FetchRequest.prototype.getSubscription = function() {
return /** @type{?proto.toit.api.pubsub.Subscription} */ (
jspb.Message.getWrapperField(this, proto.toi