spot-sdk-js
Version:
Develop applications and payloads for Spot using the unofficial Boston Dynamics Spot Node.js SDK.
609 lines (519 loc) • 17.1 kB
JavaScript
// source: bosdyn/api/parameter.proto
/**
* @fileoverview
* @enhanceable
* @suppress {missingRequire} reports error on implicit type usages.
* @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!
/* eslint-disable */
// @ts-nocheck
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var google_protobuf_duration_pb = require('google-protobuf/google/protobuf/duration_pb.js');
goog.object.extend(proto, google_protobuf_duration_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.bosdyn.api.Parameter', null, global);
goog.exportSymbol('proto.bosdyn.api.Parameter.ValuesCase', 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.bosdyn.api.Parameter = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, proto.bosdyn.api.Parameter.oneofGroups_);
};
goog.inherits(proto.bosdyn.api.Parameter, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.bosdyn.api.Parameter.displayName = 'proto.bosdyn.api.Parameter';
}
/**
* Oneof group definitions for this message. Each group defines the field
* numbers belonging to that group. When of these fields' value is set, all
* other fields in the group are cleared. During deserialization, if multiple
* fields are encountered for a group, only the last value seen will be kept.
* @private {!Array<!Array<number>>}
* @const
*/
proto.bosdyn.api.Parameter.oneofGroups_ = [[3,4,5,6,7,8,10]];
/**
* @enum {number}
*/
proto.bosdyn.api.Parameter.ValuesCase = {
VALUES_NOT_SET: 0,
INT_VALUE: 3,
FLOAT_VALUE: 4,
TIMESTAMP: 5,
DURATION: 6,
STRING_VALUE: 7,
BOOL_VALUE: 8,
UINT_VALUE: 10
};
/**
* @return {proto.bosdyn.api.Parameter.ValuesCase}
*/
proto.bosdyn.api.Parameter.prototype.getValuesCase = function() {
return /** @type {proto.bosdyn.api.Parameter.ValuesCase} */(jspb.Message.computeOneofCase(this, proto.bosdyn.api.Parameter.oneofGroups_[0]));
};
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.bosdyn.api.Parameter.prototype.toObject = function(opt_includeInstance) {
return proto.bosdyn.api.Parameter.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.bosdyn.api.Parameter} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.Parameter.toObject = function(includeInstance, msg) {
var f, obj = {
label: jspb.Message.getFieldWithDefault(msg, 1, ""),
units: jspb.Message.getFieldWithDefault(msg, 2, ""),
intValue: jspb.Message.getFieldWithDefault(msg, 3, 0),
floatValue: jspb.Message.getFloatingPointFieldWithDefault(msg, 4, 0.0),
timestamp: (f = msg.getTimestamp()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
duration: (f = msg.getDuration()) && google_protobuf_duration_pb.Duration.toObject(includeInstance, f),
stringValue: jspb.Message.getFieldWithDefault(msg, 7, ""),
boolValue: jspb.Message.getBooleanFieldWithDefault(msg, 8, false),
uintValue: jspb.Message.getFieldWithDefault(msg, 10, 0),
notes: jspb.Message.getFieldWithDefault(msg, 9, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.bosdyn.api.Parameter}
*/
proto.bosdyn.api.Parameter.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.bosdyn.api.Parameter;
return proto.bosdyn.api.Parameter.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.bosdyn.api.Parameter} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.bosdyn.api.Parameter}
*/
proto.bosdyn.api.Parameter.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.setLabel(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setUnits(value);
break;
case 3:
var value = /** @type {number} */ (reader.readInt64());
msg.setIntValue(value);
break;
case 4:
var value = /** @type {number} */ (reader.readDouble());
msg.setFloatValue(value);
break;
case 5:
var value = new google_protobuf_timestamp_pb.Timestamp;
reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
msg.setTimestamp(value);
break;
case 6:
var value = new google_protobuf_duration_pb.Duration;
reader.readMessage(value,google_protobuf_duration_pb.Duration.deserializeBinaryFromReader);
msg.setDuration(value);
break;
case 7:
var value = /** @type {string} */ (reader.readString());
msg.setStringValue(value);
break;
case 8:
var value = /** @type {boolean} */ (reader.readBool());
msg.setBoolValue(value);
break;
case 10:
var value = /** @type {number} */ (reader.readUint64());
msg.setUintValue(value);
break;
case 9:
var value = /** @type {string} */ (reader.readString());
msg.setNotes(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.bosdyn.api.Parameter.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.bosdyn.api.Parameter.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.bosdyn.api.Parameter} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.bosdyn.api.Parameter.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getLabel();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getUnits();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = /** @type {number} */ (jspb.Message.getField(message, 3));
if (f != null) {
writer.writeInt64(
3,
f
);
}
f = /** @type {number} */ (jspb.Message.getField(message, 4));
if (f != null) {
writer.writeDouble(
4,
f
);
}
f = message.getTimestamp();
if (f != null) {
writer.writeMessage(
5,
f,
google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
);
}
f = message.getDuration();
if (f != null) {
writer.writeMessage(
6,
f,
google_protobuf_duration_pb.Duration.serializeBinaryToWriter
);
}
f = /** @type {string} */ (jspb.Message.getField(message, 7));
if (f != null) {
writer.writeString(
7,
f
);
}
f = /** @type {boolean} */ (jspb.Message.getField(message, 8));
if (f != null) {
writer.writeBool(
8,
f
);
}
f = /** @type {number} */ (jspb.Message.getField(message, 10));
if (f != null) {
writer.writeUint64(
10,
f
);
}
f = message.getNotes();
if (f.length > 0) {
writer.writeString(
9,
f
);
}
};
/**
* optional string label = 1;
* @return {string}
*/
proto.bosdyn.api.Parameter.prototype.getLabel = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.bosdyn.api.Parameter} returns this
*/
proto.bosdyn.api.Parameter.prototype.setLabel = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string units = 2;
* @return {string}
*/
proto.bosdyn.api.Parameter.prototype.getUnits = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.bosdyn.api.Parameter} returns this
*/
proto.bosdyn.api.Parameter.prototype.setUnits = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional int64 int_value = 3;
* @return {number}
*/
proto.bosdyn.api.Parameter.prototype.getIntValue = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
};
/**
* @param {number} value
* @return {!proto.bosdyn.api.Parameter} returns this
*/
proto.bosdyn.api.Parameter.prototype.setIntValue = function(value) {
return jspb.Message.setOneofField(this, 3, proto.bosdyn.api.Parameter.oneofGroups_[0], value);
};
/**
* Clears the field making it undefined.
* @return {!proto.bosdyn.api.Parameter} returns this
*/
proto.bosdyn.api.Parameter.prototype.clearIntValue = function() {
return jspb.Message.setOneofField(this, 3, proto.bosdyn.api.Parameter.oneofGroups_[0], undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.bosdyn.api.Parameter.prototype.hasIntValue = function() {
return jspb.Message.getField(this, 3) != null;
};
/**
* optional double float_value = 4;
* @return {number}
*/
proto.bosdyn.api.Parameter.prototype.getFloatValue = function() {
return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 4, 0.0));
};
/**
* @param {number} value
* @return {!proto.bosdyn.api.Parameter} returns this
*/
proto.bosdyn.api.Parameter.prototype.setFloatValue = function(value) {
return jspb.Message.setOneofField(this, 4, proto.bosdyn.api.Parameter.oneofGroups_[0], value);
};
/**
* Clears the field making it undefined.
* @return {!proto.bosdyn.api.Parameter} returns this
*/
proto.bosdyn.api.Parameter.prototype.clearFloatValue = function() {
return jspb.Message.setOneofField(this, 4, proto.bosdyn.api.Parameter.oneofGroups_[0], undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.bosdyn.api.Parameter.prototype.hasFloatValue = function() {
return jspb.Message.getField(this, 4) != null;
};
/**
* optional google.protobuf.Timestamp timestamp = 5;
* @return {?proto.google.protobuf.Timestamp}
*/
proto.bosdyn.api.Parameter.prototype.getTimestamp = function() {
return /** @type{?proto.google.protobuf.Timestamp} */ (
jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 5));
};
/**
* @param {?proto.google.protobuf.Timestamp|undefined} value
* @return {!proto.bosdyn.api.Parameter} returns this
*/
proto.bosdyn.api.Parameter.prototype.setTimestamp = function(value) {
return jspb.Message.setOneofWrapperField(this, 5, proto.bosdyn.api.Parameter.oneofGroups_[0], value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.bosdyn.api.Parameter} returns this
*/
proto.bosdyn.api.Parameter.prototype.clearTimestamp = function() {
return this.setTimestamp(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.bosdyn.api.Parameter.prototype.hasTimestamp = function() {
return jspb.Message.getField(this, 5) != null;
};
/**
* optional google.protobuf.Duration duration = 6;
* @return {?proto.google.protobuf.Duration}
*/
proto.bosdyn.api.Parameter.prototype.getDuration = function() {
return /** @type{?proto.google.protobuf.Duration} */ (
jspb.Message.getWrapperField(this, google_protobuf_duration_pb.Duration, 6));
};
/**
* @param {?proto.google.protobuf.Duration|undefined} value
* @return {!proto.bosdyn.api.Parameter} returns this
*/
proto.bosdyn.api.Parameter.prototype.setDuration = function(value) {
return jspb.Message.setOneofWrapperField(this, 6, proto.bosdyn.api.Parameter.oneofGroups_[0], value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.bosdyn.api.Parameter} returns this
*/
proto.bosdyn.api.Parameter.prototype.clearDuration = function() {
return this.setDuration(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.bosdyn.api.Parameter.prototype.hasDuration = function() {
return jspb.Message.getField(this, 6) != null;
};
/**
* optional string string_value = 7;
* @return {string}
*/
proto.bosdyn.api.Parameter.prototype.getStringValue = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, ""));
};
/**
* @param {string} value
* @return {!proto.bosdyn.api.Parameter} returns this
*/
proto.bosdyn.api.Parameter.prototype.setStringValue = function(value) {
return jspb.Message.setOneofField(this, 7, proto.bosdyn.api.Parameter.oneofGroups_[0], value);
};
/**
* Clears the field making it undefined.
* @return {!proto.bosdyn.api.Parameter} returns this
*/
proto.bosdyn.api.Parameter.prototype.clearStringValue = function() {
return jspb.Message.setOneofField(this, 7, proto.bosdyn.api.Parameter.oneofGroups_[0], undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.bosdyn.api.Parameter.prototype.hasStringValue = function() {
return jspb.Message.getField(this, 7) != null;
};
/**
* optional bool bool_value = 8;
* @return {boolean}
*/
proto.bosdyn.api.Parameter.prototype.getBoolValue = function() {
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false));
};
/**
* @param {boolean} value
* @return {!proto.bosdyn.api.Parameter} returns this
*/
proto.bosdyn.api.Parameter.prototype.setBoolValue = function(value) {
return jspb.Message.setOneofField(this, 8, proto.bosdyn.api.Parameter.oneofGroups_[0], value);
};
/**
* Clears the field making it undefined.
* @return {!proto.bosdyn.api.Parameter} returns this
*/
proto.bosdyn.api.Parameter.prototype.clearBoolValue = function() {
return jspb.Message.setOneofField(this, 8, proto.bosdyn.api.Parameter.oneofGroups_[0], undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.bosdyn.api.Parameter.prototype.hasBoolValue = function() {
return jspb.Message.getField(this, 8) != null;
};
/**
* optional uint64 uint_value = 10;
* @return {number}
*/
proto.bosdyn.api.Parameter.prototype.getUintValue = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 0));
};
/**
* @param {number} value
* @return {!proto.bosdyn.api.Parameter} returns this
*/
proto.bosdyn.api.Parameter.prototype.setUintValue = function(value) {
return jspb.Message.setOneofField(this, 10, proto.bosdyn.api.Parameter.oneofGroups_[0], value);
};
/**
* Clears the field making it undefined.
* @return {!proto.bosdyn.api.Parameter} returns this
*/
proto.bosdyn.api.Parameter.prototype.clearUintValue = function() {
return jspb.Message.setOneofField(this, 10, proto.bosdyn.api.Parameter.oneofGroups_[0], undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.bosdyn.api.Parameter.prototype.hasUintValue = function() {
return jspb.Message.getField(this, 10) != null;
};
/**
* optional string notes = 9;
* @return {string}
*/
proto.bosdyn.api.Parameter.prototype.getNotes = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, ""));
};
/**
* @param {string} value
* @return {!proto.bosdyn.api.Parameter} returns this
*/
proto.bosdyn.api.Parameter.prototype.setNotes = function(value) {
return jspb.Message.setProto3StringField(this, 9, value);
};
goog.object.extend(exports, proto.bosdyn.api);