UNPKG

@toitware/api

Version:
1,603 lines (1,405 loc) 108 kB
// source: toit/api/hardware.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_device_pb = require('../../toit/model/device_pb.js'); goog.object.extend(proto, toit_model_device_pb); var toit_model_data_pb = require('../../toit/model/data_pb.js'); goog.object.extend(proto, toit_model_data_pb); var toit_model_pubsub_message_pb = require('../../toit/model/pubsub/message_pb.js'); goog.object.extend(proto, toit_model_pubsub_message_pb); 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.ClaimHardwareIdentityRequest', null, global); goog.exportSymbol('proto.toit.api.ClaimHardwareIdentityResponse', null, global); goog.exportSymbol('proto.toit.api.ClaimRequest', null, global); goog.exportSymbol('proto.toit.api.ClaimResponse', null, global); goog.exportSymbol('proto.toit.api.GetActiveDeviceIDRequest', null, global); goog.exportSymbol('proto.toit.api.GetActiveDeviceIDResponse', null, global); goog.exportSymbol('proto.toit.api.HardwareEvent', null, global); goog.exportSymbol('proto.toit.api.HardwareEvent.DataCase', null, global); goog.exportSymbol('proto.toit.api.HardwareEvent.Type', null, global); goog.exportSymbol('proto.toit.api.HardwareEventsRequest', null, global); goog.exportSymbol('proto.toit.api.HardwareEventsRequest.OffsetCase', null, global); goog.exportSymbol('proto.toit.api.HardwareEventsResponse', null, global); goog.exportSymbol('proto.toit.api.ReplaceRequest', null, global); goog.exportSymbol('proto.toit.api.ReplaceResponse', null, global); goog.exportSymbol('proto.toit.api.SetHardwareIdentityInfoRequest', null, global); goog.exportSymbol('proto.toit.api.SetHardwareIdentityInfoResponse', 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.ClaimRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.ClaimRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.ClaimRequest.displayName = 'proto.toit.api.ClaimRequest'; } /** * 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.ClaimResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.ClaimResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.ClaimResponse.displayName = 'proto.toit.api.ClaimResponse'; } /** * 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.ReplaceRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.ReplaceRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.ReplaceRequest.displayName = 'proto.toit.api.ReplaceRequest'; } /** * 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.ReplaceResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.ReplaceResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.ReplaceResponse.displayName = 'proto.toit.api.ReplaceResponse'; } /** * 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.GetActiveDeviceIDRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.GetActiveDeviceIDRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.GetActiveDeviceIDRequest.displayName = 'proto.toit.api.GetActiveDeviceIDRequest'; } /** * 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.GetActiveDeviceIDResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.GetActiveDeviceIDResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.GetActiveDeviceIDResponse.displayName = 'proto.toit.api.GetActiveDeviceIDResponse'; } /** * 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.HardwareEvent = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, proto.toit.api.HardwareEvent.oneofGroups_); }; goog.inherits(proto.toit.api.HardwareEvent, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.HardwareEvent.displayName = 'proto.toit.api.HardwareEvent'; } /** * 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.HardwareEventsRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, proto.toit.api.HardwareEventsRequest.oneofGroups_); }; goog.inherits(proto.toit.api.HardwareEventsRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.HardwareEventsRequest.displayName = 'proto.toit.api.HardwareEventsRequest'; } /** * 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.HardwareEventsResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.HardwareEventsResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.HardwareEventsResponse.displayName = 'proto.toit.api.HardwareEventsResponse'; } /** * 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.ClaimHardwareIdentityRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.ClaimHardwareIdentityRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.ClaimHardwareIdentityRequest.displayName = 'proto.toit.api.ClaimHardwareIdentityRequest'; } /** * 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.ClaimHardwareIdentityResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.ClaimHardwareIdentityResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.ClaimHardwareIdentityResponse.displayName = 'proto.toit.api.ClaimHardwareIdentityResponse'; } /** * 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.SetHardwareIdentityInfoRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.SetHardwareIdentityInfoRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.SetHardwareIdentityInfoRequest.displayName = 'proto.toit.api.SetHardwareIdentityInfoRequest'; } /** * 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.SetHardwareIdentityInfoResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.toit.api.SetHardwareIdentityInfoResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.toit.api.SetHardwareIdentityInfoResponse.displayName = 'proto.toit.api.SetHardwareIdentityInfoResponse'; } 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.ClaimRequest.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.ClaimRequest.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.ClaimRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.ClaimRequest.toObject = function(includeInstance, msg) { var f, obj = { hardwareId: msg.getHardwareId_asB64(), initDeviceName: jspb.Message.getFieldWithDefault(msg, 2, ""), organizationId: msg.getOrganizationId_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.ClaimRequest} */ proto.toit.api.ClaimRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.ClaimRequest; return proto.toit.api.ClaimRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.ClaimRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.ClaimRequest} */ proto.toit.api.ClaimRequest.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.setHardwareId(value); break; case 2: var value = /** @type {string} */ (reader.readString()); msg.setInitDeviceName(value); break; case 3: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setOrganizationId(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.toit.api.ClaimRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.api.ClaimRequest.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.ClaimRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.ClaimRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getHardwareId_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getInitDeviceName(); if (f.length > 0) { writer.writeString( 2, f ); } f = message.getOrganizationId_asU8(); if (f.length > 0) { writer.writeBytes( 3, f ); } }; /** * optional bytes hardware_id = 1; * @return {!(string|Uint8Array)} */ proto.toit.api.ClaimRequest.prototype.getHardwareId = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes hardware_id = 1; * This is a type-conversion wrapper around `getHardwareId()` * @return {string} */ proto.toit.api.ClaimRequest.prototype.getHardwareId_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getHardwareId())); }; /** * optional bytes hardware_id = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getHardwareId()` * @return {!Uint8Array} */ proto.toit.api.ClaimRequest.prototype.getHardwareId_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getHardwareId())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.toit.api.ClaimRequest} returns this */ proto.toit.api.ClaimRequest.prototype.setHardwareId = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional string init_device_name = 2; * @return {string} */ proto.toit.api.ClaimRequest.prototype.getInitDeviceName = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value * @return {!proto.toit.api.ClaimRequest} returns this */ proto.toit.api.ClaimRequest.prototype.setInitDeviceName = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; /** * optional bytes organization_id = 3; * @return {!(string|Uint8Array)} */ proto.toit.api.ClaimRequest.prototype.getOrganizationId = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** * optional bytes organization_id = 3; * This is a type-conversion wrapper around `getOrganizationId()` * @return {string} */ proto.toit.api.ClaimRequest.prototype.getOrganizationId_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getOrganizationId())); }; /** * optional bytes organization_id = 3; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getOrganizationId()` * @return {!Uint8Array} */ proto.toit.api.ClaimRequest.prototype.getOrganizationId_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getOrganizationId())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.toit.api.ClaimRequest} returns this */ proto.toit.api.ClaimRequest.prototype.setOrganizationId = function(value) { return jspb.Message.setProto3BytesField(this, 3, 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.ClaimResponse.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.ClaimResponse.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.ClaimResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.ClaimResponse.toObject = function(includeInstance, msg) { var f, obj = { hardwareInfo: (f = msg.getHardwareInfo()) && toit_model_device_pb.HardwareInfo.toObject(includeInstance, f), deviceId: msg.getDeviceId_asB64(), deviceName: jspb.Message.getFieldWithDefault(msg, 3, ""), organizationId: msg.getOrganizationId_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.ClaimResponse} */ proto.toit.api.ClaimResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.ClaimResponse; return proto.toit.api.ClaimResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.ClaimResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.ClaimResponse} */ proto.toit.api.ClaimResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new toit_model_device_pb.HardwareInfo; reader.readMessage(value,toit_model_device_pb.HardwareInfo.deserializeBinaryFromReader); msg.setHardwareInfo(value); break; case 2: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setDeviceId(value); break; case 3: var value = /** @type {string} */ (reader.readString()); msg.setDeviceName(value); break; case 4: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setOrganizationId(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.toit.api.ClaimResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.api.ClaimResponse.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.ClaimResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.ClaimResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getHardwareInfo(); if (f != null) { writer.writeMessage( 1, f, toit_model_device_pb.HardwareInfo.serializeBinaryToWriter ); } f = message.getDeviceId_asU8(); if (f.length > 0) { writer.writeBytes( 2, f ); } f = message.getDeviceName(); if (f.length > 0) { writer.writeString( 3, f ); } f = message.getOrganizationId_asU8(); if (f.length > 0) { writer.writeBytes( 4, f ); } }; /** * optional toit.model.HardwareInfo hardware_info = 1; * @return {?proto.toit.model.HardwareInfo} */ proto.toit.api.ClaimResponse.prototype.getHardwareInfo = function() { return /** @type{?proto.toit.model.HardwareInfo} */ ( jspb.Message.getWrapperField(this, toit_model_device_pb.HardwareInfo, 1)); }; /** * @param {?proto.toit.model.HardwareInfo|undefined} value * @return {!proto.toit.api.ClaimResponse} returns this */ proto.toit.api.ClaimResponse.prototype.setHardwareInfo = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.toit.api.ClaimResponse} returns this */ proto.toit.api.ClaimResponse.prototype.clearHardwareInfo = function() { return this.setHardwareInfo(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.toit.api.ClaimResponse.prototype.hasHardwareInfo = function() { return jspb.Message.getField(this, 1) != null; }; /** * optional bytes device_id = 2; * @return {!(string|Uint8Array)} */ proto.toit.api.ClaimResponse.prototype.getDeviceId = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * optional bytes device_id = 2; * This is a type-conversion wrapper around `getDeviceId()` * @return {string} */ proto.toit.api.ClaimResponse.prototype.getDeviceId_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getDeviceId())); }; /** * optional bytes device_id = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getDeviceId()` * @return {!Uint8Array} */ proto.toit.api.ClaimResponse.prototype.getDeviceId_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getDeviceId())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.toit.api.ClaimResponse} returns this */ proto.toit.api.ClaimResponse.prototype.setDeviceId = function(value) { return jspb.Message.setProto3BytesField(this, 2, value); }; /** * optional string device_name = 3; * @return {string} */ proto.toit.api.ClaimResponse.prototype.getDeviceName = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** * @param {string} value * @return {!proto.toit.api.ClaimResponse} returns this */ proto.toit.api.ClaimResponse.prototype.setDeviceName = function(value) { return jspb.Message.setProto3StringField(this, 3, value); }; /** * optional bytes organization_id = 4; * @return {!(string|Uint8Array)} */ proto.toit.api.ClaimResponse.prototype.getOrganizationId = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); }; /** * optional bytes organization_id = 4; * This is a type-conversion wrapper around `getOrganizationId()` * @return {string} */ proto.toit.api.ClaimResponse.prototype.getOrganizationId_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getOrganizationId())); }; /** * optional bytes organization_id = 4; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getOrganizationId()` * @return {!Uint8Array} */ proto.toit.api.ClaimResponse.prototype.getOrganizationId_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getOrganizationId())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.toit.api.ClaimResponse} returns this */ proto.toit.api.ClaimResponse.prototype.setOrganizationId = function(value) { return jspb.Message.setProto3BytesField(this, 4, 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.ReplaceRequest.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.ReplaceRequest.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.ReplaceRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.ReplaceRequest.toObject = function(includeInstance, msg) { var f, obj = { newHardwareId: msg.getNewHardwareId_asB64(), currentHardwareId: msg.getCurrentHardwareId_asB64(), deviceId: msg.getDeviceId_asB64(), organizationId: msg.getOrganizationId_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.ReplaceRequest} */ proto.toit.api.ReplaceRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.ReplaceRequest; return proto.toit.api.ReplaceRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.ReplaceRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.ReplaceRequest} */ proto.toit.api.ReplaceRequest.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.setNewHardwareId(value); break; case 2: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setCurrentHardwareId(value); break; case 3: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setDeviceId(value); break; case 4: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setOrganizationId(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.toit.api.ReplaceRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.api.ReplaceRequest.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.ReplaceRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.ReplaceRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getNewHardwareId_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getCurrentHardwareId_asU8(); if (f.length > 0) { writer.writeBytes( 2, f ); } f = message.getDeviceId_asU8(); if (f.length > 0) { writer.writeBytes( 3, f ); } f = message.getOrganizationId_asU8(); if (f.length > 0) { writer.writeBytes( 4, f ); } }; /** * optional bytes new_hardware_id = 1; * @return {!(string|Uint8Array)} */ proto.toit.api.ReplaceRequest.prototype.getNewHardwareId = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes new_hardware_id = 1; * This is a type-conversion wrapper around `getNewHardwareId()` * @return {string} */ proto.toit.api.ReplaceRequest.prototype.getNewHardwareId_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getNewHardwareId())); }; /** * optional bytes new_hardware_id = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getNewHardwareId()` * @return {!Uint8Array} */ proto.toit.api.ReplaceRequest.prototype.getNewHardwareId_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getNewHardwareId())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.toit.api.ReplaceRequest} returns this */ proto.toit.api.ReplaceRequest.prototype.setNewHardwareId = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional bytes current_hardware_id = 2; * @return {!(string|Uint8Array)} */ proto.toit.api.ReplaceRequest.prototype.getCurrentHardwareId = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * optional bytes current_hardware_id = 2; * This is a type-conversion wrapper around `getCurrentHardwareId()` * @return {string} */ proto.toit.api.ReplaceRequest.prototype.getCurrentHardwareId_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getCurrentHardwareId())); }; /** * optional bytes current_hardware_id = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getCurrentHardwareId()` * @return {!Uint8Array} */ proto.toit.api.ReplaceRequest.prototype.getCurrentHardwareId_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getCurrentHardwareId())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.toit.api.ReplaceRequest} returns this */ proto.toit.api.ReplaceRequest.prototype.setCurrentHardwareId = function(value) { return jspb.Message.setProto3BytesField(this, 2, value); }; /** * optional bytes device_id = 3; * @return {!(string|Uint8Array)} */ proto.toit.api.ReplaceRequest.prototype.getDeviceId = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** * optional bytes device_id = 3; * This is a type-conversion wrapper around `getDeviceId()` * @return {string} */ proto.toit.api.ReplaceRequest.prototype.getDeviceId_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getDeviceId())); }; /** * optional bytes device_id = 3; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getDeviceId()` * @return {!Uint8Array} */ proto.toit.api.ReplaceRequest.prototype.getDeviceId_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getDeviceId())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.toit.api.ReplaceRequest} returns this */ proto.toit.api.ReplaceRequest.prototype.setDeviceId = function(value) { return jspb.Message.setProto3BytesField(this, 3, value); }; /** * optional bytes organization_id = 4; * @return {!(string|Uint8Array)} */ proto.toit.api.ReplaceRequest.prototype.getOrganizationId = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); }; /** * optional bytes organization_id = 4; * This is a type-conversion wrapper around `getOrganizationId()` * @return {string} */ proto.toit.api.ReplaceRequest.prototype.getOrganizationId_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getOrganizationId())); }; /** * optional bytes organization_id = 4; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getOrganizationId()` * @return {!Uint8Array} */ proto.toit.api.ReplaceRequest.prototype.getOrganizationId_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getOrganizationId())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.toit.api.ReplaceRequest} returns this */ proto.toit.api.ReplaceRequest.prototype.setOrganizationId = function(value) { return jspb.Message.setProto3BytesField(this, 4, 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.ReplaceResponse.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.ReplaceResponse.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.ReplaceResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.ReplaceResponse.toObject = function(includeInstance, msg) { var f, obj = { hardwareInfo: (f = msg.getHardwareInfo()) && toit_model_device_pb.HardwareInfo.toObject(includeInstance, f), organizationId: msg.getOrganizationId_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.ReplaceResponse} */ proto.toit.api.ReplaceResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.ReplaceResponse; return proto.toit.api.ReplaceResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.ReplaceResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.ReplaceResponse} */ proto.toit.api.ReplaceResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new toit_model_device_pb.HardwareInfo; reader.readMessage(value,toit_model_device_pb.HardwareInfo.deserializeBinaryFromReader); msg.setHardwareInfo(value); break; case 2: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setOrganizationId(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.toit.api.ReplaceResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.api.ReplaceResponse.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.ReplaceResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.ReplaceResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getHardwareInfo(); if (f != null) { writer.writeMessage( 1, f, toit_model_device_pb.HardwareInfo.serializeBinaryToWriter ); } f = message.getOrganizationId_asU8(); if (f.length > 0) { writer.writeBytes( 2, f ); } }; /** * optional toit.model.HardwareInfo hardware_info = 1; * @return {?proto.toit.model.HardwareInfo} */ proto.toit.api.ReplaceResponse.prototype.getHardwareInfo = function() { return /** @type{?proto.toit.model.HardwareInfo} */ ( jspb.Message.getWrapperField(this, toit_model_device_pb.HardwareInfo, 1)); }; /** * @param {?proto.toit.model.HardwareInfo|undefined} value * @return {!proto.toit.api.ReplaceResponse} returns this */ proto.toit.api.ReplaceResponse.prototype.setHardwareInfo = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.toit.api.ReplaceResponse} returns this */ proto.toit.api.ReplaceResponse.prototype.clearHardwareInfo = function() { return this.setHardwareInfo(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.toit.api.ReplaceResponse.prototype.hasHardwareInfo = function() { return jspb.Message.getField(this, 1) != null; }; /** * optional bytes organization_id = 2; * @return {!(string|Uint8Array)} */ proto.toit.api.ReplaceResponse.prototype.getOrganizationId = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * optional bytes organization_id = 2; * This is a type-conversion wrapper around `getOrganizationId()` * @return {string} */ proto.toit.api.ReplaceResponse.prototype.getOrganizationId_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getOrganizationId())); }; /** * optional bytes organization_id = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getOrganizationId()` * @return {!Uint8Array} */ proto.toit.api.ReplaceResponse.prototype.getOrganizationId_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getOrganizationId())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.toit.api.ReplaceResponse} returns this */ proto.toit.api.ReplaceResponse.prototype.setOrganizationId = 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.GetActiveDeviceIDRequest.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.GetActiveDeviceIDRequest.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.GetActiveDeviceIDRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.GetActiveDeviceIDRequest.toObject = function(includeInstance, msg) { var f, obj = { hardwareId: msg.getHardwareId_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.GetActiveDeviceIDRequest} */ proto.toit.api.GetActiveDeviceIDRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.GetActiveDeviceIDRequest; return proto.toit.api.GetActiveDeviceIDRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.GetActiveDeviceIDRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.GetActiveDeviceIDRequest} */ proto.toit.api.GetActiveDeviceIDRequest.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.setHardwareId(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.toit.api.GetActiveDeviceIDRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.api.GetActiveDeviceIDRequest.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.GetActiveDeviceIDRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.GetActiveDeviceIDRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getHardwareId_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } }; /** * optional bytes hardware_id = 1; * @return {!(string|Uint8Array)} */ proto.toit.api.GetActiveDeviceIDRequest.prototype.getHardwareId = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes hardware_id = 1; * This is a type-conversion wrapper around `getHardwareId()` * @return {string} */ proto.toit.api.GetActiveDeviceIDRequest.prototype.getHardwareId_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getHardwareId())); }; /** * optional bytes hardware_id = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getHardwareId()` * @return {!Uint8Array} */ proto.toit.api.GetActiveDeviceIDRequest.prototype.getHardwareId_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getHardwareId())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.toit.api.GetActiveDeviceIDRequest} returns this */ proto.toit.api.GetActiveDeviceIDRequest.prototype.setHardwareId = function(value) { return jspb.Message.setProto3BytesField(this, 1, 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.GetActiveDeviceIDResponse.prototype.toObject = function(opt_includeInstance) { return proto.toit.api.GetActiveDeviceIDResponse.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.GetActiveDeviceIDResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.toit.api.GetActiveDeviceIDResponse.toObject = function(includeInstance, msg) { var f, obj = { deviceId: msg.getDeviceId_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.GetActiveDeviceIDResponse} */ proto.toit.api.GetActiveDeviceIDResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.toit.api.GetActiveDeviceIDResponse; return proto.toit.api.GetActiveDeviceIDResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.toit.api.GetActiveDeviceIDResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.toit.api.GetActiveDeviceIDResponse} */ proto.toit.api.GetActiveDeviceIDResponse.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.setDeviceId(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.toit.api.GetActiveDeviceIDResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.toit.api.GetActiveDeviceIDResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer()