Class CloudStorageRegexFileSet

  • All Implemented Interfaces:
    CloudStorageRegexFileSetOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

    public final class CloudStorageRegexFileSet
    extends com.google.protobuf.GeneratedMessageV3
    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
    See Also:
    Serialized Form
    • Field Detail

      • BUCKET_NAME_FIELD_NUMBER

        public static final int BUCKET_NAME_FIELD_NUMBER
        See Also:
        Constant Field Values
      • INCLUDE_REGEX_FIELD_NUMBER

        public static final int INCLUDE_REGEX_FIELD_NUMBER
        See Also:
        Constant Field Values
      • EXCLUDE_REGEX_FIELD_NUMBER

        public static final int EXCLUDE_REGEX_FIELD_NUMBER
        See Also:
        Constant Field Values
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • 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
      • 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.
      • 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.
      • 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.
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static CloudStorageRegexFileSet parseFrom​(ByteBuffer data)
                                                  throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static CloudStorageRegexFileSet parseFrom​(ByteBuffer data,
                                                         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                  throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static CloudStorageRegexFileSet parseFrom​(com.google.protobuf.ByteString data)
                                                  throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static CloudStorageRegexFileSet parseFrom​(com.google.protobuf.ByteString data,
                                                         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                  throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static CloudStorageRegexFileSet parseFrom​(byte[] data)
                                                  throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static CloudStorageRegexFileSet parseFrom​(byte[] data,
                                                         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                  throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • newBuilderForType

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

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

        protected CloudStorageRegexFileSet.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getParserForType

        public com.google.protobuf.Parser<CloudStorageRegexFileSet> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

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