Class MonitoredResourceDescriptor.Builder (2.33.0)

public static final class MonitoredResourceDescriptor.Builder extends GeneratedMessageV3.Builder<MonitoredResourceDescriptor.Builder> implements MonitoredResourceDescriptorOrBuilder

An object that describes the schema of a MonitoredResource object using a type name and a set of labels. For example, the monitored resource descriptor for Google Compute Engine VM instances has a type of "gce_instance" and specifies the use of the labels "instance_id" and "zone" to identify particular VM instances.

Different APIs can support different monitored resource types. APIs generally provide a list method that returns the monitored resource descriptors used by the API.

Protobuf type google.api.MonitoredResourceDescriptor

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAllLabels(Iterable<? extends LabelDescriptor> values)

public MonitoredResourceDescriptor.Builder addAllLabels(Iterable<? extends LabelDescriptor> values)

Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels "database_id" and "zone".

repeated .google.api.LabelDescriptor labels = 4;

Parameter
NameDescription
valuesIterable<? extends com.google.api.LabelDescriptor>
Returns
TypeDescription
MonitoredResourceDescriptor.Builder

addLabels(LabelDescriptor value)

public MonitoredResourceDescriptor.Builder addLabels(LabelDescriptor value)

Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels "database_id" and "zone".

repeated .google.api.LabelDescriptor labels = 4;

Parameter
NameDescription
valueLabelDescriptor
Returns
TypeDescription
MonitoredResourceDescriptor.Builder

addLabels(LabelDescriptor.Builder builderForValue)

public MonitoredResourceDescriptor.Builder addLabels(LabelDescriptor.Builder builderForValue)

Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels "database_id" and "zone".

repeated .google.api.LabelDescriptor labels = 4;

Parameter
NameDescription
builderForValueLabelDescriptor.Builder
Returns
TypeDescription
MonitoredResourceDescriptor.Builder

addLabels(int index, LabelDescriptor value)

public MonitoredResourceDescriptor.Builder addLabels(int index, LabelDescriptor value)

Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels "database_id" and "zone".

repeated .google.api.LabelDescriptor labels = 4;

Parameters
NameDescription
indexint
valueLabelDescriptor
Returns
TypeDescription
MonitoredResourceDescriptor.Builder

addLabels(int index, LabelDescriptor.Builder builderForValue)

public MonitoredResourceDescriptor.Builder addLabels(int index, LabelDescriptor.Builder builderForValue)

Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels "database_id" and "zone".

repeated .google.api.LabelDescriptor labels = 4;

Parameters
NameDescription
indexint
builderForValueLabelDescriptor.Builder
Returns
TypeDescription
MonitoredResourceDescriptor.Builder

addLabelsBuilder()

public LabelDescriptor.Builder addLabelsBuilder()

Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels "database_id" and "zone".

repeated .google.api.LabelDescriptor labels = 4;

Returns
TypeDescription
LabelDescriptor.Builder

addLabelsBuilder(int index)

public LabelDescriptor.Builder addLabelsBuilder(int index)

Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels "database_id" and "zone".

repeated .google.api.LabelDescriptor labels = 4;

Parameter
NameDescription
indexint
Returns
TypeDescription
LabelDescriptor.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public MonitoredResourceDescriptor.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
MonitoredResourceDescriptor.Builder
Overrides

build()

public MonitoredResourceDescriptor build()
Returns
TypeDescription
MonitoredResourceDescriptor

buildPartial()

public MonitoredResourceDescriptor buildPartial()
Returns
TypeDescription
MonitoredResourceDescriptor

clear()

public MonitoredResourceDescriptor.Builder clear()
Returns
TypeDescription
MonitoredResourceDescriptor.Builder
Overrides

clearDescription()

public MonitoredResourceDescriptor.Builder clearDescription()

Optional. A detailed description of the monitored resource type that might be used in documentation.

string description = 3;

Returns
TypeDescription
MonitoredResourceDescriptor.Builder

This builder for chaining.

clearDisplayName()

public MonitoredResourceDescriptor.Builder clearDisplayName()

Optional. A concise name for the monitored resource type that might be displayed in user interfaces. It should be a Title Cased Noun Phrase, without any article or other determiners. For example, "Google Cloud SQL Database".

string display_name = 2;

