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

947 lines
28 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_api_label_pb = require('../../google/api/label_pb.js');
var google_api_launch_stage_pb = require('../../google/api/launch_stage_pb.js');
var google_protobuf_duration_pb = require('google-protobuf/google/protobuf/duration_pb.js');
goog.exportSymbol('proto.google.api.Metric', null, global);
goog.exportSymbol('proto.google.api.MetricDescriptor', null, global);
goog.exportSymbol('proto.google.api.MetricDescriptor.MetricDescriptorMetadata', null, global);
goog.exportSymbol('proto.google.api.MetricDescriptor.MetricKind', null, global);
goog.exportSymbol('proto.google.api.MetricDescriptor.ValueType', 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.MetricDescriptor = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.google.api.MetricDescriptor.repeatedFields_, null);
};
goog.inherits(proto.google.api.MetricDescriptor, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.google.api.MetricDescriptor.displayName = 'proto.google.api.MetricDescriptor';
}
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.google.api.MetricDescriptor.repeatedFields_ = [2,13];
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.MetricDescriptor.prototype.toObject = function(opt_includeInstance) {
return proto.google.api.MetricDescriptor.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.MetricDescriptor} msg The msg instance to transform.
* @return {!Object}
*/
proto.google.api.MetricDescriptor.toObject = function(includeInstance, msg) {
var f, obj = {
name: msg.getName(),
type: msg.getType(),
labelsList: jspb.Message.toObjectList(msg.getLabelsList(),
google_api_label_pb.LabelDescriptor.toObject, includeInstance),
metricKind: msg.getMetricKind(),
valueType: msg.getValueType(),
unit: msg.getUnit(),
description: msg.getDescription(),
displayName: msg.getDisplayName(),
metadata: (f = msg.getMetadata()) && proto.google.api.MetricDescriptor.MetricDescriptorMetadata.toObject(includeInstance, f),
launchStage: msg.getLaunchStage(),
monitoredResourceTypesList: jspb.Message.getField(msg, 13)
};
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.MetricDescriptor}
*/
proto.google.api.MetricDescriptor.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.google.api.MetricDescriptor;
return proto.google.api.MetricDescriptor.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.google.api.MetricDescriptor} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.google.api.MetricDescriptor}
*/
proto.google.api.MetricDescriptor.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 8:
var value = /** @type {string} */ (reader.readString());
msg.setType(value);
break;
case 2:
var value = new google_api_label_pb.LabelDescriptor;
reader.readMessage(value,google_api_label_pb.LabelDescriptor.deserializeBinaryFromReader);
msg.getLabelsList().push(value);
msg.setLabelsList(msg.getLabelsList());
break;
case 3:
var value = /** @type {!proto.google.api.MetricDescriptor.MetricKind} */ (reader.readEnum());
msg.setMetricKind(value);
break;
case 4:
var value = /** @type {!proto.google.api.MetricDescriptor.ValueType} */ (reader.readEnum());
msg.setValueType(value);
break;
case 5:
var value = /** @type {string} */ (reader.readString());
msg.setUnit(value);
break;
case 6:
var value = /** @type {string} */ (reader.readString());
msg.setDescription(value);
break;
case 7:
var value = /** @type {string} */ (reader.readString());
msg.setDisplayName(value);
break;
case 10:
var value = new proto.google.api.MetricDescriptor.MetricDescriptorMetadata;
reader.readMessage(value,proto.google.api.MetricDescriptor.MetricDescriptorMetadata.deserializeBinaryFromReader);
msg.setMetadata(value);
break;
case 12:
var value = /** @type {!proto.google.api.LaunchStage} */ (reader.readEnum());
msg.setLaunchStage(value);
break;
case 13:
var value = /** @type {string} */ (reader.readString());
msg.getMonitoredResourceTypesList().push(value);
msg.setMonitoredResourceTypesList(msg.getMonitoredResourceTypesList());
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.MetricDescriptor} message
* @param {!jspb.BinaryWriter} writer
*/
proto.google.api.MetricDescriptor.serializeBinaryToWriter = function(message, writer) {
message.serializeBinaryToWriter(writer);
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.google.api.MetricDescriptor.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.MetricDescriptor.prototype.serializeBinaryToWriter = function (writer) {
var f = undefined;
f = this.getName();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = this.getType();
if (f.length > 0) {
writer.writeString(
8,
f
);
}
f = this.getLabelsList();
if (f.length > 0) {
writer.writeRepeatedMessage(
2,
f,
google_api_label_pb.LabelDescriptor.serializeBinaryToWriter
);
}
f = this.getMetricKind();
if (f !== 0.0) {
writer.writeEnum(
3,
f
);
}
f = this.getValueType();
if (f !== 0.0) {
writer.writeEnum(
4,
f
);
}
f = this.getUnit();
if (f.length > 0) {
writer.writeString(
5,
f
);
}
f = this.getDescription();
if (f.length > 0) {
writer.writeString(
6,
f
);
}
f = this.getDisplayName();
if (f.length > 0) {
writer.writeString(
7,
f
);
}
f = this.getMetadata();
if (f != null) {
writer.writeMessage(
10,
f,
proto.google.api.MetricDescriptor.MetricDescriptorMetadata.serializeBinaryToWriter
);
}
f = this.getLaunchStage();
if (f !== 0.0) {
writer.writeEnum(
12,
f
);
}
f = this.getMonitoredResourceTypesList();
if (f.length > 0) {
writer.writeRepeatedString(
13,
f
);
}
};
/**
* Creates a deep clone of this proto. No data is shared with the original.
* @return {!proto.google.api.MetricDescriptor} The clone.
*/
proto.google.api.MetricDescriptor.prototype.cloneMessage = function() {
return /** @type {!proto.google.api.MetricDescriptor} */ (jspb.Message.cloneMessage(this));
};
/**
* optional string name = 1;
* @return {string}
*/
proto.google.api.MetricDescriptor.prototype.getName = function() {
return /** @type {string} */ (jspb.Message.getFieldProto3(this, 1, ""));
};
/** @param {string} value */
proto.google.api.MetricDescriptor.prototype.setName = function(value) {
jspb.Message.setField(this, 1, value);
};
/**
* optional string type = 8;
* @return {string}
*/
proto.google.api.MetricDescriptor.prototype.getType = function() {
return /** @type {string} */ (jspb.Message.getFieldProto3(this, 8, ""));
};
/** @param {string} value */
proto.google.api.MetricDescriptor.prototype.setType = function(value) {
jspb.Message.setField(this, 8, value);
};
/**
* repeated LabelDescriptor labels = 2;
* 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.LabelDescriptor>}
*/
proto.google.api.MetricDescriptor.prototype.getLabelsList = function() {
return /** @type{!Array.<!proto.google.api.LabelDescriptor>} */ (
jspb.Message.getRepeatedWrapperField(this, google_api_label_pb.LabelDescriptor, 2));
};
/** @param {Array.<!proto.google.api.LabelDescriptor>} value */
proto.google.api.MetricDescriptor.prototype.setLabelsList = function(value) {
jspb.Message.setRepeatedWrapperField(this, 2, value);
};
proto.google.api.MetricDescriptor.prototype.clearLabelsList = function() {
this.setLabelsList([]);
};
/**
* optional MetricKind metric_kind = 3;
* @return {!proto.google.api.MetricDescriptor.MetricKind}
*/
proto.google.api.MetricDescriptor.prototype.getMetricKind = function() {
return /** @type {!proto.google.api.MetricDescriptor.MetricKind} */ (jspb.Message.getFieldProto3(this, 3, 0));
};
/** @param {!proto.google.api.MetricDescriptor.MetricKind} value */
proto.google.api.MetricDescriptor.prototype.setMetricKind = function(value) {
jspb.Message.setField(this, 3, value);
};
/**
* optional ValueType value_type = 4;
* @return {!proto.google.api.MetricDescriptor.ValueType}
*/
proto.google.api.MetricDescriptor.prototype.getValueType = function() {
return /** @type {!proto.google.api.MetricDescriptor.ValueType} */ (jspb.Message.getFieldProto3(this, 4, 0));
};
/** @param {!proto.google.api.MetricDescriptor.ValueType} value */
proto.google.api.MetricDescriptor.prototype.setValueType = function(value) {
jspb.Message.setField(this, 4, value);
};
/**
* optional string unit = 5;
* @return {string}
*/
proto.google.api.MetricDescriptor.prototype.getUnit = function() {
return /** @type {string} */ (jspb.Message.getFieldProto3(this, 5, ""));
};
/** @param {string} value */
proto.google.api.MetricDescriptor.prototype.setUnit = function(value) {
jspb.Message.setField(this, 5, value);
};
/**
* optional string description = 6;
* @return {string}
*/
proto.google.api.MetricDescriptor.prototype.getDescription = function() {
return /** @type {string} */ (jspb.Message.getFieldProto3(this, 6, ""));
};
/** @param {string} value */
proto.google.api.MetricDescriptor.prototype.setDescription = function(value) {
jspb.Message.setField(this, 6, value);
};
/**
* optional string display_name = 7;
* @return {string}
*/
proto.google.api.MetricDescriptor.prototype.getDisplayName = function() {
return /** @type {string} */ (jspb.Message.getFieldProto3(this, 7, ""));
};
/** @param {string} value */
proto.google.api.MetricDescriptor.prototype.setDisplayName = function(value) {
jspb.Message.setField(this, 7, value);
};
/**
* optional MetricDescriptorMetadata metadata = 10;
* @return {proto.google.api.MetricDescriptor.MetricDescriptorMetadata}
*/
proto.google.api.MetricDescriptor.prototype.getMetadata = function() {
return /** @type{proto.google.api.MetricDescriptor.MetricDescriptorMetadata} */ (
jspb.Message.getWrapperField(this, proto.google.api.MetricDescriptor.MetricDescriptorMetadata, 10));
};
/** @param {proto.google.api.MetricDescriptor.MetricDescriptorMetadata|undefined} value */
proto.google.api.MetricDescriptor.prototype.setMetadata = function(value) {
jspb.Message.setWrapperField(this, 10, value);
};
proto.google.api.MetricDescriptor.prototype.clearMetadata = function() {
this.setMetadata(undefined);
};
/**
* Returns whether this field is set.
* @return{!boolean}
*/
proto.google.api.MetricDescriptor.prototype.hasMetadata = function() {
return jspb.Message.getField(this, 10) != null;
};
/**
* optional LaunchStage launch_stage = 12;
* @return {!proto.google.api.LaunchStage}
*/
proto.google.api.MetricDescriptor.prototype.getLaunchStage = function() {
return /** @type {!proto.google.api.LaunchStage} */ (jspb.Message.getFieldProto3(this, 12, 0));
};
/** @param {!proto.google.api.LaunchStage} value */
proto.google.api.MetricDescriptor.prototype.setLaunchStage = function(value) {
jspb.Message.setField(this, 12, value);
};
/**
* repeated string monitored_resource_types = 13;
* 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.<string>}
*/
proto.google.api.MetricDescriptor.prototype.getMonitoredResourceTypesList = function() {
return /** @type {!Array.<string>} */ (jspb.Message.getField(this, 13));
};
/** @param {Array.<string>} value */
proto.google.api.MetricDescriptor.prototype.setMonitoredResourceTypesList = function(value) {
jspb.Message.setField(this, 13, value || []);
};
proto.google.api.MetricDescriptor.prototype.clearMonitoredResourceTypesList = function() {
jspb.Message.setField(this, 13, []);
};
/**
* @enum {number}
*/
proto.google.api.MetricDescriptor.MetricKind = {
METRIC_KIND_UNSPECIFIED: 0,
GAUGE: 1,
DELTA: 2,
CUMULATIVE: 3
};
/**
* @enum {number}
*/
proto.google.api.MetricDescriptor.ValueType = {
VALUE_TYPE_UNSPECIFIED: 0,
BOOL: 1,
INT64: 2,
DOUBLE: 3,
STRING: 4,
DISTRIBUTION: 5,
MONEY: 6
};
/**
* 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.MetricDescriptor.MetricDescriptorMetadata = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.google.api.MetricDescriptor.MetricDescriptorMetadata, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.google.api.MetricDescriptor.MetricDescriptorMetadata.displayName = 'proto.google.api.MetricDescriptor.MetricDescriptorMetadata';
}
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.MetricDescriptor.MetricDescriptorMetadata.prototype.toObject = function(opt_includeInstance) {
return proto.google.api.MetricDescriptor.MetricDescriptorMetadata.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.MetricDescriptor.MetricDescriptorMetadata} msg The msg instance to transform.
* @return {!Object}
*/
proto.google.api.MetricDescriptor.MetricDescriptorMetadata.toObject = function(includeInstance, msg) {
var f, obj = {
launchStage: msg.getLaunchStage(),
samplePeriod: (f = msg.getSamplePeriod()) && google_protobuf_duration_pb.Duration.toObject(includeInstance, f),
ingestDelay: (f = msg.getIngestDelay()) && google_protobuf_duration_pb.Duration.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.MetricDescriptor.MetricDescriptorMetadata}
*/
proto.google.api.MetricDescriptor.MetricDescriptorMetadata.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.google.api.MetricDescriptor.MetricDescriptorMetadata;
return proto.google.api.MetricDescriptor.MetricDescriptorMetadata.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.google.api.MetricDescriptor.MetricDescriptorMetadata} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.google.api.MetricDescriptor.MetricDescriptorMetadata}
*/
proto.google.api.MetricDescriptor.MetricDescriptorMetadata.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {!proto.google.api.LaunchStage} */ (reader.readEnum());
msg.setLaunchStage(value);
break;
case 2:
var value = new google_protobuf_duration_pb.Duration;
reader.readMessage(value,google_protobuf_duration_pb.Duration.deserializeBinaryFromReader);
msg.setSamplePeriod(value);
break;
case 3:
var value = new google_protobuf_duration_pb.Duration;
reader.readMessage(value,google_protobuf_duration_pb.Duration.deserializeBinaryFromReader);
msg.setIngestDelay(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.MetricDescriptor.MetricDescriptorMetadata} message
* @param {!jspb.BinaryWriter} writer
*/
proto.google.api.MetricDescriptor.MetricDescriptorMetadata.serializeBinaryToWriter = function(message, writer) {
message.serializeBinaryToWriter(writer);
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.google.api.MetricDescriptor.MetricDescriptorMetadata.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.MetricDescriptor.MetricDescriptorMetadata.prototype.serializeBinaryToWriter = function (writer) {
var f = undefined;
f = this.getLaunchStage();
if (f !== 0.0) {
writer.writeEnum(
1,
f
);
}
f = this.getSamplePeriod();
if (f != null) {
writer.writeMessage(
2,
f,
google_protobuf_duration_pb.Duration.serializeBinaryToWriter
);
}
f = this.getIngestDelay();
if (f != null) {
writer.writeMessage(
3,
f,
google_protobuf_duration_pb.Duration.serializeBinaryToWriter
);
}
};
/**
* Creates a deep clone of this proto. No data is shared with the original.
* @return {!proto.google.api.MetricDescriptor.MetricDescriptorMetadata} The clone.
*/
proto.google.api.MetricDescriptor.MetricDescriptorMetadata.prototype.cloneMessage = function() {
return /** @type {!proto.google.api.MetricDescriptor.MetricDescriptorMetadata} */ (jspb.Message.cloneMessage(this));
};
/**
* optional LaunchStage launch_stage = 1;
* @return {!proto.google.api.LaunchStage}
*/
proto.google.api.MetricDescriptor.MetricDescriptorMetadata.prototype.getLaunchStage = function() {
return /** @type {!proto.google.api.LaunchStage} */ (jspb.Message.getFieldProto3(this, 1, 0));
};
/** @param {!proto.google.api.LaunchStage} value */
proto.google.api.MetricDescriptor.MetricDescriptorMetadata.prototype.setLaunchStage = function(value) {
jspb.Message.setField(this, 1, value);
};
/**
* optional google.protobuf.Duration sample_period = 2;
* @return {proto.google.protobuf.Duration}
*/
proto.google.api.MetricDescriptor.MetricDescriptorMetadata.prototype.getSamplePeriod = function() {
return /** @type{proto.google.protobuf.Duration} */ (
jspb.Message.getWrapperField(this, google_protobuf_duration_pb.Duration, 2));
};
/** @param {proto.google.protobuf.Duration|undefined} value */
proto.google.api.MetricDescriptor.MetricDescriptorMetadata.prototype.setSamplePeriod = function(value) {
jspb.Message.setWrapperField(this, 2, value);
};
proto.google.api.MetricDescriptor.MetricDescriptorMetadata.prototype.clearSamplePeriod = function() {
this.setSamplePeriod(undefined);
};
/**
* Returns whether this field is set.
* @return{!boolean}
*/
proto.google.api.MetricDescriptor.MetricDescriptorMetadata.prototype.hasSamplePeriod = function() {
return jspb.Message.getField(this, 2) != null;
};
/**
* optional google.protobuf.Duration ingest_delay = 3;
* @return {proto.google.protobuf.Duration}
*/
proto.google.api.MetricDescriptor.MetricDescriptorMetadata.prototype.getIngestDelay = function() {
return /** @type{proto.google.protobuf.Duration} */ (
jspb.Message.getWrapperField(this, google_protobuf_duration_pb.Duration, 3));
};
/** @param {proto.google.protobuf.Duration|undefined} value */
proto.google.api.MetricDescriptor.MetricDescriptorMetadata.prototype.setIngestDelay = function(value) {
jspb.Message.setWrapperField(this, 3, value);
};
proto.google.api.MetricDescriptor.MetricDescriptorMetadata.prototype.clearIngestDelay = function() {
this.setIngestDelay(undefined);
};
/**
* Returns whether this field is set.
* @return{!boolean}
*/
proto.google.api.MetricDescriptor.MetricDescriptorMetadata.prototype.hasIngestDelay = 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.Metric = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.google.api.Metric, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.google.api.Metric.displayName = 'proto.google.api.Metric';
}
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.Metric.prototype.toObject = function(opt_includeInstance) {
return proto.google.api.Metric.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.Metric} msg The msg instance to transform.
* @return {!Object}
*/
proto.google.api.Metric.toObject = function(includeInstance, msg) {
var f, obj = {
type: msg.getType(),
labelsMap: (f = msg.getLabelsMap(true)) ? f.toArray() : []
};
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.Metric}
*/
proto.google.api.Metric.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.google.api.Metric;
return proto.google.api.Metric.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.google.api.Metric} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.google.api.Metric}
*/
proto.google.api.Metric.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setType(value);
break;
case 2:
var value = msg.getLabelsMap();
reader.readMessage(value, function(message, reader) {
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString);
});
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.Metric} message
* @param {!jspb.BinaryWriter} writer
*/
proto.google.api.Metric.serializeBinaryToWriter = function(message, writer) {
message.serializeBinaryToWriter(writer);
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.google.api.Metric.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.Metric.prototype.serializeBinaryToWriter = function (writer) {
var f = undefined;
f = this.getType();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
f = this.getLabelsMap(true);
if (f && f.getLength() > 0) {
f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString);
}
};
/**
* Creates a deep clone of this proto. No data is shared with the original.
* @return {!proto.google.api.Metric} The clone.
*/
proto.google.api.Metric.prototype.cloneMessage = function() {
return /** @type {!proto.google.api.Metric} */ (jspb.Message.cloneMessage(this));
};
/**
* optional string type = 3;
* @return {string}
*/
proto.google.api.Metric.prototype.getType = function() {
return /** @type {string} */ (jspb.Message.getFieldProto3(this, 3, ""));
};
/** @param {string} value */
proto.google.api.Metric.prototype.setType = function(value) {
jspb.Message.setField(this, 3, value);
};
/**
* map<string, string> labels = 2;
* @param {boolean=} opt_noLazyCreate Do not create the map if
* empty, instead returning `undefined`
* @return {!jspb.Map<string,string>}
*/
proto.google.api.Metric.prototype.getLabelsMap = function(opt_noLazyCreate) {
return /** @type {!jspb.Map<string,string>} */ (
jspb.Message.getMapField(this, 2, opt_noLazyCreate,
null));
};
goog.object.extend(exports, proto.google.api);