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.



2439
2440
2441
# File 'generated/google/apis/dlp_v2/classes.rb', line 2439

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


2425
2426
2427
# File 'generated/google/apis/dlp_v2/classes.rb', line 2425

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)


2437
2438
2439
# File 'generated/google/apis/dlp_v2/classes.rb', line 2437

def url
  @url
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2444
2445
2446
2447
# File 'generated/google/apis/dlp_v2/classes.rb', line 2444

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