com.google.api.MonitoredResourceMetadata Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lightstep-opentelemetry-auto-exporter Show documentation
Show all versions of lightstep-opentelemetry-auto-exporter Show documentation
Lightstep OpenTelemetry Auto Exporter
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/api/monitored_resource.proto
package com.google.api;
/**
*
* Auxiliary metadata for a [MonitoredResource][google.api.MonitoredResource] object.
* [MonitoredResource][google.api.MonitoredResource] objects contain the minimum set of information to
* uniquely identify a monitored resource instance. There is some other useful
* auxiliary metadata. Monitoring and Logging use an ingestion
* pipeline to extract metadata for cloud resources of all types, and store
* the metadata in this message.
*
*
* Protobuf type {@code google.api.MonitoredResourceMetadata}
*/
public final class MonitoredResourceMetadata extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:google.api.MonitoredResourceMetadata)
MonitoredResourceMetadataOrBuilder {
private static final long serialVersionUID = 0L;
// Use MonitoredResourceMetadata.newBuilder() to construct.
private MonitoredResourceMetadata(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private MonitoredResourceMetadata() {
}
@Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private MonitoredResourceMetadata(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new 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: {
com.google.protobuf.Struct.Builder subBuilder = null;
if (systemLabels_ != null) {
subBuilder = systemLabels_.toBuilder();
}
systemLabels_ = input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(systemLabels_);
systemLabels_ = subBuilder.buildPartial();
}
break;
}
case 18: {
if (!((mutable_bitField0_ & 0x00000002) != 0)) {
userLabels_ = com.google.protobuf.MapField.newMapField(
UserLabelsDefaultEntryHolder.defaultEntry);
mutable_bitField0_ |= 0x00000002;
}
com.google.protobuf.MapEntry
userLabels__ = input.readMessage(
UserLabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
userLabels_.getMutableMap().put(
userLabels__.getKey(), userLabels__.getValue());
break;
}
default: {
if (!parseUnknownField(
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 MonitoredResourceProto.internal_static_google_api_MonitoredResourceMetadata_descriptor;
}
@SuppressWarnings({"rawtypes"})
@Override
protected com.google.protobuf.MapField internalGetMapField(
int number) {
switch (number) {
case 2:
return internalGetUserLabels();
default:
throw new RuntimeException(
"Invalid map field number: " + number);
}
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return MonitoredResourceProto.internal_static_google_api_MonitoredResourceMetadata_fieldAccessorTable
.ensureFieldAccessorsInitialized(
MonitoredResourceMetadata.class, Builder.class);
}
private int bitField0_;
public static final int SYSTEM_LABELS_FIELD_NUMBER = 1;
private com.google.protobuf.Struct systemLabels_;
/**
*
* Output only. Values for predefined system metadata labels.
* System labels are a kind of metadata extracted by Google, including
* "machine_image", "vpc", "subnet_id",
* "security_group", "name", etc.
* System label values can be only strings, Boolean values, or a list of
* strings. For example:
* { "name": "my-test-instance",
* "security_group": ["a", "b", "c"],
* "spot_instance": false }
*
*
* .google.protobuf.Struct system_labels = 1;
*/
public boolean hasSystemLabels() {
return systemLabels_ != null;
}
/**
*
* Output only. Values for predefined system metadata labels.
* System labels are a kind of metadata extracted by Google, including
* "machine_image", "vpc", "subnet_id",
* "security_group", "name", etc.
* System label values can be only strings, Boolean values, or a list of
* strings. For example:
* { "name": "my-test-instance",
* "security_group": ["a", "b", "c"],
* "spot_instance": false }
*
*
* .google.protobuf.Struct system_labels = 1;
*/
public com.google.protobuf.Struct getSystemLabels() {
return systemLabels_ == null ? com.google.protobuf.Struct.getDefaultInstance() : systemLabels_;
}
/**
*
* Output only. Values for predefined system metadata labels.
* System labels are a kind of metadata extracted by Google, including
* "machine_image", "vpc", "subnet_id",
* "security_group", "name", etc.
* System label values can be only strings, Boolean values, or a list of
* strings. For example:
* { "name": "my-test-instance",
* "security_group": ["a", "b", "c"],
* "spot_instance": false }
*
*
* .google.protobuf.Struct system_labels = 1;
*/
public com.google.protobuf.StructOrBuilder getSystemLabelsOrBuilder() {
return getSystemLabels();
}
public static final int USER_LABELS_FIELD_NUMBER = 2;
private static final class UserLabelsDefaultEntryHolder {
static final com.google.protobuf.MapEntry<
String, String> defaultEntry =
com.google.protobuf.MapEntry
.newDefaultInstance(
MonitoredResourceProto.internal_static_google_api_MonitoredResourceMetadata_UserLabelsEntry_descriptor,
com.google.protobuf.WireFormat.FieldType.STRING,
"",
com.google.protobuf.WireFormat.FieldType.STRING,
"");
}
private com.google.protobuf.MapField<
String, String> userLabels_;
private com.google.protobuf.MapField
internalGetUserLabels() {
if (userLabels_ == null) {
return com.google.protobuf.MapField.emptyMapField(
UserLabelsDefaultEntryHolder.defaultEntry);
}
return userLabels_;
}
public int getUserLabelsCount() {
return internalGetUserLabels().getMap().size();
}
/**
*
* Output only. A map of user-defined metadata labels.
*
*
* map<string, string> user_labels = 2;
*/
public boolean containsUserLabels(
String key) {
if (key == null) { throw new NullPointerException(); }
return internalGetUserLabels().getMap().containsKey(key);
}
/**
* Use {@link #getUserLabelsMap()} instead.
*/
@Deprecated
public java.util.Map getUserLabels() {
return getUserLabelsMap();
}
/**
*
* Output only. A map of user-defined metadata labels.
*
*
* map<string, string> user_labels = 2;
*/
public java.util.Map getUserLabelsMap() {
return internalGetUserLabels().getMap();
}
/**
*
* Output only. A map of user-defined metadata labels.
*
*
* map<string, string> user_labels = 2;
*/
public String getUserLabelsOrDefault(
String key,
String defaultValue) {
if (key == null) { throw new NullPointerException(); }
java.util.Map map =
internalGetUserLabels().getMap();
return map.containsKey(key) ? map.get(key) : defaultValue;
}
/**
*
* Output only. A map of user-defined metadata labels.
*
*
* map<string, string> user_labels = 2;
*/
public String getUserLabelsOrThrow(
String key) {
if (key == null) { throw new NullPointerException(); }
java.util.Map map =
internalGetUserLabels().getMap();
if (!map.containsKey(key)) {
throw new IllegalArgumentException();
}
return map.get(key);
}
private byte memoizedIsInitialized = -1;
@Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (systemLabels_ != null) {
output.writeMessage(1, getSystemLabels());
}
com.google.protobuf.GeneratedMessageV3
.serializeStringMapTo(
output,
internalGetUserLabels(),
UserLabelsDefaultEntryHolder.defaultEntry,
2);
unknownFields.writeTo(output);
}
@Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (systemLabels_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, getSystemLabels());
}
for (java.util.Map.Entry entry
: internalGetUserLabels().getMap().entrySet()) {
com.google.protobuf.MapEntry
userLabels__ = UserLabelsDefaultEntryHolder.defaultEntry.newBuilderForType()
.setKey(entry.getKey())
.setValue(entry.getValue())
.build();
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, userLabels__);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof MonitoredResourceMetadata)) {
return super.equals(obj);
}
MonitoredResourceMetadata other = (MonitoredResourceMetadata) obj;
if (hasSystemLabels() != other.hasSystemLabels()) return false;
if (hasSystemLabels()) {
if (!getSystemLabels()
.equals(other.getSystemLabels())) return false;
}
if (!internalGetUserLabels().equals(
other.internalGetUserLabels())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasSystemLabels()) {
hash = (37 * hash) + SYSTEM_LABELS_FIELD_NUMBER;
hash = (53 * hash) + getSystemLabels().hashCode();
}
if (!internalGetUserLabels().getMap().isEmpty()) {
hash = (37 * hash) + USER_LABELS_FIELD_NUMBER;
hash = (53 * hash) + internalGetUserLabels().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static MonitoredResourceMetadata parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static MonitoredResourceMetadata parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static MonitoredResourceMetadata parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static MonitoredResourceMetadata parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static MonitoredResourceMetadata parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static MonitoredResourceMetadata parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static MonitoredResourceMetadata parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static MonitoredResourceMetadata 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 MonitoredResourceMetadata parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static MonitoredResourceMetadata 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 MonitoredResourceMetadata parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static MonitoredResourceMetadata parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(MonitoredResourceMetadata prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@Override
protected Builder newBuilderForType(
BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* Auxiliary metadata for a [MonitoredResource][google.api.MonitoredResource] object.
* [MonitoredResource][google.api.MonitoredResource] objects contain the minimum set of information to
* uniquely identify a monitored resource instance. There is some other useful
* auxiliary metadata. Monitoring and Logging use an ingestion
* pipeline to extract metadata for cloud resources of all types, and store
* the metadata in this message.
*
*
* Protobuf type {@code google.api.MonitoredResourceMetadata}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:google.api.MonitoredResourceMetadata)
com.google.api.MonitoredResourceMetadataOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return MonitoredResourceProto.internal_static_google_api_MonitoredResourceMetadata_descriptor;
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapField internalGetMapField(
int number) {
switch (number) {
case 2:
return internalGetUserLabels();
default:
throw new RuntimeException(
"Invalid map field number: " + number);
}
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapField internalGetMutableMapField(
int number) {
switch (number) {
case 2:
return internalGetMutableUserLabels();
default:
throw new RuntimeException(
"Invalid map field number: " + number);
}
}
@Override
protected FieldAccessorTable
internalGetFieldAccessorTable() {
return MonitoredResourceProto.internal_static_google_api_MonitoredResourceMetadata_fieldAccessorTable
.ensureFieldAccessorsInitialized(
MonitoredResourceMetadata.class, Builder.class);
}
// Construct using com.google.api.MonitoredResourceMetadata.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@Override
public Builder clear() {
super.clear();
if (systemLabelsBuilder_ == null) {
systemLabels_ = null;
} else {
systemLabels_ = null;
systemLabelsBuilder_ = null;
}
internalGetMutableUserLabels().clear();
return this;
}
@Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return MonitoredResourceProto.internal_static_google_api_MonitoredResourceMetadata_descriptor;
}
@Override
public MonitoredResourceMetadata getDefaultInstanceForType() {
return MonitoredResourceMetadata.getDefaultInstance();
}
@Override
public MonitoredResourceMetadata build() {
MonitoredResourceMetadata result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@Override
public MonitoredResourceMetadata buildPartial() {
MonitoredResourceMetadata result = new MonitoredResourceMetadata(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (systemLabelsBuilder_ == null) {
result.systemLabels_ = systemLabels_;
} else {
result.systemLabels_ = systemLabelsBuilder_.build();
}
result.userLabels_ = internalGetUserLabels();
result.userLabels_.makeImmutable();
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
@Override
public Builder clone() {
return super.clone();
}
@Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.setField(field, value);
}
@Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return super.setRepeatedField(field, index, value);
}
@Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return super.addRepeatedField(field, value);
}
@Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof MonitoredResourceMetadata) {
return mergeFrom((MonitoredResourceMetadata)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(MonitoredResourceMetadata other) {
if (other == MonitoredResourceMetadata.getDefaultInstance()) return this;
if (other.hasSystemLabels()) {
mergeSystemLabels(other.getSystemLabels());
}
internalGetMutableUserLabels().mergeFrom(
other.internalGetUserLabels());
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@Override
public final boolean isInitialized() {
return true;
}
@Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
MonitoredResourceMetadata parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (MonitoredResourceMetadata) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private com.google.protobuf.Struct systemLabels_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> systemLabelsBuilder_;
/**
*
* Output only. Values for predefined system metadata labels.
* System labels are a kind of metadata extracted by Google, including
* "machine_image", "vpc", "subnet_id",
* "security_group", "name", etc.
* System label values can be only strings, Boolean values, or a list of
* strings. For example:
* { "name": "my-test-instance",
* "security_group": ["a", "b", "c"],
* "spot_instance": false }
*
*
* .google.protobuf.Struct system_labels = 1;
*/
public boolean hasSystemLabels() {
return systemLabelsBuilder_ != null || systemLabels_ != null;
}
/**
*
* Output only. Values for predefined system metadata labels.
* System labels are a kind of metadata extracted by Google, including
* "machine_image", "vpc", "subnet_id",
* "security_group", "name", etc.
* System label values can be only strings, Boolean values, or a list of
* strings. For example:
* { "name": "my-test-instance",
* "security_group": ["a", "b", "c"],
* "spot_instance": false }
*
*
* .google.protobuf.Struct system_labels = 1;
*/
public com.google.protobuf.Struct getSystemLabels() {
if (systemLabelsBuilder_ == null) {
return systemLabels_ == null ? com.google.protobuf.Struct.getDefaultInstance() : systemLabels_;
} else {
return systemLabelsBuilder_.getMessage();
}
}
/**
*
* Output only. Values for predefined system metadata labels.
* System labels are a kind of metadata extracted by Google, including
* "machine_image", "vpc", "subnet_id",
* "security_group", "name", etc.
* System label values can be only strings, Boolean values, or a list of
* strings. For example:
* { "name": "my-test-instance",
* "security_group": ["a", "b", "c"],
* "spot_instance": false }
*
*
* .google.protobuf.Struct system_labels = 1;
*/
public Builder setSystemLabels(com.google.protobuf.Struct value) {
if (systemLabelsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
systemLabels_ = value;
onChanged();
} else {
systemLabelsBuilder_.setMessage(value);
}
return this;
}
/**
*
* Output only. Values for predefined system metadata labels.
* System labels are a kind of metadata extracted by Google, including
* "machine_image", "vpc", "subnet_id",
* "security_group", "name", etc.
* System label values can be only strings, Boolean values, or a list of
* strings. For example:
* { "name": "my-test-instance",
* "security_group": ["a", "b", "c"],
* "spot_instance": false }
*
*
* .google.protobuf.Struct system_labels = 1;
*/
public Builder setSystemLabels(
com.google.protobuf.Struct.Builder builderForValue) {
if (systemLabelsBuilder_ == null) {
systemLabels_ = builderForValue.build();
onChanged();
} else {
systemLabelsBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* Output only. Values for predefined system metadata labels.
* System labels are a kind of metadata extracted by Google, including
* "machine_image", "vpc", "subnet_id",
* "security_group", "name", etc.
* System label values can be only strings, Boolean values, or a list of
* strings. For example:
* { "name": "my-test-instance",
* "security_group": ["a", "b", "c"],
* "spot_instance": false }
*
*
* .google.protobuf.Struct system_labels = 1;
*/
public Builder mergeSystemLabels(com.google.protobuf.Struct value) {
if (systemLabelsBuilder_ == null) {
if (systemLabels_ != null) {
systemLabels_ =
com.google.protobuf.Struct.newBuilder(systemLabels_).mergeFrom(value).buildPartial();
} else {
systemLabels_ = value;
}
onChanged();
} else {
systemLabelsBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* Output only. Values for predefined system metadata labels.
* System labels are a kind of metadata extracted by Google, including
* "machine_image", "vpc", "subnet_id",
* "security_group", "name", etc.
* System label values can be only strings, Boolean values, or a list of
* strings. For example:
* { "name": "my-test-instance",
* "security_group": ["a", "b", "c"],
* "spot_instance": false }
*
*
* .google.protobuf.Struct system_labels = 1;
*/
public Builder clearSystemLabels() {
if (systemLabelsBuilder_ == null) {
systemLabels_ = null;
onChanged();
} else {
systemLabels_ = null;
systemLabelsBuilder_ = null;
}
return this;
}
/**
*
* Output only. Values for predefined system metadata labels.
* System labels are a kind of metadata extracted by Google, including
* "machine_image", "vpc", "subnet_id",
* "security_group", "name", etc.
* System label values can be only strings, Boolean values, or a list of
* strings. For example:
* { "name": "my-test-instance",
* "security_group": ["a", "b", "c"],
* "spot_instance": false }
*
*
* .google.protobuf.Struct system_labels = 1;
*/
public com.google.protobuf.Struct.Builder getSystemLabelsBuilder() {
onChanged();
return getSystemLabelsFieldBuilder().getBuilder();
}
/**
*
* Output only. Values for predefined system metadata labels.
* System labels are a kind of metadata extracted by Google, including
* "machine_image", "vpc", "subnet_id",
* "security_group", "name", etc.
* System label values can be only strings, Boolean values, or a list of
* strings. For example:
* { "name": "my-test-instance",
* "security_group": ["a", "b", "c"],
* "spot_instance": false }
*
*
* .google.protobuf.Struct system_labels = 1;
*/
public com.google.protobuf.StructOrBuilder getSystemLabelsOrBuilder() {
if (systemLabelsBuilder_ != null) {
return systemLabelsBuilder_.getMessageOrBuilder();
} else {
return systemLabels_ == null ?
com.google.protobuf.Struct.getDefaultInstance() : systemLabels_;
}
}
/**
*
* Output only. Values for predefined system metadata labels.
* System labels are a kind of metadata extracted by Google, including
* "machine_image", "vpc", "subnet_id",
* "security_group", "name", etc.
* System label values can be only strings, Boolean values, or a list of
* strings. For example:
* { "name": "my-test-instance",
* "security_group": ["a", "b", "c"],
* "spot_instance": false }
*
*
* .google.protobuf.Struct system_labels = 1;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>
getSystemLabelsFieldBuilder() {
if (systemLabelsBuilder_ == null) {
systemLabelsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>(
getSystemLabels(),
getParentForChildren(),
isClean());
systemLabels_ = null;
}
return systemLabelsBuilder_;
}
private com.google.protobuf.MapField<
String, String> userLabels_;
private com.google.protobuf.MapField
internalGetUserLabels() {
if (userLabels_ == null) {
return com.google.protobuf.MapField.emptyMapField(
UserLabelsDefaultEntryHolder.defaultEntry);
}
return userLabels_;
}
private com.google.protobuf.MapField
internalGetMutableUserLabels() {
onChanged();;
if (userLabels_ == null) {
userLabels_ = com.google.protobuf.MapField.newMapField(
UserLabelsDefaultEntryHolder.defaultEntry);
}
if (!userLabels_.isMutable()) {
userLabels_ = userLabels_.copy();
}
return userLabels_;
}
public int getUserLabelsCount() {
return internalGetUserLabels().getMap().size();
}
/**
*
* Output only. A map of user-defined metadata labels.
*
*
* map<string, string> user_labels = 2;
*/
public boolean containsUserLabels(
String key) {
if (key == null) { throw new NullPointerException(); }
return internalGetUserLabels().getMap().containsKey(key);
}
/**
* Use {@link #getUserLabelsMap()} instead.
*/
@Deprecated
public java.util.Map getUserLabels() {
return getUserLabelsMap();
}
/**
*
* Output only. A map of user-defined metadata labels.
*
*
* map<string, string> user_labels = 2;
*/
public java.util.Map getUserLabelsMap() {
return internalGetUserLabels().getMap();
}
/**
*
* Output only. A map of user-defined metadata labels.
*
*
* map<string, string> user_labels = 2;
*/
public String getUserLabelsOrDefault(
String key,
String defaultValue) {
if (key == null) { throw new NullPointerException(); }
java.util.Map map =
internalGetUserLabels().getMap();
return map.containsKey(key) ? map.get(key) : defaultValue;
}
/**
*
* Output only. A map of user-defined metadata labels.
*
*
* map<string, string> user_labels = 2;
*/
public String getUserLabelsOrThrow(
String key) {
if (key == null) { throw new NullPointerException(); }
java.util.Map map =
internalGetUserLabels().getMap();
if (!map.containsKey(key)) {
throw new IllegalArgumentException();
}
return map.get(key);
}
public Builder clearUserLabels() {
internalGetMutableUserLabels().getMutableMap()
.clear();
return this;
}
/**
*
* Output only. A map of user-defined metadata labels.
*
*
* map<string, string> user_labels = 2;
*/
public Builder removeUserLabels(
String key) {
if (key == null) { throw new NullPointerException(); }
internalGetMutableUserLabels().getMutableMap()
.remove(key);
return this;
}
/**
* Use alternate mutation accessors instead.
*/
@Deprecated
public java.util.Map
getMutableUserLabels() {
return internalGetMutableUserLabels().getMutableMap();
}
/**
*
* Output only. A map of user-defined metadata labels.
*
*
* map<string, string> user_labels = 2;
*/
public Builder putUserLabels(
String key,
String value) {
if (key == null) { throw new NullPointerException(); }
if (value == null) { throw new NullPointerException(); }
internalGetMutableUserLabels().getMutableMap()
.put(key, value);
return this;
}
/**
*
* Output only. A map of user-defined metadata labels.
*
*
* map<string, string> user_labels = 2;
*/
public Builder putAllUserLabels(
java.util.Map values) {
internalGetMutableUserLabels().getMutableMap()
.putAll(values);
return this;
}
@Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.api.MonitoredResourceMetadata)
}
// @@protoc_insertion_point(class_scope:google.api.MonitoredResourceMetadata)
private static final MonitoredResourceMetadata DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new MonitoredResourceMetadata();
}
public static MonitoredResourceMetadata getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@Override
public MonitoredResourceMetadata parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new MonitoredResourceMetadata(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@Override
public MonitoredResourceMetadata getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}