Class Asset.Builder

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

    public static final class Asset.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<Asset.Builder>
    implements AssetOrBuilder
     Cloud asset. This includes all Google Cloud Platform resources,
     Cloud IAM policies, and other non-GCP assets.
     
    Protobuf type google.cloud.asset.v1p2beta1.Asset
    • 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<Asset.Builder>
      • clear

        public Asset.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<Asset.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<Asset.Builder>
      • getDefaultInstanceForType

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

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

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

        public Asset.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<Asset.Builder>
      • setField

        public Asset.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<Asset.Builder>
      • clearField

        public Asset.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<Asset.Builder>
      • clearOneof

        public Asset.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<Asset.Builder>
      • setRepeatedField

        public Asset.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<Asset.Builder>
      • addRepeatedField

        public Asset.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<Asset.Builder>
      • mergeFrom

        public Asset.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<Asset.Builder>
      • isInitialized

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

        public Asset.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<Asset.Builder>
        Throws:
        IOException
      • getName

        public String getName()
         The full name of the asset. For 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 name = 1;
        Specified by:
        getName in interface AssetOrBuilder
        Returns:
        The name.
      • getNameBytes

        public com.google.protobuf.ByteString getNameBytes()
         The full name of the asset. For 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 name = 1;
        Specified by:
        getNameBytes in interface AssetOrBuilder
        Returns:
        The bytes for name.
      • setName

        public Asset.Builder setName​(String value)
         The full name of the asset. For 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 name = 1;
        Parameters:
        value - The name to set.
        Returns:
        This builder for chaining.
      • clearName

        public Asset.Builder clearName()
         The full name of the asset. For 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 name = 1;
        Returns:
        This builder for chaining.
      • setNameBytes

        public Asset.Builder setNameBytes​(com.google.protobuf.ByteString value)
         The full name of the asset. For 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 name = 1;
        Parameters:
        value - The bytes for name to set.
        Returns:
        This builder for chaining.
      • getAssetType

        public String getAssetType()
         Type of the asset. Example: "compute.googleapis.com/Disk".
         
        string asset_type = 2;
        Specified by:
        getAssetType in interface AssetOrBuilder
        Returns:
        The assetType.
      • getAssetTypeBytes

        public com.google.protobuf.ByteString getAssetTypeBytes()
         Type of the asset. Example: "compute.googleapis.com/Disk".
         
        string asset_type = 2;
        Specified by:
        getAssetTypeBytes in interface AssetOrBuilder
        Returns:
        The bytes for assetType.
      • setAssetType

        public Asset.Builder setAssetType​(String value)
         Type of the asset. Example: "compute.googleapis.com/Disk".
         
        string asset_type = 2;
        Parameters:
        value - The assetType to set.
        Returns:
        This builder for chaining.
      • clearAssetType

        public Asset.Builder clearAssetType()
         Type of the asset. Example: "compute.googleapis.com/Disk".
         
        string asset_type = 2;
        Returns:
        This builder for chaining.
      • setAssetTypeBytes

        public Asset.Builder setAssetTypeBytes​(com.google.protobuf.ByteString value)
         Type of the asset. Example: "compute.googleapis.com/Disk".
         
        string asset_type = 2;
        Parameters:
        value - The bytes for assetType to set.
        Returns:
        This builder for chaining.
      • hasResource

        public boolean hasResource()
         Representation of the resource.
         
        .google.cloud.asset.v1p2beta1.Resource resource = 3;
        Specified by:
        hasResource in interface AssetOrBuilder
        Returns:
        Whether the resource field is set.
      • getResource

        public Resource getResource()
         Representation of the resource.
         
        .google.cloud.asset.v1p2beta1.Resource resource = 3;
        Specified by:
        getResource in interface AssetOrBuilder
        Returns:
        The resource.
      • setResource

        public Asset.Builder setResource​(Resource value)
         Representation of the resource.
         
        .google.cloud.asset.v1p2beta1.Resource resource = 3;
      • setResource

        public Asset.Builder setResource​(Resource.Builder builderForValue)
         Representation of the resource.
         
        .google.cloud.asset.v1p2beta1.Resource resource = 3;
      • mergeResource

        public Asset.Builder mergeResource​(Resource value)
         Representation of the resource.
         
        .google.cloud.asset.v1p2beta1.Resource resource = 3;
      • clearResource

        public Asset.Builder clearResource()
         Representation of the resource.
         
        .google.cloud.asset.v1p2beta1.Resource resource = 3;
      • getResourceBuilder

        public Resource.Builder getResourceBuilder()
         Representation of the resource.
         
        .google.cloud.asset.v1p2beta1.Resource resource = 3;
      • hasIamPolicy

        public boolean hasIamPolicy()
         Representation of the actual Cloud IAM policy set on a cloud resource. For
         each resource, there must be at most one Cloud IAM policy set on it.
         
        .google.iam.v1.Policy iam_policy = 4;
        Specified by:
        hasIamPolicy in interface AssetOrBuilder
        Returns:
        Whether the iamPolicy field is set.
      • getIamPolicy

        public com.google.iam.v1.Policy getIamPolicy()
         Representation of the actual Cloud IAM policy set on a cloud resource. For
         each resource, there must be at most one Cloud IAM policy set on it.
         
        .google.iam.v1.Policy iam_policy = 4;
        Specified by:
        getIamPolicy in interface AssetOrBuilder
        Returns:
        The iamPolicy.
      • setIamPolicy

        public Asset.Builder setIamPolicy​(com.google.iam.v1.Policy value)
         Representation of the actual Cloud IAM policy set on a cloud resource. For
         each resource, there must be at most one Cloud IAM policy set on it.
         
        .google.iam.v1.Policy iam_policy = 4;
      • setIamPolicy

        public Asset.Builder setIamPolicy​(com.google.iam.v1.Policy.Builder builderForValue)
         Representation of the actual Cloud IAM policy set on a cloud resource. For
         each resource, there must be at most one Cloud IAM policy set on it.
         
        .google.iam.v1.Policy iam_policy = 4;
      • mergeIamPolicy

        public Asset.Builder mergeIamPolicy​(com.google.iam.v1.Policy value)
         Representation of the actual Cloud IAM policy set on a cloud resource. For
         each resource, there must be at most one Cloud IAM policy set on it.
         
        .google.iam.v1.Policy iam_policy = 4;
      • clearIamPolicy

        public Asset.Builder clearIamPolicy()
         Representation of the actual Cloud IAM policy set on a cloud resource. For
         each resource, there must be at most one Cloud IAM policy set on it.
         
        .google.iam.v1.Policy iam_policy = 4;
      • getIamPolicyBuilder

        public com.google.iam.v1.Policy.Builder getIamPolicyBuilder()
         Representation of the actual Cloud IAM policy set on a cloud resource. For
         each resource, there must be at most one Cloud IAM policy set on it.
         
        .google.iam.v1.Policy iam_policy = 4;
      • getIamPolicyOrBuilder

        public com.google.iam.v1.PolicyOrBuilder getIamPolicyOrBuilder()
         Representation of the actual Cloud IAM policy set on a cloud resource. For
         each resource, there must be at most one Cloud IAM policy set on it.
         
        .google.iam.v1.Policy iam_policy = 4;
        Specified by:
        getIamPolicyOrBuilder in interface AssetOrBuilder
      • getAncestorsList

        public com.google.protobuf.ProtocolStringList getAncestorsList()
         Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy,
         represented as a list of relative resource names. Ancestry path starts with
         the closest CRM ancestor and ends at root. If the asset is a CRM
         project/folder/organization, this starts from the asset itself.
        
         Example: ["projects/123456789", "folders/5432", "organizations/1234"]
         
        repeated string ancestors = 6;
        Specified by:
        getAncestorsList in interface AssetOrBuilder
        Returns:
        A list containing the ancestors.
      • getAncestorsCount

        public int getAncestorsCount()
         Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy,
         represented as a list of relative resource names. Ancestry path starts with
         the closest CRM ancestor and ends at root. If the asset is a CRM
         project/folder/organization, this starts from the asset itself.
        
         Example: ["projects/123456789", "folders/5432", "organizations/1234"]
         
        repeated string ancestors = 6;
        Specified by:
        getAncestorsCount in interface AssetOrBuilder
        Returns:
        The count of ancestors.
      • getAncestors

        public String getAncestors​(int index)
         Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy,
         represented as a list of relative resource names. Ancestry path starts with
         the closest CRM ancestor and ends at root. If the asset is a CRM
         project/folder/organization, this starts from the asset itself.
        
         Example: ["projects/123456789", "folders/5432", "organizations/1234"]
         
        repeated string ancestors = 6;
        Specified by:
        getAncestors in interface AssetOrBuilder
        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)
         Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy,
         represented as a list of relative resource names. Ancestry path starts with
         the closest CRM ancestor and ends at root. If the asset is a CRM
         project/folder/organization, this starts from the asset itself.
        
         Example: ["projects/123456789", "folders/5432", "organizations/1234"]
         
        repeated string ancestors = 6;
        Specified by:
        getAncestorsBytes in interface AssetOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the ancestors at the given index.
      • setAncestors

        public Asset.Builder setAncestors​(int index,
                                          String value)
         Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy,
         represented as a list of relative resource names. Ancestry path starts with
         the closest CRM ancestor and ends at root. If the asset is a CRM
         project/folder/organization, this starts from the asset itself.
        
         Example: ["projects/123456789", "folders/5432", "organizations/1234"]
         
        repeated string ancestors = 6;
        Parameters:
        index - The index to set the value at.
        value - The ancestors to set.
        Returns:
        This builder for chaining.
      • addAncestors

        public Asset.Builder addAncestors​(String value)
         Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy,
         represented as a list of relative resource names. Ancestry path starts with
         the closest CRM ancestor and ends at root. If the asset is a CRM
         project/folder/organization, this starts from the asset itself.
        
         Example: ["projects/123456789", "folders/5432", "organizations/1234"]
         
        repeated string ancestors = 6;
        Parameters:
        value - The ancestors to add.
        Returns:
        This builder for chaining.
      • addAllAncestors

        public Asset.Builder addAllAncestors​(Iterable<String> values)
         Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy,
         represented as a list of relative resource names. Ancestry path starts with
         the closest CRM ancestor and ends at root. If the asset is a CRM
         project/folder/organization, this starts from the asset itself.
        
         Example: ["projects/123456789", "folders/5432", "organizations/1234"]
         
        repeated string ancestors = 6;
        Parameters:
        values - The ancestors to add.
        Returns:
        This builder for chaining.
      • clearAncestors

        public Asset.Builder clearAncestors()
         Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy,
         represented as a list of relative resource names. Ancestry path starts with
         the closest CRM ancestor and ends at root. If the asset is a CRM
         project/folder/organization, this starts from the asset itself.
        
         Example: ["projects/123456789", "folders/5432", "organizations/1234"]
         
        repeated string ancestors = 6;
        Returns:
        This builder for chaining.
      • addAncestorsBytes

        public Asset.Builder addAncestorsBytes​(com.google.protobuf.ByteString value)
         Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy,
         represented as a list of relative resource names. Ancestry path starts with
         the closest CRM ancestor and ends at root. If the asset is a CRM
         project/folder/organization, this starts from the asset itself.
        
         Example: ["projects/123456789", "folders/5432", "organizations/1234"]
         
        repeated string ancestors = 6;
        Parameters:
        value - The bytes of the ancestors to add.
        Returns:
        This builder for chaining.
      • setUnknownFields

        public final Asset.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<Asset.Builder>
      • mergeUnknownFields

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