UNPKG

@toitware/api

Version:
1,568 lines (1,377 loc) 94.3 kB
// source: toit/api/data.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 google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js'); goog.object.extend(proto, google_protobuf_timestamp_pb); goog.exportSymbol('proto.toit.api.AcknowledgeRequest', null, global); goog.exportSymbol('proto.toit.api.AcknowledgeResponse', null, global); goog.exportSymbol('proto.toit.api.CreateSubscriptionRequest', null, global); goog.exportSymbol('proto.toit.api.CreateSubscriptionResponse', null, global); goog.exportSymbol('proto.toit.api.Data', null, global); goog.exportSymbol('proto.toit.api.DataType', null, global); goog.exportSymbol('proto.toit.api.DeleteSubscriptionRequest', null, global); goog.exportSymbol('proto.toit.api.DeleteSubscriptionResponse', null, global); goog.exportSymbol('proto.toit.api.FetchRequest', null, global); goog.exportSymbol('proto.toit.api.FetchResponse', null, global); goog.exportSymbol('proto.toit.api.ListSubscriptionsRequest', null, global); goog.exportSymbol('proto.toit.api.ListSubscriptionsResponse', null, global); goog.exportSymbol('proto.toit.api.Message', null, global); goog.exportSymbol('proto.toit.api.StreamRequest', null, global); goog.exportSymbol('proto.toit.api.StreamResponse', null, global); goog.exportSymbol('proto.toit.api.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.Subscription = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.Subscription, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.Subscription.displayName = 'proto.toit.api.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.Message = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.Message, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.Message.displayName = 'proto.toit.api.Message'; } /** * 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.CreateSubscriptionRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.CreateSubscriptionRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.CreateSubscriptionRequest.displayName = 'proto.toit.api.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.CreateSubscriptionResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.CreateSubscriptionResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.CreateSubscriptionResponse.displayName = 'proto.toit.api.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.DeleteSubscriptionRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.DeleteSubscriptionRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.DeleteSubscriptionRequest.displayName = 'proto.toit.api.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.DeleteSubscriptionResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.DeleteSubscriptionResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.DeleteSubscriptionResponse.displayName = 'proto.toit.api.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.ListSubscriptionsRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.ListSubscriptionsRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.ListSubscriptionsRequest.displayName = 'proto.toit.api.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.ListSubscriptionsResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.toit.api.ListSubscriptionsResponse.repeatedFields_, null); }; goog.inherits(proto.toit.api.ListSubscriptionsResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.ListSubscriptionsResponse.displayName = 'proto.toit.api.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.FetchRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.FetchRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.FetchRequest.displayName = 'proto.toit.api.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.FetchResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.toit.api.FetchResponse.repeatedFields_, null); }; goog.inherits(proto.toit.api.FetchResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.FetchResponse.displayName = 'proto.toit.api.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.StreamRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.StreamRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.StreamRequest.displayName = 'proto.toit.api.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.StreamResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.toit.api.StreamResponse.repeatedFields_, null); }; goog.inherits(proto.toit.api.StreamResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.StreamResponse.displayName = 'proto.toit.api.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.AcknowledgeRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.toit.api.AcknowledgeRequest.repeatedFields_, null); }; goog.inherits(proto.toit.api.AcknowledgeRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.AcknowledgeRequest.displayName = 'proto.toit.api.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.AcknowledgeResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.AcknowledgeResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.AcknowledgeResponse.displayName = 'proto.toit.api.AcknowledgeResponse'; } /** * 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.Data = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.Data, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.Data.displayName = 'proto.toit.api.Data'; } 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.Subscription.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.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.Subscription} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.Subscription.toObject = function(includeInstance, msg) { var f, obj = { type: jspb.Message.getFieldWithDefault(msg, 1, 0), 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.Subscription} */ proto.toit.api.Subscription.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.Subscription; return proto.toit.api.Subscription.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.Subscription} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.Subscription} */ proto.toit.api.Subscription.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {!proto.toit.api.DataType} */ (reader.readEnum()); msg.setType(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.Subscription.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.api.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.Subscription} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.Subscription.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getType(); if (f !== 0.0) { writer.writeEnum( 1, f ); } f = message.getName(); if (f.length > 0) { writer.writeString( 2, f ); } }; /** * optional DataType type = 1; * @return {!proto.toit.api.DataType} */ proto.toit.api.Subscription.prototype.getType = function() { return /** @type {!proto.toit.api.DataType} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; /** * @param {!proto.toit.api.DataType} value * @return {!proto.toit.api.Subscription} returns this */ proto.toit.api.Subscription.prototype.setType = function(value) { return jspb.Message.setProto3EnumField(this, 1, value); }; /** * optional string name = 2; * @return {string} */ proto.toit.api.Subscription.prototype.getName = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value * @return {!proto.toit.api.Subscription} returns this */ proto.toit.api.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.Message.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.Message.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.Message} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.Message.toObject = function(includeInstance, msg) { var f, obj = { id: msg.getId_asB64(), message: (f = msg.getMessage()) && proto.toit.api.Data.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.Message} */ proto.toit.api.Message.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.Message; return proto.toit.api.Message.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.Message} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.Message} */ proto.toit.api.Message.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setId(value); break; case 2: var value = new proto.toit.api.Data; reader.readMessage(value,proto.toit.api.Data.deserializeBinaryFromReader); msg.setMessage(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.toit.api.Message.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.api.Message.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.Message} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.Message.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getId_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getMessage(); if (f != null) { writer.writeMessage( 2, f, proto.toit.api.Data.serializeBinaryToWriter ); } }; /** * optional bytes id = 1; * @return {!(string|Uint8Array)} */ proto.toit.api.Message.prototype.getId = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes id = 1; * This is a type-conversion wrapper around `getId()` * @return {string} */ proto.toit.api.Message.prototype.getId_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getId())); }; /** * optional bytes id = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getId()` * @return {!Uint8Array} */ proto.toit.api.Message.prototype.getId_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getId())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.toit.api.Message} returns this */ proto.toit.api.Message.prototype.setId = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional Data message = 2; * @return {?proto.toit.api.Data} */ proto.toit.api.Message.prototype.getMessage = function() { return /** @type{?proto.toit.api.Data} */ ( jspb.Message.getWrapperField(this, proto.toit.api.Data, 2)); }; /** * @param {?proto.toit.api.Data|undefined} value * @return {!proto.toit.api.Message} returns this */ proto.toit.api.Message.prototype.setMessage = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. * @return {!proto.toit.api.Message} returns this */ proto.toit.api.Message.prototype.clearMessage = function() { return this.setMessage(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.toit.api.Message.prototype.hasMessage = function() { return jspb.Message.getField(this, 2) != 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.CreateSubscriptionRequest.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.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.CreateSubscriptionRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.CreateSubscriptionRequest.toObject = function(includeInstance, msg) { var f, obj = { subscription: (f = msg.getSubscription()) && proto.toit.api.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.CreateSubscriptionRequest} */ proto.toit.api.CreateSubscriptionRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.CreateSubscriptionRequest; return proto.toit.api.CreateSubscriptionRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.CreateSubscriptionRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.CreateSubscriptionRequest} */ proto.toit.api.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.Subscription; reader.readMessage(value,proto.toit.api.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.CreateSubscriptionRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.api.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.CreateSubscriptionRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.CreateSubscriptionRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getSubscription(); if (f != null) { writer.writeMessage( 1, f, proto.toit.api.Subscription.serializeBinaryToWriter ); } }; /** * optional Subscription subscription = 1; * @return {?proto.toit.api.Subscription} */ proto.toit.api.CreateSubscriptionRequest.prototype.getSubscription = function() { return /** @type{?proto.toit.api.Subscription} */ ( jspb.Message.getWrapperField(this, proto.toit.api.Subscription, 1)); }; /** * @param {?proto.toit.api.Subscription|undefined} value * @return {!proto.toit.api.CreateSubscriptionRequest} returns this */ proto.toit.api.CreateSubscriptionRequest.prototype.setSubscription = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.toit.api.CreateSubscriptionRequest} returns this */ proto.toit.api.CreateSubscriptionRequest.prototype.clearSubscription = function() { return this.setSubscription(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.toit.api.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.CreateSubscriptionResponse.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.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.CreateSubscriptionResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.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.CreateSubscriptionResponse} */ proto.toit.api.CreateSubscriptionResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.CreateSubscriptionResponse; return proto.toit.api.CreateSubscriptionResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.CreateSubscriptionResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.CreateSubscriptionResponse} */ proto.toit.api.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.CreateSubscriptionResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.api.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.CreateSubscriptionResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.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.DeleteSubscriptionRequest.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.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.DeleteSubscriptionRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.DeleteSubscriptionRequest.toObject = function(includeInstance, msg) { var f, obj = { subscription: (f = msg.getSubscription()) && proto.toit.api.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.DeleteSubscriptionRequest} */ proto.toit.api.DeleteSubscriptionRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.DeleteSubscriptionRequest; return proto.toit.api.DeleteSubscriptionRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.DeleteSubscriptionRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.DeleteSubscriptionRequest} */ proto.toit.api.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.Subscription; reader.readMessage(value,proto.toit.api.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.DeleteSubscriptionRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.api.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.DeleteSubscriptionRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.DeleteSubscriptionRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getSubscription(); if (f != null) { writer.writeMessage( 1, f, proto.toit.api.Subscription.serializeBinaryToWriter ); } }; /** * optional Subscription subscription = 1; * @return {?proto.toit.api.Subscription} */ proto.toit.api.DeleteSubscriptionRequest.prototype.getSubscription = function() { return /** @type{?proto.toit.api.Subscription} */ ( jspb.Message.getWrapperField(this, proto.toit.api.Subscription, 1)); }; /** * @param {?proto.toit.api.Subscription|undefined} value * @return {!proto.toit.api.DeleteSubscriptionRequest} returns this */ proto.toit.api.DeleteSubscriptionRequest.prototype.setSubscription = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.toit.api.DeleteSubscriptionRequest} returns this */ proto.toit.api.DeleteSubscriptionRequest.prototype.clearSubscription = function() { return this.setSubscription(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.toit.api.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.DeleteSubscriptionResponse.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.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.DeleteSubscriptionResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.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.DeleteSubscriptionResponse} */ proto.toit.api.DeleteSubscriptionResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.DeleteSubscriptionResponse; return proto.toit.api.DeleteSubscriptionResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.DeleteSubscriptionResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.DeleteSubscriptionResponse} */ proto.toit.api.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.DeleteSubscriptionResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.api.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.DeleteSubscriptionResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.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.ListSubscriptionsRequest.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.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.ListSubscriptionsRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.ListSubscriptionsRequest.toObject = function(includeInstance, msg) { var f, obj = { type: jspb.Message.getFieldWithDefault(msg, 1, 0), 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.ListSubscriptionsRequest} */ proto.toit.api.ListSubscriptionsRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.ListSubscriptionsRequest; return proto.toit.api.ListSubscriptionsRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.ListSubscriptionsRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.ListSubscriptionsRequest} */ proto.toit.api.ListSubscriptionsRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {!proto.toit.api.DataType} */ (reader.readEnum()); msg.setType(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.ListSubscriptionsRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.api.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.ListSubscriptionsRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.ListSubscriptionsRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getType(); if (f !== 0.0) { writer.writeEnum( 1, f ); } f = message.getOffset_asU8(); if (f.length > 0) { writer.writeBytes( 3, f ); } }; /** * optional DataType type = 1; * @return {!proto.toit.api.DataType} */ proto.toit.api.ListSubscriptionsRequest.prototype.getType = function() { return /** @type {!proto.toit.api.DataType} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; /** * @param {!proto.toit.api.DataType} value * @return {!proto.toit.api.ListSubscriptionsRequest} returns this */ proto.toit.api.ListSubscriptionsRequest.prototype.setType = function(value) { return jspb.Message.setProto3EnumField(this, 1, value); }; /** * optional bytes offset = 3; * @return {!(string|Uint8Array)} */ proto.toit.api.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.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.ListSubscriptionsRequest.prototype.getOffset_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getOffset())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.toit.api.ListSubscriptionsRequest} returns this */ proto.toit.api.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.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.ListSubscriptionsResponse.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.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.ListSubscriptionsResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.ListSubscriptionsResponse.toObject = function(includeInstance, msg) { var f, obj = { subscriptionsList: jspb.Message.toObjectList(msg.getSubscriptionsList(), proto.toit.api.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.ListSubscriptionsResponse} */ proto.toit.api.ListSubscriptionsResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.ListSubscriptionsResponse; return proto.toit.api.ListSubscriptionsResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.ListSubscriptionsResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.ListSubscriptionsResponse} */ proto.toit.api.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.Subscription; reader.readMessage(value,proto.toit.api.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.ListSubscriptionsResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.api.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.ListSubscriptionsResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.ListSubscriptionsResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getSubscriptionsList(); if (f.length > 0) { writer.writeRepeatedMessage( 1, f, proto.toit.api.Subscription.serializeBinaryToWriter ); } f = message.getNextOffset_asU8(); if (f.length > 0) { writer.writeBytes( 2, f ); } }; /** * repeated Subscription subscriptions = 1; * @return {!Array<!proto.toit.api.Subscription>} */ proto.toit.api.ListSubscriptionsResponse.prototype.getSubscriptionsList = function() { return /** @type{!Array<!proto.toit.api.Subscription>} */ ( jspb.Message.getRepeatedWrapperField(this, proto.toit.api.Subscription, 1)); }; /** * @param {!Array<!proto.toit.api.Subscription>} value * @return {!proto.toit.api.ListSubscriptionsResponse} returns this */ proto.toit.api.ListSubscriptionsResponse.prototype.setSubscriptionsList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 1, value); }; /** * @param {!proto.toit.api.Subscription=} opt_value * @param {number=} opt_index * @return {!proto.toit.api.Subscription} */ proto.toit.api.ListSubscriptionsResponse.prototype.addSubscriptions = function(opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.toit.api.Subscription, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.toit.api.ListSubscriptionsResponse} returns this */ proto.toit.api.Lis