From fdc1b112793622fbddfae1bcc2bd1bda0fa37f68 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 25 Mar 2022 17:12:17 -0400 Subject: [PATCH] feat: new Bytes and File types POWERPOINT and EXCEL (#355) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: new Bytes and File types: POWERPOINT and EXCEL PiperOrigin-RevId: 437260831 Source-Link: https://github.com/googleapis/googleapis/commit/3c34a4075b81b318b68d1a100a13fd0f8db55c87 Source-Link: https://github.com/googleapis/googleapis-gen/commit/a4035213e686b96afc3ed66d0d04328e4ffbd4d1 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYTQwMzUyMTNlNjg2Yjk2YWZjM2VkNjZkMGQwNDMyOGU0ZmZiZDRkMSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../google/cloud/dlp_v2/types/dlp.py | 23 +++++----- .../google/cloud/dlp_v2/types/storage.py | 43 ++++++++----------- 2 files changed, 31 insertions(+), 35 deletions(-) diff --git a/packages/google-cloud-dlp/google/cloud/dlp_v2/types/dlp.py b/packages/google-cloud-dlp/google/cloud/dlp_v2/types/dlp.py index 4ad9cd409b37..f14691d0a006 100644 --- a/packages/google-cloud-dlp/google/cloud/dlp_v2/types/dlp.py +++ b/packages/google-cloud-dlp/google/cloud/dlp_v2/types/dlp.py @@ -189,9 +189,7 @@ class MatchingType(proto.Enum): class ContentOption(proto.Enum): - r"""Options describing which parts of the provided content should - be scanned. - """ + r"""Deprecated and unused.""" CONTENT_UNSPECIFIED = 0 CONTENT_TEXT = 1 CONTENT_IMAGE = 2 @@ -368,22 +366,22 @@ class InspectConfig(proto.Message): to learn more. limits (google.cloud.dlp_v2.types.InspectConfig.FindingLimits): Configuration to control the number of - findings returned. + findings returned. This is not used for data + profiling. include_quote (bool): When true, a contextual quote from the data that triggered a finding is included in the - response; see Finding.quote. + response; see Finding.quote. This is not used + for data profiling. exclude_info_types (bool): When true, excludes type information of the - findings. + findings. This is not used for data profiling. custom_info_types (Sequence[google.cloud.dlp_v2.types.CustomInfoType]): CustomInfoTypes provided by the user. See https://cloud.google.com/dlp/docs/creating-custom-infotypes to learn more. content_options (Sequence[google.cloud.dlp_v2.types.ContentOption]): - List of options defining data content to - scan. If empty, text, images, and other content - will be included. + Deprecated and unused. rule_set (Sequence[google.cloud.dlp_v2.types.InspectionRuleSet]): Set of rules to apply to the findings for this InspectConfig. Exclusion rules, contained @@ -393,8 +391,9 @@ class InspectConfig(proto.Message): """ class FindingLimits(proto.Message): - r"""Configuration to control the number of findings returned. - Cannot be set if de-identification is requested. + r"""Configuration to control the number of findings returned for + inspection. This is not used for de-identification or data + profiling. Attributes: max_findings_per_item (int): @@ -476,6 +475,8 @@ class BytesType(proto.Enum): TEXT_UTF8 = 5 WORD_DOCUMENT = 7 PDF = 8 + POWERPOINT_DOCUMENT = 9 + EXCEL_DOCUMENT = 10 AVRO = 11 CSV = 12 TSV = 13 diff --git a/packages/google-cloud-dlp/google/cloud/dlp_v2/types/storage.py b/packages/google-cloud-dlp/google/cloud/dlp_v2/types/storage.py index 33e0b93b7ed0..d8f9be065bcd 100644 --- a/packages/google-cloud-dlp/google/cloud/dlp_v2/types/storage.py +++ b/packages/google-cloud-dlp/google/cloud/dlp_v2/types/storage.py @@ -75,6 +75,8 @@ class FileType(proto.Enum): AVRO = 7 CSV = 8 TSV = 9 + POWERPOINT = 11 + EXCEL = 12 class InfoType(proto.Message): @@ -188,13 +190,12 @@ class Dictionary(proto.Message): Plane `__ will be replaced with whitespace when scanning for matches, so the dictionary phrase "Sam Johnson" will match all three phrases "sam - johnson", - Plane](https://en.wikipedia.org/wiki/Plane_%28Unicode%29#Basic_Multilingual_Plane) - surrounding any match must be of a different type than the adjacent - characters within the word, so letters must be next to non-letters - and digits next to non-digits. For example, the dictionary word - "jen" will match the first three letters of the text "jen123" but - will return no matches for "jennifer". + johnson", "Sam, Johnson", and "Sam (Johnson)". Additionally, the + characters surrounding any match must be of a different type than + the adjacent characters within the word, so letters must be next to + non-letters and digits next to non-digits. For example, the + dictionary word "jen" will match the first three letters of the text + "jen123" but will return no matches for "jennifer". Dictionary words containing a large number of characters that are not letters or digits may result in unexpected findings because such @@ -202,9 +203,7 @@ class Dictionary(proto.Message): `limits `__ page contains details about the size limits of dictionaries. For dictionaries that do not fit within these constraints, consider using - ``LargeCustomDictionaryConfig`` in the - `limits `__ page contains - details about + ``LargeCustomDictionaryConfig`` in the ``StoredInfoType`` API. This message has `oneof`_ fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. @@ -260,11 +259,9 @@ class Regex(proto.Message): be found under the google/re2 repository on GitHub. group_indexes (Sequence[int]): - (https://github.com/google/re2/wiki/Syntax) - can be found under the The index of the submatch - to extract as findings. When not specified, the - entire match is returned. No more than 3 may be - included. + The index of the submatch to extract as + findings. When not specified, the entire match + is returned. No more than 3 may be included. """ pattern = proto.Field(proto.STRING, number=1,) @@ -275,10 +272,10 @@ class SurrogateType(proto.Message): such as ```CryptoReplaceFfxFpeConfig`` `__. These types of transformations are those that perform - pseudonymization, thereby producing a "surrogate" as - ```CryptoReplaceFfxFpeConfig`` `__. - transformation such as ``surrogate_info_type``. This CustomInfoType - does not support the use of ``detection_rules``. + pseudonymization, thereby producing a "surrogate" as output. This + should be used in conjunction with a field on the transformation + such as ``surrogate_info_type``. This CustomInfoType does not + support the use of ``detection_rules``. """ @@ -527,11 +524,9 @@ class CloudStorageRegexFileSet(proto.Message): guide can be found under the google/re2 repository on GitHub. exclude_regex (Sequence[str]): - `syntax `__; a - guide can be found 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. + 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 `__; a