Class: Google::Apis::DlpV2::GooglePrivacyDlpV2FileSet

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/dlp_v2/classes.rb,
generated/google/apis/dlp_v2/representations.rb,
generated/google/apis/dlp_v2/representations.rb

Overview

Set of files to scan.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ GooglePrivacyDlpV2FileSet

Returns a new instance of GooglePrivacyDlpV2FileSet



2324
2325
2326
# File 'generated/google/apis/dlp_v2/classes.rb', line 2324

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#regex_file_setGoogle::Apis::DlpV2::GooglePrivacyDlpV2CloudStorageRegexFileSet

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 / Corresponds to the JSON property regexFileSet


2310
2311
2312
# File 'generated/google/apis/dlp_v2/classes.rb', line 2310

def regex_file_set
  @regex_file_set
end

#urlString

The Cloud Storage url of the file(s) to scan, in the format gs://<bucket>/<path>. Trailing wildcard in the path is allowed. If the url ends in a trailing slash, the bucket or directory represented by the url will be scanned non-recursively (content in sub-directories will not be scanned). This means that gs://mybucket/ is equivalent to gs://mybucket/*, and gs://mybucket/directory/ is equivalent to gs://mybucket/directory/*. Exactly one of url or regex_file_set must be set. Corresponds to the JSON property url

Returns:

  • (String)


2322
2323
2324
# File 'generated/google/apis/dlp_v2/classes.rb', line 2322

def url
  @url
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2329
2330
2331
2332
# File 'generated/google/apis/dlp_v2/classes.rb', line 2329

def update!(**args)
  @regex_file_set = args[:regex_file_set] if args.key?(:regex_file_set)
  @url = args[:url] if args.key?(:url)
end