Returns
TypeDescription
MonitoredResourceDescriptor.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public MonitoredResourceDescriptor.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
MonitoredResourceDescriptor.Builder
Overrides

clearLabels()

public MonitoredResourceDescriptor.Builder clearLabels()

Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels "database_id" and "zone".

repeated .google.api.LabelDescriptor labels = 4;

Returns
TypeDescription
MonitoredResourceDescriptor.Builder

clearLaunchStage()

public MonitoredResourceDescriptor.Builder clearLaunchStage()

Optional. The launch stage of the monitored resource definition.

.google.api.LaunchStage launch_stage = 7;

Returns
TypeDescription
MonitoredResourceDescriptor.Builder

This builder for chaining.

clearName()

public MonitoredResourceDescriptor.Builder clearName()

Optional. The resource name of the monitored resource descriptor: "projects/{project_id}/monitoredResourceDescriptors/{type}" where {type} is the value of the type field in this object and {project_id} is a project ID that provides API-specific context for accessing the type. APIs that do not use project information can use the resource name format "monitoredResourceDescriptors/{type}".

string name = 5;

Returns
TypeDescription
MonitoredResourceDescriptor.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public MonitoredResourceDescriptor.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
MonitoredResourceDescriptor.Builder
Overrides

clearType()

public MonitoredResourceDescriptor.Builder clearType()

Required. The monitored resource type. For example, the type "cloudsql_database" represents databases in Google Cloud SQL. For a list of types, see Monitoring resource types and Logging resource types.

string type = 1;

Returns
TypeDescription
MonitoredResourceDescriptor.Builder

This builder for chaining.

clone()

public MonitoredResourceDescriptor.Builder clone()
Returns
TypeDescription
MonitoredResourceDescriptor.Builder
Overrides

getDefaultInstanceForType()

public MonitoredResourceDescriptor getDefaultInstanceForType()
Returns
TypeDescription
MonitoredResourceDescriptor

getDescription()

public String getDescription()

Optional. A detailed description of the monitored resource type that might be used in documentation.

string description = 3;

Returns
TypeDescription
String

The description.

getDescriptionBytes()

public ByteString getDescriptionBytes()

Optional. A detailed description of the monitored resource type that might be used in documentation.

string description = 3;

Returns
TypeDescription
ByteString

The bytes for description.

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getDisplayName()

public String getDisplayName()

Optional. A concise name for the monitored resource type that might be displayed in user interfaces. It should be a Title Cased Noun Phrase, without any article or other determiners. For example, "Google Cloud SQL Database".

string display_name = 2;

Returns
TypeDescription
String

The displayName.

getDisplayNameBytes()

public ByteString getDisplayNameBytes()

Optional. A concise name for the monitored resource type that might be displayed in user interfaces. It should be a Title Cased Noun Phrase, without any article or other determiners. For example, "Google Cloud SQL Database".

string display_name = 2;

Returns
TypeDescription
ByteString

The bytes for displayName.

getLabels(int index)

public LabelDescriptor getLabels(int index)

Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels "database_id" and "zone".

repeated .google.api.LabelDescriptor labels = 4;

Parameter
NameDescription
indexint
Returns
TypeDescription
LabelDescriptor

getLabelsBuilder(int index)

public LabelDescriptor.Builder getLabelsBuilder(int index)

Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels "database_id" and "zone".

repeated .google.api.LabelDescriptor labels = 4;

Parameter
NameDescription
indexint
Returns
TypeDescription
LabelDescriptor.Builder

getLabelsBuilderList()

public List<LabelDescriptor.Builder> getLabelsBuilderList()

Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels "database_id" and "zone".

repeated .google.api.LabelDescriptor labels = 4;

Returns
TypeDescription
List<Builder>

getLabelsCount()

public int getLabelsCount()

Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels "database_id" and "zone".

repeated .google.api.LabelDescriptor labels = 4;

Returns
TypeDescription
int

getLabelsList()

public List<LabelDescriptor> getLabelsList()

Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels "database_id" and "zone".

repeated .google.api.LabelDescriptor labels = 4;

Returns
TypeDescription
List<LabelDescriptor>

getLabelsOrBuilder(int index)

public LabelDescriptorOrBuilder getLabelsOrBuilder(int index)

Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels "database_id" and "zone".

