com.google.api.MetricDescriptor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of grpc-core-proto Show documentation
Show all versions of grpc-core-proto Show documentation
GoogleAPI classes generated from core protos
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/api/metric.proto
package com.google.api;
/**
* Protobuf type {@code google.api.MetricDescriptor}
*
*
* Defines a metric type and its schema.
*
*/
public final class MetricDescriptor extends
com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:google.api.MetricDescriptor)
MetricDescriptorOrBuilder {
// Use MetricDescriptor.newBuilder() to construct.
private MetricDescriptor(com.google.protobuf.GeneratedMessage.Builder> builder) {
super(builder);
}
private MetricDescriptor() {
name_ = "";
type_ = "";
labels_ = java.util.Collections.emptyList();
metricKind_ = 0;
valueType_ = 0;
unit_ = "";
description_ = "";
displayName_ = "";
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
}
private MetricDescriptor(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) {
this();
int mutable_bitField0_ = 0;
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!input.skipField(tag)) {
done = true;
}
break;
}
case 10: {
java.lang.String s = input.readStringRequireUtf8();
name_ = s;
break;
}
case 18: {
if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
labels_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000004;
}
labels_.add(input.readMessage(com.google.api.LabelDescriptor.parser(), extensionRegistry));
break;
}
case 24: {
int rawValue = input.readEnum();
metricKind_ = rawValue;
break;
}
case 32: {
int rawValue = input.readEnum();
valueType_ = rawValue;
break;
}
case 42: {
java.lang.String s = input.readStringRequireUtf8();
unit_ = s;
break;
}
case 50: {
java.lang.String s = input.readStringRequireUtf8();
description_ = s;
break;
}
case 58: {
java.lang.String s = input.readStringRequireUtf8();
displayName_ = s;
break;
}
case 66: {
java.lang.String s = input.readStringRequireUtf8();
type_ = s;
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw new RuntimeException(e.setUnfinishedMessage(this));
} catch (java.io.IOException e) {
throw new RuntimeException(
new com.google.protobuf.InvalidProtocolBufferException(
e.getMessage()).setUnfinishedMessage(this));
} finally {
if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
labels_ = java.util.Collections.unmodifiableList(labels_);
}
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.api.MetricProto.internal_static_google_api_MetricDescriptor_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.api.MetricProto.internal_static_google_api_MetricDescriptor_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.api.MetricDescriptor.class, com.google.api.MetricDescriptor.Builder.class);
}
/**
* Protobuf enum {@code google.api.MetricDescriptor.MetricKind}
*
*
* The kind of measurement. It describes how the data is reported.
*
*/
public enum MetricKind
implements com.google.protobuf.ProtocolMessageEnum {
/**
* METRIC_KIND_UNSPECIFIED = 0;
*
*
* Do not use this default value.
*
*/
METRIC_KIND_UNSPECIFIED(0, 0),
/**
* GAUGE = 1;
*
*
* Instantaneous measurements of a varying quantity.
*
*/
GAUGE(1, 1),
/**
* DELTA = 2;
*
*
* Changes over non-overlapping time intervals.
*
*/
DELTA(2, 2),
/**
* CUMULATIVE = 3;
*
*
* Cumulative value over time intervals that can overlap.
* The overlapping intervals must have the same start time.
*
*/
CUMULATIVE(3, 3),
UNRECOGNIZED(-1, -1),
;
/**
* METRIC_KIND_UNSPECIFIED = 0;
*
*
* Do not use this default value.
*
*/
public static final int METRIC_KIND_UNSPECIFIED_VALUE = 0;
/**
* GAUGE = 1;
*
*
* Instantaneous measurements of a varying quantity.
*
*/
public static final int GAUGE_VALUE = 1;
/**
* DELTA = 2;
*
*
* Changes over non-overlapping time intervals.
*
*/
public static final int DELTA_VALUE = 2;
/**
* CUMULATIVE = 3;
*
*
* Cumulative value over time intervals that can overlap.
* The overlapping intervals must have the same start time.
*
*/
public static final int CUMULATIVE_VALUE = 3;
public final int getNumber() {
if (index == -1) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
public static MetricKind valueOf(int value) {
switch (value) {
case 0: return METRIC_KIND_UNSPECIFIED;
case 1: return GAUGE;
case 2: return DELTA;
case 3: return CUMULATIVE;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
MetricKind> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public MetricKind findValueByNumber(int number) {
return MetricKind.valueOf(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(index);
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return com.google.api.MetricDescriptor.getDescriptor().getEnumTypes().get(0);
}
private static final MetricKind[] VALUES = values();
public static MetricKind valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int index;
private final int value;
private MetricKind(int index, int value) {
this.index = index;
this.value = value;
}
// @@protoc_insertion_point(enum_scope:google.api.MetricDescriptor.MetricKind)
}
/**
* Protobuf enum {@code google.api.MetricDescriptor.ValueType}
*
*
* The value type of a metric.
*
*/
public enum ValueType
implements com.google.protobuf.ProtocolMessageEnum {
/**
* VALUE_TYPE_UNSPECIFIED = 0;
*
*
* Do not use this default value.
*
*/
VALUE_TYPE_UNSPECIFIED(0, 0),
/**
* BOOL = 1;
*
*
* The value is a boolean.
* This value type can be used only if the metric kind is `GAUGE`.
*
*/
BOOL(1, 1),
/**
* INT64 = 2;
*
*
* The value is a signed 64-bit integer.
*
*/
INT64(2, 2),
/**
* DOUBLE = 3;
*
*
* The value is a double precision floating point number.
*
*/
DOUBLE(3, 3),
/**
* STRING = 4;
*
*
* The value is a text string.
* This value type can be used only if the metric kind is `GAUGE`.
*
*/
STRING(4, 4),
/**
* DISTRIBUTION = 5;
*
*
* The value is a [`Distribution`][google.api.Distribution].
*
*/
DISTRIBUTION(5, 5),
/**
* MONEY = 6;
*
*
* The value is money.
*
*/
MONEY(6, 6),
UNRECOGNIZED(-1, -1),
;
/**
* VALUE_TYPE_UNSPECIFIED = 0;
*
*
* Do not use this default value.
*
*/
public static final int VALUE_TYPE_UNSPECIFIED_VALUE = 0;
/**
* BOOL = 1;
*
*
* The value is a boolean.
* This value type can be used only if the metric kind is `GAUGE`.
*
*/
public static final int BOOL_VALUE = 1;
/**
* INT64 = 2;
*
*
* The value is a signed 64-bit integer.
*
*/
public static final int INT64_VALUE = 2;
/**
* DOUBLE = 3;
*
*
* The value is a double precision floating point number.
*
*/
public static final int DOUBLE_VALUE = 3;
/**
* STRING = 4;
*
*
* The value is a text string.
* This value type can be used only if the metric kind is `GAUGE`.
*
*/
public static final int STRING_VALUE = 4;
/**
* DISTRIBUTION = 5;
*
*
* The value is a [`Distribution`][google.api.Distribution].
*
*/
public static final int DISTRIBUTION_VALUE = 5;
/**
* MONEY = 6;
*
*
* The value is money.
*
*/
public static final int MONEY_VALUE = 6;
public final int getNumber() {
if (index == -1) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
public static ValueType valueOf(int value) {
switch (value) {
case 0: return VALUE_TYPE_UNSPECIFIED;
case 1: return BOOL;
case 2: return INT64;
case 3: return DOUBLE;
case 4: return STRING;
case 5: return DISTRIBUTION;
case 6: return MONEY;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
ValueType> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public ValueType findValueByNumber(int number) {
return ValueType.valueOf(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(index);
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return com.google.api.MetricDescriptor.getDescriptor().getEnumTypes().get(1);
}
private static final ValueType[] VALUES = values();
public static ValueType valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int index;
private final int value;
private ValueType(int index, int value) {
this.index = index;
this.value = value;
}
// @@protoc_insertion_point(enum_scope:google.api.MetricDescriptor.ValueType)
}
private int bitField0_;
public static final int NAME_FIELD_NUMBER = 1;
private volatile java.lang.Object name_;
/**
* optional string name = 1;
*
*
* Resource name. The format of the name may vary between different
* implementations. For examples:
* projects/{project_id}/metricDescriptors/{type=**}
* metricDescriptors/{type=**}
*
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
}
}
/**
* optional string name = 1;
*
*
* Resource name. The format of the name may vary between different
* implementations. For examples:
* projects/{project_id}/metricDescriptors/{type=**}
* metricDescriptors/{type=**}
*
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int TYPE_FIELD_NUMBER = 8;
private volatile java.lang.Object type_;
/**
* optional string type = 8;
*
*
* The metric type including a DNS name prefix, for example
* `"compute.googleapis.com/instance/cpu/utilization"`. Metric types
* should use a natural hierarchical grouping such as the following:
* compute.googleapis.com/instance/cpu/utilization
* compute.googleapis.com/instance/disk/read_ops_count
* compute.googleapis.com/instance/network/received_bytes_count
* Note that if the metric type changes, the monitoring data will be
* discontinued, and anything depends on it will break, such as monitoring
* dashboards, alerting rules and quota limits. Therefore, once a metric has
* been published, its type should be immutable.
*
*/
public java.lang.String getType() {
java.lang.Object ref = type_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
type_ = s;
return s;
}
}
/**
* optional string type = 8;
*
*
* The metric type including a DNS name prefix, for example
* `"compute.googleapis.com/instance/cpu/utilization"`. Metric types
* should use a natural hierarchical grouping such as the following:
* compute.googleapis.com/instance/cpu/utilization
* compute.googleapis.com/instance/disk/read_ops_count
* compute.googleapis.com/instance/network/received_bytes_count
* Note that if the metric type changes, the monitoring data will be
* discontinued, and anything depends on it will break, such as monitoring
* dashboards, alerting rules and quota limits. Therefore, once a metric has
* been published, its type should be immutable.
*
*/
public com.google.protobuf.ByteString
getTypeBytes() {
java.lang.Object ref = type_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
type_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int LABELS_FIELD_NUMBER = 2;
private java.util.List labels_;
/**
* repeated .google.api.LabelDescriptor labels = 2;
*
*
* The set of labels that can be used to describe a specific instance of this
* metric type. For example, the
* `compute.googleapis.com/instance/network/received_bytes_count` metric type
* has a label, `loadbalanced`, that specifies whether the traffic was
* received through a load balanced IP address.
*
*/
public java.util.List getLabelsList() {
return labels_;
}
/**
* repeated .google.api.LabelDescriptor labels = 2;
*
*
* The set of labels that can be used to describe a specific instance of this
* metric type. For example, the
* `compute.googleapis.com/instance/network/received_bytes_count` metric type
* has a label, `loadbalanced`, that specifies whether the traffic was
* received through a load balanced IP address.
*
*/
public java.util.List extends com.google.api.LabelDescriptorOrBuilder>
getLabelsOrBuilderList() {
return labels_;
}
/**
* repeated .google.api.LabelDescriptor labels = 2;
*
*
* The set of labels that can be used to describe a specific instance of this
* metric type. For example, the
* `compute.googleapis.com/instance/network/received_bytes_count` metric type
* has a label, `loadbalanced`, that specifies whether the traffic was
* received through a load balanced IP address.
*
*/
public int getLabelsCount() {
return labels_.size();
}
/**
* repeated .google.api.LabelDescriptor labels = 2;
*
*
* The set of labels that can be used to describe a specific instance of this
* metric type. For example, the
* `compute.googleapis.com/instance/network/received_bytes_count` metric type
* has a label, `loadbalanced`, that specifies whether the traffic was
* received through a load balanced IP address.
*
*/
public com.google.api.LabelDescriptor getLabels(int index) {
return labels_.get(index);
}
/**
* repeated .google.api.LabelDescriptor labels = 2;
*
*
* The set of labels that can be used to describe a specific instance of this
* metric type. For example, the
* `compute.googleapis.com/instance/network/received_bytes_count` metric type
* has a label, `loadbalanced`, that specifies whether the traffic was
* received through a load balanced IP address.
*
*/
public com.google.api.LabelDescriptorOrBuilder getLabelsOrBuilder(
int index) {
return labels_.get(index);
}
public static final int METRIC_KIND_FIELD_NUMBER = 3;
private int metricKind_;
/**
* optional .google.api.MetricDescriptor.MetricKind metric_kind = 3;
*
*
* Whether the metric records instantaneous values, changes to a value, etc.
*
*/
public int getMetricKindValue() {
return metricKind_;
}
/**
* optional .google.api.MetricDescriptor.MetricKind metric_kind = 3;
*
*
* Whether the metric records instantaneous values, changes to a value, etc.
*
*/
public com.google.api.MetricDescriptor.MetricKind getMetricKind() {
com.google.api.MetricDescriptor.MetricKind result = com.google.api.MetricDescriptor.MetricKind.valueOf(metricKind_);
return result == null ? com.google.api.MetricDescriptor.MetricKind.UNRECOGNIZED : result;
}
public static final int VALUE_TYPE_FIELD_NUMBER = 4;
private int valueType_;
/**
* optional .google.api.MetricDescriptor.ValueType value_type = 4;
*
*
* Whether the measurement is an integer, a floating-point number, etc.
*
*/
public int getValueTypeValue() {
return valueType_;
}
/**
* optional .google.api.MetricDescriptor.ValueType value_type = 4;
*
*
* Whether the measurement is an integer, a floating-point number, etc.
*
*/
public com.google.api.MetricDescriptor.ValueType getValueType() {
com.google.api.MetricDescriptor.ValueType result = com.google.api.MetricDescriptor.ValueType.valueOf(valueType_);
return result == null ? com.google.api.MetricDescriptor.ValueType.UNRECOGNIZED : result;
}
public static final int UNIT_FIELD_NUMBER = 5;
private volatile java.lang.Object unit_;
/**
* optional string unit = 5;
*
*
* The unit in which the metric value is reported. It is only applicable
* if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The
* supported units are a subset of [The Unified Code for Units of
* Measure](http://unitsofmeasure.org/ucum.html) standard:
* **Basic units (UNIT)**
* * `bit` bit
* * `By` byte
* * `s` second
* * `min` minute
* * `h` hour
* * `d` day
* **Prefixes (PREFIX)**
* * `k` kilo (10**3)
* * `M` mega (10**6)
* * `G` giga (10**9)
* * `T` tera (10**12)
* * `P` peta (10**15)
* * `E` exa (10**18)
* * `Z` zetta (10**21)
* * `Y` yotta (10**24)
* * `m` milli (10**-3)
* * `u` micro (10**-6)
* * `n` nano (10**-9)
* * `p` pico (10**-12)
* * `f` femto (10**-15)
* * `a` atto (10**-18)
* * `z` zepto (10**-21)
* * `y` yocto (10**-24)
* * `Ki` kibi (2**10)
* * `Mi` mebi (2**20)
* * `Gi` gibi (2**30)
* * `Ti` tebi (2**40)
* **Grammar**
* The grammar includes the dimensionless unit `1`, such as `1/s`.
* The grammar also includes these connectors:
* * `/` division (as an infix operator, e.g. `1/s`).
* * `.` multiplication (as an infix operator, e.g. `GBy.d`)
* The grammar for a unit is as follows:
* Expression = Component { "." Component } { "/" Component } ;
* Component = [ PREFIX ] UNIT [ Annotation ]
* | Annotation
* | "1"
* ;
* Annotation = "{" NAME "}" ;
* Notes:
* * `Annotation` is just a comment if it follows a `UNIT` and is
* equivalent to `1` if it is used alone. For examples,
* `{requests}/s == 1/s`, `By{transmitted}/s == By/s`.
* * `NAME` is a sequence of non-blank printable ASCII characters not
* containing '{' or '}'.
*
*/
public java.lang.String getUnit() {
java.lang.Object ref = unit_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
unit_ = s;
return s;
}
}
/**
* optional string unit = 5;
*
*
* The unit in which the metric value is reported. It is only applicable
* if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The
* supported units are a subset of [The Unified Code for Units of
* Measure](http://unitsofmeasure.org/ucum.html) standard:
* **Basic units (UNIT)**
* * `bit` bit
* * `By` byte
* * `s` second
* * `min` minute
* * `h` hour
* * `d` day
* **Prefixes (PREFIX)**
* * `k` kilo (10**3)
* * `M` mega (10**6)
* * `G` giga (10**9)
* * `T` tera (10**12)
* * `P` peta (10**15)
* * `E` exa (10**18)
* * `Z` zetta (10**21)
* * `Y` yotta (10**24)
* * `m` milli (10**-3)
* * `u` micro (10**-6)
* * `n` nano (10**-9)
* * `p` pico (10**-12)
* * `f` femto (10**-15)
* * `a` atto (10**-18)
* * `z` zepto (10**-21)
* * `y` yocto (10**-24)
* * `Ki` kibi (2**10)
* * `Mi` mebi (2**20)
* * `Gi` gibi (2**30)
* * `Ti` tebi (2**40)
* **Grammar**
* The grammar includes the dimensionless unit `1`, such as `1/s`.
* The grammar also includes these connectors:
* * `/` division (as an infix operator, e.g. `1/s`).
* * `.` multiplication (as an infix operator, e.g. `GBy.d`)
* The grammar for a unit is as follows:
* Expression = Component { "." Component } { "/" Component } ;
* Component = [ PREFIX ] UNIT [ Annotation ]
* | Annotation
* | "1"
* ;
* Annotation = "{" NAME "}" ;
* Notes:
* * `Annotation` is just a comment if it follows a `UNIT` and is
* equivalent to `1` if it is used alone. For examples,
* `{requests}/s == 1/s`, `By{transmitted}/s == By/s`.
* * `NAME` is a sequence of non-blank printable ASCII characters not
* containing '{' or '}'.
*
*/
public com.google.protobuf.ByteString
getUnitBytes() {
java.lang.Object ref = unit_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
unit_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int DESCRIPTION_FIELD_NUMBER = 6;
private volatile java.lang.Object description_;
/**
* optional string description = 6;
*
*
* A detailed description of the metric, which can be used in documentation.
*
*/
public java.lang.String getDescription() {
java.lang.Object ref = description_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
description_ = s;
return s;
}
}
/**
* optional string description = 6;
*
*
* A detailed description of the metric, which can be used in documentation.
*
*/
public com.google.protobuf.ByteString
getDescriptionBytes() {
java.lang.Object ref = description_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
description_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int DISPLAY_NAME_FIELD_NUMBER = 7;
private volatile java.lang.Object displayName_;
/**
* optional string display_name = 7;
*
*
* A concise name for the metric, which can be displayed in user interfaces.
* Use sentence case without an ending period, for example "Request count".
*
*/
public java.lang.String getDisplayName() {
java.lang.Object ref = displayName_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
displayName_ = s;
return s;
}
}
/**
* optional string display_name = 7;
*
*
* A concise name for the metric, which can be displayed in user interfaces.
* Use sentence case without an ending period, for example "Request count".
*
*/
public com.google.protobuf.ByteString
getDisplayNameBytes() {
java.lang.Object ref = displayName_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
displayName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!getNameBytes().isEmpty()) {
com.google.protobuf.GeneratedMessage.writeString(output, 1, name_);
}
for (int i = 0; i < labels_.size(); i++) {
output.writeMessage(2, labels_.get(i));
}
if (metricKind_ != com.google.api.MetricDescriptor.MetricKind.METRIC_KIND_UNSPECIFIED.getNumber()) {
output.writeEnum(3, metricKind_);
}
if (valueType_ != com.google.api.MetricDescriptor.ValueType.VALUE_TYPE_UNSPECIFIED.getNumber()) {
output.writeEnum(4, valueType_);
}
if (!getUnitBytes().isEmpty()) {
com.google.protobuf.GeneratedMessage.writeString(output, 5, unit_);
}
if (!getDescriptionBytes().isEmpty()) {
com.google.protobuf.GeneratedMessage.writeString(output, 6, description_);
}
if (!getDisplayNameBytes().isEmpty()) {
com.google.protobuf.GeneratedMessage.writeString(output, 7, displayName_);
}
if (!getTypeBytes().isEmpty()) {
com.google.protobuf.GeneratedMessage.writeString(output, 8, type_);
}
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getNameBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_);
}
for (int i = 0; i < labels_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, labels_.get(i));
}
if (metricKind_ != com.google.api.MetricDescriptor.MetricKind.METRIC_KIND_UNSPECIFIED.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(3, metricKind_);
}
if (valueType_ != com.google.api.MetricDescriptor.ValueType.VALUE_TYPE_UNSPECIFIED.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(4, valueType_);
}
if (!getUnitBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessage.computeStringSize(5, unit_);
}
if (!getDescriptionBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessage.computeStringSize(6, description_);
}
if (!getDisplayNameBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessage.computeStringSize(7, displayName_);
}
if (!getTypeBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessage.computeStringSize(8, type_);
}
memoizedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
public static com.google.api.MetricDescriptor parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.MetricDescriptor parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.api.MetricDescriptor parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.api.MetricDescriptor parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.api.MetricDescriptor parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static com.google.api.MetricDescriptor parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static com.google.api.MetricDescriptor parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static com.google.api.MetricDescriptor parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static com.google.api.MetricDescriptor parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static com.google.api.MetricDescriptor parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.api.MetricDescriptor prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code google.api.MetricDescriptor}
*
*
* Defines a metric type and its schema.
*
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder implements
// @@protoc_insertion_point(builder_implements:google.api.MetricDescriptor)
com.google.api.MetricDescriptorOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.api.MetricProto.internal_static_google_api_MetricDescriptor_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.api.MetricProto.internal_static_google_api_MetricDescriptor_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.api.MetricDescriptor.class, com.google.api.MetricDescriptor.Builder.class);
}
// Construct using com.google.api.MetricDescriptor.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getLabelsFieldBuilder();
}
}
public Builder clear() {
super.clear();
name_ = "";
type_ = "";
if (labelsBuilder_ == null) {
labels_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000004);
} else {
labelsBuilder_.clear();
}
metricKind_ = 0;
valueType_ = 0;
unit_ = "";
description_ = "";
displayName_ = "";
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.google.api.MetricProto.internal_static_google_api_MetricDescriptor_descriptor;
}
public com.google.api.MetricDescriptor getDefaultInstanceForType() {
return com.google.api.MetricDescriptor.getDefaultInstance();
}
public com.google.api.MetricDescriptor build() {
com.google.api.MetricDescriptor result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public com.google.api.MetricDescriptor buildPartial() {
com.google.api.MetricDescriptor result = new com.google.api.MetricDescriptor(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
result.name_ = name_;
result.type_ = type_;
if (labelsBuilder_ == null) {
if (((bitField0_ & 0x00000004) == 0x00000004)) {
labels_ = java.util.Collections.unmodifiableList(labels_);
bitField0_ = (bitField0_ & ~0x00000004);
}
result.labels_ = labels_;
} else {
result.labels_ = labelsBuilder_.build();
}
result.metricKind_ = metricKind_;
result.valueType_ = valueType_;
result.unit_ = unit_;
result.description_ = description_;
result.displayName_ = displayName_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.api.MetricDescriptor) {
return mergeFrom((com.google.api.MetricDescriptor)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.api.MetricDescriptor other) {
if (other == com.google.api.MetricDescriptor.getDefaultInstance()) return this;
if (!other.getName().isEmpty()) {
name_ = other.name_;
onChanged();
}
if (!other.getType().isEmpty()) {
type_ = other.type_;
onChanged();
}
if (labelsBuilder_ == null) {
if (!other.labels_.isEmpty()) {
if (labels_.isEmpty()) {
labels_ = other.labels_;
bitField0_ = (bitField0_ & ~0x00000004);
} else {
ensureLabelsIsMutable();
labels_.addAll(other.labels_);
}
onChanged();
}
} else {
if (!other.labels_.isEmpty()) {
if (labelsBuilder_.isEmpty()) {
labelsBuilder_.dispose();
labelsBuilder_ = null;
labels_ = other.labels_;
bitField0_ = (bitField0_ & ~0x00000004);
labelsBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getLabelsFieldBuilder() : null;
} else {
labelsBuilder_.addAllMessages(other.labels_);
}
}
}
if (other.metricKind_ != 0) {
setMetricKindValue(other.getMetricKindValue());
}
if (other.valueType_ != 0) {
setValueTypeValue(other.getValueTypeValue());
}
if (!other.getUnit().isEmpty()) {
unit_ = other.unit_;
onChanged();
}
if (!other.getDescription().isEmpty()) {
description_ = other.description_;
onChanged();
}
if (!other.getDisplayName().isEmpty()) {
displayName_ = other.displayName_;
onChanged();
}
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.api.MetricDescriptor parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.google.api.MetricDescriptor) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.lang.Object name_ = "";
/**
* optional string name = 1;
*
*
* Resource name. The format of the name may vary between different
* implementations. For examples:
* projects/{project_id}/metricDescriptors/{type=**}
* metricDescriptors/{type=**}
*
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* optional string name = 1;
*
*
* Resource name. The format of the name may vary between different
* implementations. For examples:
* projects/{project_id}/metricDescriptors/{type=**}
* metricDescriptors/{type=**}
*
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* optional string name = 1;
*
*
* Resource name. The format of the name may vary between different
* implementations. For examples:
* projects/{project_id}/metricDescriptors/{type=**}
* metricDescriptors/{type=**}
*
*/
public Builder setName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
name_ = value;
onChanged();
return this;
}
/**
* optional string name = 1;
*
*
* Resource name. The format of the name may vary between different
* implementations. For examples:
* projects/{project_id}/metricDescriptors/{type=**}
* metricDescriptors/{type=**}
*
*/
public Builder clearName() {
name_ = getDefaultInstance().getName();
onChanged();
return this;
}
/**
* optional string name = 1;
*
*
* Resource name. The format of the name may vary between different
* implementations. For examples:
* projects/{project_id}/metricDescriptors/{type=**}
* metricDescriptors/{type=**}
*
*/
public Builder setNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
name_ = value;
onChanged();
return this;
}
private java.lang.Object type_ = "";
/**
* optional string type = 8;
*
*
* The metric type including a DNS name prefix, for example
* `"compute.googleapis.com/instance/cpu/utilization"`. Metric types
* should use a natural hierarchical grouping such as the following:
* compute.googleapis.com/instance/cpu/utilization
* compute.googleapis.com/instance/disk/read_ops_count
* compute.googleapis.com/instance/network/received_bytes_count
* Note that if the metric type changes, the monitoring data will be
* discontinued, and anything depends on it will break, such as monitoring
* dashboards, alerting rules and quota limits. Therefore, once a metric has
* been published, its type should be immutable.
*
*/
public java.lang.String getType() {
java.lang.Object ref = type_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
type_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* optional string type = 8;
*
*
* The metric type including a DNS name prefix, for example
* `"compute.googleapis.com/instance/cpu/utilization"`. Metric types
* should use a natural hierarchical grouping such as the following:
* compute.googleapis.com/instance/cpu/utilization
* compute.googleapis.com/instance/disk/read_ops_count
* compute.googleapis.com/instance/network/received_bytes_count
* Note that if the metric type changes, the monitoring data will be
* discontinued, and anything depends on it will break, such as monitoring
* dashboards, alerting rules and quota limits. Therefore, once a metric has
* been published, its type should be immutable.
*
*/
public com.google.protobuf.ByteString
getTypeBytes() {
java.lang.Object ref = type_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
type_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* optional string type = 8;
*
*
* The metric type including a DNS name prefix, for example
* `"compute.googleapis.com/instance/cpu/utilization"`. Metric types
* should use a natural hierarchical grouping such as the following:
* compute.googleapis.com/instance/cpu/utilization
* compute.googleapis.com/instance/disk/read_ops_count
* compute.googleapis.com/instance/network/received_bytes_count
* Note that if the metric type changes, the monitoring data will be
* discontinued, and anything depends on it will break, such as monitoring
* dashboards, alerting rules and quota limits. Therefore, once a metric has
* been published, its type should be immutable.
*
*/
public Builder setType(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
type_ = value;
onChanged();
return this;
}
/**
* optional string type = 8;
*
*
* The metric type including a DNS name prefix, for example
* `"compute.googleapis.com/instance/cpu/utilization"`. Metric types
* should use a natural hierarchical grouping such as the following:
* compute.googleapis.com/instance/cpu/utilization
* compute.googleapis.com/instance/disk/read_ops_count
* compute.googleapis.com/instance/network/received_bytes_count
* Note that if the metric type changes, the monitoring data will be
* discontinued, and anything depends on it will break, such as monitoring
* dashboards, alerting rules and quota limits. Therefore, once a metric has
* been published, its type should be immutable.
*
*/
public Builder clearType() {
type_ = getDefaultInstance().getType();
onChanged();
return this;
}
/**
* optional string type = 8;
*
*
* The metric type including a DNS name prefix, for example
* `"compute.googleapis.com/instance/cpu/utilization"`. Metric types
* should use a natural hierarchical grouping such as the following:
* compute.googleapis.com/instance/cpu/utilization
* compute.googleapis.com/instance/disk/read_ops_count
* compute.googleapis.com/instance/network/received_bytes_count
* Note that if the metric type changes, the monitoring data will be
* discontinued, and anything depends on it will break, such as monitoring
* dashboards, alerting rules and quota limits. Therefore, once a metric has
* been published, its type should be immutable.
*
*/
public Builder setTypeBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
type_ = value;
onChanged();
return this;
}
private java.util.List labels_ =
java.util.Collections.emptyList();
private void ensureLabelsIsMutable() {
if (!((bitField0_ & 0x00000004) == 0x00000004)) {
labels_ = new java.util.ArrayList(labels_);
bitField0_ |= 0x00000004;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
com.google.api.LabelDescriptor, com.google.api.LabelDescriptor.Builder, com.google.api.LabelDescriptorOrBuilder> labelsBuilder_;
/**
* repeated .google.api.LabelDescriptor labels = 2;
*
*
* The set of labels that can be used to describe a specific instance of this
* metric type. For example, the
* `compute.googleapis.com/instance/network/received_bytes_count` metric type
* has a label, `loadbalanced`, that specifies whether the traffic was
* received through a load balanced IP address.
*
*/
public java.util.List getLabelsList() {
if (labelsBuilder_ == null) {
return java.util.Collections.unmodifiableList(labels_);
} else {
return labelsBuilder_.getMessageList();
}
}
/**
* repeated .google.api.LabelDescriptor labels = 2;
*
*
* The set of labels that can be used to describe a specific instance of this
* metric type. For example, the
* `compute.googleapis.com/instance/network/received_bytes_count` metric type
* has a label, `loadbalanced`, that specifies whether the traffic was
* received through a load balanced IP address.
*
*/
public int getLabelsCount() {
if (labelsBuilder_ == null) {
return labels_.size();
} else {
return labelsBuilder_.getCount();
}
}
/**
* repeated .google.api.LabelDescriptor labels = 2;
*
*
* The set of labels that can be used to describe a specific instance of this
* metric type. For example, the
* `compute.googleapis.com/instance/network/received_bytes_count` metric type
* has a label, `loadbalanced`, that specifies whether the traffic was
* received through a load balanced IP address.
*
*/
public com.google.api.LabelDescriptor getLabels(int index) {
if (labelsBuilder_ == null) {
return labels_.get(index);
} else {
return labelsBuilder_.getMessage(index);
}
}
/**
* repeated .google.api.LabelDescriptor labels = 2;
*
*
* The set of labels that can be used to describe a specific instance of this
* metric type. For example, the
* `compute.googleapis.com/instance/network/received_bytes_count` metric type
* has a label, `loadbalanced`, that specifies whether the traffic was
* received through a load balanced IP address.
*
*/
public Builder setLabels(
int index, com.google.api.LabelDescriptor value) {
if (labelsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureLabelsIsMutable();
labels_.set(index, value);
onChanged();
} else {
labelsBuilder_.setMessage(index, value);
}
return this;
}
/**
* repeated .google.api.LabelDescriptor labels = 2;
*
*
* The set of labels that can be used to describe a specific instance of this
* metric type. For example, the
* `compute.googleapis.com/instance/network/received_bytes_count` metric type
* has a label, `loadbalanced`, that specifies whether the traffic was
* received through a load balanced IP address.
*
*/
public Builder setLabels(
int index, com.google.api.LabelDescriptor.Builder builderForValue) {
if (labelsBuilder_ == null) {
ensureLabelsIsMutable();
labels_.set(index, builderForValue.build());
onChanged();
} else {
labelsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* repeated .google.api.LabelDescriptor labels = 2;
*
*
* The set of labels that can be used to describe a specific instance of this
* metric type. For example, the
* `compute.googleapis.com/instance/network/received_bytes_count` metric type
* has a label, `loadbalanced`, that specifies whether the traffic was
* received through a load balanced IP address.
*
*/
public Builder addLabels(com.google.api.LabelDescriptor value) {
if (labelsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureLabelsIsMutable();
labels_.add(value);
onChanged();
} else {
labelsBuilder_.addMessage(value);
}
return this;
}
/**
* repeated .google.api.LabelDescriptor labels = 2;
*
*
* The set of labels that can be used to describe a specific instance of this
* metric type. For example, the
* `compute.googleapis.com/instance/network/received_bytes_count` metric type
* has a label, `loadbalanced`, that specifies whether the traffic was
* received through a load balanced IP address.
*
*/
public Builder addLabels(
int index, com.google.api.LabelDescriptor value) {
if (labelsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureLabelsIsMutable();
labels_.add(index, value);
onChanged();
} else {
labelsBuilder_.addMessage(index, value);
}
return this;
}
/**
* repeated .google.api.LabelDescriptor labels = 2;
*
*
* The set of labels that can be used to describe a specific instance of this
* metric type. For example, the
* `compute.googleapis.com/instance/network/received_bytes_count` metric type
* has a label, `loadbalanced`, that specifies whether the traffic was
* received through a load balanced IP address.
*
*/
public Builder addLabels(
com.google.api.LabelDescriptor.Builder builderForValue) {
if (labelsBuilder_ == null) {
ensureLabelsIsMutable();
labels_.add(builderForValue.build());
onChanged();
} else {
labelsBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* repeated .google.api.LabelDescriptor labels = 2;
*
*
* The set of labels that can be used to describe a specific instance of this
* metric type. For example, the
* `compute.googleapis.com/instance/network/received_bytes_count` metric type
* has a label, `loadbalanced`, that specifies whether the traffic was
* received through a load balanced IP address.
*
*/
public Builder addLabels(
int index, com.google.api.LabelDescriptor.Builder builderForValue) {
if (labelsBuilder_ == null) {
ensureLabelsIsMutable();
labels_.add(index, builderForValue.build());
onChanged();
} else {
labelsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* repeated .google.api.LabelDescriptor labels = 2;
*
*
* The set of labels that can be used to describe a specific instance of this
* metric type. For example, the
* `compute.googleapis.com/instance/network/received_bytes_count` metric type
* has a label, `loadbalanced`, that specifies whether the traffic was
* received through a load balanced IP address.
*
*/
public Builder addAllLabels(
java.lang.Iterable extends com.google.api.LabelDescriptor> values) {
if (labelsBuilder_ == null) {
ensureLabelsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, labels_);
onChanged();
} else {
labelsBuilder_.addAllMessages(values);
}
return this;
}
/**
* repeated .google.api.LabelDescriptor labels = 2;
*
*
* The set of labels that can be used to describe a specific instance of this
* metric type. For example, the
* `compute.googleapis.com/instance/network/received_bytes_count` metric type
* has a label, `loadbalanced`, that specifies whether the traffic was
* received through a load balanced IP address.
*
*/
public Builder clearLabels() {
if (labelsBuilder_ == null) {
labels_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000004);
onChanged();
} else {
labelsBuilder_.clear();
}
return this;
}
/**
* repeated .google.api.LabelDescriptor labels = 2;
*
*
* The set of labels that can be used to describe a specific instance of this
* metric type. For example, the
* `compute.googleapis.com/instance/network/received_bytes_count` metric type
* has a label, `loadbalanced`, that specifies whether the traffic was
* received through a load balanced IP address.
*
*/
public Builder removeLabels(int index) {
if (labelsBuilder_ == null) {
ensureLabelsIsMutable();
labels_.remove(index);
onChanged();
} else {
labelsBuilder_.remove(index);
}
return this;
}
/**
* repeated .google.api.LabelDescriptor labels = 2;
*
*
* The set of labels that can be used to describe a specific instance of this
* metric type. For example, the
* `compute.googleapis.com/instance/network/received_bytes_count` metric type
* has a label, `loadbalanced`, that specifies whether the traffic was
* received through a load balanced IP address.
*
*/
public com.google.api.LabelDescriptor.Builder getLabelsBuilder(
int index) {
return getLabelsFieldBuilder().getBuilder(index);
}
/**
* repeated .google.api.LabelDescriptor labels = 2;
*
*
* The set of labels that can be used to describe a specific instance of this
* metric type. For example, the
* `compute.googleapis.com/instance/network/received_bytes_count` metric type
* has a label, `loadbalanced`, that specifies whether the traffic was
* received through a load balanced IP address.
*
*/
public com.google.api.LabelDescriptorOrBuilder getLabelsOrBuilder(
int index) {
if (labelsBuilder_ == null) {
return labels_.get(index); } else {
return labelsBuilder_.getMessageOrBuilder(index);
}
}
/**
* repeated .google.api.LabelDescriptor labels = 2;
*
*
* The set of labels that can be used to describe a specific instance of this
* metric type. For example, the
* `compute.googleapis.com/instance/network/received_bytes_count` metric type
* has a label, `loadbalanced`, that specifies whether the traffic was
* received through a load balanced IP address.
*
*/
public java.util.List extends com.google.api.LabelDescriptorOrBuilder>
getLabelsOrBuilderList() {
if (labelsBuilder_ != null) {
return labelsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(labels_);
}
}
/**
* repeated .google.api.LabelDescriptor labels = 2;
*
*
* The set of labels that can be used to describe a specific instance of this
* metric type. For example, the
* `compute.googleapis.com/instance/network/received_bytes_count` metric type
* has a label, `loadbalanced`, that specifies whether the traffic was
* received through a load balanced IP address.
*
*/
public com.google.api.LabelDescriptor.Builder addLabelsBuilder() {
return getLabelsFieldBuilder().addBuilder(
com.google.api.LabelDescriptor.getDefaultInstance());
}
/**
* repeated .google.api.LabelDescriptor labels = 2;
*
*
* The set of labels that can be used to describe a specific instance of this
* metric type. For example, the
* `compute.googleapis.com/instance/network/received_bytes_count` metric type
* has a label, `loadbalanced`, that specifies whether the traffic was
* received through a load balanced IP address.
*
*/
public com.google.api.LabelDescriptor.Builder addLabelsBuilder(
int index) {
return getLabelsFieldBuilder().addBuilder(
index, com.google.api.LabelDescriptor.getDefaultInstance());
}
/**
* repeated .google.api.LabelDescriptor labels = 2;
*
*
* The set of labels that can be used to describe a specific instance of this
* metric type. For example, the
* `compute.googleapis.com/instance/network/received_bytes_count` metric type
* has a label, `loadbalanced`, that specifies whether the traffic was
* received through a load balanced IP address.
*
*/
public java.util.List
getLabelsBuilderList() {
return getLabelsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
com.google.api.LabelDescriptor, com.google.api.LabelDescriptor.Builder, com.google.api.LabelDescriptorOrBuilder>
getLabelsFieldBuilder() {
if (labelsBuilder_ == null) {
labelsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
com.google.api.LabelDescriptor, com.google.api.LabelDescriptor.Builder, com.google.api.LabelDescriptorOrBuilder>(
labels_,
((bitField0_ & 0x00000004) == 0x00000004),
getParentForChildren(),
isClean());
labels_ = null;
}
return labelsBuilder_;
}
private int metricKind_ = 0;
/**
* optional .google.api.MetricDescriptor.MetricKind metric_kind = 3;
*
*
* Whether the metric records instantaneous values, changes to a value, etc.
*
*/
public int getMetricKindValue() {
return metricKind_;
}
/**
* optional .google.api.MetricDescriptor.MetricKind metric_kind = 3;
*
*
* Whether the metric records instantaneous values, changes to a value, etc.
*
*/
public Builder setMetricKindValue(int value) {
metricKind_ = value;
onChanged();
return this;
}
/**
* optional .google.api.MetricDescriptor.MetricKind metric_kind = 3;
*
*
* Whether the metric records instantaneous values, changes to a value, etc.
*
*/
public com.google.api.MetricDescriptor.MetricKind getMetricKind() {
com.google.api.MetricDescriptor.MetricKind result = com.google.api.MetricDescriptor.MetricKind.valueOf(metricKind_);
return result == null ? com.google.api.MetricDescriptor.MetricKind.UNRECOGNIZED : result;
}
/**
* optional .google.api.MetricDescriptor.MetricKind metric_kind = 3;
*
*
* Whether the metric records instantaneous values, changes to a value, etc.
*
*/
public Builder setMetricKind(com.google.api.MetricDescriptor.MetricKind value) {
if (value == null) {
throw new NullPointerException();
}
metricKind_ = value.getNumber();
onChanged();
return this;
}
/**
* optional .google.api.MetricDescriptor.MetricKind metric_kind = 3;
*
*
* Whether the metric records instantaneous values, changes to a value, etc.
*
*/
public Builder clearMetricKind() {
metricKind_ = 0;
onChanged();
return this;
}
private int valueType_ = 0;
/**
* optional .google.api.MetricDescriptor.ValueType value_type = 4;
*
*
* Whether the measurement is an integer, a floating-point number, etc.
*
*/
public int getValueTypeValue() {
return valueType_;
}
/**
* optional .google.api.MetricDescriptor.ValueType value_type = 4;
*
*
* Whether the measurement is an integer, a floating-point number, etc.
*
*/
public Builder setValueTypeValue(int value) {
valueType_ = value;
onChanged();
return this;
}
/**
* optional .google.api.MetricDescriptor.ValueType value_type = 4;
*
*
* Whether the measurement is an integer, a floating-point number, etc.
*
*/
public com.google.api.MetricDescriptor.ValueType getValueType() {
com.google.api.MetricDescriptor.ValueType result = com.google.api.MetricDescriptor.ValueType.valueOf(valueType_);
return result == null ? com.google.api.MetricDescriptor.ValueType.UNRECOGNIZED : result;
}
/**
* optional .google.api.MetricDescriptor.ValueType value_type = 4;
*
*
* Whether the measurement is an integer, a floating-point number, etc.
*
*/
public Builder setValueType(com.google.api.MetricDescriptor.ValueType value) {
if (value == null) {
throw new NullPointerException();
}
valueType_ = value.getNumber();
onChanged();
return this;
}
/**
* optional .google.api.MetricDescriptor.ValueType value_type = 4;
*
*
* Whether the measurement is an integer, a floating-point number, etc.
*
*/
public Builder clearValueType() {
valueType_ = 0;
onChanged();
return this;
}
private java.lang.Object unit_ = "";
/**
* optional string unit = 5;
*
*
* The unit in which the metric value is reported. It is only applicable
* if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The
* supported units are a subset of [The Unified Code for Units of
* Measure](http://unitsofmeasure.org/ucum.html) standard:
* **Basic units (UNIT)**
* * `bit` bit
* * `By` byte
* * `s` second
* * `min` minute
* * `h` hour
* * `d` day
* **Prefixes (PREFIX)**
* * `k` kilo (10**3)
* * `M` mega (10**6)
* * `G` giga (10**9)
* * `T` tera (10**12)
* * `P` peta (10**15)
* * `E` exa (10**18)
* * `Z` zetta (10**21)
* * `Y` yotta (10**24)
* * `m` milli (10**-3)
* * `u` micro (10**-6)
* * `n` nano (10**-9)
* * `p` pico (10**-12)
* * `f` femto (10**-15)
* * `a` atto (10**-18)
* * `z` zepto (10**-21)
* * `y` yocto (10**-24)
* * `Ki` kibi (2**10)
* * `Mi` mebi (2**20)
* * `Gi` gibi (2**30)
* * `Ti` tebi (2**40)
* **Grammar**
* The grammar includes the dimensionless unit `1`, such as `1/s`.
* The grammar also includes these connectors:
* * `/` division (as an infix operator, e.g. `1/s`).
* * `.` multiplication (as an infix operator, e.g. `GBy.d`)
* The grammar for a unit is as follows:
* Expression = Component { "." Component } { "/" Component } ;
* Component = [ PREFIX ] UNIT [ Annotation ]
* | Annotation
* | "1"
* ;
* Annotation = "{" NAME "}" ;
* Notes:
* * `Annotation` is just a comment if it follows a `UNIT` and is
* equivalent to `1` if it is used alone. For examples,
* `{requests}/s == 1/s`, `By{transmitted}/s == By/s`.
* * `NAME` is a sequence of non-blank printable ASCII characters not
* containing '{' or '}'.
*
*/
public java.lang.String getUnit() {
java.lang.Object ref = unit_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
unit_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* optional string unit = 5;
*
*
* The unit in which the metric value is reported. It is only applicable
* if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The
* supported units are a subset of [The Unified Code for Units of
* Measure](http://unitsofmeasure.org/ucum.html) standard:
* **Basic units (UNIT)**
* * `bit` bit
* * `By` byte
* * `s` second
* * `min` minute
* * `h` hour
* * `d` day
* **Prefixes (PREFIX)**
* * `k` kilo (10**3)
* * `M` mega (10**6)
* * `G` giga (10**9)
* * `T` tera (10**12)
* * `P` peta (10**15)
* * `E` exa (10**18)
* * `Z` zetta (10**21)
* * `Y` yotta (10**24)
* * `m` milli (10**-3)
* * `u` micro (10**-6)
* * `n` nano (10**-9)
* * `p` pico (10**-12)
* * `f` femto (10**-15)
* * `a` atto (10**-18)
* * `z` zepto (10**-21)
* * `y` yocto (10**-24)
* * `Ki` kibi (2**10)
* * `Mi` mebi (2**20)
* * `Gi` gibi (2**30)
* * `Ti` tebi (2**40)
* **Grammar**
* The grammar includes the dimensionless unit `1`, such as `1/s`.
* The grammar also includes these connectors:
* * `/` division (as an infix operator, e.g. `1/s`).
* * `.` multiplication (as an infix operator, e.g. `GBy.d`)
* The grammar for a unit is as follows:
* Expression = Component { "." Component } { "/" Component } ;
* Component = [ PREFIX ] UNIT [ Annotation ]
* | Annotation
* | "1"
* ;
* Annotation = "{" NAME "}" ;
* Notes:
* * `Annotation` is just a comment if it follows a `UNIT` and is
* equivalent to `1` if it is used alone. For examples,
* `{requests}/s == 1/s`, `By{transmitted}/s == By/s`.
* * `NAME` is a sequence of non-blank printable ASCII characters not
* containing '{' or '}'.
*
*/
public com.google.protobuf.ByteString
getUnitBytes() {
java.lang.Object ref = unit_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
unit_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* optional string unit = 5;
*
*
* The unit in which the metric value is reported. It is only applicable
* if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The
* supported units are a subset of [The Unified Code for Units of
* Measure](http://unitsofmeasure.org/ucum.html) standard:
* **Basic units (UNIT)**
* * `bit` bit
* * `By` byte
* * `s` second
* * `min` minute
* * `h` hour
* * `d` day
* **Prefixes (PREFIX)**
* * `k` kilo (10**3)
* * `M` mega (10**6)
* * `G` giga (10**9)
* * `T` tera (10**12)
* * `P` peta (10**15)
* * `E` exa (10**18)
* * `Z` zetta (10**21)
* * `Y` yotta (10**24)
* * `m` milli (10**-3)
* * `u` micro (10**-6)
* * `n` nano (10**-9)
* * `p` pico (10**-12)
* * `f` femto (10**-15)
* * `a` atto (10**-18)
* * `z` zepto (10**-21)
* * `y` yocto (10**-24)
* * `Ki` kibi (2**10)
* * `Mi` mebi (2**20)
* * `Gi` gibi (2**30)
* * `Ti` tebi (2**40)
* **Grammar**
* The grammar includes the dimensionless unit `1`, such as `1/s`.
* The grammar also includes these connectors:
* * `/` division (as an infix operator, e.g. `1/s`).
* * `.` multiplication (as an infix operator, e.g. `GBy.d`)
* The grammar for a unit is as follows:
* Expression = Component { "." Component } { "/" Component } ;
* Component = [ PREFIX ] UNIT [ Annotation ]
* | Annotation
* | "1"
* ;
* Annotation = "{" NAME "}" ;
* Notes:
* * `Annotation` is just a comment if it follows a `UNIT` and is
* equivalent to `1` if it is used alone. For examples,
* `{requests}/s == 1/s`, `By{transmitted}/s == By/s`.
* * `NAME` is a sequence of non-blank printable ASCII characters not
* containing '{' or '}'.
*
*/
public Builder setUnit(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
unit_ = value;
onChanged();
return this;
}
/**
* optional string unit = 5;
*
*
* The unit in which the metric value is reported. It is only applicable
* if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The
* supported units are a subset of [The Unified Code for Units of
* Measure](http://unitsofmeasure.org/ucum.html) standard:
* **Basic units (UNIT)**
* * `bit` bit
* * `By` byte
* * `s` second
* * `min` minute
* * `h` hour
* * `d` day
* **Prefixes (PREFIX)**
* * `k` kilo (10**3)
* * `M` mega (10**6)
* * `G` giga (10**9)
* * `T` tera (10**12)
* * `P` peta (10**15)
* * `E` exa (10**18)
* * `Z` zetta (10**21)
* * `Y` yotta (10**24)
* * `m` milli (10**-3)
* * `u` micro (10**-6)
* * `n` nano (10**-9)
* * `p` pico (10**-12)
* * `f` femto (10**-15)
* * `a` atto (10**-18)
* * `z` zepto (10**-21)
* * `y` yocto (10**-24)
* * `Ki` kibi (2**10)
* * `Mi` mebi (2**20)
* * `Gi` gibi (2**30)
* * `Ti` tebi (2**40)
* **Grammar**
* The grammar includes the dimensionless unit `1`, such as `1/s`.
* The grammar also includes these connectors:
* * `/` division (as an infix operator, e.g. `1/s`).
* * `.` multiplication (as an infix operator, e.g. `GBy.d`)
* The grammar for a unit is as follows:
* Expression = Component { "." Component } { "/" Component } ;
* Component = [ PREFIX ] UNIT [ Annotation ]
* | Annotation
* | "1"
* ;
* Annotation = "{" NAME "}" ;
* Notes:
* * `Annotation` is just a comment if it follows a `UNIT` and is
* equivalent to `1` if it is used alone. For examples,
* `{requests}/s == 1/s`, `By{transmitted}/s == By/s`.
* * `NAME` is a sequence of non-blank printable ASCII characters not
* containing '{' or '}'.
*
*/
public Builder clearUnit() {
unit_ = getDefaultInstance().getUnit();
onChanged();
return this;
}
/**
* optional string unit = 5;
*
*
* The unit in which the metric value is reported. It is only applicable
* if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The
* supported units are a subset of [The Unified Code for Units of
* Measure](http://unitsofmeasure.org/ucum.html) standard:
* **Basic units (UNIT)**
* * `bit` bit
* * `By` byte
* * `s` second
* * `min` minute
* * `h` hour
* * `d` day
* **Prefixes (PREFIX)**
* * `k` kilo (10**3)
* * `M` mega (10**6)
* * `G` giga (10**9)
* * `T` tera (10**12)
* * `P` peta (10**15)
* * `E` exa (10**18)
* * `Z` zetta (10**21)
* * `Y` yotta (10**24)
* * `m` milli (10**-3)
* * `u` micro (10**-6)
* * `n` nano (10**-9)
* * `p` pico (10**-12)
* * `f` femto (10**-15)
* * `a` atto (10**-18)
* * `z` zepto (10**-21)
* * `y` yocto (10**-24)
* * `Ki` kibi (2**10)
* * `Mi` mebi (2**20)
* * `Gi` gibi (2**30)
* * `Ti` tebi (2**40)
* **Grammar**
* The grammar includes the dimensionless unit `1`, such as `1/s`.
* The grammar also includes these connectors:
* * `/` division (as an infix operator, e.g. `1/s`).
* * `.` multiplication (as an infix operator, e.g. `GBy.d`)
* The grammar for a unit is as follows:
* Expression = Component { "." Component } { "/" Component } ;
* Component = [ PREFIX ] UNIT [ Annotation ]
* | Annotation
* | "1"
* ;
* Annotation = "{" NAME "}" ;
* Notes:
* * `Annotation` is just a comment if it follows a `UNIT` and is
* equivalent to `1` if it is used alone. For examples,
* `{requests}/s == 1/s`, `By{transmitted}/s == By/s`.
* * `NAME` is a sequence of non-blank printable ASCII characters not
* containing '{' or '}'.
*
*/
public Builder setUnitBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
unit_ = value;
onChanged();
return this;
}
private java.lang.Object description_ = "";
/**
* optional string description = 6;
*
*
* A detailed description of the metric, which can be used in documentation.
*
*/
public java.lang.String getDescription() {
java.lang.Object ref = description_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
description_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* optional string description = 6;
*
*
* A detailed description of the metric, which can be used in documentation.
*
*/
public com.google.protobuf.ByteString
getDescriptionBytes() {
java.lang.Object ref = description_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
description_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* optional string description = 6;
*
*
* A detailed description of the metric, which can be used in documentation.
*
*/
public Builder setDescription(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
description_ = value;
onChanged();
return this;
}
/**
* optional string description = 6;
*
*
* A detailed description of the metric, which can be used in documentation.
*
*/
public Builder clearDescription() {
description_ = getDefaultInstance().getDescription();
onChanged();
return this;
}
/**
* optional string description = 6;
*
*
* A detailed description of the metric, which can be used in documentation.
*
*/
public Builder setDescriptionBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
description_ = value;
onChanged();
return this;
}
private java.lang.Object displayName_ = "";
/**
* optional string display_name = 7;
*
*
* A concise name for the metric, which can be displayed in user interfaces.
* Use sentence case without an ending period, for example "Request count".
*
*/
public java.lang.String getDisplayName() {
java.lang.Object ref = displayName_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
displayName_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* optional string display_name = 7;
*
*
* A concise name for the metric, which can be displayed in user interfaces.
* Use sentence case without an ending period, for example "Request count".
*
*/
public com.google.protobuf.ByteString
getDisplayNameBytes() {
java.lang.Object ref = displayName_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
displayName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* optional string display_name = 7;
*
*
* A concise name for the metric, which can be displayed in user interfaces.
* Use sentence case without an ending period, for example "Request count".
*
*/
public Builder setDisplayName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
displayName_ = value;
onChanged();
return this;
}
/**
* optional string display_name = 7;
*
*
* A concise name for the metric, which can be displayed in user interfaces.
* Use sentence case without an ending period, for example "Request count".
*
*/
public Builder clearDisplayName() {
displayName_ = getDefaultInstance().getDisplayName();
onChanged();
return this;
}
/**
* optional string display_name = 7;
*
*
* A concise name for the metric, which can be displayed in user interfaces.
* Use sentence case without an ending period, for example "Request count".
*
*/
public Builder setDisplayNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
displayName_ = value;
onChanged();
return this;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
// @@protoc_insertion_point(builder_scope:google.api.MetricDescriptor)
}
// @@protoc_insertion_point(class_scope:google.api.MetricDescriptor)
private static final com.google.api.MetricDescriptor DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.api.MetricDescriptor();
}
public static com.google.api.MetricDescriptor getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
public MetricDescriptor parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
try {
return new MetricDescriptor(input, extensionRegistry);
} catch (RuntimeException e) {
if (e.getCause() instanceof
com.google.protobuf.InvalidProtocolBufferException) {
throw (com.google.protobuf.InvalidProtocolBufferException)
e.getCause();
}
throw e;
}
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
public com.google.api.MetricDescriptor getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}