Class CloudStorageRegexFileSet.Builder

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

    public static final class CloudStorageRegexFileSet.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<CloudStorageRegexFileSet.Builder>
    implements CloudStorageRegexFileSetOrBuilder
     Message representing a set of files in a Cloud Storage bucket. Regular
     expressions are used to allow fine-grained control over which files in the
     bucket to include.
    
     Included files are those that match at least one item in `include_regex` and
     do not match any items in `exclude_regex`. Note that a file that matches
     items from both lists will _not_ be included. For a match to occur, the
     entire file path (i.e., everything in the url after the bucket name) must
     match the regular expression.
    
     For example, given the input `{bucket_name: "mybucket", include_regex:
     ["directory1/.*"], exclude_regex:
     ["directory1/excluded.*"]}`:
    
     * `gs://mybucket/directory1/myfile` will be included
     * `gs://mybucket/directory1/directory2/myfile` will be included (`.*` matches
     across `/`)
     * `gs://mybucket/directory0/directory1/myfile` will _not_ be included (the
     full path doesn't match any items in `include_regex`)
     * `gs://mybucket/directory1/excludedfile` will _not_ be included (the path
     matches an item in `exclude_regex`)
    
     If `include_regex` is left empty, it will match all files by default
     (this is equivalent to setting `include_regex: [".*"]`).
    
     Some other common use cases:
    
     * `{bucket_name: "mybucket", exclude_regex: [".*\.pdf"]}` will include all
     files in `mybucket` except for .pdf files
     * `{bucket_name: "mybucket", include_regex: ["directory/[^/]+"]}` will
     include all files directly under `gs://mybucket/directory/`, without matching
     across `/`
     
    Protobuf type google.privacy.dlp.v2.CloudStorageRegexFileSet
    • 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<CloudStorageRegexFileSet.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<CloudStorageRegexFileSet.Builder>
      • getDefaultInstanceForType

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

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

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

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

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

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

        public CloudStorageRegexFileSet.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<CloudStorageRegexFileSet.Builder>
        Throws:
        IOException
      • getBucketNameBytes

        public com.google.protobuf.ByteString getBucketNameBytes()
         The name of a Cloud Storage bucket. Required.
         
        string bucket_name = 1;
        Specified by:
        getBucketNameBytes in interface CloudStorageRegexFileSetOrBuilder
        Returns:
        The bytes for bucketName.
      • setBucketName

        public CloudStorageRegexFileSet.Builder setBucketName​(String value)
         The name of a Cloud Storage bucket. Required.
         
        string bucket_name = 1;
        Parameters:
        value - The bucketName to set.
        Returns:
        This builder for chaining.
      • clearBucketName

        public CloudStorageRegexFileSet.Builder clearBucketName()
         The name of a Cloud Storage bucket. Required.
         
        string bucket_name = 1;
        Returns:
        This builder for chaining.
      • setBucketNameBytes

        public CloudStorageRegexFileSet.Builder setBucketNameBytes​(com.google.protobuf.ByteString value)
         The name of a Cloud Storage bucket. Required.
         
        string bucket_name = 1;
        Parameters:
        value - The bytes for bucketName to set.
        Returns:
        This builder for chaining.
      • getIncludeRegexList

        public com.google.protobuf.ProtocolStringList getIncludeRegexList()
         A list of regular expressions matching file paths to include. All files in
         the bucket that match at least one of these regular expressions will be
         included in the set of files, except for those that also match an item in
         `exclude_regex`. Leaving this field empty will match all files by default
         (this is equivalent to including `.*` in the list).
        
         Regular expressions use RE2
         [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found
         under the google/re2 repository on GitHub.
         
        repeated string include_regex = 2;
        Specified by:
        getIncludeRegexList in interface CloudStorageRegexFileSetOrBuilder
        Returns:
        A list containing the includeRegex.
      • getIncludeRegexCount

        public int getIncludeRegexCount()
         A list of regular expressions matching file paths to include. All files in
         the bucket that match at least one of these regular expressions will be
         included in the set of files, except for those that also match an item in
         `exclude_regex`. Leaving this field empty will match all files by default
         (this is equivalent to including `.*` in the list).
        
         Regular expressions use RE2
         [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found
         under the google/re2 repository on GitHub.
         
        repeated string include_regex = 2;
        Specified by:
        getIncludeRegexCount in interface CloudStorageRegexFileSetOrBuilder
        Returns:
        The count of includeRegex.
      • getIncludeRegex

        public String getIncludeRegex​(int index)
         A list of regular expressions matching file paths to include. All files in
         the bucket that match at least one of these regular expressions will be
         included in the set of files, except for those that also match an item in
         `exclude_regex`. Leaving this field empty will match all files by default
         (this is equivalent to including `.*` in the list).
        
         Regular expressions use RE2
         [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found
         under the google/re2 repository on GitHub.
         
        repeated string include_regex = 2;
        Specified by:
        getIncludeRegex in interface CloudStorageRegexFileSetOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The includeRegex at the given index.
      • getIncludeRegexBytes

        public com.google.protobuf.ByteString getIncludeRegexBytes​(int index)
         A list of regular expressions matching file paths to include. All files in
         the bucket that match at least one of these regular expressions will be
         included in the set of files, except for those that also match an item in
         `exclude_regex`. Leaving this field empty will match all files by default
         (this is equivalent to including `.*` in the list).
        
         Regular expressions use RE2
         [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found
         under the google/re2 repository on GitHub.
         
        repeated string include_regex = 2;
        Specified by:
        getIncludeRegexBytes in interface CloudStorageRegexFileSetOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the includeRegex at the given index.
      • setIncludeRegex

        public CloudStorageRegexFileSet.Builder setIncludeRegex​(int index,
                                                                String value)
         A list of regular expressions matching file paths to include. All files in
         the bucket that match at least one of these regular expressions will be
         included in the set of files, except for those that also match an item in
         `exclude_regex`. Leaving this field empty will match all files by default
         (this is equivalent to including `.*` in the list).
        
         Regular expressions use RE2
         [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found
         under the google/re2 repository on GitHub.
         
        repeated string include_regex = 2;
        Parameters:
        index - The index to set the value at.
        value - The includeRegex to set.
        Returns:
        This builder for chaining.
      • addIncludeRegex

        public CloudStorageRegexFileSet.Builder addIncludeRegex​(String value)
         A list of regular expressions matching file paths to include. All files in
         the bucket that match at least one of these regular expressions will be
         included in the set of files, except for those that also match an item in
         `exclude_regex`. Leaving this field empty will match all files by default
         (this is equivalent to including `.*` in the list).
        
         Regular expressions use RE2
         [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found
         under the google/re2 repository on GitHub.
         
        repeated string include_regex = 2;
        Parameters:
        value - The includeRegex to add.
        Returns:
        This builder for chaining.
      • addAllIncludeRegex

        public CloudStorageRegexFileSet.Builder addAllIncludeRegex​(Iterable<String> values)
         A list of regular expressions matching file paths to include. All files in
         the bucket that match at least one of these regular expressions will be
         included in the set of files, except for those that also match an item in
         `exclude_regex`. Leaving this field empty will match all files by default
         (this is equivalent to including `.*` in the list).
        
         Regular expressions use RE2
         [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found
         under the google/re2 repository on GitHub.
         
        repeated string include_regex = 2;
        Parameters:
        values - The includeRegex to add.
        Returns:
        This builder for chaining.
      • clearIncludeRegex

        public CloudStorageRegexFileSet.Builder clearIncludeRegex()
         A list of regular expressions matching file paths to include. All files in
         the bucket that match at least one of these regular expressions will be
         included in the set of files, except for those that also match an item in
         `exclude_regex`. Leaving this field empty will match all files by default
         (this is equivalent to including `.*` in the list).
        
         Regular expressions use RE2
         [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found
         under the google/re2 repository on GitHub.
         
        repeated string include_regex = 2;
        Returns:
        This builder for chaining.
      • addIncludeRegexBytes

        public CloudStorageRegexFileSet.Builder addIncludeRegexBytes​(com.google.protobuf.ByteString value)
         A list of regular expressions matching file paths to include. All files in
         the bucket that match at least one of these regular expressions will be
         included in the set of files, except for those that also match an item in
         `exclude_regex`. Leaving this field empty will match all files by default
         (this is equivalent to including `.*` in the list).
        
         Regular expressions use RE2
         [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found
         under the google/re2 repository on GitHub.
         
        repeated string include_regex = 2;
        Parameters:
        value - The bytes of the includeRegex to add.
        Returns:
        This builder for chaining.
      • getExcludeRegexList

        public com.google.protobuf.ProtocolStringList getExcludeRegexList()
         A list of regular expressions matching file paths to exclude. All files in
         the bucket that match at least one of these regular expressions will be
         excluded from the scan.
        
         Regular expressions use RE2
         [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found
         under the google/re2 repository on GitHub.
         
        repeated string exclude_regex = 3;
        Specified by:
        getExcludeRegexList in interface CloudStorageRegexFileSetOrBuilder
        Returns:
        A list containing the excludeRegex.
      • getExcludeRegexCount

        public int getExcludeRegexCount()
         A list of regular expressions matching file paths to exclude. All files in
         the bucket that match at least one of these regular expressions will be
         excluded from the scan.
        
         Regular expressions use RE2
         [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found
         under the google/re2 repository on GitHub.
         
        repeated string exclude_regex = 3;
        Specified by:
        getExcludeRegexCount in interface CloudStorageRegexFileSetOrBuilder
        Returns:
        The count of excludeRegex.
      • getExcludeRegex

        public String getExcludeRegex​(int index)
         A list of regular expressions matching file paths to exclude. All files in
         the bucket that match at least one of these regular expressions will be
         excluded from the scan.
        
         Regular expressions use RE2
         [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found
         under the google/re2 repository on GitHub.
         
        repeated string exclude_regex = 3;
        Specified by:
        getExcludeRegex in interface CloudStorageRegexFileSetOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The excludeRegex at the given index.
      • getExcludeRegexBytes

        public com.google.protobuf.ByteString getExcludeRegexBytes​(int index)
         A list of regular expressions matching file paths to exclude. All files in
         the bucket that match at least one of these regular expressions will be
         excluded from the scan.
        
         Regular expressions use RE2
         [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found
         under the google/re2 repository on GitHub.
         
        repeated string exclude_regex = 3;
        Specified by:
        getExcludeRegexBytes in interface CloudStorageRegexFileSetOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the excludeRegex at the given index.
      • setExcludeRegex

        public CloudStorageRegexFileSet.Builder setExcludeRegex​(int index,
                                                                String value)
         A list of regular expressions matching file paths to exclude. All files in
         the bucket that match at least one of these regular expressions will be
         excluded from the scan.
        
         Regular expressions use RE2
         [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found
         under the google/re2 repository on GitHub.
         
        repeated string exclude_regex = 3;
        Parameters:
        index - The index to set the value at.
        value - The excludeRegex to set.
        Returns:
        This builder for chaining.
      • addExcludeRegex

        public CloudStorageRegexFileSet.Builder addExcludeRegex​(String value)
         A list of regular expressions matching file paths to exclude. All files in
         the bucket that match at least one of these regular expressions will be
         excluded from the scan.
        
         Regular expressions use RE2
         [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found
         under the google/re2 repository on GitHub.
         
        repeated string exclude_regex = 3;
        Parameters:
        value - The excludeRegex to add.
        Returns:
        This builder for chaining.
      • addAllExcludeRegex

        public CloudStorageRegexFileSet.Builder addAllExcludeRegex​(Iterable<String> values)
         A list of regular expressions matching file paths to exclude. All files in
         the bucket that match at least one of these regular expressions will be
         excluded from the scan.
        
         Regular expressions use RE2
         [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found
         under the google/re2 repository on GitHub.
         
        repeated string exclude_regex = 3;
        Parameters:
        values - The excludeRegex to add.
        Returns:
        This builder for chaining.
      • clearExcludeRegex

        public CloudStorageRegexFileSet.Builder clearExcludeRegex()
         A list of regular expressions matching file paths to exclude. All files in
         the bucket that match at least one of these regular expressions will be
         excluded from the scan.
        
         Regular expressions use RE2
         [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found
         under the google/re2 repository on GitHub.
         
        repeated string exclude_regex = 3;
        Returns:
        This builder for chaining.
      • addExcludeRegexBytes

        public CloudStorageRegexFileSet.Builder addExcludeRegexBytes​(com.google.protobuf.ByteString value)
         A list of regular expressions matching file paths to exclude. All files in
         the bucket that match at least one of these regular expressions will be
         excluded from the scan.
        
         Regular expressions use RE2
         [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found
         under the google/re2 repository on GitHub.
         
        repeated string exclude_regex = 3;
        Parameters:
        value - The bytes of the excludeRegex to add.
        Returns:
        This builder for chaining.
      • setUnknownFields

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

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