repeated .google.api.LabelDescriptor labels = 4;

Parameter
NameDescription
indexint
Returns
TypeDescription
LabelDescriptorOrBuilder

getLabelsOrBuilderList()

public List<? extends LabelDescriptorOrBuilder> getLabelsOrBuilderList()

Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels "database_id" and "zone".

repeated .google.api.LabelDescriptor labels = 4;

Returns
TypeDescription
List<? extends com.google.api.LabelDescriptorOrBuilder>

getLaunchStage()

public LaunchStage getLaunchStage()

Optional. The launch stage of the monitored resource definition.

.google.api.LaunchStage launch_stage = 7;

Returns
TypeDescription
LaunchStage

The launchStage.

getLaunchStageValue()

public int getLaunchStageValue()

Optional. The launch stage of the monitored resource definition.

.google.api.LaunchStage launch_stage = 7;

Returns
TypeDescription
int

The enum numeric value on the wire for launchStage.

getName()

public String getName()

Optional. The resource name of the monitored resource descriptor: "projects/{project_id}/monitoredResourceDescriptors/{type}" where {type} is the value of the type field in this object and {project_id} is a project ID that provides API-specific context for accessing the type. APIs that do not use project information can use the resource name format "monitoredResourceDescriptors/{type}".

string name = 5;

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

Optional. The resource name of the monitored resource descriptor: "projects/{project_id}/monitoredResourceDescriptors/{type}" where {type} is the value of the type field in this object and {project_id} is a project ID that provides API-specific context for accessing the type. APIs that do not use project information can use the resource name format "monitoredResourceDescriptors/{type}".

string name = 5;

Returns
TypeDescription
ByteString

The bytes for name.

getType()

public String getType()

Required. The monitored resource type. For example, the type "cloudsql_database" represents databases in Google Cloud SQL. For a list of types, see Monitoring resource types and Logging resource types.

string type = 1;

Returns
TypeDescription
String

The type.

getTypeBytes()

public ByteString getTypeBytes()

Required. The monitored resource type. For example, the type "cloudsql_database" represents databases in Google Cloud SQL. For a list of types, see Monitoring resource types and Logging resource types.

string type = 1;

Returns
TypeDescription
ByteString

The bytes for type.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(MonitoredResourceDescriptor other)

public MonitoredResourceDescriptor.Builder mergeFrom(MonitoredResourceDescriptor other)
Parameter
NameDescription
otherMonitoredResourceDescriptor
Returns
TypeDescription
MonitoredResourceDescriptor.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public MonitoredResourceDescriptor.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
MonitoredResourceDescriptor.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public MonitoredResourceDescriptor.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
MonitoredResourceDescriptor.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final MonitoredResourceDescriptor.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
MonitoredResourceDescriptor.Builder
Overrides

removeLabels(int index)

public MonitoredResourceDescriptor.Builder removeLabels(int index)

Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels "database_id" and "zone".

repeated .google.api.LabelDescriptor labels = 4;

Parameter
NameDescription
indexint
Returns
TypeDescription
MonitoredResourceDescriptor.Builder

setDescription(String value)

public MonitoredResourceDescriptor.Builder setDescription(String value)

Optional. A detailed description of the monitored resource type that might be used in documentation.

string description = 3;

Parameter
NameDescription
valueString

The description to set.

Returns
TypeDescription
MonitoredResourceDescriptor.Builder

This builder for chaining.

setDescriptionBytes(ByteString value)

public MonitoredResourceDescriptor.Builder setDescriptionBytes(ByteString value)

Optional. A detailed description of the monitored resource type that might be used in documentation.

string description = 3;

Parameter
NameDescription
valueByteString

The bytes for description to set.

Returns
TypeDescription
MonitoredResourceDescriptor.Builder

This builder for chaining.

setDisplayName(String value)

public MonitoredResourceDescriptor.Builder setDisplayName(String value)

Optional. A concise name for the monitored resource type that might be displayed in user interfaces. It should be a Title Cased Noun Phrase, without any article or other determiners. For example, "Google Cloud SQL Database".

string display_name = 2;

Parameter
NameDescription
valueString

The displayName to set.

Returns
TypeDescription
MonitoredResourceDescriptor.Builder

This builder for chaining.

