UNPKG

@toitware/api

Version:
351 lines (303 loc) 10.3 kB
// source: toit/api/doctor.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')(); goog.exportSymbol('proto.toit.api.HealthRequest', null, global); goog.exportSymbol('proto.toit.api.HealthResponse', 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.HealthRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.HealthRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.HealthRequest.displayName = 'proto.toit.api.HealthRequest'; } /** * 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.HealthResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.HealthResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.HealthResponse.displayName = 'proto.toit.api.HealthResponse'; } 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.HealthRequest.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.HealthRequest.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.HealthRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.HealthRequest.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.HealthRequest} */ proto.toit.api.HealthRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.HealthRequest; return proto.toit.api.HealthRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.HealthRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.HealthRequest} */ proto.toit.api.HealthRequest.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.HealthRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.api.HealthRequest.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.HealthRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.HealthRequest.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.HealthResponse.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.HealthResponse.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.HealthResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.HealthResponse.toObject = function(includeInstance, msg) { var f, obj = { beaver: jspb.Message.getBooleanFieldWithDefault(msg, 2, false), grass: jspb.Message.getBooleanFieldWithDefault(msg, 3, false), oak: jspb.Message.getBooleanFieldWithDefault(msg, 4, false) }; 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.HealthResponse} */ proto.toit.api.HealthResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.HealthResponse; return proto.toit.api.HealthResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.HealthResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.HealthResponse} */ proto.toit.api.HealthResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 2: var value = /** @type {boolean} */ (reader.readBool()); msg.setBeaver(value); break; case 3: var value = /** @type {boolean} */ (reader.readBool()); msg.setGrass(value); break; case 4: var value = /** @type {boolean} */ (reader.readBool()); msg.setOak(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.toit.api.HealthResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.api.HealthResponse.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.HealthResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.HealthResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getBeaver(); if (f) { writer.writeBool( 2, f ); } f = message.getGrass(); if (f) { writer.writeBool( 3, f ); } f = message.getOak(); if (f) { writer.writeBool( 4, f ); } }; /** * optional bool beaver = 2; * @return {boolean} */ proto.toit.api.HealthResponse.prototype.getBeaver = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); }; /** * @param {boolean} value * @return {!proto.toit.api.HealthResponse} returns this */ proto.toit.api.HealthResponse.prototype.setBeaver = function(value) { return jspb.Message.setProto3BooleanField(this, 2, value); }; /** * optional bool grass = 3; * @return {boolean} */ proto.toit.api.HealthResponse.prototype.getGrass = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); }; /** * @param {boolean} value * @return {!proto.toit.api.HealthResponse} returns this */ proto.toit.api.HealthResponse.prototype.setGrass = function(value) { return jspb.Message.setProto3BooleanField(this, 3, value); }; /** * optional bool oak = 4; * @return {boolean} */ proto.toit.api.HealthResponse.prototype.getOak = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); }; /** * @param {boolean} value * @return {!proto.toit.api.HealthResponse} returns this */ proto.toit.api.HealthResponse.prototype.setOak = function(value) { return jspb.Message.setProto3BooleanField(this, 4, value); }; goog.object.extend(exports, proto.toit.api);