hyperdrive-daemon-client
Version:
A client library and CLI tool for interacting with the Hyperdrive daemon.
1,020 lines (872 loc) • 29.5 kB
JavaScript
/**
* @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 daemon_common_pb = require('../daemon/common_pb.js');
goog.object.extend(proto, daemon_common_pb);
goog.exportSymbol('proto.InfoRequest', null, global);
goog.exportSymbol('proto.InfoResponse', null, global);
goog.exportSymbol('proto.MountRequest', null, global);
goog.exportSymbol('proto.MountResponse', null, global);
goog.exportSymbol('proto.UnmountRequest', null, global);
goog.exportSymbol('proto.UnmountResponse', 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.MountRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.MountRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.MountRequest.displayName = 'proto.MountRequest';
}
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.MountRequest.prototype.toObject = function(opt_includeInstance) {
return proto.MountRequest.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.MountRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.MountRequest.toObject = function(includeInstance, msg) {
var f, obj = {
path: jspb.Message.getFieldWithDefault(msg, 1, ""),
opts: (f = msg.getOpts()) && daemon_common_pb.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.MountRequest}
*/
proto.MountRequest.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.MountRequest;
return proto.MountRequest.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.MountRequest} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.MountRequest}
*/
proto.MountRequest.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 daemon_common_pb.HyperdriveOptions;
reader.readMessage(value,daemon_common_pb.HyperdriveOptions.deserializeBinaryFromReader);
msg.setOpts(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.MountRequest.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.MountRequest.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.MountRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.MountRequest.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,
daemon_common_pb.HyperdriveOptions.serializeBinaryToWriter
);
}
};
/**
* optional string path = 1;
* @return {string}
*/
proto.MountRequest.prototype.getPath = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.MountRequest.prototype.setPath = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional HyperdriveOptions opts = 2;
* @return {?proto.HyperdriveOptions}
*/
proto.MountRequest.prototype.getOpts = function() {
return /** @type{?proto.HyperdriveOptions} */ (
jspb.Message.getWrapperField(this, daemon_common_pb.HyperdriveOptions, 2));
};
/** @param {?proto.HyperdriveOptions|undefined} value */
proto.MountRequest.prototype.setOpts = function(value) {
jspb.Message.setWrapperField(this, 2, value);
};
proto.MountRequest.prototype.clearOpts = function() {
this.setOpts(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.MountRequest.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.MountResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.MountResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.MountResponse.displayName = 'proto.MountResponse';
}
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.MountResponse.prototype.toObject = function(opt_includeInstance) {
return proto.MountResponse.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.MountResponse} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.MountResponse.toObject = function(includeInstance, msg) {
var f, obj = {
path: jspb.Message.getFieldWithDefault(msg, 1, ""),
mountinfo: (f = msg.getMountinfo()) && daemon_common_pb.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.MountResponse}
*/
proto.MountResponse.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.MountResponse;
return proto.MountResponse.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.MountResponse} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.MountResponse}
*/
proto.MountResponse.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 daemon_common_pb.HyperdriveOptions;
reader.readMessage(value,daemon_common_pb.HyperdriveOptions.deserializeBinaryFromReader);
msg.setMountinfo(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.MountResponse.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.MountResponse.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.MountResponse} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.MountResponse.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getPath();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getMountinfo();
if (f != null) {
writer.writeMessage(
2,
f,
daemon_common_pb.HyperdriveOptions.serializeBinaryToWriter
);
}
};
/**
* optional string path = 1;
* @return {string}
*/
proto.MountResponse.prototype.getPath = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.MountResponse.prototype.setPath = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional HyperdriveOptions mountInfo = 2;
* @return {?proto.HyperdriveOptions}
*/
proto.MountResponse.prototype.getMountinfo = function() {
return /** @type{?proto.HyperdriveOptions} */ (
jspb.Message.getWrapperField(this, daemon_common_pb.HyperdriveOptions, 2));
};
/** @param {?proto.HyperdriveOptions|undefined} value */
proto.MountResponse.prototype.setMountinfo = function(value) {
jspb.Message.setWrapperField(this, 2, value);
};
proto.MountResponse.prototype.clearMountinfo = function() {
this.setMountinfo(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.MountResponse.prototype.hasMountinfo = 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.UnmountRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.UnmountRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.UnmountRequest.displayName = 'proto.UnmountRequest';
}
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.UnmountRequest.prototype.toObject = function(opt_includeInstance) {
return proto.UnmountRequest.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.UnmountRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.UnmountRequest.toObject = function(includeInstance, msg) {
var f, obj = {
path: jspb.Message.getFieldWithDefault(msg, 1, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.UnmountRequest}
*/
proto.UnmountRequest.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.UnmountRequest;
return proto.UnmountRequest.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.UnmountRequest} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.UnmountRequest}
*/
proto.UnmountRequest.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;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.UnmountRequest.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.UnmountRequest.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.UnmountRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.UnmountRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getPath();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
};
/**
* optional string path = 1;
* @return {string}
*/
proto.UnmountRequest.prototype.getPath = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.UnmountRequest.prototype.setPath = function(value) {
jspb.Message.setProto3StringField(this, 1, 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.UnmountResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.UnmountResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.UnmountResponse.displayName = 'proto.UnmountResponse';
}
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.UnmountResponse.prototype.toObject = function(opt_includeInstance) {
return proto.UnmountResponse.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.UnmountResponse} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.UnmountResponse.toObject = function(includeInstance, msg) {
var f, obj = {
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.UnmountResponse}
*/
proto.UnmountResponse.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.UnmountResponse;
return proto.UnmountResponse.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.UnmountResponse} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.UnmountResponse}
*/
proto.UnmountResponse.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.UnmountResponse.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.UnmountResponse.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.UnmountResponse} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.UnmountResponse.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
};
/**
* 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.InfoRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.InfoRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.InfoRequest.displayName = 'proto.InfoRequest';
}
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.InfoRequest.prototype.toObject = function(opt_includeInstance) {
return proto.InfoRequest.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.InfoRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.InfoRequest.toObject = function(includeInstance, msg) {
var f, obj = {
path: jspb.Message.getFieldWithDefault(msg, 1, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.InfoRequest}
*/
proto.InfoRequest.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.InfoRequest;
return proto.InfoRequest.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.InfoRequest} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.InfoRequest}
*/
proto.InfoRequest.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;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.InfoRequest.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.InfoRequest.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.InfoRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.InfoRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getPath();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
};
/**
* optional string path = 1;
* @return {string}
*/
proto.InfoRequest.prototype.getPath = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.InfoRequest.prototype.setPath = function(value) {
jspb.Message.setProto3StringField(this, 1, 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.InfoResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.InfoResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.InfoResponse.displayName = 'proto.InfoResponse';
}
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.InfoResponse.prototype.toObject = function(opt_includeInstance) {
return proto.InfoResponse.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.InfoResponse} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.InfoResponse.toObject = function(includeInstance, msg) {
var f, obj = {
key: jspb.Message.getFieldWithDefault(msg, 1, ""),
path: jspb.Message.getFieldWithDefault(msg, 2, ""),
mountpath: jspb.Message.getFieldWithDefault(msg, 3, ""),
writable: jspb.Message.getFieldWithDefault(msg, 4, false)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.InfoResponse}
*/
proto.InfoResponse.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.InfoResponse;
return proto.InfoResponse.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.InfoResponse} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.InfoResponse}
*/
proto.InfoResponse.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.setKey(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setPath(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setMountpath(value);
break;
case 4:
var value = /** @type {boolean} */ (reader.readBool());
msg.setWritable(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.InfoResponse.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.InfoResponse.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.InfoResponse} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.InfoResponse.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getKey();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getPath();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getMountpath();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
f = message.getWritable();
if (f) {
writer.writeBool(
4,
f
);
}
};
/**
* optional string key = 1;
* @return {string}
*/
proto.InfoResponse.prototype.getKey = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.InfoResponse.prototype.setKey = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string path = 2;
* @return {string}
*/
proto.InfoResponse.prototype.getPath = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/** @param {string} value */
proto.InfoResponse.prototype.setPath = function(value) {
jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional string mountPath = 3;
* @return {string}
*/
proto.InfoResponse.prototype.getMountpath = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/** @param {string} value */
proto.InfoResponse.prototype.setMountpath = function(value) {
jspb.Message.setProto3StringField(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.InfoResponse.prototype.getWritable = function() {
return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 4, false));
};
/** @param {boolean} value */
proto.InfoResponse.prototype.setWritable = function(value) {
jspb.Message.setProto3BooleanField(this, 4, value);
};
goog.object.extend(exports, proto);