setDisplayNameBytes(ByteString value)

public MonitoredResourceDescriptor.Builder setDisplayNameBytes(ByteString value)

Optional. A concise name for the monitored resource type that might be displayed in user interfaces. It should be a Title Cased Noun Phrase, without any article or other determiners. For example, "Google Cloud SQL Database".

string display_name = 2;

Parameter
NameDescription
valueByteString

The bytes for displayName to set.

Returns
TypeDescription
MonitoredResourceDescriptor.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public MonitoredResourceDescriptor.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
MonitoredResourceDescriptor.Builder
Overrides

setLabels(int index, LabelDescriptor value)

public MonitoredResourceDescriptor.Builder setLabels(int index, LabelDescriptor value)

Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels "database_id" and "zone".

repeated .google.api.LabelDescriptor labels = 4;

Parameters
NameDescription
indexint
valueLabelDescriptor
Returns
TypeDescription
MonitoredResourceDescriptor.Builder

setLabels(int index, LabelDescriptor.Builder builderForValue)

public MonitoredResourceDescriptor.Builder setLabels(int index, LabelDescriptor.Builder builderForValue)

Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels "database_id" and "zone".

repeated .google.api.LabelDescriptor labels = 4;

Parameters
NameDescription
indexint
builderForValueLabelDescriptor.Builder
Returns
TypeDescription
MonitoredResourceDescriptor.Builder

setLaunchStage(LaunchStage value)

public MonitoredResourceDescriptor.Builder setLaunchStage(LaunchStage value)

Optional. The launch stage of the monitored resource definition.

.google.api.LaunchStage launch_stage = 7;

Parameter
NameDescription
valueLaunchStage

The launchStage to set.

Returns
TypeDescription
MonitoredResourceDescriptor.Builder

This builder for chaining.

setLaunchStageValue(int value)

public MonitoredResourceDescriptor.Builder setLaunchStageValue(int value)

Optional. The launch stage of the monitored resource definition.

.google.api.LaunchStage launch_stage = 7;

Parameter
NameDescription
valueint

The enum numeric value on the wire for launchStage to set.

Returns
TypeDescription
MonitoredResourceDescriptor.Builder

This builder for chaining.

setName(String value)

public MonitoredResourceDescriptor.Builder setName(String value)

Optional. The resource name of the monitored resource descriptor: "projects/{project_id}/monitoredResourceDescriptors/{type}" where {type} is the value of the type field in this object and {project_id} is a project ID that provides API-specific context for accessing the type. APIs that do not use project information can use the resource name format "monitoredResourceDescriptors/{type}".

string name = 5;

Parameter
NameDescription
valueString

The name to set.

Returns
TypeDescription
MonitoredResourceDescriptor.Builder

This builder for chaining.

setNameBytes(ByteString value)

public MonitoredResourceDescriptor.Builder setNameBytes(ByteString value)

Optional. The resource name of the monitored resource descriptor: "projects/{project_id}/monitoredResourceDescriptors/{type}" where {type} is the value of the type field in this object and {project_id} is a project ID that provides API-specific context for accessing the type. APIs that do not use project information can use the resource name format "monitoredResourceDescriptors/{type}".

string name = 5;

Parameter
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
MonitoredResourceDescriptor.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public MonitoredResourceDescriptor.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
MonitoredResourceDescriptor.Builder
Overrides

setType(String value)

public MonitoredResourceDescriptor.Builder setType(String value)

Required. The monitored resource type. For example, the type "cloudsql_database" represents databases in Google Cloud SQL. For a list of types, see Monitoring resource types and Logging resource types.

string type = 1;

Parameter
NameDescription
valueString

The type to set.

Returns
TypeDescription
MonitoredResourceDescriptor.Builder

This builder for chaining.

setTypeBytes(ByteString value)

public MonitoredResourceDescriptor.Builder setTypeBytes(ByteString value)

Required. The monitored resource type. For example, the type "cloudsql_database" represents databases in Google Cloud SQL. For a list of types, see Monitoring resource types and Logging resource types.

string type = 1;

Parameter
NameDescription
valueByteString

The bytes for type to set.

Returns
TypeDescription
MonitoredResourceDescriptor.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final MonitoredResourceDescriptor.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
MonitoredResourceDescriptor.Builder
Overrides