chirpstack/api/js/google/api/distribution_pb.js
2022-04-06 21:18:32 +01:00

1728 lines
54 KiB
JavaScript
Vendored

/**
* @fileoverview
* @enhanceable
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var google_protobuf_any_pb = require('google-protobuf/google/protobuf/any_pb.js');
var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js');
goog.exportSymbol('proto.google.api.Distribution', null, global);
goog.exportSymbol('proto.google.api.Distribution.BucketOptions', null, global);
goog.exportSymbol('proto.google.api.Distribution.BucketOptions.Explicit', null, global);
goog.exportSymbol('proto.google.api.Distribution.BucketOptions.Exponential', null, global);
goog.exportSymbol('proto.google.api.Distribution.BucketOptions.Linear', null, global);
goog.exportSymbol('proto.google.api.Distribution.Exemplar', null, global);
goog.exportSymbol('proto.google.api.Distribution.Range', 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.google.api.Distribution = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.google.api.Distribution.repeatedFields_, null);
};
goog.inherits(proto.google.api.Distribution, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.google.api.Distribution.displayName = 'proto.google.api.Distribution';
}
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.google.api.Distribution.repeatedFields_ = [7,10];
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.google.api.Distribution.prototype.toObject = function(opt_includeInstance) {
return proto.google.api.Distribution.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.google.api.Distribution} msg The msg instance to transform.
* @return {!Object}
*/
proto.google.api.Distribution.toObject = function(includeInstance, msg) {
var f, obj = {
count: msg.getCount(),
mean: msg.getMean(),
sumOfSquaredDeviation: msg.getSumOfSquaredDeviation(),
range: (f = msg.getRange()) && proto.google.api.Distribution.Range.toObject(includeInstance, f),
bucketOptions: (f = msg.getBucketOptions()) && proto.google.api.Distribution.BucketOptions.toObject(includeInstance, f),
bucketCountsList: jspb.Message.getField(msg, 7),
exemplarsList: jspb.Message.toObjectList(msg.getExemplarsList(),
proto.google.api.Distribution.Exemplar.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.google.api.Distribution}
*/
proto.google.api.Distribution.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.google.api.Distribution;
return proto.google.api.Distribution.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.google.api.Distribution} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.google.api.Distribution}
*/
proto.google.api.Distribution.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {number} */ (reader.readInt64());
msg.setCount(value);
break;
case 2:
var value = /** @type {number} */ (reader.readDouble());
msg.setMean(value);
break;
case 3:
var value = /** @type {number} */ (reader.readDouble());
msg.setSumOfSquaredDeviation(value);
break;
case 4:
var value = new proto.google.api.Distribution.Range;
reader.readMessage(value,proto.google.api.Distribution.Range.deserializeBinaryFromReader);
msg.setRange(value);
break;
case 6:
var value = new proto.google.api.Distribution.BucketOptions;
reader.readMessage(value,proto.google.api.Distribution.BucketOptions.deserializeBinaryFromReader);
msg.setBucketOptions(value);
break;
case 7:
var value = /** @type {!Array.<number>} */ (reader.readPackedInt64());
msg.setBucketCountsList(value);
break;
case 10:
var value = new proto.google.api.Distribution.Exemplar;
reader.readMessage(value,proto.google.api.Distribution.Exemplar.deserializeBinaryFromReader);
msg.getExemplarsList().push(value);
msg.setExemplarsList(msg.getExemplarsList());
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Class method variant: serializes the given message to binary data
* (in protobuf wire format), writing to the given BinaryWriter.
* @param {!proto.google.api.Distribution} message
* @param {!jspb.BinaryWriter} writer
*/
proto.google.api.Distribution.serializeBinaryToWriter = function(message, writer) {
message.serializeBinaryToWriter(writer);
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.google.api.Distribution.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
this.serializeBinaryToWriter(writer);
return writer.getResultBuffer();
};
/**
* Serializes the message to binary data (in protobuf wire format),
* writing to the given BinaryWriter.
* @param {!jspb.BinaryWriter} writer
*/
proto.google.api.Distribution.prototype.serializeBinaryToWriter = function (writer) {
var f = undefined;
f = this.getCount();
if (f !== 0) {
writer.writeInt64(
1,
f
);
}
f = this.getMean();
if (f !== 0.0) {
writer.writeDouble(
2,
f
);
}
f = this.getSumOfSquaredDeviation();
if (f !== 0.0) {
writer.writeDouble(
3,
f
);
}
f = this.getRange();
if (f != null) {
writer.writeMessage(
4,
f,
proto.google.api.Distribution.Range.serializeBinaryToWriter
);
}
f = this.getBucketOptions();
if (f != null) {
writer.writeMessage(
6,
f,
proto.google.api.Distribution.BucketOptions.serializeBinaryToWriter
);
}
f = this.getBucketCountsList();
if (f.length > 0) {
writer.writePackedInt64(
7,
f
);
}
f = this.getExemplarsList();
if (f.length > 0) {
writer.writeRepeatedMessage(
10,
f,
proto.google.api.Distribution.Exemplar.serializeBinaryToWriter
);
}
};
/**
* Creates a deep clone of this proto. No data is shared with the original.
* @return {!proto.google.api.Distribution} The clone.
*/
proto.google.api.Distribution.prototype.cloneMessage = function() {
return /** @type {!proto.google.api.Distribution} */ (jspb.Message.cloneMessage(this));
};
/**
* optional int64 count = 1;
* @return {number}
*/
proto.google.api.Distribution.prototype.getCount = function() {
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 1, 0));
};
/** @param {number} value */
proto.google.api.Distribution.prototype.setCount = function(value) {
jspb.Message.setField(this, 1, value);
};
/**
* optional double mean = 2;
* @return {number}
*/
proto.google.api.Distribution.prototype.getMean = function() {
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 2, 0));
};
/** @param {number} value */
proto.google.api.Distribution.prototype.setMean = function(value) {
jspb.Message.setField(this, 2, value);
};
/**
* optional double sum_of_squared_deviation = 3;
* @return {number}
*/
proto.google.api.Distribution.prototype.getSumOfSquaredDeviation = function() {
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 3, 0));
};
/** @param {number} value */
proto.google.api.Distribution.prototype.setSumOfSquaredDeviation = function(value) {
jspb.Message.setField(this, 3, value);
};
/**
* optional Range range = 4;
* @return {proto.google.api.Distribution.Range}
*/
proto.google.api.Distribution.prototype.getRange = function() {
return /** @type{proto.google.api.Distribution.Range} */ (
jspb.Message.getWrapperField(this, proto.google.api.Distribution.Range, 4));
};
/** @param {proto.google.api.Distribution.Range|undefined} value */
proto.google.api.Distribution.prototype.setRange = function(value) {
jspb.Message.setWrapperField(this, 4, value);
};
proto.google.api.Distribution.prototype.clearRange = function() {
this.setRange(undefined);
};
/**
* Returns whether this field is set.
* @return{!boolean}
*/
proto.google.api.Distribution.prototype.hasRange = function() {
return jspb.Message.getField(this, 4) != null;
};
/**
* optional BucketOptions bucket_options = 6;
* @return {proto.google.api.Distribution.BucketOptions}
*/
proto.google.api.Distribution.prototype.getBucketOptions = function() {
return /** @type{proto.google.api.Distribution.BucketOptions} */ (
jspb.Message.getWrapperField(this, proto.google.api.Distribution.BucketOptions, 6));
};
/** @param {proto.google.api.Distribution.BucketOptions|undefined} value */
proto.google.api.Distribution.prototype.setBucketOptions = function(value) {
jspb.Message.setWrapperField(this, 6, value);
};
proto.google.api.Distribution.prototype.clearBucketOptions = function() {
this.setBucketOptions(undefined);
};
/**
* Returns whether this field is set.
* @return{!boolean}
*/
proto.google.api.Distribution.prototype.hasBucketOptions = function() {
return jspb.Message.getField(this, 6) != null;
};
/**
* repeated int64 bucket_counts = 7;
* If you change this array by adding, removing or replacing elements, or if you
* replace the array itself, then you must call the setter to update it.
* @return {!Array.<number>}
*/
proto.google.api.Distribution.prototype.getBucketCountsList = function() {
return /** @type {!Array.<number>} */ (jspb.Message.getField(this, 7));
};
/** @param {Array.<number>} value */
proto.google.api.Distribution.prototype.setBucketCountsList = function(value) {
jspb.Message.setField(this, 7, value || []);
};
proto.google.api.Distribution.prototype.clearBucketCountsList = function() {
jspb.Message.setField(this, 7, []);
};
/**
* repeated Exemplar exemplars = 10;
* If you change this array by adding, removing or replacing elements, or if you
* replace the array itself, then you must call the setter to update it.
* @return {!Array.<!proto.google.api.Distribution.Exemplar>}
*/
proto.google.api.Distribution.prototype.getExemplarsList = function() {
return /** @type{!Array.<!proto.google.api.Distribution.Exemplar>} */ (
jspb.Message.getRepeatedWrapperField(this, proto.google.api.Distribution.Exemplar, 10));
};
/** @param {Array.<!proto.google.api.Distribution.Exemplar>} value */
proto.google.api.Distribution.prototype.setExemplarsList = function(value) {
jspb.Message.setRepeatedWrapperField(this, 10, value);
};
proto.google.api.Distribution.prototype.clearExemplarsList = function() {
this.setExemplarsList([]);
};
/**
* 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.google.api.Distribution.Range = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.google.api.Distribution.Range, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.google.api.Distribution.Range.displayName = 'proto.google.api.Distribution.Range';
}
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.google.api.Distribution.Range.prototype.toObject = function(opt_includeInstance) {
return proto.google.api.Distribution.Range.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.google.api.Distribution.Range} msg The msg instance to transform.
* @return {!Object}
*/
proto.google.api.Distribution.Range.toObject = function(includeInstance, msg) {
var f, obj = {
min: msg.getMin(),
max: msg.getMax()
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.google.api.Distribution.Range}
*/
proto.google.api.Distribution.Range.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.google.api.Distribution.Range;
return proto.google.api.Distribution.Range.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.google.api.Distribution.Range} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.google.api.Distribution.Range}
*/
proto.google.api.Distribution.Range.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.setMin(value);
break;
case 2:
var value = /** @type {number} */ (reader.readDouble());
msg.setMax(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Class method variant: serializes the given message to binary data
* (in protobuf wire format), writing to the given BinaryWriter.
* @param {!proto.google.api.Distribution.Range} message
* @param {!jspb.BinaryWriter} writer
*/
proto.google.api.Distribution.Range.serializeBinaryToWriter = function(message, writer) {
message.serializeBinaryToWriter(writer);
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.google.api.Distribution.Range.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
this.serializeBinaryToWriter(writer);
return writer.getResultBuffer();
};
/**
* Serializes the message to binary data (in protobuf wire format),
* writing to the given BinaryWriter.
* @param {!jspb.BinaryWriter} writer
*/
proto.google.api.Distribution.Range.prototype.serializeBinaryToWriter = function (writer) {
var f = undefined;
f = this.getMin();
if (f !== 0.0) {
writer.writeDouble(
1,
f
);
}
f = this.getMax();
if (f !== 0.0) {
writer.writeDouble(
2,
f
);
}
};
/**
* Creates a deep clone of this proto. No data is shared with the original.
* @return {!proto.google.api.Distribution.Range} The clone.
*/
proto.google.api.Distribution.Range.prototype.cloneMessage = function() {
return /** @type {!proto.google.api.Distribution.Range} */ (jspb.Message.cloneMessage(this));
};
/**
* optional double min = 1;
* @return {number}
*/
proto.google.api.Distribution.Range.prototype.getMin = function() {
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 1, 0));
};
/** @param {number} value */
proto.google.api.Distribution.Range.prototype.setMin = function(value) {
jspb.Message.setField(this, 1, value);
};
/**
* optional double max = 2;
* @return {number}
*/
proto.google.api.Distribution.Range.prototype.getMax = function() {
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 2, 0));
};
/** @param {number} value */
proto.google.api.Distribution.Range.prototype.setMax = function(value) {
jspb.Message.setField(this, 2, 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.google.api.Distribution.BucketOptions = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, proto.google.api.Distribution.BucketOptions.oneofGroups_);
};
goog.inherits(proto.google.api.Distribution.BucketOptions, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.google.api.Distribution.BucketOptions.displayName = 'proto.google.api.Distribution.BucketOptions';
}
/**
* 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.google.api.Distribution.BucketOptions.oneofGroups_ = [[1,2,3]];
/**
* @enum {number}
*/
proto.google.api.Distribution.BucketOptions.OptionsCase = {
OPTIONS_NOT_SET: 0,
LINEAR_BUCKETS: 1,
EXPONENTIAL_BUCKETS: 2,
EXPLICIT_BUCKETS: 3
};
/**
* @return {proto.google.api.Distribution.BucketOptions.OptionsCase}
*/
proto.google.api.Distribution.BucketOptions.prototype.getOptionsCase = function() {
return /** @type {proto.google.api.Distribution.BucketOptions.OptionsCase} */(jspb.Message.computeOneofCase(this, proto.google.api.Distribution.BucketOptions.oneofGroups_[0]));
};
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.google.api.Distribution.BucketOptions.prototype.toObject = function(opt_includeInstance) {
return proto.google.api.Distribution.BucketOptions.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.google.api.Distribution.BucketOptions} msg The msg instance to transform.
* @return {!Object}
*/
proto.google.api.Distribution.BucketOptions.toObject = function(includeInstance, msg) {
var f, obj = {
linearBuckets: (f = msg.getLinearBuckets()) && proto.google.api.Distribution.BucketOptions.Linear.toObject(includeInstance, f),
exponentialBuckets: (f = msg.getExponentialBuckets()) && proto.google.api.Distribution.BucketOptions.Exponential.toObject(includeInstance, f),
explicitBuckets: (f = msg.getExplicitBuckets()) && proto.google.api.Distribution.BucketOptions.Explicit.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.google.api.Distribution.BucketOptions}
*/
proto.google.api.Distribution.BucketOptions.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.google.api.Distribution.BucketOptions;
return proto.google.api.Distribution.BucketOptions.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.google.api.Distribution.BucketOptions} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.google.api.Distribution.BucketOptions}
*/
proto.google.api.Distribution.BucketOptions.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new proto.google.api.Distribution.BucketOptions.Linear;
reader.readMessage(value,proto.google.api.Distribution.BucketOptions.Linear.deserializeBinaryFromReader);
msg.setLinearBuckets(value);
break;
case 2:
var value = new proto.google.api.Distribution.BucketOptions.Exponential;
reader.readMessage(value,proto.google.api.Distribution.BucketOptions.Exponential.deserializeBinaryFromReader);
msg.setExponentialBuckets(value);
break;
case 3:
var value = new proto.google.api.Distribution.BucketOptions.Explicit;
reader.readMessage(value,proto.google.api.Distribution.BucketOptions.Explicit.deserializeBinaryFromReader);
msg.setExplicitBuckets(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Class method variant: serializes the given message to binary data
* (in protobuf wire format), writing to the given BinaryWriter.
* @param {!proto.google.api.Distribution.BucketOptions} message
* @param {!jspb.BinaryWriter} writer
*/
proto.google.api.Distribution.BucketOptions.serializeBinaryToWriter = function(message, writer) {
message.serializeBinaryToWriter(writer);
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.google.api.Distribution.BucketOptions.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
this.serializeBinaryToWriter(writer);
return writer.getResultBuffer();
};
/**
* Serializes the message to binary data (in protobuf wire format),
* writing to the given BinaryWriter.
* @param {!jspb.BinaryWriter} writer
*/
proto.google.api.Distribution.BucketOptions.prototype.serializeBinaryToWriter = function (writer) {
var f = undefined;
f = this.getLinearBuckets();
if (f != null) {
writer.writeMessage(
1,
f,
proto.google.api.Distribution.BucketOptions.Linear.serializeBinaryToWriter
);
}
f = this.getExponentialBuckets();
if (f != null) {
writer.writeMessage(
2,
f,
proto.google.api.Distribution.BucketOptions.Exponential.serializeBinaryToWriter
);
}
f = this.getExplicitBuckets();
if (f != null) {
writer.writeMessage(
3,
f,
proto.google.api.Distribution.BucketOptions.Explicit.serializeBinaryToWriter
);
}
};
/**
* Creates a deep clone of this proto. No data is shared with the original.
* @return {!proto.google.api.Distribution.BucketOptions} The clone.
*/
proto.google.api.Distribution.BucketOptions.prototype.cloneMessage = function() {
return /** @type {!proto.google.api.Distribution.BucketOptions} */ (jspb.Message.cloneMessage(this));
};
/**
* optional Linear linear_buckets = 1;
* @return {proto.google.api.Distribution.BucketOptions.Linear}
*/
proto.google.api.Distribution.BucketOptions.prototype.getLinearBuckets = function() {
return /** @type{proto.google.api.Distribution.BucketOptions.Linear} */ (
jspb.Message.getWrapperField(this, proto.google.api.Distribution.BucketOptions.Linear, 1));
};
/** @param {proto.google.api.Distribution.BucketOptions.Linear|undefined} value */
proto.google.api.Distribution.BucketOptions.prototype.setLinearBuckets = function(value) {
jspb.Message.setOneofWrapperField(this, 1, proto.google.api.Distribution.BucketOptions.oneofGroups_[0], value);
};
proto.google.api.Distribution.BucketOptions.prototype.clearLinearBuckets = function() {
this.setLinearBuckets(undefined);
};
/**
* Returns whether this field is set.
* @return{!boolean}
*/
proto.google.api.Distribution.BucketOptions.prototype.hasLinearBuckets = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* optional Exponential exponential_buckets = 2;
* @return {proto.google.api.Distribution.BucketOptions.Exponential}
*/
proto.google.api.Distribution.BucketOptions.prototype.getExponentialBuckets = function() {
return /** @type{proto.google.api.Distribution.BucketOptions.Exponential} */ (
jspb.Message.getWrapperField(this, proto.google.api.Distribution.BucketOptions.Exponential, 2));
};
/** @param {proto.google.api.Distribution.BucketOptions.Exponential|undefined} value */
proto.google.api.Distribution.BucketOptions.prototype.setExponentialBuckets = function(value) {
jspb.Message.setOneofWrapperField(this, 2, proto.google.api.Distribution.BucketOptions.oneofGroups_[0], value);
};
proto.google.api.Distribution.BucketOptions.prototype.clearExponentialBuckets = function() {
this.setExponentialBuckets(undefined);
};
/**
* Returns whether this field is set.
* @return{!boolean}
*/
proto.google.api.Distribution.BucketOptions.prototype.hasExponentialBuckets = function() {
return jspb.Message.getField(this, 2) != null;
};
/**
* optional Explicit explicit_buckets = 3;
* @return {proto.google.api.Distribution.BucketOptions.Explicit}
*/
proto.google.api.Distribution.BucketOptions.prototype.getExplicitBuckets = function() {
return /** @type{proto.google.api.Distribution.BucketOptions.Explicit} */ (
jspb.Message.getWrapperField(this, proto.google.api.Distribution.BucketOptions.Explicit, 3));
};
/** @param {proto.google.api.Distribution.BucketOptions.Explicit|undefined} value */
proto.google.api.Distribution.BucketOptions.prototype.setExplicitBuckets = function(value) {
jspb.Message.setOneofWrapperField(this, 3, proto.google.api.Distribution.BucketOptions.oneofGroups_[0], value);
};
proto.google.api.Distribution.BucketOptions.prototype.clearExplicitBuckets = function() {
this.setExplicitBuckets(undefined);
};
/**
* Returns whether this field is set.
* @return{!boolean}
*/
proto.google.api.Distribution.BucketOptions.prototype.hasExplicitBuckets = 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.google.api.Distribution.BucketOptions.Linear = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.google.api.Distribution.BucketOptions.Linear, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.google.api.Distribution.BucketOptions.Linear.displayName = 'proto.google.api.Distribution.BucketOptions.Linear';
}
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.google.api.Distribution.BucketOptions.Linear.prototype.toObject = function(opt_includeInstance) {
return proto.google.api.Distribution.BucketOptions.Linear.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.google.api.Distribution.BucketOptions.Linear} msg The msg instance to transform.
* @return {!Object}
*/
proto.google.api.Distribution.BucketOptions.Linear.toObject = function(includeInstance, msg) {
var f, obj = {
numFiniteBuckets: msg.getNumFiniteBuckets(),
width: msg.getWidth(),
offset: msg.getOffset()
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.google.api.Distribution.BucketOptions.Linear}
*/
proto.google.api.Distribution.BucketOptions.Linear.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.google.api.Distribution.BucketOptions.Linear;
return proto.google.api.Distribution.BucketOptions.Linear.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.google.api.Distribution.BucketOptions.Linear} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.google.api.Distribution.BucketOptions.Linear}
*/
proto.google.api.Distribution.BucketOptions.Linear.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {number} */ (reader.readInt32());
msg.setNumFiniteBuckets(value);
break;
case 2:
var value = /** @type {number} */ (reader.readDouble());
msg.setWidth(value);
break;
case 3:
var value = /** @type {number} */ (reader.readDouble());
msg.setOffset(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Class method variant: serializes the given message to binary data
* (in protobuf wire format), writing to the given BinaryWriter.
* @param {!proto.google.api.Distribution.BucketOptions.Linear} message
* @param {!jspb.BinaryWriter} writer
*/
proto.google.api.Distribution.BucketOptions.Linear.serializeBinaryToWriter = function(message, writer) {
message.serializeBinaryToWriter(writer);
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.google.api.Distribution.BucketOptions.Linear.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
this.serializeBinaryToWriter(writer);
return writer.getResultBuffer();
};
/**
* Serializes the message to binary data (in protobuf wire format),
* writing to the given BinaryWriter.
* @param {!jspb.BinaryWriter} writer
*/
proto.google.api.Distribution.BucketOptions.Linear.prototype.serializeBinaryToWriter = function (writer) {
var f = undefined;
f = this.getNumFiniteBuckets();
if (f !== 0) {
writer.writeInt32(
1,
f
);
}
f = this.getWidth();
if (f !== 0.0) {
writer.writeDouble(
2,
f
);
}
f = this.getOffset();
if (f !== 0.0) {
writer.writeDouble(
3,
f
);
}
};
/**
* Creates a deep clone of this proto. No data is shared with the original.
* @return {!proto.google.api.Distribution.BucketOptions.Linear} The clone.
*/
proto.google.api.Distribution.BucketOptions.Linear.prototype.cloneMessage = function() {
return /** @type {!proto.google.api.Distribution.BucketOptions.Linear} */ (jspb.Message.cloneMessage(this));
};
/**
* optional int32 num_finite_buckets = 1;
* @return {number}
*/
proto.google.api.Distribution.BucketOptions.Linear.prototype.getNumFiniteBuckets = function() {
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 1, 0));
};
/** @param {number} value */
proto.google.api.Distribution.BucketOptions.Linear.prototype.setNumFiniteBuckets = function(value) {
jspb.Message.setField(this, 1, value);
};
/**
* optional double width = 2;
* @return {number}
*/
proto.google.api.Distribution.BucketOptions.Linear.prototype.getWidth = function() {
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 2, 0));
};
/** @param {number} value */
proto.google.api.Distribution.BucketOptions.Linear.prototype.setWidth = function(value) {
jspb.Message.setField(this, 2, value);
};
/**
* optional double offset = 3;
* @return {number}
*/
proto.google.api.Distribution.BucketOptions.Linear.prototype.getOffset = function() {
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 3, 0));
};
/** @param {number} value */
proto.google.api.Distribution.BucketOptions.Linear.prototype.setOffset = function(value) {
jspb.Message.setField(this, 3, 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.google.api.Distribution.BucketOptions.Exponential = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.google.api.Distribution.BucketOptions.Exponential, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.google.api.Distribution.BucketOptions.Exponential.displayName = 'proto.google.api.Distribution.BucketOptions.Exponential';
}
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.google.api.Distribution.BucketOptions.Exponential.prototype.toObject = function(opt_includeInstance) {
return proto.google.api.Distribution.BucketOptions.Exponential.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.google.api.Distribution.BucketOptions.Exponential} msg The msg instance to transform.
* @return {!Object}
*/
proto.google.api.Distribution.BucketOptions.Exponential.toObject = function(includeInstance, msg) {
var f, obj = {
numFiniteBuckets: msg.getNumFiniteBuckets(),
growthFactor: msg.getGrowthFactor(),
scale: msg.getScale()
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.google.api.Distribution.BucketOptions.Exponential}
*/
proto.google.api.Distribution.BucketOptions.Exponential.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.google.api.Distribution.BucketOptions.Exponential;
return proto.google.api.Distribution.BucketOptions.Exponential.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.google.api.Distribution.BucketOptions.Exponential} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.google.api.Distribution.BucketOptions.Exponential}
*/
proto.google.api.Distribution.BucketOptions.Exponential.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {number} */ (reader.readInt32());
msg.setNumFiniteBuckets(value);
break;
case 2:
var value = /** @type {number} */ (reader.readDouble());
msg.setGrowthFactor(value);
break;
case 3:
var value = /** @type {number} */ (reader.readDouble());
msg.setScale(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Class method variant: serializes the given message to binary data
* (in protobuf wire format), writing to the given BinaryWriter.
* @param {!proto.google.api.Distribution.BucketOptions.Exponential} message
* @param {!jspb.BinaryWriter} writer
*/
proto.google.api.Distribution.BucketOptions.Exponential.serializeBinaryToWriter = function(message, writer) {
message.serializeBinaryToWriter(writer);
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.google.api.Distribution.BucketOptions.Exponential.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
this.serializeBinaryToWriter(writer);
return writer.getResultBuffer();
};
/**
* Serializes the message to binary data (in protobuf wire format),
* writing to the given BinaryWriter.
* @param {!jspb.BinaryWriter} writer
*/
proto.google.api.Distribution.BucketOptions.Exponential.prototype.serializeBinaryToWriter = function (writer) {
var f = undefined;
f = this.getNumFiniteBuckets();
if (f !== 0) {
writer.writeInt32(
1,
f
);
}
f = this.getGrowthFactor();
if (f !== 0.0) {
writer.writeDouble(
2,
f
);
}
f = this.getScale();
if (f !== 0.0) {
writer.writeDouble(
3,
f
);
}
};
/**
* Creates a deep clone of this proto. No data is shared with the original.
* @return {!proto.google.api.Distribution.BucketOptions.Exponential} The clone.
*/
proto.google.api.Distribution.BucketOptions.Exponential.prototype.cloneMessage = function() {
return /** @type {!proto.google.api.Distribution.BucketOptions.Exponential} */ (jspb.Message.cloneMessage(this));
};
/**
* optional int32 num_finite_buckets = 1;
* @return {number}
*/
proto.google.api.Distribution.BucketOptions.Exponential.prototype.getNumFiniteBuckets = function() {
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 1, 0));
};
/** @param {number} value */
proto.google.api.Distribution.BucketOptions.Exponential.prototype.setNumFiniteBuckets = function(value) {
jspb.Message.setField(this, 1, value);
};
/**
* optional double growth_factor = 2;
* @return {number}
*/
proto.google.api.Distribution.BucketOptions.Exponential.prototype.getGrowthFactor = function() {
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 2, 0));
};
/** @param {number} value */
proto.google.api.Distribution.BucketOptions.Exponential.prototype.setGrowthFactor = function(value) {
jspb.Message.setField(this, 2, value);
};
/**
* optional double scale = 3;
* @return {number}
*/
proto.google.api.Distribution.BucketOptions.Exponential.prototype.getScale = function() {
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 3, 0));
};
/** @param {number} value */
proto.google.api.Distribution.BucketOptions.Exponential.prototype.setScale = function(value) {
jspb.Message.setField(this, 3, 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.google.api.Distribution.BucketOptions.Explicit = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.google.api.Distribution.BucketOptions.Explicit.repeatedFields_, null);
};
goog.inherits(proto.google.api.Distribution.BucketOptions.Explicit, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.google.api.Distribution.BucketOptions.Explicit.displayName = 'proto.google.api.Distribution.BucketOptions.Explicit';
}
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.google.api.Distribution.BucketOptions.Explicit.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.google.api.Distribution.BucketOptions.Explicit.prototype.toObject = function(opt_includeInstance) {
return proto.google.api.Distribution.BucketOptions.Explicit.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.google.api.Distribution.BucketOptions.Explicit} msg The msg instance to transform.
* @return {!Object}
*/
proto.google.api.Distribution.BucketOptions.Explicit.toObject = function(includeInstance, msg) {
var f, obj = {
boundsList: jspb.Message.getRepeatedFloatingPointField(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.google.api.Distribution.BucketOptions.Explicit}
*/
proto.google.api.Distribution.BucketOptions.Explicit.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.google.api.Distribution.BucketOptions.Explicit;
return proto.google.api.Distribution.BucketOptions.Explicit.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.google.api.Distribution.BucketOptions.Explicit} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.google.api.Distribution.BucketOptions.Explicit}
*/
proto.google.api.Distribution.BucketOptions.Explicit.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {!Array.<number>} */ (reader.readPackedDouble());
msg.setBoundsList(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Class method variant: serializes the given message to binary data
* (in protobuf wire format), writing to the given BinaryWriter.
* @param {!proto.google.api.Distribution.BucketOptions.Explicit} message
* @param {!jspb.BinaryWriter} writer
*/
proto.google.api.Distribution.BucketOptions.Explicit.serializeBinaryToWriter = function(message, writer) {
message.serializeBinaryToWriter(writer);
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.google.api.Distribution.BucketOptions.Explicit.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
this.serializeBinaryToWriter(writer);
return writer.getResultBuffer();
};
/**
* Serializes the message to binary data (in protobuf wire format),
* writing to the given BinaryWriter.
* @param {!jspb.BinaryWriter} writer
*/
proto.google.api.Distribution.BucketOptions.Explicit.prototype.serializeBinaryToWriter = function (writer) {
var f = undefined;
f = this.getBoundsList();
if (f.length > 0) {
writer.writePackedDouble(
1,
f
);
}
};
/**
* Creates a deep clone of this proto. No data is shared with the original.
* @return {!proto.google.api.Distribution.BucketOptions.Explicit} The clone.
*/
proto.google.api.Distribution.BucketOptions.Explicit.prototype.cloneMessage = function() {
return /** @type {!proto.google.api.Distribution.BucketOptions.Explicit} */ (jspb.Message.cloneMessage(this));
};
/**
* repeated double bounds = 1;
* If you change this array by adding, removing or replacing elements, or if you
* replace the array itself, then you must call the setter to update it.
* @return {!Array.<number>}
*/
proto.google.api.Distribution.BucketOptions.Explicit.prototype.getBoundsList = function() {
return /** @type {!Array.<number>} */ (jspb.Message.getRepeatedFloatingPointField(this, 1));
};
/** @param {Array.<number>} value */
proto.google.api.Distribution.BucketOptions.Explicit.prototype.setBoundsList = function(value) {
jspb.Message.setField(this, 1, value || []);
};
proto.google.api.Distribution.BucketOptions.Explicit.prototype.clearBoundsList = function() {
jspb.Message.setField(this, 1, []);
};
/**
* 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.google.api.Distribution.Exemplar = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.google.api.Distribution.Exemplar.repeatedFields_, null);
};
goog.inherits(proto.google.api.Distribution.Exemplar, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.google.api.Distribution.Exemplar.displayName = 'proto.google.api.Distribution.Exemplar';
}
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.google.api.Distribution.Exemplar.repeatedFields_ = [3];
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.google.api.Distribution.Exemplar.prototype.toObject = function(opt_includeInstance) {
return proto.google.api.Distribution.Exemplar.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.google.api.Distribution.Exemplar} msg The msg instance to transform.
* @return {!Object}
*/
proto.google.api.Distribution.Exemplar.toObject = function(includeInstance, msg) {
var f, obj = {
value: msg.getValue(),
timestamp: (f = msg.getTimestamp()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
attachmentsList: jspb.Message.toObjectList(msg.getAttachmentsList(),
google_protobuf_any_pb.Any.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.google.api.Distribution.Exemplar}
*/
proto.google.api.Distribution.Exemplar.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.google.api.Distribution.Exemplar;
return proto.google.api.Distribution.Exemplar.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.google.api.Distribution.Exemplar} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.google.api.Distribution.Exemplar}
*/
proto.google.api.Distribution.Exemplar.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.setValue(value);
break;
case 2:
var value = new google_protobuf_timestamp_pb.Timestamp;
reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
msg.setTimestamp(value);
break;
case 3:
var value = new google_protobuf_any_pb.Any;
reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader);
msg.getAttachmentsList().push(value);
msg.setAttachmentsList(msg.getAttachmentsList());
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Class method variant: serializes the given message to binary data
* (in protobuf wire format), writing to the given BinaryWriter.
* @param {!proto.google.api.Distribution.Exemplar} message
* @param {!jspb.BinaryWriter} writer
*/
proto.google.api.Distribution.Exemplar.serializeBinaryToWriter = function(message, writer) {
message.serializeBinaryToWriter(writer);
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.google.api.Distribution.Exemplar.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
this.serializeBinaryToWriter(writer);
return writer.getResultBuffer();
};
/**
* Serializes the message to binary data (in protobuf wire format),
* writing to the given BinaryWriter.
* @param {!jspb.BinaryWriter} writer
*/
proto.google.api.Distribution.Exemplar.prototype.serializeBinaryToWriter = function (writer) {
var f = undefined;
f = this.getValue();
if (f !== 0.0) {
writer.writeDouble(
1,
f
);
}
f = this.getTimestamp();
if (f != null) {
writer.writeMessage(
2,
f,
google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
);
}
f = this.getAttachmentsList();
if (f.length > 0) {
writer.writeRepeatedMessage(
3,
f,
google_protobuf_any_pb.Any.serializeBinaryToWriter
);
}
};
/**
* Creates a deep clone of this proto. No data is shared with the original.
* @return {!proto.google.api.Distribution.Exemplar} The clone.
*/
proto.google.api.Distribution.Exemplar.prototype.cloneMessage = function() {
return /** @type {!proto.google.api.Distribution.Exemplar} */ (jspb.Message.cloneMessage(this));
};
/**
* optional double value = 1;
* @return {number}
*/
proto.google.api.Distribution.Exemplar.prototype.getValue = function() {
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 1, 0));
};
/** @param {number} value */
proto.google.api.Distribution.Exemplar.prototype.setValue = function(value) {
jspb.Message.setField(this, 1, value);
};
/**
* optional google.protobuf.Timestamp timestamp = 2;
* @return {proto.google.protobuf.Timestamp}
*/
proto.google.api.Distribution.Exemplar.prototype.getTimestamp = function() {
return /** @type{proto.google.protobuf.Timestamp} */ (
jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 2));
};
/** @param {proto.google.protobuf.Timestamp|undefined} value */
proto.google.api.Distribution.Exemplar.prototype.setTimestamp = function(value) {
jspb.Message.setWrapperField(this, 2, value);
};
proto.google.api.Distribution.Exemplar.prototype.clearTimestamp = function() {
this.setTimestamp(undefined);
};
/**
* Returns whether this field is set.
* @return{!boolean}
*/
proto.google.api.Distribution.Exemplar.prototype.hasTimestamp = function() {
return jspb.Message.getField(this, 2) != null;
};
/**
* repeated google.protobuf.Any attachments = 3;
* If you change this array by adding, removing or replacing elements, or if you
* replace the array itself, then you must call the setter to update it.
* @return {!Array.<!proto.google.protobuf.Any>}
*/
proto.google.api.Distribution.Exemplar.prototype.getAttachmentsList = function() {
return /** @type{!Array.<!proto.google.protobuf.Any>} */ (
jspb.Message.getRepeatedWrapperField(this, google_protobuf_any_pb.Any, 3));
};
/** @param {Array.<!proto.google.protobuf.Any>} value */
proto.google.api.Distribution.Exemplar.prototype.setAttachmentsList = function(value) {
jspb.Message.setRepeatedWrapperField(this, 3, value);
};
proto.google.api.Distribution.Exemplar.prototype.clearAttachmentsList = function() {
this.setAttachmentsList([]);
};
goog.object.extend(exports, proto.google.api);