skywalking-apache
Version:
The NodeJS agent for Apache SkyWalking
1,006 lines • 35.6 kB
JavaScript
"use strict";
// source: language-agent/Meter.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 common_Common_pb = require('../common/Common_pb.js');
goog.object.extend(proto, common_Common_pb);
goog.exportSymbol('proto.Label', null, global);
goog.exportSymbol('proto.MeterBucketValue', null, global);
goog.exportSymbol('proto.MeterData', null, global);
goog.exportSymbol('proto.MeterData.MetricCase', null, global);
goog.exportSymbol('proto.MeterHistogram', null, global);
goog.exportSymbol('proto.MeterSingleValue', 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.Label = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.Label, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.Label.displayName = 'proto.Label';
}
/**
* 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.MeterBucketValue = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.MeterBucketValue, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.MeterBucketValue.displayName = 'proto.MeterBucketValue';
}
/**
* 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.MeterSingleValue = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.MeterSingleValue.repeatedFields_, null);
};
goog.inherits(proto.MeterSingleValue, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.MeterSingleValue.displayName = 'proto.MeterSingleValue';
}
/**
* 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.MeterHistogram = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.MeterHistogram.repeatedFields_, null);
};
goog.inherits(proto.MeterHistogram, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.MeterHistogram.displayName = 'proto.MeterHistogram';
}
/**
* 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.MeterData = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, proto.MeterData.oneofGroups_);
};
goog.inherits(proto.MeterData, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.MeterData.displayName = 'proto.MeterData';
}
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.Label.prototype.toObject = function (opt_includeInstance) {
return proto.Label.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.Label} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.Label.toObject = function (includeInstance, msg) {
var f, obj = {
name: jspb.Message.getFieldWithDefault(msg, 1, ""),
value: jspb.Message.getFieldWithDefault(msg, 2, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.Label}
*/
proto.Label.deserializeBinary = function (bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.Label;
return proto.Label.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.Label} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.Label}
*/
proto.Label.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 = /** @type {string} */ (reader.readString());
msg.setValue(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.Label.prototype.serializeBinary = function () {
var writer = new jspb.BinaryWriter();
proto.Label.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.Label} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.Label.serializeBinaryToWriter = function (message, writer) {
var f = undefined;
f = message.getName();
if (f.length > 0) {
writer.writeString(1, f);
}
f = message.getValue();
if (f.length > 0) {
writer.writeString(2, f);
}
};
/**
* optional string name = 1;
* @return {string}
*/
proto.Label.prototype.getName = function () {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.Label} returns this
*/
proto.Label.prototype.setName = function (value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string value = 2;
* @return {string}
*/
proto.Label.prototype.getValue = function () {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.Label} returns this
*/
proto.Label.prototype.setValue = function (value) {
return jspb.Message.setProto3StringField(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.MeterBucketValue.prototype.toObject = function (opt_includeInstance) {
return proto.MeterBucketValue.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.MeterBucketValue} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.MeterBucketValue.toObject = function (includeInstance, msg) {
var f, obj = {
bucket: jspb.Message.getFloatingPointFieldWithDefault(msg, 1, 0.0),
count: jspb.Message.getFieldWithDefault(msg, 2, 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.MeterBucketValue}
*/
proto.MeterBucketValue.deserializeBinary = function (bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.MeterBucketValue;
return proto.MeterBucketValue.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.MeterBucketValue} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.MeterBucketValue}
*/
proto.MeterBucketValue.deserializeBinaryFromReader = function (msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {number} */ (reader.readDouble());
msg.setBucket(value);
break;
case 2:
var value = /** @type {number} */ (reader.readInt64());
msg.setCount(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.MeterBucketValue.prototype.serializeBinary = function () {
var writer = new jspb.BinaryWriter();
proto.MeterBucketValue.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.MeterBucketValue} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.MeterBucketValue.serializeBinaryToWriter = function (message, writer) {
var f = undefined;
f = message.getBucket();
if (f !== 0.0) {
writer.writeDouble(1, f);
}
f = message.getCount();
if (f !== 0) {
writer.writeInt64(2, f);
}
};
/**
* optional double bucket = 1;
* @return {number}
*/
proto.MeterBucketValue.prototype.getBucket = function () {
return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 1, 0.0));
};
/**
* @param {number} value
* @return {!proto.MeterBucketValue} returns this
*/
proto.MeterBucketValue.prototype.setBucket = function (value) {
return jspb.Message.setProto3FloatField(this, 1, value);
};
/**
* optional int64 count = 2;
* @return {number}
*/
proto.MeterBucketValue.prototype.getCount = function () {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
};
/**
* @param {number} value
* @return {!proto.MeterBucketValue} returns this
*/
proto.MeterBucketValue.prototype.setCount = function (value) {
return jspb.Message.setProto3IntField(this, 2, value);
};
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.MeterSingleValue.repeatedFields_ = [2];
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.MeterSingleValue.prototype.toObject = function (opt_includeInstance) {
return proto.MeterSingleValue.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.MeterSingleValue} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.MeterSingleValue.toObject = function (includeInstance, msg) {
var f, obj = {
name: jspb.Message.getFieldWithDefault(msg, 1, ""),
labelsList: jspb.Message.toObjectList(msg.getLabelsList(), proto.Label.toObject, includeInstance),
value: jspb.Message.getFloatingPointFieldWithDefault(msg, 3, 0.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.MeterSingleValue}
*/
proto.MeterSingleValue.deserializeBinary = function (bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.MeterSingleValue;
return proto.MeterSingleValue.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.MeterSingleValue} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.MeterSingleValue}
*/
proto.MeterSingleValue.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.Label;
reader.readMessage(value, proto.Label.deserializeBinaryFromReader);
msg.addLabels(value);
break;
case 3:
var value = /** @type {number} */ (reader.readDouble());
msg.setValue(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.MeterSingleValue.prototype.serializeBinary = function () {
var writer = new jspb.BinaryWriter();
proto.MeterSingleValue.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.MeterSingleValue} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.MeterSingleValue.serializeBinaryToWriter = function (message, writer) {
var f = undefined;
f = message.getName();
if (f.length > 0) {
writer.writeString(1, f);
}
f = message.getLabelsList();
if (f.length > 0) {
writer.writeRepeatedMessage(2, f, proto.Label.serializeBinaryToWriter);
}
f = message.getValue();
if (f !== 0.0) {
writer.writeDouble(3, f);
}
};
/**
* optional string name = 1;
* @return {string}
*/
proto.MeterSingleValue.prototype.getName = function () {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.MeterSingleValue} returns this
*/
proto.MeterSingleValue.prototype.setName = function (value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* repeated Label labels = 2;
* @return {!Array<!proto.Label>}
*/
proto.MeterSingleValue.prototype.getLabelsList = function () {
return /** @type{!Array<!proto.Label>} */ (jspb.Message.getRepeatedWrapperField(this, proto.Label, 2));
};
/**
* @param {!Array<!proto.Label>} value
* @return {!proto.MeterSingleValue} returns this
*/
proto.MeterSingleValue.prototype.setLabelsList = function (value) {
return jspb.Message.setRepeatedWrapperField(this, 2, value);
};
/**
* @param {!proto.Label=} opt_value
* @param {number=} opt_index
* @return {!proto.Label}
*/
proto.MeterSingleValue.prototype.addLabels = function (opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.Label, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.MeterSingleValue} returns this
*/
proto.MeterSingleValue.prototype.clearLabelsList = function () {
return this.setLabelsList([]);
};
/**
* optional double value = 3;
* @return {number}
*/
proto.MeterSingleValue.prototype.getValue = function () {
return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 3, 0.0));
};
/**
* @param {number} value
* @return {!proto.MeterSingleValue} returns this
*/
proto.MeterSingleValue.prototype.setValue = function (value) {
return jspb.Message.setProto3FloatField(this, 3, value);
};
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.MeterHistogram.repeatedFields_ = [2, 3];
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.MeterHistogram.prototype.toObject = function (opt_includeInstance) {
return proto.MeterHistogram.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.MeterHistogram} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.MeterHistogram.toObject = function (includeInstance, msg) {
var f, obj = {
name: jspb.Message.getFieldWithDefault(msg, 1, ""),
labelsList: jspb.Message.toObjectList(msg.getLabelsList(), proto.Label.toObject, includeInstance),
valuesList: jspb.Message.toObjectList(msg.getValuesList(), proto.MeterBucketValue.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.MeterHistogram}
*/
proto.MeterHistogram.deserializeBinary = function (bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.MeterHistogram;
return proto.MeterHistogram.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.MeterHistogram} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.MeterHistogram}
*/
proto.MeterHistogram.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.Label;
reader.readMessage(value, proto.Label.deserializeBinaryFromReader);
msg.addLabels(value);
break;
case 3:
var value = new proto.MeterBucketValue;
reader.readMessage(value, proto.MeterBucketValue.deserializeBinaryFromReader);
msg.addValues(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.MeterHistogram.prototype.serializeBinary = function () {
var writer = new jspb.BinaryWriter();
proto.MeterHistogram.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.MeterHistogram} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.MeterHistogram.serializeBinaryToWriter = function (message, writer) {
var f = undefined;
f = message.getName();
if (f.length > 0) {
writer.writeString(1, f);
}
f = message.getLabelsList();
if (f.length > 0) {
writer.writeRepeatedMessage(2, f, proto.Label.serializeBinaryToWriter);
}
f = message.getValuesList();
if (f.length > 0) {
writer.writeRepeatedMessage(3, f, proto.MeterBucketValue.serializeBinaryToWriter);
}
};
/**
* optional string name = 1;
* @return {string}
*/
proto.MeterHistogram.prototype.getName = function () {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.MeterHistogram} returns this
*/
proto.MeterHistogram.prototype.setName = function (value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* repeated Label labels = 2;
* @return {!Array<!proto.Label>}
*/
proto.MeterHistogram.prototype.getLabelsList = function () {
return /** @type{!Array<!proto.Label>} */ (jspb.Message.getRepeatedWrapperField(this, proto.Label, 2));
};
/**
* @param {!Array<!proto.Label>} value
* @return {!proto.MeterHistogram} returns this
*/
proto.MeterHistogram.prototype.setLabelsList = function (value) {
return jspb.Message.setRepeatedWrapperField(this, 2, value);
};
/**
* @param {!proto.Label=} opt_value
* @param {number=} opt_index
* @return {!proto.Label}
*/
proto.MeterHistogram.prototype.addLabels = function (opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.Label, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.MeterHistogram} returns this
*/
proto.MeterHistogram.prototype.clearLabelsList = function () {
return this.setLabelsList([]);
};
/**
* repeated MeterBucketValue values = 3;
* @return {!Array<!proto.MeterBucketValue>}
*/
proto.MeterHistogram.prototype.getValuesList = function () {
return /** @type{!Array<!proto.MeterBucketValue>} */ (jspb.Message.getRepeatedWrapperField(this, proto.MeterBucketValue, 3));
};
/**
* @param {!Array<!proto.MeterBucketValue>} value
* @return {!proto.MeterHistogram} returns this
*/
proto.MeterHistogram.prototype.setValuesList = function (value) {
return jspb.Message.setRepeatedWrapperField(this, 3, value);
};
/**
* @param {!proto.MeterBucketValue=} opt_value
* @param {number=} opt_index
* @return {!proto.MeterBucketValue}
*/
proto.MeterHistogram.prototype.addValues = function (opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.MeterBucketValue, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.MeterHistogram} returns this
*/
proto.MeterHistogram.prototype.clearValuesList = function () {
return this.setValuesList([]);
};
/**
* 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.MeterData.oneofGroups_ = [[1, 2]];
/**
* @enum {number}
*/
proto.MeterData.MetricCase = {
METRIC_NOT_SET: 0,
SINGLEVALUE: 1,
HISTOGRAM: 2
};
/**
* @return {proto.MeterData.MetricCase}
*/
proto.MeterData.prototype.getMetricCase = function () {
return /** @type {proto.MeterData.MetricCase} */ (jspb.Message.computeOneofCase(this, proto.MeterData.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.MeterData.prototype.toObject = function (opt_includeInstance) {
return proto.MeterData.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.MeterData} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.MeterData.toObject = function (includeInstance, msg) {
var f, obj = {
singlevalue: (f = msg.getSinglevalue()) && proto.MeterSingleValue.toObject(includeInstance, f),
histogram: (f = msg.getHistogram()) && proto.MeterHistogram.toObject(includeInstance, f),
service: jspb.Message.getFieldWithDefault(msg, 3, ""),
serviceinstance: jspb.Message.getFieldWithDefault(msg, 4, ""),
timestamp: jspb.Message.getFieldWithDefault(msg, 5, 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.MeterData}
*/
proto.MeterData.deserializeBinary = function (bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.MeterData;
return proto.MeterData.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.MeterData} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.MeterData}
*/
proto.MeterData.deserializeBinaryFromReader = function (msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new proto.MeterSingleValue;
reader.readMessage(value, proto.MeterSingleValue.deserializeBinaryFromReader);
msg.setSinglevalue(value);
break;
case 2:
var value = new proto.MeterHistogram;
reader.readMessage(value, proto.MeterHistogram.deserializeBinaryFromReader);
msg.setHistogram(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setService(value);
break;
case 4:
var value = /** @type {string} */ (reader.readString());
msg.setServiceinstance(value);
break;
case 5:
var value = /** @type {number} */ (reader.readInt64());
msg.setTimestamp(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.MeterData.prototype.serializeBinary = function () {
var writer = new jspb.BinaryWriter();
proto.MeterData.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.MeterData} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.MeterData.serializeBinaryToWriter = function (message, writer) {
var f = undefined;
f = message.getSinglevalue();
if (f != null) {
writer.writeMessage(1, f, proto.MeterSingleValue.serializeBinaryToWriter);
}
f = message.getHistogram();
if (f != null) {
writer.writeMessage(2, f, proto.MeterHistogram.serializeBinaryToWriter);
}
f = message.getService();
if (f.length > 0) {
writer.writeString(3, f);
}
f = message.getServiceinstance();
if (f.length > 0) {
writer.writeString(4, f);
}
f = message.getTimestamp();
if (f !== 0) {
writer.writeInt64(5, f);
}
};
/**
* optional MeterSingleValue singleValue = 1;
* @return {?proto.MeterSingleValue}
*/
proto.MeterData.prototype.getSinglevalue = function () {
return /** @type{?proto.MeterSingleValue} */ (jspb.Message.getWrapperField(this, proto.MeterSingleValue, 1));
};
/**
* @param {?proto.MeterSingleValue|undefined} value
* @return {!proto.MeterData} returns this
*/
proto.MeterData.prototype.setSinglevalue = function (value) {
return jspb.Message.setOneofWrapperField(this, 1, proto.MeterData.oneofGroups_[0], value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.MeterData} returns this
*/
proto.MeterData.prototype.clearSinglevalue = function () {
return this.setSinglevalue(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.MeterData.prototype.hasSinglevalue = function () {
return jspb.Message.getField(this, 1) != null;
};
/**
* optional MeterHistogram histogram = 2;
* @return {?proto.MeterHistogram}
*/
proto.MeterData.prototype.getHistogram = function () {
return /** @type{?proto.MeterHistogram} */ (jspb.Message.getWrapperField(this, proto.MeterHistogram, 2));
};
/**
* @param {?proto.MeterHistogram|undefined} value
* @return {!proto.MeterData} returns this
*/
proto.MeterData.prototype.setHistogram = function (value) {
return jspb.Message.setOneofWrapperField(this, 2, proto.MeterData.oneofGroups_[0], value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.MeterData} returns this
*/
proto.MeterData.prototype.clearHistogram = function () {
return this.setHistogram(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.MeterData.prototype.hasHistogram = function () {
return jspb.Message.getField(this, 2) != null;
};
/**
* optional string service = 3;
* @return {string}
*/
proto.MeterData.prototype.getService = function () {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/**
* @param {string} value
* @return {!proto.MeterData} returns this
*/
proto.MeterData.prototype.setService = function (value) {
return jspb.Message.setProto3StringField(this, 3, value);
};
/**
* optional string serviceInstance = 4;
* @return {string}
*/
proto.MeterData.prototype.getServiceinstance = function () {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
};
/**
* @param {string} value
* @return {!proto.MeterData} returns this
*/
proto.MeterData.prototype.setServiceinstance = function (value) {
return jspb.Message.setProto3StringField(this, 4, value);
};
/**
* optional int64 timestamp = 5;
* @return {number}
*/
proto.MeterData.prototype.getTimestamp = function () {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0));
};
/**
* @param {number} value
* @return {!proto.MeterData} returns this
*/
proto.MeterData.prototype.setTimestamp = function (value) {
return jspb.Message.setProto3IntField(this, 5, value);
};
goog.object.extend(exports, proto);
//# sourceMappingURL=Meter_pb.js.map