public static final class MonitoredResource.Builder extends GeneratedMessageV3.Builder<MonitoredResource.Builder> implements MonitoredResourceOrBuilder
An object representing a resource that can be used for monitoring, logging,
billing, or other purposes. Examples include virtual machine instances,
databases, and storage devices such as disks. The type
field identifies a
MonitoredResourceDescriptor object that describes the resource's
schema. Information in the labels
field identifies the actual resource and
its attributes according to the schema. For example, a particular Compute
Engine VM instance could be represented by the following object, because the
MonitoredResourceDescriptor for "gce_instance"
has labels
"instance_id"
and "zone"
:
{ "type": "gce_instance",
"labels": { "instance_id": "12345678901234",
"zone": "us-central1-a" }}
Protobuf type google.api.MonitoredResource
Inherited Members
com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)
Static Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns
Methods
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public MonitoredResource.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Returns
Overrides
build()
public MonitoredResource build()
Returns
buildPartial()
public MonitoredResource buildPartial()
Returns
clear()
public MonitoredResource.Builder clear()
Returns
Overrides
clearField(Descriptors.FieldDescriptor field)
public MonitoredResource.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Returns
Overrides
clearLabels()
public MonitoredResource.Builder clearLabels()
Returns
clearOneof(Descriptors.OneofDescriptor oneof)
public MonitoredResource.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Returns
Overrides
clearType()
public MonitoredResource.Builder clearType()
Required. The monitored resource type. This field must match
the type
field of a MonitoredResourceDescriptor object. For
example, the type of a Compute Engine VM instance is gce_instance
.
string type = 1;
Returns
clone()
public MonitoredResource.Builder clone()
Returns
Overrides
containsLabels(String key)
public boolean containsLabels(String key)
Required. Values for all of the labels listed in the associated monitored
resource descriptor. For example, Compute Engine VM instances use the
labels "project_id"
, "instance_id"
, and "zone"
.
map<string, string> labels = 2;
Parameter
Returns
getDefaultInstanceForType()
public MonitoredResource getDefaultInstanceForType()
Returns
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Returns
Overrides
getLabels()
public Map<String,String> getLabels()
Returns
getLabelsCount()
public int getLabelsCount()
Required. Values for all of the labels listed in the associated monitored
resource descriptor. For example, Compute Engine VM instances use the
labels "project_id"
, "instance_id"
, and "zone"
.
map<string, string> labels = 2;
Returns
getLabelsMap()
public Map<String,String> getLabelsMap()
Required. Values for all of the labels listed in the associated monitored
resource descriptor. For example, Compute Engine VM instances use the
labels "project_id"
, "instance_id"
, and "zone"
.
map<string, string> labels = 2;
Returns
getLabelsOrDefault(String key, String defaultValue)
public String getLabelsOrDefault(String key, String defaultValue)
Required. Values for all of the labels listed in the associated monitored
resource descriptor. For example, Compute Engine VM instances use the
labels "project_id"
, "instance_id"
, and "zone"
.
map<string, string> labels = 2;
Parameters
Returns
getLabelsOrThrow(String key)
public String getLabelsOrThrow(String key)
Required. Values for all of the labels listed in the associated monitored
resource descriptor. For example, Compute Engine VM instances use the
labels "project_id"
, "instance_id"
, and "zone"
.
map<string, string> labels = 2;
Parameter
Returns
getMutableLabels()
public Map<String,String> getMutableLabels()
Use alternate mutation accessors instead.
Returns
getType()
Required. The monitored resource type. This field must match
the type
field of a MonitoredResourceDescriptor object. For
example, the type of a Compute Engine VM instance is gce_instance
.
string type = 1;
Returns
Type | Description |
String | The type.
|
getTypeBytes()
public ByteString getTypeBytes()
Required. The monitored resource type. This field must match
the type
field of a MonitoredResourceDescriptor object. For
example, the type of a Compute Engine VM instance is gce_instance
.
string type = 1;
Returns
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Overrides
internalGetMapField(int number)
protected MapField internalGetMapField(int number)
Parameter
Returns
Overrides
internalGetMutableMapField(int number)
protected MapField internalGetMutableMapField(int number)
Parameter
Returns
Overrides
isInitialized()
public final boolean isInitialized()
Returns
Overrides
mergeFrom(MonitoredResource other)
public MonitoredResource.Builder mergeFrom(MonitoredResource other)
Parameter
Returns
public MonitoredResource.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Overrides
Exceptions
mergeFrom(Message other)
public MonitoredResource.Builder mergeFrom(Message other)
Parameter
Returns
Overrides
mergeUnknownFields(UnknownFieldSet unknownFields)
public final MonitoredResource.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Returns
Overrides
putAllLabels(Map<String,String> values)
public MonitoredResource.Builder putAllLabels(Map<String,String> values)
Required. Values for all of the labels listed in the associated monitored
resource descriptor. For example, Compute Engine VM instances use the
labels "project_id"
, "instance_id"
, and "zone"
.
map<string, string> labels = 2;
Parameter
Returns
putLabels(String key, String value)
public MonitoredResource.Builder putLabels(String key, String value)
Required. Values for all of the labels listed in the associated monitored
resource descriptor. For example, Compute Engine VM instances use the
labels "project_id"
, "instance_id"
, and "zone"
.
map<string, string> labels = 2;
Parameters
Returns
removeLabels(String key)
public MonitoredResource.Builder removeLabels(String key)
Required. Values for all of the labels listed in the associated monitored
resource descriptor. For example, Compute Engine VM instances use the
labels "project_id"
, "instance_id"
, and "zone"
.
map<string, string> labels = 2;
Parameter
Returns
setField(Descriptors.FieldDescriptor field, Object value)
public MonitoredResource.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Returns
Overrides
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public MonitoredResource.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Returns
Overrides
setType(String value)
public MonitoredResource.Builder setType(String value)
Required. The monitored resource type. This field must match
the type
field of a MonitoredResourceDescriptor object. For
example, the type of a Compute Engine VM instance is gce_instance
.
string type = 1;
Parameter
Name | Description |
value | String
The type to set.
|
Returns
setTypeBytes(ByteString value)
public MonitoredResource.Builder setTypeBytes(ByteString value)
Required. The monitored resource type. This field must match
the type
field of a MonitoredResourceDescriptor object. For
example, the type of a Compute Engine VM instance is gce_instance
.
string type = 1;
Parameter
Name | Description |
value | ByteString
The bytes for type to set.
|
Returns
setUnknownFields(UnknownFieldSet unknownFields)
public final MonitoredResource.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Returns
Overrides