Class MonitoredResourceDescriptor.Builder (2.39.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
Type Description
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
Name Description
values Iterable<? extends com.google.api.LabelDescriptor>
Returns
Type Description
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
Name Description
value LabelDescriptor
Returns
Type Description
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
Name Description
builderForValue LabelDescriptor.Builder
Returns
Type Description
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
Name Description
index int
value LabelDescriptor
Returns
Type Description
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
Name Description
index int
builderForValue LabelDescriptor.Builder
Returns
Type Description
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
Type Description
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
Name Description
index int
Returns
Type Description
LabelDescriptor.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public MonitoredResourceDescriptor.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
MonitoredResourceDescriptor.Builder
Overrides

build()

public MonitoredResourceDescriptor build()
Returns
Type Description
MonitoredResourceDescriptor

buildPartial()

public MonitoredResourceDescriptor buildPartial()
Returns
Type Description
MonitoredResourceDescriptor

clear()

public MonitoredResourceDescriptor.Builder clear()
Returns
Type Description
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
Type Description
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
Type Description
MonitoredResourceDescriptor.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public MonitoredResourceDescriptor.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
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
Type Description
MonitoredResourceDescriptor.Builder

clearLaunchStage()

public MonitoredResourceDescriptor.Builder clearLaunchStage()

Optional. The launch stage of the monitored resource definition.

.google.api.LaunchStage launch_stage = 7;

Returns
Type Description
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
Type Description
MonitoredResourceDescriptor.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public MonitoredResourceDescriptor.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
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 Monitored resource types and Logging resource types.

string type = 1;

Returns
Type Description
MonitoredResourceDescriptor.Builder

This builder for chaining.

clone()

public MonitoredResourceDescriptor.Builder clone()
Returns
Type Description
MonitoredResourceDescriptor.Builder
Overrides

getDefaultInstanceForType()

public MonitoredResourceDescriptor getDefaultInstanceForType()
Returns
Type Description
MonitoredResourceDescriptor

getDescription()

public String getDescription()

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

string description = 3;

Returns
Type Description
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
Type Description
ByteString

The bytes for description.

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
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
Type Description
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
Type Description
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
Name Description
index int
Returns
Type Description
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
Name Description
index int
Returns
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Name Description
index int
Returns
Type Description
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
Type Description
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
Type Description
LaunchStage

The launchStage.

getLaunchStageValue()

public int getLaunchStageValue()

Optional. The launch stage of the monitored resource definition.

.google.api.LaunchStage launch_stage = 7;

Returns
Type Description
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
Type Description
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
Type Description
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 Monitored resource types and Logging resource types.

string type = 1;

Returns
Type Description
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 Monitored resource types and Logging resource types.

string type = 1;

Returns
Type Description
ByteString

The bytes for type.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(MonitoredResourceDescriptor other)

public MonitoredResourceDescriptor.Builder mergeFrom(MonitoredResourceDescriptor other)
Parameter
Name Description
other MonitoredResourceDescriptor
Returns
Type Description
MonitoredResourceDescriptor.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public MonitoredResourceDescriptor.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
MonitoredResourceDescriptor.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public MonitoredResourceDescriptor.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
MonitoredResourceDescriptor.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final MonitoredResourceDescriptor.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
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
Name Description
index int
Returns
Type Description
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
Name Description
value String

The description to set.

Returns
Type Description
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
Name Description
value ByteString

The bytes for description to set.

Returns
Type Description
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
Name Description
value String

The displayName to set.

Returns
Type Description
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
Name Description
value ByteString

The bytes for displayName to set.

Returns
Type Description
MonitoredResourceDescriptor.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public MonitoredResourceDescriptor.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
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
Name Description
index int
value LabelDescriptor
Returns
Type Description
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
Name Description
index int
builderForValue LabelDescriptor.Builder
Returns
Type Description
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
Name Description
value LaunchStage

The launchStage to set.

Returns
Type Description
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
Name Description
value int

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

Returns
Type Description
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
Name Description
value String

The name to set.

Returns
Type Description
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
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
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
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
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 Monitored resource types and Logging resource types.

string type = 1;

Parameter
Name Description
value String

The type to set.

Returns
Type Description
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 Monitored resource types and Logging resource types.

string type = 1;

Parameter
Name Description
value ByteString

The bytes for type to set.

Returns
Type Description
MonitoredResourceDescriptor.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final MonitoredResourceDescriptor.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
MonitoredResourceDescriptor.Builder
Overrides