Class RelatedAsset.Builder

  • All Implemented Interfaces:
    RelatedAssetOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
    Enclosing class:
    RelatedAsset

    public static final class RelatedAsset.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<RelatedAsset.Builder>
    implements RelatedAssetOrBuilder
     An asset identifier in Google Cloud which contains its name, type and
     ancestors. An asset can be any resource in the Google Cloud [resource
     hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
     a resource outside the Google Cloud resource hierarchy (such as Google
     Kubernetes Engine clusters and objects), or a policy (e.g. IAM policy).
     See [Supported asset
     types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
     for more information.
     
    Protobuf type google.cloud.asset.v1.RelatedAsset
    • Method Detail

      • getDescriptor

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

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<RelatedAsset.Builder>
      • clear

        public RelatedAsset.Builder clear()
        Specified by:
        clear in interface com.google.protobuf.Message.Builder
        Specified by:
        clear in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clear in class com.google.protobuf.GeneratedMessageV3.Builder<RelatedAsset.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.GeneratedMessageV3.Builder<RelatedAsset.Builder>
      • getDefaultInstanceForType

        public RelatedAsset getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
      • build

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

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

        public RelatedAsset.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<RelatedAsset.Builder>
      • setField

        public RelatedAsset.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                             Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<RelatedAsset.Builder>
      • clearField

        public RelatedAsset.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<RelatedAsset.Builder>
      • clearOneof

        public RelatedAsset.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<RelatedAsset.Builder>
      • setRepeatedField

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

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

        public RelatedAsset.Builder mergeFrom​(com.google.protobuf.Message other)
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<RelatedAsset.Builder>
      • isInitialized

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

        public RelatedAsset.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                       throws 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<RelatedAsset.Builder>
        Throws:
        IOException
      • getAsset

        public String getAsset()
         The full name of the asset. Example:
         `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
        
         See [Resource
         names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
         for more information.
         
        string asset = 1 [(.google.api.resource_reference) = { ... }
        Specified by:
        getAsset in interface RelatedAssetOrBuilder
        Returns:
        The asset.
      • getAssetBytes

        public com.google.protobuf.ByteString getAssetBytes()
         The full name of the asset. Example:
         `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
        
         See [Resource
         names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
         for more information.
         
        string asset = 1 [(.google.api.resource_reference) = { ... }
        Specified by:
        getAssetBytes in interface RelatedAssetOrBuilder
        Returns:
        The bytes for asset.
      • setAsset

        public RelatedAsset.Builder setAsset​(String value)
         The full name of the asset. Example:
         `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
        
         See [Resource
         names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
         for more information.
         
        string asset = 1 [(.google.api.resource_reference) = { ... }
        Parameters:
        value - The asset to set.
        Returns:
        This builder for chaining.
      • clearAsset

        public RelatedAsset.Builder clearAsset()
         The full name of the asset. Example:
         `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
        
         See [Resource
         names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
         for more information.
         
        string asset = 1 [(.google.api.resource_reference) = { ... }
        Returns:
        This builder for chaining.
      • setAssetBytes

        public RelatedAsset.Builder setAssetBytes​(com.google.protobuf.ByteString value)
         The full name of the asset. Example:
         `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
        
         See [Resource
         names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
         for more information.
         
        string asset = 1 [(.google.api.resource_reference) = { ... }
        Parameters:
        value - The bytes for asset to set.
        Returns:
        This builder for chaining.
      • getAssetType

        public String getAssetType()
         The type of the asset. Example: `compute.googleapis.com/Disk`
        
         See [Supported asset
         types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
         for more information.
         
        string asset_type = 2;
        Specified by:
        getAssetType in interface RelatedAssetOrBuilder
        Returns:
        The assetType.
      • getAssetTypeBytes

        public com.google.protobuf.ByteString getAssetTypeBytes()
         The type of the asset. Example: `compute.googleapis.com/Disk`
        
         See [Supported asset
         types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
         for more information.
         
        string asset_type = 2;
        Specified by:
        getAssetTypeBytes in interface RelatedAssetOrBuilder
        Returns:
        The bytes for assetType.
      • setAssetType

        public RelatedAsset.Builder setAssetType​(String value)
         The type of the asset. Example: `compute.googleapis.com/Disk`
        
         See [Supported asset
         types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
         for more information.
         
        string asset_type = 2;
        Parameters:
        value - The assetType to set.
        Returns:
        This builder for chaining.
      • clearAssetType

        public RelatedAsset.Builder clearAssetType()
         The type of the asset. Example: `compute.googleapis.com/Disk`
        
         See [Supported asset
         types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
         for more information.
         
        string asset_type = 2;
        Returns:
        This builder for chaining.
      • setAssetTypeBytes

        public RelatedAsset.Builder setAssetTypeBytes​(com.google.protobuf.ByteString value)
         The type of the asset. Example: `compute.googleapis.com/Disk`
        
         See [Supported asset
         types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
         for more information.
         
        string asset_type = 2;
        Parameters:
        value - The bytes for assetType to set.
        Returns:
        This builder for chaining.
      • getAncestorsList

        public com.google.protobuf.ProtocolStringList getAncestorsList()
         The ancestors of an asset in Google Cloud [resource
         hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
         represented as a list of relative resource names. An ancestry path starts
         with the closest ancestor in the hierarchy and ends at root.
        
         Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
         
        repeated string ancestors = 3;
        Specified by:
        getAncestorsList in interface RelatedAssetOrBuilder
        Returns:
        A list containing the ancestors.
      • getAncestorsCount

        public int getAncestorsCount()
         The ancestors of an asset in Google Cloud [resource
         hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
         represented as a list of relative resource names. An ancestry path starts
         with the closest ancestor in the hierarchy and ends at root.
        
         Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
         
        repeated string ancestors = 3;
        Specified by:
        getAncestorsCount in interface RelatedAssetOrBuilder
        Returns:
        The count of ancestors.
      • getAncestors

        public String getAncestors​(int index)
         The ancestors of an asset in Google Cloud [resource
         hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
         represented as a list of relative resource names. An ancestry path starts
         with the closest ancestor in the hierarchy and ends at root.
        
         Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
         
        repeated string ancestors = 3;
        Specified by:
        getAncestors in interface RelatedAssetOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The ancestors at the given index.
      • getAncestorsBytes

        public com.google.protobuf.ByteString getAncestorsBytes​(int index)
         The ancestors of an asset in Google Cloud [resource
         hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
         represented as a list of relative resource names. An ancestry path starts
         with the closest ancestor in the hierarchy and ends at root.
        
         Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
         
        repeated string ancestors = 3;
        Specified by:
        getAncestorsBytes in interface RelatedAssetOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the ancestors at the given index.
      • setAncestors

        public RelatedAsset.Builder setAncestors​(int index,
                                                 String value)
         The ancestors of an asset in Google Cloud [resource
         hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
         represented as a list of relative resource names. An ancestry path starts
         with the closest ancestor in the hierarchy and ends at root.
        
         Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
         
        repeated string ancestors = 3;
        Parameters:
        index - The index to set the value at.
        value - The ancestors to set.
        Returns:
        This builder for chaining.
      • addAncestors

        public RelatedAsset.Builder addAncestors​(String value)
         The ancestors of an asset in Google Cloud [resource
         hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
         represented as a list of relative resource names. An ancestry path starts
         with the closest ancestor in the hierarchy and ends at root.
        
         Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
         
        repeated string ancestors = 3;
        Parameters:
        value - The ancestors to add.
        Returns:
        This builder for chaining.
      • addAllAncestors

        public RelatedAsset.Builder addAllAncestors​(Iterable<String> values)
         The ancestors of an asset in Google Cloud [resource
         hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
         represented as a list of relative resource names. An ancestry path starts
         with the closest ancestor in the hierarchy and ends at root.
        
         Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
         
        repeated string ancestors = 3;
        Parameters:
        values - The ancestors to add.
        Returns:
        This builder for chaining.
      • clearAncestors

        public RelatedAsset.Builder clearAncestors()
         The ancestors of an asset in Google Cloud [resource
         hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
         represented as a list of relative resource names. An ancestry path starts
         with the closest ancestor in the hierarchy and ends at root.
        
         Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
         
        repeated string ancestors = 3;
        Returns:
        This builder for chaining.
      • addAncestorsBytes

        public RelatedAsset.Builder addAncestorsBytes​(com.google.protobuf.ByteString value)
         The ancestors of an asset in Google Cloud [resource
         hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
         represented as a list of relative resource names. An ancestry path starts
         with the closest ancestor in the hierarchy and ends at root.
        
         Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
         
        repeated string ancestors = 3;
        Parameters:
        value - The bytes of the ancestors to add.
        Returns:
        This builder for chaining.
      • getRelationshipType

        public String getRelationshipType()
         The unique identifier of the relationship type. Example:
         `INSTANCE_TO_INSTANCEGROUP`
         
        string relationship_type = 4;
        Specified by:
        getRelationshipType in interface RelatedAssetOrBuilder
        Returns:
        The relationshipType.
      • getRelationshipTypeBytes

        public com.google.protobuf.ByteString getRelationshipTypeBytes()
         The unique identifier of the relationship type. Example:
         `INSTANCE_TO_INSTANCEGROUP`
         
        string relationship_type = 4;
        Specified by:
        getRelationshipTypeBytes in interface RelatedAssetOrBuilder
        Returns:
        The bytes for relationshipType.
      • setRelationshipType

        public RelatedAsset.Builder setRelationshipType​(String value)
         The unique identifier of the relationship type. Example:
         `INSTANCE_TO_INSTANCEGROUP`
         
        string relationship_type = 4;
        Parameters:
        value - The relationshipType to set.
        Returns:
        This builder for chaining.
      • clearRelationshipType

        public RelatedAsset.Builder clearRelationshipType()
         The unique identifier of the relationship type. Example:
         `INSTANCE_TO_INSTANCEGROUP`
         
        string relationship_type = 4;
        Returns:
        This builder for chaining.
      • setRelationshipTypeBytes

        public RelatedAsset.Builder setRelationshipTypeBytes​(com.google.protobuf.ByteString value)
         The unique identifier of the relationship type. Example:
         `INSTANCE_TO_INSTANCEGROUP`
         
        string relationship_type = 4;
        Parameters:
        value - The bytes for relationshipType to set.
        Returns:
        This builder for chaining.
      • setUnknownFields

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

        public final RelatedAsset.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<RelatedAsset.Builder>