// source: google/api/metric.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 google_api_label_pb = require('../../google/api/label_pb.js'); goog.object.extend(proto, google_api_label_pb); var google_api_launch_stage_pb = require('../../google/api/launch_stage_pb.js'); goog.object.extend(proto, google_api_launch_stage_pb); var google_protobuf_duration_pb = require('google-protobuf/google/protobuf/duration_pb.js'); goog.object.extend(proto, google_protobuf_duration_pb); 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) { /** * @public * @override */ proto.google.api.MetricDescriptor.displayName = 'proto.google.api.MetricDescriptor'; } /** * 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) { /** * @public * @override */ proto.google.api.MetricDescriptor.MetricDescriptorMetadata.displayName = 'proto.google.api.MetricDescriptor.MetricDescriptorMetadata'; } /** * 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) { /** * @public * @override */ proto.google.api.Metric.displayName = 'proto.google.api.Metric'; } /** * List of repeated fields within this message type. * @private {!Array} * @const */ proto.google.api.MetricDescriptor.repeatedFields_ = [2,13]; 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_, 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.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 Deprecated. 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} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.google.api.MetricDescriptor.toObject = function(includeInstance, msg) { var f, obj = { name: jspb.Message.getFieldWithDefault(msg, 1, ""), type: jspb.Message.getFieldWithDefault(msg, 8, ""), labelsList: jspb.Message.toObjectList(msg.getLabelsList(), google_api_label_pb.LabelDescriptor.toObject, includeInstance), metricKind: jspb.Message.getFieldWithDefault(msg, 3, 0), valueType: jspb.Message.getFieldWithDefault(msg, 4, 0), unit: jspb.Message.getFieldWithDefault(msg, 5, ""), description: jspb.Message.getFieldWithDefault(msg, 6, ""), displayName: jspb.Message.getFieldWithDefault(msg, 7, ""), metadata: (f = msg.getMetadata()) && proto.google.api.MetricDescriptor.MetricDescriptorMetadata.toObject(includeInstance, f), launchStage: jspb.Message.getFieldWithDefault(msg, 12, 0), monitoredResourceTypesList: (f = jspb.Message.getRepeatedField(msg, 13)) == null ? undefined : 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} */ 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.addLabels(value); 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.addMonitoredResourceTypes(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.google.api.MetricDescriptor.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.google.api.MetricDescriptor.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * 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 * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.google.api.MetricDescriptor.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getName(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getType(); if (f.length > 0) { writer.writeString( 8, f ); } f = message.getLabelsList(); if (f.length > 0) { writer.writeRepeatedMessage( 2, f, google_api_label_pb.LabelDescriptor.serializeBinaryToWriter ); } f = message.getMetricKind(); if (f !== 0.0) { writer.writeEnum( 3, f ); } f = message.getValueType(); if (f !== 0.0) { writer.writeEnum( 4, f ); } f = message.getUnit(); if (f.length > 0) { writer.writeString( 5, f ); } f = message.getDescription(); if (f.length > 0) { writer.writeString( 6, f ); } f = message.getDisplayName(); if (f.length > 0) { writer.writeString( 7, f ); } f = message.getMetadata(); if (f != null) { writer.writeMessage( 10, f, proto.google.api.MetricDescriptor.MetricDescriptorMetadata.serializeBinaryToWriter ); } f = message.getLaunchStage(); if (f !== 0.0) { writer.writeEnum( 12, f ); } f = message.getMonitoredResourceTypesList(); if (f.length > 0) { writer.writeRepeatedString( 13, f ); } }; /** * @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 }; 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_, 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.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 Deprecated. 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} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.google.api.MetricDescriptor.MetricDescriptorMetadata.toObject = function(includeInstance, msg) { var f, obj = { launchStage: jspb.Message.getFieldWithDefault(msg, 1, 0), 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; }; /** * 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(); proto.google.api.MetricDescriptor.MetricDescriptorMetadata.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * 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 * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.google.api.MetricDescriptor.MetricDescriptorMetadata.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getLaunchStage(); if (f !== 0.0) { writer.writeEnum( 1, f ); } f = message.getSamplePeriod(); if (f != null) { writer.writeMessage( 2, f, google_protobuf_duration_pb.Duration.serializeBinaryToWriter ); } f = message.getIngestDelay(); if (f != null) { writer.writeMessage( 3, f, google_protobuf_duration_pb.Duration.serializeBinaryToWriter ); } }; /** * 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.getFieldWithDefault(this, 1, 0)); }; /** * @param {!proto.google.api.LaunchStage} value * @return {!proto.google.api.MetricDescriptor.MetricDescriptorMetadata} returns this */ proto.google.api.MetricDescriptor.MetricDescriptorMetadata.prototype.setLaunchStage = function(value) { return jspb.Message.setProto3EnumField(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 * @return {!proto.google.api.MetricDescriptor.MetricDescriptorMetadata} returns this */ proto.google.api.MetricDescriptor.MetricDescriptorMetadata.prototype.setSamplePeriod = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. * @return {!proto.google.api.MetricDescriptor.MetricDescriptorMetadata} returns this */ proto.google.api.MetricDescriptor.MetricDescriptorMetadata.prototype.clearSamplePeriod = function() { return 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 * @return {!proto.google.api.MetricDescriptor.MetricDescriptorMetadata} returns this */ proto.google.api.MetricDescriptor.MetricDescriptorMetadata.prototype.setIngestDelay = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; /** * Clears the message field making it undefined. * @return {!proto.google.api.MetricDescriptor.MetricDescriptorMetadata} returns this */ proto.google.api.MetricDescriptor.MetricDescriptorMetadata.prototype.clearIngestDelay = function() { return 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; }; /** * optional string name = 1; * @return {string} */ proto.google.api.MetricDescriptor.prototype.getName = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.google.api.MetricDescriptor} returns this */ proto.google.api.MetricDescriptor.prototype.setName = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional string type = 8; * @return {string} */ proto.google.api.MetricDescriptor.prototype.getType = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, "")); }; /** * @param {string} value * @return {!proto.google.api.MetricDescriptor} returns this */ proto.google.api.MetricDescriptor.prototype.setType = function(value) { return jspb.Message.setProto3StringField(this, 8, value); }; /** * repeated LabelDescriptor labels = 2; * @return {!Array} */ proto.google.api.MetricDescriptor.prototype.getLabelsList = function() { return /** @type{!Array} */ ( jspb.Message.getRepeatedWrapperField(this, google_api_label_pb.LabelDescriptor, 2)); }; /** * @param {!Array} value * @return {!proto.google.api.MetricDescriptor} returns this */ proto.google.api.MetricDescriptor.prototype.setLabelsList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 2, value); }; /** * @param {!proto.google.api.LabelDescriptor=} opt_value * @param {number=} opt_index * @return {!proto.google.api.LabelDescriptor} */ proto.google.api.MetricDescriptor.prototype.addLabels = function(opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.google.api.LabelDescriptor, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.google.api.MetricDescriptor} returns this */ proto.google.api.MetricDescriptor.prototype.clearLabelsList = function() { return 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.getFieldWithDefault(this, 3, 0)); }; /** * @param {!proto.google.api.MetricDescriptor.MetricKind} value * @return {!proto.google.api.MetricDescriptor} returns this */ proto.google.api.MetricDescriptor.prototype.setMetricKind = function(value) { return jspb.Message.setProto3EnumField(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.getFieldWithDefault(this, 4, 0)); }; /** * @param {!proto.google.api.MetricDescriptor.ValueType} value * @return {!proto.google.api.MetricDescriptor} returns this */ proto.google.api.MetricDescriptor.prototype.setValueType = function(value) { return jspb.Message.setProto3EnumField(this, 4, value); }; /** * optional string unit = 5; * @return {string} */ proto.google.api.MetricDescriptor.prototype.getUnit = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); }; /** * @param {string} value * @return {!proto.google.api.MetricDescriptor} returns this */ proto.google.api.MetricDescriptor.prototype.setUnit = function(value) { return jspb.Message.setProto3StringField(this, 5, value); }; /** * optional string description = 6; * @return {string} */ proto.google.api.MetricDescriptor.prototype.getDescription = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); }; /** * @param {string} value * @return {!proto.google.api.MetricDescriptor} returns this */ proto.google.api.MetricDescriptor.prototype.setDescription = function(value) { return jspb.Message.setProto3StringField(this, 6, value); }; /** * optional string display_name = 7; * @return {string} */ proto.google.api.MetricDescriptor.prototype.getDisplayName = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); }; /** * @param {string} value * @return {!proto.google.api.MetricDescriptor} returns this */ proto.google.api.MetricDescriptor.prototype.setDisplayName = function(value) { return jspb.Message.setProto3StringField(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 * @return {!proto.google.api.MetricDescriptor} returns this */ proto.google.api.MetricDescriptor.prototype.setMetadata = function(value) { return jspb.Message.setWrapperField(this, 10, value); }; /** * Clears the message field making it undefined. * @return {!proto.google.api.MetricDescriptor} returns this */ proto.google.api.MetricDescriptor.prototype.clearMetadata = function() { return 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.getFieldWithDefault(this, 12, 0)); }; /** * @param {!proto.google.api.LaunchStage} value * @return {!proto.google.api.MetricDescriptor} returns this */ proto.google.api.MetricDescriptor.prototype.setLaunchStage = function(value) { return jspb.Message.setProto3EnumField(this, 12, value); }; /** * repeated string monitored_resource_types = 13; * @return {!Array} */ proto.google.api.MetricDescriptor.prototype.getMonitoredResourceTypesList = function() { return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 13)); }; /** * @param {!Array} value * @return {!proto.google.api.MetricDescriptor} returns this */ proto.google.api.MetricDescriptor.prototype.setMonitoredResourceTypesList = function(value) { return jspb.Message.setField(this, 13, value || []); }; /** * @param {string} value * @param {number=} opt_index * @return {!proto.google.api.MetricDescriptor} returns this */ proto.google.api.MetricDescriptor.prototype.addMonitoredResourceTypes = function(value, opt_index) { return jspb.Message.addToRepeatedField(this, 13, value, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.google.api.MetricDescriptor} returns this */ proto.google.api.MetricDescriptor.prototype.clearMonitoredResourceTypesList = function() { return this.setMonitoredResourceTypesList([]); }; 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_, 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.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 Deprecated. 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} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.google.api.Metric.toObject = function(includeInstance, msg) { var f, obj = { type: jspb.Message.getFieldWithDefault(msg, 3, ""), labelsMap: (f = msg.getLabelsMap()) ? f.toObject(includeInstance, undefined) : [] }; 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, null, "", ""); }); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.google.api.Metric.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.google.api.Metric.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * 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 * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.google.api.Metric.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getType(); if (f.length > 0) { writer.writeString( 3, f ); } f = message.getLabelsMap(true); if (f && f.getLength() > 0) { f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); } }; /** * optional string type = 3; * @return {string} */ proto.google.api.Metric.prototype.getType = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** * @param {string} value * @return {!proto.google.api.Metric} returns this */ proto.google.api.Metric.prototype.setType = function(value) { return jspb.Message.setProto3StringField(this, 3, value); }; /** * map labels = 2; * @param {boolean=} opt_noLazyCreate Do not create the map if * empty, instead returning `undefined` * @return {!jspb.Map} */ proto.google.api.Metric.prototype.getLabelsMap = function(opt_noLazyCreate) { return /** @type {!jspb.Map} */ ( jspb.Message.getMapField(this, 2, opt_noLazyCreate, null)); }; /** * Clears values from the map. The map will be non-null. * @return {!proto.google.api.Metric} returns this */ proto.google.api.Metric.prototype.clearLabelsMap = function() { this.getLabelsMap().clear(); return this;}; goog.object.extend(exports, proto.google.api);