Class MonitoredResourceDescriptor.Builder

  • All Implemented Interfaces:
    MonitoredResourceDescriptorOrBuilder, com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<com.google.protobuf.GeneratedMessageV3>, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, java.lang.Cloneable
    Enclosing class:
    MonitoredResourceDescriptor

    public static final class MonitoredResourceDescriptor.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<MonitoredResourceDescriptor.Builder>
    implements MonitoredResourceDescriptorOrBuilder
     An object that describes the schema of a
     [MonitoredResource][google.api.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
    • Method Detail

      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Overrides:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<MonitoredResourceDescriptor.Builder>
      • getDescriptorForType

        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface com.google.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<MonitoredResourceDescriptor.Builder>
      • getDefaultInstanceForType

        public MonitoredResourceDescriptor getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<com.google.protobuf.GeneratedMessageV3>
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
      • build

        public MonitoredResourceDescriptor build()
        Specified by:
        build in interface com.google.protobuf.Message.Builder
        Specified by:
        build in interface com.google.protobuf.MessageLite.Builder
      • buildPartial

        public MonitoredResourceDescriptor buildPartial()
        Specified by:
        buildPartial in interface com.google.protobuf.Message.Builder
        Specified by:
        buildPartial in interface com.google.protobuf.MessageLite.Builder
      • setRepeatedField

        public MonitoredResourceDescriptor.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                                    int index,
                                                                    java.lang.Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<MonitoredResourceDescriptor.Builder>
      • addRepeatedField

        public MonitoredResourceDescriptor.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                                    java.lang.Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<MonitoredResourceDescriptor.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessage.ExtendableBuilder<com.google.protobuf.GeneratedMessageV3,​MonitoredResourceDescriptor.Builder>
      • mergeFrom

        public MonitoredResourceDescriptor.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                                             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                      throws java.io.IOException
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<MonitoredResourceDescriptor.Builder>
        Throws:
        java.io.IOException
      • getName

        public java.lang.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;
        Specified by:
        getName in interface MonitoredResourceDescriptorOrBuilder
        Returns:
        The name.
      • getNameBytes

        public com.google.protobuf.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;
        Specified by:
        getNameBytes in interface MonitoredResourceDescriptorOrBuilder
        Returns:
        The bytes for name.
      • setName

        public MonitoredResourceDescriptor.Builder setName​(java.lang.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;
        Parameters:
        value - The name to set.
        Returns:
        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:
        This builder for chaining.
      • setNameBytes

        public MonitoredResourceDescriptor.Builder setNameBytes​(com.google.protobuf.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;
        Parameters:
        value - The bytes for name to set.
        Returns:
        This builder for chaining.
      • getType

        public java.lang.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](https://cloud.google.com/monitoring/api/resources)
         and [Logging resource
         types](https://cloud.google.com/logging/docs/api/v2/resource-list).
         
        string type = 1;
        Specified by:
        getType in interface MonitoredResourceDescriptorOrBuilder
        Returns:
        The type.
      • getTypeBytes

        public com.google.protobuf.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](https://cloud.google.com/monitoring/api/resources)
         and [Logging resource
         types](https://cloud.google.com/logging/docs/api/v2/resource-list).
         
        string type = 1;
        Specified by:
        getTypeBytes in interface MonitoredResourceDescriptorOrBuilder
        Returns:
        The bytes for type.
      • setType

        public MonitoredResourceDescriptor.Builder setType​(java.lang.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](https://cloud.google.com/monitoring/api/resources)
         and [Logging resource
         types](https://cloud.google.com/logging/docs/api/v2/resource-list).
         
        string type = 1;
        Parameters:
        value - The type to set.
        Returns:
        This builder for chaining.
      • 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](https://cloud.google.com/monitoring/api/resources)
         and [Logging resource
         types](https://cloud.google.com/logging/docs/api/v2/resource-list).
         
        string type = 1;
        Returns:
        This builder for chaining.
      • setTypeBytes

        public MonitoredResourceDescriptor.Builder setTypeBytes​(com.google.protobuf.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](https://cloud.google.com/monitoring/api/resources)
         and [Logging resource
         types](https://cloud.google.com/logging/docs/api/v2/resource-list).
         
        string type = 1;
        Parameters:
        value - The bytes for type to set.
        Returns:
        This builder for chaining.
      • getDisplayName

        public java.lang.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;
        Specified by:
        getDisplayName in interface MonitoredResourceDescriptorOrBuilder
        Returns:
        The displayName.
      • getDisplayNameBytes

        public com.google.protobuf.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;
        Specified by:
        getDisplayNameBytes in interface MonitoredResourceDescriptorOrBuilder
        Returns:
        The bytes for displayName.
      • setDisplayName

        public MonitoredResourceDescriptor.Builder setDisplayName​(java.lang.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;
        Parameters:
        value - The displayName to set.
        Returns:
        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:
        This builder for chaining.
      • setDisplayNameBytes

        public MonitoredResourceDescriptor.Builder setDisplayNameBytes​(com.google.protobuf.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;
        Parameters:
        value - The bytes for displayName to set.
        Returns:
        This builder for chaining.
      • getDescription

        public java.lang.String getDescription()
         Optional. A detailed description of the monitored resource type that might
         be used in documentation.
         
        string description = 3;
        Specified by:
        getDescription in interface MonitoredResourceDescriptorOrBuilder
        Returns:
        The description.
      • getDescriptionBytes

        public com.google.protobuf.ByteString getDescriptionBytes()
         Optional. A detailed description of the monitored resource type that might
         be used in documentation.
         
        string description = 3;
        Specified by:
        getDescriptionBytes in interface MonitoredResourceDescriptorOrBuilder
        Returns:
        The bytes for description.
      • setDescription

        public MonitoredResourceDescriptor.Builder setDescription​(java.lang.String value)
         Optional. A detailed description of the monitored resource type that might
         be used in documentation.
         
        string description = 3;
        Parameters:
        value - The description to set.
        Returns:
        This builder for chaining.
      • clearDescription

        public MonitoredResourceDescriptor.Builder clearDescription()
         Optional. A detailed description of the monitored resource type that might
         be used in documentation.
         
        string description = 3;
        Returns:
        This builder for chaining.
      • setDescriptionBytes

        public MonitoredResourceDescriptor.Builder setDescriptionBytes​(com.google.protobuf.ByteString value)
         Optional. A detailed description of the monitored resource type that might
         be used in documentation.
         
        string description = 3;
        Parameters:
        value - The bytes for description to set.
        Returns:
        This builder for chaining.
      • getLabelsList

        public java.util.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;
        Specified by:
        getLabelsList in interface MonitoredResourceDescriptorOrBuilder
      • 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;
        Specified by:
        getLabelsCount in interface MonitoredResourceDescriptorOrBuilder
      • getLabels

        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;
        Specified by:
        getLabels in interface MonitoredResourceDescriptorOrBuilder
      • setLabels

        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;
      • setLabels

        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;
      • addLabels

        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;
      • addLabels

        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;
      • addLabels

        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;
      • addLabels

        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;
      • addAllLabels

        public MonitoredResourceDescriptor.Builder addAllLabels​(java.lang.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;
      • 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;
      • removeLabels

        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;
      • getLabelsBuilder

        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;
      • getLabelsOrBuilder

        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;
        Specified by:
        getLabelsOrBuilder in interface MonitoredResourceDescriptorOrBuilder
      • getLabelsOrBuilderList

        public java.util.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;
        Specified by:
        getLabelsOrBuilderList in interface MonitoredResourceDescriptorOrBuilder
      • 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;
      • addLabelsBuilder

        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;
      • getLabelsBuilderList

        public java.util.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;
      • getLaunchStageValue

        public int getLaunchStageValue()
         Optional. The launch stage of the monitored resource definition.
         
        .google.api.LaunchStage launch_stage = 7;
        Specified by:
        getLaunchStageValue in interface MonitoredResourceDescriptorOrBuilder
        Returns:
        The enum numeric value on the wire for launchStage.
      • setLaunchStageValue

        public MonitoredResourceDescriptor.Builder setLaunchStageValue​(int value)
         Optional. The launch stage of the monitored resource definition.
         
        .google.api.LaunchStage launch_stage = 7;
        Parameters:
        value - The enum numeric value on the wire for launchStage to set.
        Returns:
        This builder for chaining.
      • setLaunchStage

        public MonitoredResourceDescriptor.Builder setLaunchStage​(LaunchStage value)
         Optional. The launch stage of the monitored resource definition.
         
        .google.api.LaunchStage launch_stage = 7;
        Parameters:
        value - The launchStage to set.
        Returns:
        This builder for chaining.
      • clearLaunchStage

        public MonitoredResourceDescriptor.Builder clearLaunchStage()
         Optional. The launch stage of the monitored resource definition.
         
        .google.api.LaunchStage launch_stage = 7;
        Returns:
        This builder for chaining.
      • mergeUnknownFields

        public final MonitoredResourceDescriptor.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<MonitoredResourceDescriptor.Builder>