diff --git a/google-api-grpc/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DroppedLabels.java b/google-api-grpc/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DroppedLabels.java new file mode 100644 index 000000000000..49bfe6d4affa --- /dev/null +++ b/google-api-grpc/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DroppedLabels.java @@ -0,0 +1,770 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/monitoring/v3/dropped_labels.proto + +package com.google.monitoring.v3; + +/** + * + * + *
+ * A set of (label, value) pairs which were dropped during aggregation, attached
+ * to google.api.Distribution.Exemplars in google.api.Distribution values during
+ * aggregation.
+ * These values are used in combination with the label values that remain on the
+ * aggregated Distribution timeseries to construct the full label set for the
+ * exemplar values.  The resulting full label set may be used to identify the
+ * specific task/job/instance (for example) which may be contributing to a
+ * long-tail, while allowing the storage savings of only storing aggregated
+ * distribution values for a large group.
+ * Note that there are no guarantees on ordering of the labels from
+ * exemplar-to-exemplar and from distribution-to-distribution in the same
+ * stream, and there may be duplicates.  It is up to clients to resolve any
+ * ambiguities.
+ * 
+ * + * Protobuf type {@code google.monitoring.v3.DroppedLabels} + */ +public final class DroppedLabels extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.monitoring.v3.DroppedLabels) + DroppedLabelsOrBuilder { + private static final long serialVersionUID = 0L; + // Use DroppedLabels.newBuilder() to construct. + private DroppedLabels(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DroppedLabels() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DroppedLabels( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + label_ = + com.google.protobuf.MapField.newMapField(LabelDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry label__ = + input.readMessage( + LabelDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + label_.getMutableMap().put(label__.getKey(), label__.getValue()); + break; + } + default: + { + if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.DroppedLabelsProto + .internal_static_google_monitoring_v3_DroppedLabels_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetLabel(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.DroppedLabelsProto + .internal_static_google_monitoring_v3_DroppedLabels_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.DroppedLabels.class, + com.google.monitoring.v3.DroppedLabels.Builder.class); + } + + public static final int LABEL_FIELD_NUMBER = 1; + + private static final class LabelDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.monitoring.v3.DroppedLabelsProto + .internal_static_google_monitoring_v3_DroppedLabels_LabelEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField label_; + + private com.google.protobuf.MapField internalGetLabel() { + if (label_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelDefaultEntryHolder.defaultEntry); + } + return label_; + } + + public int getLabelCount() { + return internalGetLabel().getMap().size(); + } + /** + * + * + *
+   * Map from label to its value, for all labels dropped in any aggregation.
+   * 
+ * + * map<string, string> label = 1; + */ + public boolean containsLabel(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabel().getMap().containsKey(key); + } + /** Use {@link #getLabelMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getLabel() { + return getLabelMap(); + } + /** + * + * + *
+   * Map from label to its value, for all labels dropped in any aggregation.
+   * 
+ * + * map<string, string> label = 1; + */ + public java.util.Map getLabelMap() { + return internalGetLabel().getMap(); + } + /** + * + * + *
+   * Map from label to its value, for all labels dropped in any aggregation.
+   * 
+ * + * map<string, string> label = 1; + */ + public java.lang.String getLabelOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabel().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Map from label to its value, for all labels dropped in any aggregation.
+   * 
+ * + * map<string, string> label = 1; + */ + public java.lang.String getLabelOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabel().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabel(), LabelDefaultEntryHolder.defaultEntry, 1); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry : + internalGetLabel().getMap().entrySet()) { + com.google.protobuf.MapEntry label__ = + LabelDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, label__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.monitoring.v3.DroppedLabels)) { + return super.equals(obj); + } + com.google.monitoring.v3.DroppedLabels other = (com.google.monitoring.v3.DroppedLabels) obj; + + boolean result = true; + result = result && internalGetLabel().equals(other.internalGetLabel()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetLabel().getMap().isEmpty()) { + hash = (37 * hash) + LABEL_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabel().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.monitoring.v3.DroppedLabels parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.DroppedLabels parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.DroppedLabels parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.DroppedLabels 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.monitoring.v3.DroppedLabels parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.monitoring.v3.DroppedLabels parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.monitoring.v3.DroppedLabels parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.DroppedLabels parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.monitoring.v3.DroppedLabels parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.DroppedLabels parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.monitoring.v3.DroppedLabels parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.monitoring.v3.DroppedLabels parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.monitoring.v3.DroppedLabels prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A set of (label, value) pairs which were dropped during aggregation, attached
+   * to google.api.Distribution.Exemplars in google.api.Distribution values during
+   * aggregation.
+   * These values are used in combination with the label values that remain on the
+   * aggregated Distribution timeseries to construct the full label set for the
+   * exemplar values.  The resulting full label set may be used to identify the
+   * specific task/job/instance (for example) which may be contributing to a
+   * long-tail, while allowing the storage savings of only storing aggregated
+   * distribution values for a large group.
+   * Note that there are no guarantees on ordering of the labels from
+   * exemplar-to-exemplar and from distribution-to-distribution in the same
+   * stream, and there may be duplicates.  It is up to clients to resolve any
+   * ambiguities.
+   * 
+ * + * Protobuf type {@code google.monitoring.v3.DroppedLabels} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.monitoring.v3.DroppedLabels) + com.google.monitoring.v3.DroppedLabelsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.monitoring.v3.DroppedLabelsProto + .internal_static_google_monitoring_v3_DroppedLabels_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 1: + return internalGetLabel(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 1: + return internalGetMutableLabel(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.monitoring.v3.DroppedLabelsProto + .internal_static_google_monitoring_v3_DroppedLabels_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.monitoring.v3.DroppedLabels.class, + com.google.monitoring.v3.DroppedLabels.Builder.class); + } + + // Construct using com.google.monitoring.v3.DroppedLabels.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + internalGetMutableLabel().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.monitoring.v3.DroppedLabelsProto + .internal_static_google_monitoring_v3_DroppedLabels_descriptor; + } + + @java.lang.Override + public com.google.monitoring.v3.DroppedLabels getDefaultInstanceForType() { + return com.google.monitoring.v3.DroppedLabels.getDefaultInstance(); + } + + @java.lang.Override + public com.google.monitoring.v3.DroppedLabels build() { + com.google.monitoring.v3.DroppedLabels result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.monitoring.v3.DroppedLabels buildPartial() { + com.google.monitoring.v3.DroppedLabels result = + new com.google.monitoring.v3.DroppedLabels(this); + int from_bitField0_ = bitField0_; + result.label_ = internalGetLabel(); + result.label_.makeImmutable(); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.monitoring.v3.DroppedLabels) { + return mergeFrom((com.google.monitoring.v3.DroppedLabels) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.monitoring.v3.DroppedLabels other) { + if (other == com.google.monitoring.v3.DroppedLabels.getDefaultInstance()) return this; + internalGetMutableLabel().mergeFrom(other.internalGetLabel()); + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.monitoring.v3.DroppedLabels parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.monitoring.v3.DroppedLabels) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.MapField label_; + + private com.google.protobuf.MapField internalGetLabel() { + if (label_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelDefaultEntryHolder.defaultEntry); + } + return label_; + } + + private com.google.protobuf.MapField + internalGetMutableLabel() { + onChanged(); + ; + if (label_ == null) { + label_ = com.google.protobuf.MapField.newMapField(LabelDefaultEntryHolder.defaultEntry); + } + if (!label_.isMutable()) { + label_ = label_.copy(); + } + return label_; + } + + public int getLabelCount() { + return internalGetLabel().getMap().size(); + } + /** + * + * + *
+     * Map from label to its value, for all labels dropped in any aggregation.
+     * 
+ * + * map<string, string> label = 1; + */ + public boolean containsLabel(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabel().getMap().containsKey(key); + } + /** Use {@link #getLabelMap()} instead. */ + @java.lang.Deprecated + public java.util.Map getLabel() { + return getLabelMap(); + } + /** + * + * + *
+     * Map from label to its value, for all labels dropped in any aggregation.
+     * 
+ * + * map<string, string> label = 1; + */ + public java.util.Map getLabelMap() { + return internalGetLabel().getMap(); + } + /** + * + * + *
+     * Map from label to its value, for all labels dropped in any aggregation.
+     * 
+ * + * map<string, string> label = 1; + */ + public java.lang.String getLabelOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabel().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Map from label to its value, for all labels dropped in any aggregation.
+     * 
+ * + * map<string, string> label = 1; + */ + public java.lang.String getLabelOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabel().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabel() { + internalGetMutableLabel().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Map from label to its value, for all labels dropped in any aggregation.
+     * 
+ * + * map<string, string> label = 1; + */ + public Builder removeLabel(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabel().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabel() { + return internalGetMutableLabel().getMutableMap(); + } + /** + * + * + *
+     * Map from label to its value, for all labels dropped in any aggregation.
+     * 
+ * + * map<string, string> label = 1; + */ + public Builder putLabel(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabel().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Map from label to its value, for all labels dropped in any aggregation.
+     * 
+ * + * map<string, string> label = 1; + */ + public Builder putAllLabel(java.util.Map values) { + internalGetMutableLabel().getMutableMap().putAll(values); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.monitoring.v3.DroppedLabels) + } + + // @@protoc_insertion_point(class_scope:google.monitoring.v3.DroppedLabels) + private static final com.google.monitoring.v3.DroppedLabels DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.monitoring.v3.DroppedLabels(); + } + + public static com.google.monitoring.v3.DroppedLabels getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DroppedLabels parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DroppedLabels(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.monitoring.v3.DroppedLabels getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DroppedLabelsOrBuilder.java b/google-api-grpc/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DroppedLabelsOrBuilder.java new file mode 100644 index 000000000000..daff464d3394 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DroppedLabelsOrBuilder.java @@ -0,0 +1,64 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/monitoring/v3/dropped_labels.proto + +package com.google.monitoring.v3; + +public interface DroppedLabelsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.monitoring.v3.DroppedLabels) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Map from label to its value, for all labels dropped in any aggregation.
+   * 
+ * + * map<string, string> label = 1; + */ + int getLabelCount(); + /** + * + * + *
+   * Map from label to its value, for all labels dropped in any aggregation.
+   * 
+ * + * map<string, string> label = 1; + */ + boolean containsLabel(java.lang.String key); + /** Use {@link #getLabelMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabel(); + /** + * + * + *
+   * Map from label to its value, for all labels dropped in any aggregation.
+   * 
+ * + * map<string, string> label = 1; + */ + java.util.Map getLabelMap(); + /** + * + * + *
+   * Map from label to its value, for all labels dropped in any aggregation.
+   * 
+ * + * map<string, string> label = 1; + */ + java.lang.String getLabelOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * Map from label to its value, for all labels dropped in any aggregation.
+   * 
+ * + * map<string, string> label = 1; + */ + java.lang.String getLabelOrThrow(java.lang.String key); +} diff --git a/google-api-grpc/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DroppedLabelsProto.java b/google-api-grpc/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DroppedLabelsProto.java new file mode 100644 index 000000000000..218d33656617 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/DroppedLabelsProto.java @@ -0,0 +1,76 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/monitoring/v3/dropped_labels.proto + +package com.google.monitoring.v3; + +public final class DroppedLabelsProto { + private DroppedLabelsProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_DroppedLabels_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_DroppedLabels_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_monitoring_v3_DroppedLabels_LabelEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_monitoring_v3_DroppedLabels_LabelEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n)google/monitoring/v3/dropped_labels.pr" + + "oto\022\024google.monitoring.v3\032\034google/api/an" + + "notations.proto\"|\n\rDroppedLabels\022=\n\005labe" + + "l\030\001 \003(\0132..google.monitoring.v3.DroppedLa" + + "bels.LabelEntry\032,\n\nLabelEntry\022\013\n\003key\030\001 \001" + + "(\t\022\r\n\005value\030\002 \001(\t:\0028\001Bp\n\030com.google.moni" + + "toring.v3B\022DroppedLabelsProtoP\001Z>google." + + "golang.org/genproto/googleapis/monitorin" + + "g/v3;monitoringb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + }, + assigner); + internal_static_google_monitoring_v3_DroppedLabels_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_monitoring_v3_DroppedLabels_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_DroppedLabels_descriptor, + new java.lang.String[] { + "Label", + }); + internal_static_google_monitoring_v3_DroppedLabels_LabelEntry_descriptor = + internal_static_google_monitoring_v3_DroppedLabels_descriptor.getNestedTypes().get(0); + internal_static_google_monitoring_v3_DroppedLabels_LabelEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_monitoring_v3_DroppedLabels_LabelEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + com.google.api.AnnotationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/dropped_labels.proto b/google-api-grpc/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/dropped_labels.proto index d832aa454528..acbe8cf25ad1 100644 --- a/google-api-grpc/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/dropped_labels.proto +++ b/google-api-grpc/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/dropped_labels.proto @@ -20,6 +20,9 @@ package google.monitoring.v3; import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/monitoring/v3;monitoring"; +option java_multiple_files = true; +option java_outer_classname = "DroppedLabelsProto"; +option java_package = "com.google.monitoring.v3"; // A set of (label, value) pairs which were dropped during aggregation, attached // to google.api.Distribution.Exemplars in google.api.Distribution values during diff --git a/google-cloud-clients/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClient.java b/google-cloud-clients/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClient.java index cfe1554df34f..8433f26744c3 100644 --- a/google-cloud-clients/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClient.java +++ b/google-cloud-clients/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClient.java @@ -37,6 +37,7 @@ import com.google.monitoring.v3.ListUptimeCheckIpsResponse; import com.google.monitoring.v3.UpdateUptimeCheckConfigRequest; import com.google.monitoring.v3.UptimeCheckConfig; +import com.google.monitoring.v3.UptimeCheckConfigName; import com.google.monitoring.v3.UptimeCheckIp; import com.google.protobuf.Empty; import java.io.IOException; @@ -59,8 +60,8 @@ *
  * 
  * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
- *   String formattedName = UptimeCheckConfigName.format("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
- *   UptimeCheckConfig response = uptimeCheckServiceClient.getUptimeCheckConfig(formattedName);
+ *   UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+ *   UptimeCheckConfig response = uptimeCheckServiceClient.getUptimeCheckConfig(name);
  * }
  * 
  * 
@@ -289,8 +290,34 @@ public final ListUptimeCheckConfigsPagedResponse listUptimeCheckConfigs( * *

    * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
-   *   String formattedName = UptimeCheckConfigName.format("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
-   *   UptimeCheckConfig response = uptimeCheckServiceClient.getUptimeCheckConfig(formattedName);
+   *   UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+   *   UptimeCheckConfig response = uptimeCheckServiceClient.getUptimeCheckConfig(name);
+   * }
+   * 
+ * + * @param name The uptime check configuration to retrieve. The format is + * `projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID]`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final UptimeCheckConfig getUptimeCheckConfig(UptimeCheckConfigName name) { + + GetUptimeCheckConfigRequest request = + GetUptimeCheckConfigRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getUptimeCheckConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a single uptime check configuration. + * + *

Sample code: + * + *


+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+   *   UptimeCheckConfig response = uptimeCheckServiceClient.getUptimeCheckConfig(name.toString());
    * }
    * 
* @@ -313,9 +340,9 @@ public final UptimeCheckConfig getUptimeCheckConfig(String name) { * *

    * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
-   *   String formattedName = UptimeCheckConfigName.format("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+   *   UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
    *   GetUptimeCheckConfigRequest request = GetUptimeCheckConfigRequest.newBuilder()
-   *     .setName(formattedName)
+   *     .setName(name.toString())
    *     .build();
    *   UptimeCheckConfig response = uptimeCheckServiceClient.getUptimeCheckConfig(request);
    * }
@@ -336,9 +363,9 @@ public final UptimeCheckConfig getUptimeCheckConfig(GetUptimeCheckConfigRequest
    *
    * 

    * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
-   *   String formattedName = UptimeCheckConfigName.format("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+   *   UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
    *   GetUptimeCheckConfigRequest request = GetUptimeCheckConfigRequest.newBuilder()
-   *     .setName(formattedName)
+   *     .setName(name.toString())
    *     .build();
    *   ApiFuture<UptimeCheckConfig> future = uptimeCheckServiceClient.getUptimeCheckConfigCallable().futureCall(request);
    *   // Do something
@@ -523,8 +550,36 @@ public final UptimeCheckConfig updateUptimeCheckConfig(UpdateUptimeCheckConfigRe
    *
    * 

    * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
-   *   String formattedName = UptimeCheckConfigName.format("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
-   *   uptimeCheckServiceClient.deleteUptimeCheckConfig(formattedName);
+   *   UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+   *   uptimeCheckServiceClient.deleteUptimeCheckConfig(name);
+   * }
+   * 
+ * + * @param name The uptime check configuration to delete. The format is + * `projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID]`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteUptimeCheckConfig(UptimeCheckConfigName name) { + + DeleteUptimeCheckConfigRequest request = + DeleteUptimeCheckConfigRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteUptimeCheckConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes an uptime check configuration. Note that this method will fail if the uptime check + * configuration is referenced by an alert policy or other dependent configs that would be + * rendered invalid by the deletion. + * + *

Sample code: + * + *


+   * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
+   *   UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+   *   uptimeCheckServiceClient.deleteUptimeCheckConfig(name.toString());
    * }
    * 
* @@ -549,9 +604,9 @@ public final void deleteUptimeCheckConfig(String name) { * *

    * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
-   *   String formattedName = UptimeCheckConfigName.format("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+   *   UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
    *   DeleteUptimeCheckConfigRequest request = DeleteUptimeCheckConfigRequest.newBuilder()
-   *     .setName(formattedName)
+   *     .setName(name.toString())
    *     .build();
    *   uptimeCheckServiceClient.deleteUptimeCheckConfig(request);
    * }
@@ -574,9 +629,9 @@ public final void deleteUptimeCheckConfig(DeleteUptimeCheckConfigRequest request
    *
    * 

    * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
-   *   String formattedName = UptimeCheckConfigName.format("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+   *   UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
    *   DeleteUptimeCheckConfigRequest request = DeleteUptimeCheckConfigRequest.newBuilder()
-   *     .setName(formattedName)
+   *     .setName(name.toString())
    *     .build();
    *   ApiFuture<Void> future = uptimeCheckServiceClient.deleteUptimeCheckConfigCallable().futureCall(request);
    *   // Do something
diff --git a/google-cloud-clients/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/package-info.java b/google-cloud-clients/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/package-info.java
index 5c405dc40d7a..297143cd6622 100644
--- a/google-cloud-clients/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/package-info.java
+++ b/google-cloud-clients/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/package-info.java
@@ -109,8 +109,8 @@
  * 
  * 
  * try (UptimeCheckServiceClient uptimeCheckServiceClient = UptimeCheckServiceClient.create()) {
- *   String formattedName = UptimeCheckConfigName.format("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
- *   UptimeCheckConfig response = uptimeCheckServiceClient.getUptimeCheckConfig(formattedName);
+ *   UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]");
+ *   UptimeCheckConfig response = uptimeCheckServiceClient.getUptimeCheckConfig(name);
  * }
  * 
  * 
diff --git a/google-cloud-clients/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClientTest.java b/google-cloud-clients/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClientTest.java index 1c367c49f0e0..6faa686b5e2f 100644 --- a/google-cloud-clients/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClientTest.java +++ b/google-cloud-clients/google-cloud-monitoring/src/test/java/com/google/cloud/monitoring/v3/UptimeCheckServiceClientTest.java @@ -166,16 +166,16 @@ public void getUptimeCheckConfigTest() { .build(); mockUptimeCheckService.addResponse(expectedResponse); - String formattedName = UptimeCheckConfigName.format("[PROJECT]", "[UPTIME_CHECK_CONFIG]"); + UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]"); - UptimeCheckConfig actualResponse = client.getUptimeCheckConfig(formattedName); + UptimeCheckConfig actualResponse = client.getUptimeCheckConfig(name); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockUptimeCheckService.getRequests(); Assert.assertEquals(1, actualRequests.size()); GetUptimeCheckConfigRequest actualRequest = (GetUptimeCheckConfigRequest) actualRequests.get(0); - Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertEquals(name, UptimeCheckConfigName.parse(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -189,9 +189,9 @@ public void getUptimeCheckConfigExceptionTest() throws Exception { mockUptimeCheckService.addException(exception); try { - String formattedName = UptimeCheckConfigName.format("[PROJECT]", "[UPTIME_CHECK_CONFIG]"); + UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]"); - client.getUptimeCheckConfig(formattedName); + client.getUptimeCheckConfig(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception @@ -302,16 +302,16 @@ public void deleteUptimeCheckConfigTest() { Empty expectedResponse = Empty.newBuilder().build(); mockUptimeCheckService.addResponse(expectedResponse); - String formattedName = UptimeCheckConfigName.format("[PROJECT]", "[UPTIME_CHECK_CONFIG]"); + UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]"); - client.deleteUptimeCheckConfig(formattedName); + client.deleteUptimeCheckConfig(name); List actualRequests = mockUptimeCheckService.getRequests(); Assert.assertEquals(1, actualRequests.size()); DeleteUptimeCheckConfigRequest actualRequest = (DeleteUptimeCheckConfigRequest) actualRequests.get(0); - Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertEquals(name, UptimeCheckConfigName.parse(actualRequest.getName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -325,9 +325,9 @@ public void deleteUptimeCheckConfigExceptionTest() throws Exception { mockUptimeCheckService.addException(exception); try { - String formattedName = UptimeCheckConfigName.format("[PROJECT]", "[UPTIME_CHECK_CONFIG]"); + UptimeCheckConfigName name = UptimeCheckConfigName.of("[PROJECT]", "[UPTIME_CHECK_CONFIG]"); - client.deleteUptimeCheckConfig(formattedName); + client.deleteUptimeCheckConfig(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception diff --git a/google-cloud-clients/google-cloud-monitoring/synth.metadata b/google-cloud-clients/google-cloud-monitoring/synth.metadata index 03c6c0e07a28..c3a44433a82f 100644 --- a/google-cloud-clients/google-cloud-monitoring/synth.metadata +++ b/google-cloud-clients/google-cloud-monitoring/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-03-06T08:47:52.711546Z", + "updateTime": "2019-03-27T07:50:46.085733Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.15", - "dockerImage": "googleapis/artman@sha256:9caadfa59d48224cba5f3217eb9d61a155b78ccf31e628abef385bc5b7ed3bd2" + "version": "0.16.19", + "dockerImage": "googleapis/artman@sha256:70ba28fda87e032ae44e6df41b7fc342c1b0cce1ed90658c4890eb4f613038c2" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "856117505ff9075b3e9c0b5674113667b6cf9e00", - "internalRef": "236931378" + "sha": "d4d57d766601105478c661132f2687e6984b92d5", + "internalRef": "240469931" } } ],