UNPKG

hyperdrive-daemon-client

Version:

A client library and CLI tool for interacting with the Hyperdrive daemon.

1,801 lines (1,537 loc) 72.6 kB
/** * @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 hyperdrive_pb = require('../hyperdrive_pb.js'); goog.object.extend(proto, hyperdrive_pb); goog.exportSymbol('proto.CoreStats', null, global); goog.exportSymbol('proto.DiffEntry', null, global); goog.exportSymbol('proto.DownloadProgress', null, global); goog.exportSymbol('proto.DriveStats', null, global); goog.exportSymbol('proto.FileDownloadStatus', null, global); goog.exportSymbol('proto.FileStats', null, global); goog.exportSymbol('proto.HyperdriveOptions', null, global); goog.exportSymbol('proto.MountInfo', null, global); goog.exportSymbol('proto.MountStats', null, global); goog.exportSymbol('proto.NetworkConfiguration', null, global); goog.exportSymbol('proto.Profile', 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.Profile = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.Profile, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.Profile.displayName = 'proto.Profile'; } if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto suitable for use in Soy templates. * Field names that are reserved in JavaScript and will be renamed to pb_name. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. * @param {boolean=} opt_includeInstance Whether to include the JSPB instance * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ proto.Profile.prototype.toObject = function(opt_includeInstance) { return proto.Profile.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.Profile} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Profile.toObject = function(includeInstance, msg) { var f, obj = { name: jspb.Message.getFieldWithDefault(msg, 1, ""), drive: (f = msg.getDrive()) && proto.HyperdriveOptions.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.Profile} */ proto.Profile.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.Profile; return proto.Profile.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.Profile} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.Profile} */ proto.Profile.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setName(value); break; case 2: var value = new proto.HyperdriveOptions; reader.readMessage(value,proto.HyperdriveOptions.deserializeBinaryFromReader); msg.setDrive(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.Profile.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.Profile.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.Profile} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.Profile.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getName(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getDrive(); if (f != null) { writer.writeMessage( 2, f, proto.HyperdriveOptions.serializeBinaryToWriter ); } }; /** * optional string name = 1; * @return {string} */ proto.Profile.prototype.getName = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** @param {string} value */ proto.Profile.prototype.setName = function(value) { jspb.Message.setProto3StringField(this, 1, value); }; /** * optional HyperdriveOptions drive = 2; * @return {?proto.HyperdriveOptions} */ proto.Profile.prototype.getDrive = function() { return /** @type{?proto.HyperdriveOptions} */ ( jspb.Message.getWrapperField(this, proto.HyperdriveOptions, 2)); }; /** @param {?proto.HyperdriveOptions|undefined} value */ proto.Profile.prototype.setDrive = function(value) { jspb.Message.setWrapperField(this, 2, value); }; proto.Profile.prototype.clearDrive = function() { this.setDrive(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.Profile.prototype.hasDrive = function() { return jspb.Message.getField(this, 2) != null; }; /** * 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.HyperdriveOptions = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.HyperdriveOptions, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.HyperdriveOptions.displayName = 'proto.HyperdriveOptions'; } if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto suitable for use in Soy templates. * Field names that are reserved in JavaScript and will be renamed to pb_name. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. * @param {boolean=} opt_includeInstance Whether to include the JSPB instance * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ proto.HyperdriveOptions.prototype.toObject = function(opt_includeInstance) { return proto.HyperdriveOptions.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.HyperdriveOptions} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.HyperdriveOptions.toObject = function(includeInstance, msg) { var f, obj = { key: msg.getKey_asB64(), version: jspb.Message.getFieldWithDefault(msg, 2, 0), hash: msg.getHash_asB64(), writable: jspb.Message.getFieldWithDefault(msg, 4, false), seed: jspb.Message.getFieldWithDefault(msg, 5, false), discoverykey: msg.getDiscoverykey_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.HyperdriveOptions} */ proto.HyperdriveOptions.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.HyperdriveOptions; return proto.HyperdriveOptions.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.HyperdriveOptions} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.HyperdriveOptions} */ proto.HyperdriveOptions.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.setKey(value); break; case 2: var value = /** @type {number} */ (reader.readUint64()); msg.setVersion(value); break; case 3: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setHash(value); break; case 4: var value = /** @type {boolean} */ (reader.readBool()); msg.setWritable(value); break; case 5: var value = /** @type {boolean} */ (reader.readBool()); msg.setSeed(value); break; case 6: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setDiscoverykey(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.HyperdriveOptions.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.HyperdriveOptions.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.HyperdriveOptions} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.HyperdriveOptions.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getKey_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getVersion(); if (f !== 0) { writer.writeUint64( 2, f ); } f = message.getHash_asU8(); if (f.length > 0) { writer.writeBytes( 3, f ); } f = message.getWritable(); if (f) { writer.writeBool( 4, f ); } f = message.getSeed(); if (f) { writer.writeBool( 5, f ); } f = message.getDiscoverykey_asU8(); if (f.length > 0) { writer.writeBytes( 6, f ); } }; /** * optional bytes key = 1; * @return {!(string|Uint8Array)} */ proto.HyperdriveOptions.prototype.getKey = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes key = 1; * This is a type-conversion wrapper around `getKey()` * @return {string} */ proto.HyperdriveOptions.prototype.getKey_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getKey())); }; /** * optional bytes key = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getKey()` * @return {!Uint8Array} */ proto.HyperdriveOptions.prototype.getKey_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getKey())); }; /** @param {!(string|Uint8Array)} value */ proto.HyperdriveOptions.prototype.setKey = function(value) { jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional uint64 version = 2; * @return {number} */ proto.HyperdriveOptions.prototype.getVersion = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** @param {number} value */ proto.HyperdriveOptions.prototype.setVersion = function(value) { jspb.Message.setProto3IntField(this, 2, value); }; /** * optional bytes hash = 3; * @return {!(string|Uint8Array)} */ proto.HyperdriveOptions.prototype.getHash = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** * optional bytes hash = 3; * This is a type-conversion wrapper around `getHash()` * @return {string} */ proto.HyperdriveOptions.prototype.getHash_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getHash())); }; /** * optional bytes hash = 3; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getHash()` * @return {!Uint8Array} */ proto.HyperdriveOptions.prototype.getHash_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getHash())); }; /** @param {!(string|Uint8Array)} value */ proto.HyperdriveOptions.prototype.setHash = function(value) { jspb.Message.setProto3BytesField(this, 3, value); }; /** * optional bool writable = 4; * Note that Boolean fields may be set to 0/1 when serialized from a Java server. * You should avoid comparisons like {@code val === true/false} in those cases. * @return {boolean} */ proto.HyperdriveOptions.prototype.getWritable = function() { return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 4, false)); }; /** @param {boolean} value */ proto.HyperdriveOptions.prototype.setWritable = function(value) { jspb.Message.setProto3BooleanField(this, 4, value); }; /** * optional bool seed = 5; * Note that Boolean fields may be set to 0/1 when serialized from a Java server. * You should avoid comparisons like {@code val === true/false} in those cases. * @return {boolean} */ proto.HyperdriveOptions.prototype.getSeed = function() { return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 5, false)); }; /** @param {boolean} value */ proto.HyperdriveOptions.prototype.setSeed = function(value) { jspb.Message.setProto3BooleanField(this, 5, value); }; /** * optional bytes discoveryKey = 6; * @return {!(string|Uint8Array)} */ proto.HyperdriveOptions.prototype.getDiscoverykey = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 6, "")); }; /** * optional bytes discoveryKey = 6; * This is a type-conversion wrapper around `getDiscoverykey()` * @return {string} */ proto.HyperdriveOptions.prototype.getDiscoverykey_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getDiscoverykey())); }; /** * optional bytes discoveryKey = 6; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getDiscoverykey()` * @return {!Uint8Array} */ proto.HyperdriveOptions.prototype.getDiscoverykey_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getDiscoverykey())); }; /** @param {!(string|Uint8Array)} value */ proto.HyperdriveOptions.prototype.setDiscoverykey = function(value) { jspb.Message.setProto3BytesField(this, 6, value); }; /** * 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.MountInfo = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.MountInfo, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.MountInfo.displayName = 'proto.MountInfo'; } if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto suitable for use in Soy templates. * Field names that are reserved in JavaScript and will be renamed to pb_name. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. * @param {boolean=} opt_includeInstance Whether to include the JSPB instance * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ proto.MountInfo.prototype.toObject = function(opt_includeInstance) { return proto.MountInfo.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.MountInfo} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.MountInfo.toObject = function(includeInstance, msg) { var f, obj = { path: jspb.Message.getFieldWithDefault(msg, 1, ""), opts: (f = msg.getOpts()) && hyperdrive_pb.Mount.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.MountInfo} */ proto.MountInfo.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.MountInfo; return proto.MountInfo.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.MountInfo} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.MountInfo} */ proto.MountInfo.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setPath(value); break; case 2: var value = new hyperdrive_pb.Mount; reader.readMessage(value,hyperdrive_pb.Mount.deserializeBinaryFromReader); msg.setOpts(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.MountInfo.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.MountInfo.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.MountInfo} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.MountInfo.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getPath(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getOpts(); if (f != null) { writer.writeMessage( 2, f, hyperdrive_pb.Mount.serializeBinaryToWriter ); } }; /** * optional string path = 1; * @return {string} */ proto.MountInfo.prototype.getPath = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** @param {string} value */ proto.MountInfo.prototype.setPath = function(value) { jspb.Message.setProto3StringField(this, 1, value); }; /** * optional Mount opts = 2; * @return {?proto.Mount} */ proto.MountInfo.prototype.getOpts = function() { return /** @type{?proto.Mount} */ ( jspb.Message.getWrapperField(this, hyperdrive_pb.Mount, 2)); }; /** @param {?proto.Mount|undefined} value */ proto.MountInfo.prototype.setOpts = function(value) { jspb.Message.setWrapperField(this, 2, value); }; proto.MountInfo.prototype.clearOpts = function() { this.setOpts(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.MountInfo.prototype.hasOpts = function() { return jspb.Message.getField(this, 2) != null; }; /** * 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.NetworkConfiguration = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.NetworkConfiguration, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.NetworkConfiguration.displayName = 'proto.NetworkConfiguration'; } if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto suitable for use in Soy templates. * Field names that are reserved in JavaScript and will be renamed to pb_name. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. * @param {boolean=} opt_includeInstance Whether to include the JSPB instance * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ proto.NetworkConfiguration.prototype.toObject = function(opt_includeInstance) { return proto.NetworkConfiguration.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.NetworkConfiguration} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.NetworkConfiguration.toObject = function(includeInstance, msg) { var f, obj = { lookup: jspb.Message.getFieldWithDefault(msg, 1, false), announce: jspb.Message.getFieldWithDefault(msg, 2, false), remember: jspb.Message.getFieldWithDefault(msg, 3, false), key: msg.getKey_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.NetworkConfiguration} */ proto.NetworkConfiguration.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.NetworkConfiguration; return proto.NetworkConfiguration.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.NetworkConfiguration} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.NetworkConfiguration} */ proto.NetworkConfiguration.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {boolean} */ (reader.readBool()); msg.setLookup(value); break; case 2: var value = /** @type {boolean} */ (reader.readBool()); msg.setAnnounce(value); break; case 3: var value = /** @type {boolean} */ (reader.readBool()); msg.setRemember(value); break; case 4: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setKey(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.NetworkConfiguration.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.NetworkConfiguration.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.NetworkConfiguration} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.NetworkConfiguration.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getLookup(); if (f) { writer.writeBool( 1, f ); } f = message.getAnnounce(); if (f) { writer.writeBool( 2, f ); } f = message.getRemember(); if (f) { writer.writeBool( 3, f ); } f = message.getKey_asU8(); if (f.length > 0) { writer.writeBytes( 4, f ); } }; /** * optional bool lookup = 1; * Note that Boolean fields may be set to 0/1 when serialized from a Java server. * You should avoid comparisons like {@code val === true/false} in those cases. * @return {boolean} */ proto.NetworkConfiguration.prototype.getLookup = function() { return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 1, false)); }; /** @param {boolean} value */ proto.NetworkConfiguration.prototype.setLookup = function(value) { jspb.Message.setProto3BooleanField(this, 1, value); }; /** * optional bool announce = 2; * Note that Boolean fields may be set to 0/1 when serialized from a Java server. * You should avoid comparisons like {@code val === true/false} in those cases. * @return {boolean} */ proto.NetworkConfiguration.prototype.getAnnounce = function() { return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 2, false)); }; /** @param {boolean} value */ proto.NetworkConfiguration.prototype.setAnnounce = function(value) { jspb.Message.setProto3BooleanField(this, 2, value); }; /** * optional bool remember = 3; * Note that Boolean fields may be set to 0/1 when serialized from a Java server. * You should avoid comparisons like {@code val === true/false} in those cases. * @return {boolean} */ proto.NetworkConfiguration.prototype.getRemember = function() { return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 3, false)); }; /** @param {boolean} value */ proto.NetworkConfiguration.prototype.setRemember = function(value) { jspb.Message.setProto3BooleanField(this, 3, value); }; /** * optional bytes key = 4; * @return {!(string|Uint8Array)} */ proto.NetworkConfiguration.prototype.getKey = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); }; /** * optional bytes key = 4; * This is a type-conversion wrapper around `getKey()` * @return {string} */ proto.NetworkConfiguration.prototype.getKey_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getKey())); }; /** * optional bytes key = 4; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getKey()` * @return {!Uint8Array} */ proto.NetworkConfiguration.prototype.getKey_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getKey())); }; /** @param {!(string|Uint8Array)} value */ proto.NetworkConfiguration.prototype.setKey = function(value) { jspb.Message.setProto3BytesField(this, 4, value); }; /** * 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.CoreStats = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.CoreStats, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.CoreStats.displayName = 'proto.CoreStats'; } if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto suitable for use in Soy templates. * Field names that are reserved in JavaScript and will be renamed to pb_name. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. * @param {boolean=} opt_includeInstance Whether to include the JSPB instance * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ proto.CoreStats.prototype.toObject = function(opt_includeInstance) { return proto.CoreStats.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.CoreStats} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.CoreStats.toObject = function(includeInstance, msg) { var f, obj = { key: msg.getKey_asB64(), peers: jspb.Message.getFieldWithDefault(msg, 2, 0), uploadedbytes: jspb.Message.getFieldWithDefault(msg, 3, 0), downloadedbytes: jspb.Message.getFieldWithDefault(msg, 4, 0), uploadedbytescumulative: jspb.Message.getFieldWithDefault(msg, 5, 0), downloadedbytescumulative: jspb.Message.getFieldWithDefault(msg, 6, 0), totalblocks: jspb.Message.getFieldWithDefault(msg, 7, 0), downloadedblocks: jspb.Message.getFieldWithDefault(msg, 8, 0), totalbytes: jspb.Message.getFieldWithDefault(msg, 9, 0) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.CoreStats} */ proto.CoreStats.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.CoreStats; return proto.CoreStats.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.CoreStats} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.CoreStats} */ proto.CoreStats.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.setKey(value); break; case 2: var value = /** @type {number} */ (reader.readUint32()); msg.setPeers(value); break; case 3: var value = /** @type {number} */ (reader.readUint64()); msg.setUploadedbytes(value); break; case 4: var value = /** @type {number} */ (reader.readUint64()); msg.setDownloadedbytes(value); break; case 5: var value = /** @type {number} */ (reader.readUint64()); msg.setUploadedbytescumulative(value); break; case 6: var value = /** @type {number} */ (reader.readUint64()); msg.setDownloadedbytescumulative(value); break; case 7: var value = /** @type {number} */ (reader.readUint64()); msg.setTotalblocks(value); break; case 8: var value = /** @type {number} */ (reader.readUint64()); msg.setDownloadedblocks(value); break; case 9: var value = /** @type {number} */ (reader.readUint64()); msg.setTotalbytes(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.CoreStats.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.CoreStats.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.CoreStats} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.CoreStats.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getKey_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getPeers(); if (f !== 0) { writer.writeUint32( 2, f ); } f = message.getUploadedbytes(); if (f !== 0) { writer.writeUint64( 3, f ); } f = message.getDownloadedbytes(); if (f !== 0) { writer.writeUint64( 4, f ); } f = message.getUploadedbytescumulative(); if (f !== 0) { writer.writeUint64( 5, f ); } f = message.getDownloadedbytescumulative(); if (f !== 0) { writer.writeUint64( 6, f ); } f = message.getTotalblocks(); if (f !== 0) { writer.writeUint64( 7, f ); } f = message.getDownloadedblocks(); if (f !== 0) { writer.writeUint64( 8, f ); } f = message.getTotalbytes(); if (f !== 0) { writer.writeUint64( 9, f ); } }; /** * optional bytes key = 1; * @return {!(string|Uint8Array)} */ proto.CoreStats.prototype.getKey = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes key = 1; * This is a type-conversion wrapper around `getKey()` * @return {string} */ proto.CoreStats.prototype.getKey_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getKey())); }; /** * optional bytes key = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getKey()` * @return {!Uint8Array} */ proto.CoreStats.prototype.getKey_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getKey())); }; /** @param {!(string|Uint8Array)} value */ proto.CoreStats.prototype.setKey = function(value) { jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional uint32 peers = 2; * @return {number} */ proto.CoreStats.prototype.getPeers = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** @param {number} value */ proto.CoreStats.prototype.setPeers = function(value) { jspb.Message.setProto3IntField(this, 2, value); }; /** * optional uint64 uploadedBytes = 3; * @return {number} */ proto.CoreStats.prototype.getUploadedbytes = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); }; /** @param {number} value */ proto.CoreStats.prototype.setUploadedbytes = function(value) { jspb.Message.setProto3IntField(this, 3, value); }; /** * optional uint64 downloadedBytes = 4; * @return {number} */ proto.CoreStats.prototype.getDownloadedbytes = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); }; /** @param {number} value */ proto.CoreStats.prototype.setDownloadedbytes = function(value) { jspb.Message.setProto3IntField(this, 4, value); }; /** * optional uint64 uploadedBytesCumulative = 5; * @return {number} */ proto.CoreStats.prototype.getUploadedbytescumulative = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); }; /** @param {number} value */ proto.CoreStats.prototype.setUploadedbytescumulative = function(value) { jspb.Message.setProto3IntField(this, 5, value); }; /** * optional uint64 downloadedBytesCumulative = 6; * @return {number} */ proto.CoreStats.prototype.getDownloadedbytescumulative = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); }; /** @param {number} value */ proto.CoreStats.prototype.setDownloadedbytescumulative = function(value) { jspb.Message.setProto3IntField(this, 6, value); }; /** * optional uint64 totalBlocks = 7; * @return {number} */ proto.CoreStats.prototype.getTotalblocks = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0)); }; /** @param {number} value */ proto.CoreStats.prototype.setTotalblocks = function(value) { jspb.Message.setProto3IntField(this, 7, value); }; /** * optional uint64 downloadedBlocks = 8; * @return {number} */ proto.CoreStats.prototype.getDownloadedblocks = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0)); }; /** @param {number} value */ proto.CoreStats.prototype.setDownloadedblocks = function(value) { jspb.Message.setProto3IntField(this, 8, value); }; /** * optional uint64 totalBytes = 9; * @return {number} */ proto.CoreStats.prototype.getTotalbytes = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 9, 0)); }; /** @param {number} value */ proto.CoreStats.prototype.setTotalbytes = function(value) { jspb.Message.setProto3IntField(this, 9, value); }; /** * 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.MountStats = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.MountStats, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.MountStats.displayName = 'proto.MountStats'; } if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto suitable for use in Soy templates. * Field names that are reserved in JavaScript and will be renamed to pb_name. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. * @param {boolean=} opt_includeInstance Whether to include the JSPB instance * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ proto.MountStats.prototype.toObject = function(opt_includeInstance) { return proto.MountStats.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.MountStats} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.MountStats.toObject = function(includeInstance, msg) { var f, obj = { path: jspb.Message.getFieldWithDefault(msg, 1, ""), metadata: (f = msg.getMetadata()) && proto.CoreStats.toObject(includeInstance, f), content: (f = msg.getContent()) && proto.CoreStats.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.MountStats} */ proto.MountStats.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.MountStats; return proto.MountStats.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.MountStats} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.MountStats} */ proto.MountStats.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setPath(value); break; case 2: var value = new proto.CoreStats; reader.readMessage(value,proto.CoreStats.deserializeBinaryFromReader); msg.setMetadata(value); break; case 3: var value = new proto.CoreStats; reader.readMessage(value,proto.CoreStats.deserializeBinaryFromReader); msg.setContent(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.MountStats.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.MountStats.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.MountStats} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.MountStats.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getPath(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getMetadata(); if (f != null) { writer.writeMessage( 2, f, proto.CoreStats.serializeBinaryToWriter ); } f = message.getContent(); if (f != null) { writer.writeMessage( 3, f, proto.CoreStats.serializeBinaryToWriter ); } }; /** * optional string path = 1; * @return {string} */ proto.MountStats.prototype.getPath = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** @param {string} value */ proto.MountStats.prototype.setPath = function(value) { jspb.Message.setProto3StringField(this, 1, value); }; /** * optional CoreStats metadata = 2; * @return {?proto.CoreStats} */ proto.MountStats.prototype.getMetadata = function() { return /** @type{?proto.CoreStats} */ ( jspb.Message.getWrapperField(this, proto.CoreStats, 2)); }; /** @param {?proto.CoreStats|undefined} value */ proto.MountStats.prototype.setMetadata = function(value) { jspb.Message.setWrapperField(this, 2, value); }; proto.MountStats.prototype.clearMetadata = function() { this.setMetadata(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.MountStats.prototype.hasMetadata = function() { return jspb.Message.getField(this, 2) != null; }; /** * optional CoreStats content = 3; * @return {?proto.CoreStats} */ proto.MountStats.prototype.getContent = function() { return /** @type{?proto.CoreStats} */ ( jspb.Message.getWrapperField(this, proto.CoreStats, 3)); }; /** @param {?proto.CoreStats|undefined} value */ proto.MountStats.prototype.setContent = function(value) { jspb.Message.setWrapperField(this, 3, value); }; proto.MountStats.prototype.clearContent = function() { this.setContent(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.MountStats.prototype.hasContent = function() { return jspb.Message.getField(this, 3) != null; }; /** * 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.DriveStats = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.DriveStats.repeatedFields_, null); }; goog.inherits(proto.DriveStats, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.DriveStats.displayName = 'proto.DriveStats'; } /** * List of repeated fields within this message type. * @private {!Array<number>} * @const */ proto.DriveStats.repeatedFields_ = [1]; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto suitable for use in Soy templates. * Field names that are reserved in JavaScript and will be renamed to pb_name. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. * @param {boolean=} opt_includeInstance Whether to include the JSPB instance * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ proto.DriveStats.prototype.toObject = function(opt_includeInstance) { return proto.DriveStats.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.DriveStats} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.DriveStats.toObject = function(includeInstance, msg) { var f, obj = { statsList: jspb.Message.toObjectList(msg.getStatsList(), proto.MountStats.toObject, includeInstance) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.DriveStats} */ proto.DriveStats.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.DriveStats; return proto.DriveStats.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.DriveStats} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.DriveStats} */ proto.DriveStats.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new proto.MountStats; reader.readMessage(value,proto.MountStats.deserializeBinaryFromReader); msg.addStats(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.DriveStats.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.DriveStats.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.DriveStats} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.DriveStats.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getStatsList(); if (f.length > 0) { writer.writeRepeatedMessage( 1, f, proto.MountStats.serializeBinaryToWriter ); } }; /** * repeated MountStats stats = 1; * @return {!Array<!proto.MountStats>} */ proto.DriveStats.prototype.getStatsList = function() { return /** @type{!Array<!proto.MountStats>} */ ( jspb.Message.getRepeatedWrapperField(this, proto.MountStats, 1)); }; /** @param {!Array<!proto.MountStats>} value */ proto.DriveStats.prototype.setStatsList = function(value) { jspb.Message.setRepeatedWrapperField(this, 1, value); }; /** * @param {!proto.MountStats=} opt_value * @param {number=} opt_index * @return {!proto.MountStats} */ proto.DriveStats.prototype.addStats = function(opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.MountStats, opt_index); }; proto.DriveStats.prototype.clearStatsList = function() { this.setStatsList([]); }; /** * 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.DownloadProgress = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.DownloadProgress, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.DownloadProgress.