From d11a028be0311c5214240b7445dc5877da1c56ad Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 3 Dec 2021 13:10:46 -0800 Subject: [PATCH] feat: added deidentify replacement dictionaries feat: added field for BigQuery inspect template inclusion lists feat: added field to support infotype versioning (#667) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: added deidentify replacement dictionaries feat: added field for BigQuery inspect template inclusion lists feat: added field to support infotype versioning PiperOrigin-RevId: 413780624 Source-Link: https://github.com/googleapis/googleapis/commit/ed9918e8cd826344892845d51fc64bf644c51f06 Source-Link: https://github.com/googleapis/googleapis-gen/commit/9286ba60e1c1f6bcd559e9834756b2fa3e51f26d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTI4NmJhNjBlMWMxZjZiY2Q1NTllOTgzNDc1NmIyZmEzZTUxZjI2ZCJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../protos/google/privacy/dlp/v2/dlp.proto | 126 ++++-- .../google/privacy/dlp/v2/storage.proto | 41 +- .../google-privacy-dlp/protos/protos.d.ts | 125 +++++- packages/google-privacy-dlp/protos/protos.js | 379 +++++++++++++++++- .../google-privacy-dlp/protos/protos.json | 123 ++++-- .../v2/dlp_service.create_dlp_job.js | 5 +- .../v2/dlp_service.list_job_triggers.js | 6 +- .../src/v2/dlp_service_client.ts | 28 +- 8 files changed, 723 insertions(+), 110 deletions(-) diff --git a/packages/google-privacy-dlp/protos/google/privacy/dlp/v2/dlp.proto b/packages/google-privacy-dlp/protos/google/privacy/dlp/v2/dlp.proto index 3fb0c219359..26f5872e887 100644 --- a/packages/google-privacy-dlp/protos/google/privacy/dlp/v2/dlp.proto +++ b/packages/google-privacy-dlp/protos/google/privacy/dlp/v2/dlp.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -360,6 +360,10 @@ service DlpService { post: "/v2/{parent=projects/*/locations/*}/jobTriggers" body: "*" } + additional_bindings { + post: "/v2/{parent=organizations/*/locations/*}/jobTriggers" + body: "*" + } }; option (google.api.method_signature) = "parent,job_trigger"; } @@ -374,6 +378,10 @@ service DlpService { patch: "/v2/{name=projects/*/locations/*/jobTriggers/*}" body: "*" } + additional_bindings { + patch: "/v2/{name=organizations/*/locations/*/jobTriggers/*}" + body: "*" + } }; option (google.api.method_signature) = "name,job_trigger,update_mask"; } @@ -381,9 +389,6 @@ service DlpService { // Inspect hybrid content and store findings to a trigger. The inspection // will be processed asynchronously. To review the findings monitor the // jobs within the trigger. - // Early access feature is in a pre-release state and might change or have - // limited support. For more information, see - // https://cloud.google.com/products#product-launch-stages. rpc HybridInspectJobTrigger(HybridInspectJobTriggerRequest) returns (HybridInspectResponse) { option (google.api.http) = { post: "/v2/{name=projects/*/locations/*/jobTriggers/*}:hybridInspect" @@ -400,6 +405,9 @@ service DlpService { additional_bindings { get: "/v2/{name=projects/*/locations/*/jobTriggers/*}" } + additional_bindings { + get: "/v2/{name=organizations/*/locations/*/jobTriggers/*}" + } }; option (google.api.method_signature) = "name"; } @@ -412,6 +420,9 @@ service DlpService { additional_bindings { get: "/v2/{parent=projects/*/locations/*}/jobTriggers" } + additional_bindings { + get: "/v2/{parent=organizations/*/locations/*}/jobTriggers" + } }; option (google.api.method_signature) = "parent"; } @@ -424,6 +435,9 @@ service DlpService { additional_bindings { delete: "/v2/{name=projects/*/locations/*/jobTriggers/*}" } + additional_bindings { + delete: "/v2/{name=organizations/*/locations/*/jobTriggers/*}" + } }; option (google.api.method_signature) = "name"; } @@ -470,6 +484,9 @@ service DlpService { additional_bindings { get: "/v2/{parent=projects/*/locations/*}/dlpJobs" } + additional_bindings { + get: "/v2/{parent=organizations/*/locations/*}/dlpJobs" + } }; option (google.api.method_signature) = "parent"; } @@ -623,11 +640,8 @@ service DlpService { } // Inspect hybrid content and store findings to a job. - // To review the findings inspect the job. Inspection will occur + // To review the findings, inspect the job. Inspection will occur // asynchronously. - // Early access feature is in a pre-release state and might change or have - // limited support. For more information, see - // https://cloud.google.com/products#product-launch-stages. rpc HybridInspectDlpJob(HybridInspectDlpJobRequest) returns (HybridInspectResponse) { option (google.api.http) = { post: "/v2/{name=projects/*/locations/*/dlpJobs/*}:hybridInspect" @@ -638,9 +652,6 @@ service DlpService { // Finish a running hybrid DlpJob. Triggers the finalization steps and running // of any enabled actions that have not yet run. - // Early access feature is in a pre-release state and might change or have - // limited support. For more information, see - // https://cloud.google.com/products#product-launch-stages. rpc FinishDlpJob(FinishDlpJobRequest) returns (google.protobuf.Empty) { option (google.api.http) = { post: "/v2/{name=projects/*/locations/*/dlpJobs/*}:finish" @@ -708,7 +719,8 @@ message InspectionRuleSet { // When used with redactContent only info_types and min_likelihood are currently // used. message InspectConfig { - // Configuration to control the number of findings returned. + // Configuration to control the number of findings returned. Cannot be set if + // de-identification is requested. message FindingLimits { // Max findings configuration per infoType, per content item or long // running DlpJob. @@ -782,7 +794,9 @@ message InspectConfig { // Container for bytes to inspect or redact. message ByteContentItem { - // The type of data being sent for inspection. + // The type of data being sent for inspection. To learn more, see + // [Supported file + // types](https://cloud.google.com/dlp/docs/supported-file-types). enum BytesType { // Unused BYTES_TYPE_UNSPECIFIED = 0; @@ -845,9 +859,9 @@ message ContentItem { } } -// Structured content to inspect. Up to 50,000 `Value`s per request allowed. -// See https://cloud.google.com/dlp/docs/inspecting-text#inspecting_a_table to -// learn more. +// Structured content to inspect. Up to 50,000 `Value`s per request allowed. See +// https://cloud.google.com/dlp/docs/inspecting-structured-text#inspecting_a_table +// to learn more. message Table { // Values of the row. message Row { @@ -945,6 +959,9 @@ message Finding { string job_name = 13 [(google.api.resource_reference) = { type: "dlp.googleapis.com/DlpJob" }]; + + // The unique finding id. + string finding_id = 15; } // Specifies the location of the finding. @@ -1488,16 +1505,13 @@ message InspectDataSourceDetails { repeated InfoTypeStats info_type_stats = 3; // Statistics related to the processing of hybrid inspect. - // Early access feature is in a pre-release state and might change or have - // limited support. For more information, see - // https://cloud.google.com/products#product-launch-stages. HybridInspectStatistics hybrid_stats = 7; } // The configuration used for this job. RequestedOptions requested_options = 2; - // A summary of the outcome of this inspect job. + // A summary of the outcome of this inspection job. Result result = 3; } @@ -2200,7 +2214,7 @@ message TransformationErrorHandling { // A rule for transforming a value. message PrimitiveTransformation { oneof transformation { - // Replace + // Replace with a specified value. ReplaceValueConfig replace_config = 1; // Redact @@ -2232,6 +2246,9 @@ message PrimitiveTransformation { // Deterministic Crypto CryptoDeterministicConfig crypto_deterministic_config = 12; + + // Replace with a value randomly drawn (with replacement) from a dictionary. + ReplaceDictionaryConfig replace_dictionary_config = 13; } } @@ -2282,7 +2299,9 @@ message CryptoHashConfig { // input. Outputs a base64 encoded representation of the encrypted output. // Uses AES-SIV based on the RFC https://tools.ietf.org/html/rfc5297. message CryptoDeterministicConfig { - // The key used by the encryption function. + // The key used by the encryption function. For deterministic encryption + // using AES-SIV, the provided key is internally expanded to 64 bytes prior to + // use. CryptoKey crypto_key = 1; // The custom info type to annotate the surrogate with. @@ -2346,6 +2365,16 @@ message ReplaceValueConfig { Value new_value = 1; } +// Replace each input value with a value randomly selected from the dictionary. +message ReplaceDictionaryConfig { + oneof type { + // A list of words to select from for random replacement. The + // [limits](https://cloud.google.com/dlp/limits) page contains details about + // the size limits of dictionaries. + CustomInfoType.Dictionary.WordList word_list = 1; + } +} + // Replace each matching finding with the name of the info_type. message ReplaceWithInfoTypeConfig { @@ -2429,8 +2458,8 @@ message CharacterMaskConfig { // the user for simple bucketing strategies. // // The transformed value will be a hyphenated string of -// {lower_bound}-{upper_bound}, i.e if lower_bound = 10 and upper_bound = 20 -// all values that are within this bucket will be replaced with "10-20". +// {lower_bound}-{upper_bound}. For example, if lower_bound = 10 and upper_bound +// = 20, all values that are within this bucket will be replaced with "10-20". // // This can be used on data of type: double, long. // @@ -2593,10 +2622,11 @@ message CryptoReplaceFfxFpeConfig { } // This is a data encryption key (DEK) (as opposed to -// a key encryption key (KEK) stored by KMS). -// When using KMS to wrap/unwrap DEKs, be sure to set an appropriate -// IAM policy on the KMS CryptoKey (KEK) to ensure an attacker cannot -// unwrap the data crypto key. +// a key encryption key (KEK) stored by Cloud Key Management Service +// (Cloud KMS). +// When using Cloud KMS to wrap or unwrap a DEK, be sure to set an appropriate +// IAM policy on the KEK to ensure an attacker cannot +// unwrap the DEK. message CryptoKey { // Sources of crypto keys. oneof source { @@ -2606,7 +2636,7 @@ message CryptoKey { // Unwrapped crypto key UnwrappedCryptoKey unwrapped = 2; - // Kms wrapped key + // Key wrapped using Cloud KMS KmsWrappedCryptoKey kms_wrapped = 3; } } @@ -2631,10 +2661,16 @@ message UnwrappedCryptoKey { } // Include to use an existing data crypto key wrapped by KMS. -// The wrapped key must be a 128/192/256 bit key. +// The wrapped key must be a 128-, 192-, or 256-bit key. // Authorization requires the following IAM permissions when sending a request -// to perform a crypto transformation using a kms-wrapped crypto key: +// to perform a crypto transformation using a KMS-wrapped crypto key: // dlp.kms.encrypt +// +// For more information, see [Creating a wrapped key] +// (https://cloud.google.com/dlp/docs/create-wrapped-key). +// +// Note: When you use Cloud KMS for cryptographic operations, +// [charges apply](https://cloud.google.com/kms/pricing). message KmsWrappedCryptoKey { // Required. The wrapped data crypto key. bytes wrapped_key = 1 [(google.api.field_behavior) = REQUIRED]; @@ -2697,6 +2733,9 @@ message InfoTypeTransformations { // The transformation to apply to the field. message FieldTransformation { // Required. Input field(s) to apply the transformation to. + // When you have columns that reference their position within a list, + // omit the index from the FieldId. FieldId name matching ignores the index. + // For example, instead of "contact.nums[0].type", use "contact.nums.type". repeated FieldId fields = 1 [(google.api.field_behavior) = REQUIRED]; // Only apply the transformation if the condition evaluates to true for the @@ -2868,7 +2907,7 @@ message TransformationSummary { int64 transformed_bytes = 7; } -// Schedule for triggeredJobs. +// Schedule for inspect job triggers. message Schedule { oneof option { // With this option a job is started a regular periodic basis. For @@ -2955,7 +2994,7 @@ message DeidentifyTemplate { // Output only. The last update timestamp of an inspectTemplate. google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - // ///////////// // The core content of the template // /////////////// + // The core content of the template. DeidentifyConfig deidentify_config = 6; } @@ -2985,9 +3024,6 @@ message JobTrigger { Schedule schedule = 1; // For use with hybrid jobs. Jobs must be manually created and finished. - // Early access feature is in a pre-release state and might change or have - // limited support. For more information, see - // https://cloud.google.com/products#product-launch-stages. Manual manual = 2; } } @@ -3090,11 +3126,11 @@ message Action { } - // Publish findings of a DlpJob to Cloud Data Catalog. Labels summarizing the + // Publish findings of a DlpJob to Data Catalog. Labels summarizing the // results of the DlpJob will be applied to the entry for the resource scanned - // in Cloud Data Catalog. Any labels previously written by another DlpJob will + // in Data Catalog. Any labels previously written by another DlpJob will // be deleted. InfoType naming patterns are strictly enforced when using this - // feature. Note that the findings will be persisted in Cloud Data Catalog + // feature. Note that the findings will be persisted in Data Catalog // storage and are governed by Data Catalog service-specific policy, see // https://cloud.google.com/terms/service-terms // Only a single instance of this action can be specified and only allowed if @@ -3402,10 +3438,11 @@ message CreateDlpJobRequest { // The configuration details for the specific type of job to run. oneof job { - // Set to control what and how to inspect. + // An inspection job scans a storage repository for InfoTypes. InspectJobConfig inspect_job = 2; - // Set to choose what metric to calculate. + // A risk analysis job calculates re-identification risk metrics for a + // BigQuery table. RiskAnalysisJobConfig risk_job = 3; } @@ -3477,7 +3514,7 @@ message ListJobTriggersRequest { // * Restrictions can be combined by `AND` or `OR` logical operators. A // sequence of restrictions implicitly uses `AND`. // * A restriction has the form of `{field} {operator} {value}`. - // * Supported fields/values for inspect jobs: + // * Supported fields/values for inspect triggers: // - `status` - HEALTHY|PAUSED|CANCELLED // - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY // - 'last_run_time` - RFC 3339 formatted timestamp, surrounded by @@ -3495,6 +3532,9 @@ message ListJobTriggersRequest { // The length of this field should be no more than 500 characters. string filter = 5; + // The type of jobs. Will use `DlpJobType.INSPECT` if not set. + DlpJobType type = 6; + // Deprecated. This field has no effect. string location_id = 7; } @@ -4347,7 +4387,7 @@ enum InfoTypeSupportedBy { // An enum to represent the various types of DLP jobs. enum DlpJobType { - // Unused + // Defaults to INSPECT_JOB. DLP_JOB_TYPE_UNSPECIFIED = 0; // The job inspected Google Cloud for sensitive data. diff --git a/packages/google-privacy-dlp/protos/google/privacy/dlp/v2/storage.proto b/packages/google-privacy-dlp/protos/google/privacy/dlp/v2/storage.proto index 6ded28b1603..a9011213ff3 100644 --- a/packages/google-privacy-dlp/protos/google/privacy/dlp/v2/storage.proto +++ b/packages/google-privacy-dlp/protos/google/privacy/dlp/v2/storage.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,9 +16,9 @@ syntax = "proto3"; package google.privacy.dlp.v2; +import "google/api/annotations.proto"; import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.Dlp.V2"; option go_package = "google.golang.org/genproto/googleapis/privacy/dlp/v2;dlp"; @@ -36,6 +36,9 @@ message InfoType { // a built-in type. When sending Cloud DLP results to Data Catalog, infoType // names should conform to the pattern `[A-Za-z0-9$-_]{1,64}`. string name = 1; + + // Optional version name for this InfoType. + string version = 2; } // A reference to a StoredInfoType to use with scanning. @@ -82,7 +85,7 @@ message CustomInfoType { // Plane](https://en.wikipedia.org/wiki/Plane_%28Unicode%29#Basic_Multilingual_Plane) // will be replaced with whitespace when scanning for matches, so the // dictionary phrase "Sam Johnson" will match all three phrases "sam johnson", - // "Sam, Johnson", and "Sam (Johnson)". Additionally, the characters + // 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 @@ -95,7 +98,7 @@ message CustomInfoType { // [limits](https://cloud.google.com/dlp/limits) page contains details about // the size limits of dictionaries. For dictionaries that do not fit within // these constraints, consider using `LargeCustomDictionaryConfig` in the - // `StoredInfoType` API. + // [limits](https://cloud.google.com/dlp/limits) page contains details about message Dictionary { // Message defining a list of words or phrases to search for in the data. message WordList { @@ -121,7 +124,7 @@ message CustomInfoType { // (https://github.com/google/re2/wiki/Syntax) can be found under the // google/re2 repository on GitHub. string pattern = 1; - + // (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. repeated int32 group_indexes = 2; @@ -132,12 +135,10 @@ message CustomInfoType { // [`CryptoReplaceFfxFpeConfig`](https://cloud.google.com/dlp/docs/reference/rest/v2/organizations.deidentifyTemplates#cryptoreplaceffxfpeconfig). // These types of transformations are // those that perform pseudonymization, thereby producing a "surrogate" as - // output. This should be used in conjunction with a field on the + // [`CryptoReplaceFfxFpeConfig`](https://cloud.google.com/dlp/docs/reference/rest/v2/organizations.deidentifyTemplates#cryptoreplaceffxfpeconfig). // transformation such as `surrogate_info_type`. This CustomInfoType does // not support the use of `detection_rules`. - message SurrogateType { - - } + message SurrogateType {} // Deprecated; use `InspectionRuleSet` instead. Rule for modifying a // `CustomInfoType` to alter behavior under certain circumstances, depending @@ -329,7 +330,7 @@ message CloudStorageRegexFileSet { // [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; - + // [syntax](https://github.com/google/re2/wiki/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. @@ -338,6 +339,7 @@ message CloudStorageRegexFileSet { // [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; + // [syntax](https://github.com/google/re2/wiki/Syntax); a guide can be found } // Options defining a file or a set of files within a Google Cloud Storage @@ -382,12 +384,14 @@ message CloudStorageOptions { // Max number of bytes to scan from a file. If a scanned file's size is bigger // than this value then the rest of the bytes are omitted. Only one // of bytes_limit_per_file and bytes_limit_per_file_percent can be specified. + // Cannot be set if de-identification is requested. int64 bytes_limit_per_file = 4; // Max percentage of bytes to scan from a file. The rest are omitted. The // number of bytes scanned is rounded down. Must be between 0 and 100, // inclusively. Both 0 and 100 means no limit. Defaults to 0. Only one // of bytes_limit_per_file and bytes_limit_per_file_percent can be specified. + // Cannot be set if de-identification is requested. int32 bytes_limit_per_file_percent = 8; // List of file type groups to include in the scan. @@ -466,6 +470,9 @@ message BigQueryOptions { // References to fields excluded from scanning. This allows you to skip // inspection of entire columns which you know have no findings. repeated FieldId excluded_fields = 5; + + // Limit scanning only to these fields. + repeated FieldId included_fields = 7; } // Shared message indicating Cloud storage type. @@ -518,9 +525,6 @@ message StorageConfig { BigQueryOptions big_query_options = 4; // Hybrid inspection options. - // Early access feature is in a pre-release state and might change or have - // limited support. For more information, see - // https://cloud.google.com/products#product-launch-stages. HybridOptions hybrid_options = 9; } @@ -541,11 +545,12 @@ enum FileType { BINARY_FILE = 1; // Included file extensions: - // asc, brf, c, cc, cpp, csv, cxx, c++, cs, css, dart, eml, go, h, hh, hpp, - // hxx, h++, hs, html, htm, shtml, shtm, xhtml, lhs, ini, java, js, json, - // ocaml, md, mkd, markdown, m, ml, mli, pl, pm, php, phtml, pht, py, pyw, - // rb, rbw, rs, rc, scala, sh, sql, tex, txt, text, tsv, vcard, vcs, wml, - // xml, xsl, xsd, yml, yaml. + // asc,asp, aspx, brf, c, cc,cfm, cgi, cpp, csv, cxx, c++, cs, css, dart, + // dat, dot, eml,, epbub, ged, go, h, hh, hpp, hxx, h++, hs, html, htm, + // mkd, markdown, m, ml, mli, perl, pl, plist, pm, php, phtml, pht, + // properties, py, pyw, rb, rbw, rs, rss, rc, scala, sh, sql, swift, tex, + // shtml, shtm, xhtml, lhs, ics, ini, java, js, json, kix, kml, ocaml, md, + // txt, text, tsv, vb, vcard, vcs, wml, xcodeproj, xml, xsl, xsd, yml, yaml. TEXT_FILE = 2; // Included file extensions: diff --git a/packages/google-privacy-dlp/protos/protos.d.ts b/packages/google-privacy-dlp/protos/protos.d.ts index 30d6cd5e661..a06f7bf9b22 100644 --- a/packages/google-privacy-dlp/protos/protos.d.ts +++ b/packages/google-privacy-dlp/protos/protos.d.ts @@ -2039,6 +2039,9 @@ export namespace google { /** Finding jobName */ jobName?: (string|null); + + /** Finding findingId */ + findingId?: (string|null); } /** Represents a Finding. */ @@ -2086,6 +2089,9 @@ export namespace google { /** Finding jobName. */ public jobName: string; + /** Finding findingId. */ + public findingId: string; + /** * Creates a new Finding instance using the specified properties. * @param [properties] Properties to set @@ -9417,6 +9423,9 @@ export namespace google { /** PrimitiveTransformation cryptoDeterministicConfig */ cryptoDeterministicConfig?: (google.privacy.dlp.v2.ICryptoDeterministicConfig|null); + + /** PrimitiveTransformation replaceDictionaryConfig */ + replaceDictionaryConfig?: (google.privacy.dlp.v2.IReplaceDictionaryConfig|null); } /** Represents a PrimitiveTransformation. */ @@ -9461,8 +9470,11 @@ export namespace google { /** PrimitiveTransformation cryptoDeterministicConfig. */ public cryptoDeterministicConfig?: (google.privacy.dlp.v2.ICryptoDeterministicConfig|null); + /** PrimitiveTransformation replaceDictionaryConfig. */ + public replaceDictionaryConfig?: (google.privacy.dlp.v2.IReplaceDictionaryConfig|null); + /** PrimitiveTransformation transformation. */ - public transformation?: ("replaceConfig"|"redactConfig"|"characterMaskConfig"|"cryptoReplaceFfxFpeConfig"|"fixedSizeBucketingConfig"|"bucketingConfig"|"replaceWithInfoTypeConfig"|"timePartConfig"|"cryptoHashConfig"|"dateShiftConfig"|"cryptoDeterministicConfig"); + public transformation?: ("replaceConfig"|"redactConfig"|"characterMaskConfig"|"cryptoReplaceFfxFpeConfig"|"fixedSizeBucketingConfig"|"bucketingConfig"|"replaceWithInfoTypeConfig"|"timePartConfig"|"cryptoHashConfig"|"dateShiftConfig"|"cryptoDeterministicConfig"|"replaceDictionaryConfig"); /** * Creates a new PrimitiveTransformation instance using the specified properties. @@ -9921,6 +9933,99 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a ReplaceDictionaryConfig. */ + interface IReplaceDictionaryConfig { + + /** ReplaceDictionaryConfig wordList */ + wordList?: (google.privacy.dlp.v2.CustomInfoType.Dictionary.IWordList|null); + } + + /** Represents a ReplaceDictionaryConfig. */ + class ReplaceDictionaryConfig implements IReplaceDictionaryConfig { + + /** + * Constructs a new ReplaceDictionaryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.privacy.dlp.v2.IReplaceDictionaryConfig); + + /** ReplaceDictionaryConfig wordList. */ + public wordList?: (google.privacy.dlp.v2.CustomInfoType.Dictionary.IWordList|null); + + /** ReplaceDictionaryConfig type. */ + public type?: "wordList"; + + /** + * Creates a new ReplaceDictionaryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ReplaceDictionaryConfig instance + */ + public static create(properties?: google.privacy.dlp.v2.IReplaceDictionaryConfig): google.privacy.dlp.v2.ReplaceDictionaryConfig; + + /** + * Encodes the specified ReplaceDictionaryConfig message. Does not implicitly {@link google.privacy.dlp.v2.ReplaceDictionaryConfig.verify|verify} messages. + * @param message ReplaceDictionaryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.privacy.dlp.v2.IReplaceDictionaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReplaceDictionaryConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ReplaceDictionaryConfig.verify|verify} messages. + * @param message ReplaceDictionaryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.privacy.dlp.v2.IReplaceDictionaryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReplaceDictionaryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReplaceDictionaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.privacy.dlp.v2.ReplaceDictionaryConfig; + + /** + * Decodes a ReplaceDictionaryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReplaceDictionaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.privacy.dlp.v2.ReplaceDictionaryConfig; + + /** + * Verifies a ReplaceDictionaryConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReplaceDictionaryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReplaceDictionaryConfig + */ + public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.ReplaceDictionaryConfig; + + /** + * Creates a plain object from a ReplaceDictionaryConfig message. Also converts values to other types if specified. + * @param message ReplaceDictionaryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.privacy.dlp.v2.ReplaceDictionaryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReplaceDictionaryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a ReplaceWithInfoTypeConfig. */ interface IReplaceWithInfoTypeConfig { } @@ -14983,6 +15088,9 @@ export namespace google { /** ListJobTriggersRequest filter */ filter?: (string|null); + /** ListJobTriggersRequest type */ + type?: (google.privacy.dlp.v2.DlpJobType|keyof typeof google.privacy.dlp.v2.DlpJobType|null); + /** ListJobTriggersRequest locationId */ locationId?: (string|null); } @@ -15011,6 +15119,9 @@ export namespace google { /** ListJobTriggersRequest filter. */ public filter: string; + /** ListJobTriggersRequest type. */ + public type: (google.privacy.dlp.v2.DlpJobType|keyof typeof google.privacy.dlp.v2.DlpJobType); + /** ListJobTriggersRequest locationId. */ public locationId: string; @@ -18490,6 +18601,9 @@ export namespace google { /** InfoType name */ name?: (string|null); + + /** InfoType version */ + version?: (string|null); } /** Represents an InfoType. */ @@ -18504,6 +18618,9 @@ export namespace google { /** InfoType name. */ public name: string; + /** InfoType version. */ + public version: string; + /** * Creates a new InfoType instance using the specified properties. * @param [properties] Properties to set @@ -20490,6 +20607,9 @@ export namespace google { /** BigQueryOptions excludedFields */ excludedFields?: (google.privacy.dlp.v2.IFieldId[]|null); + + /** BigQueryOptions includedFields */ + includedFields?: (google.privacy.dlp.v2.IFieldId[]|null); } /** Represents a BigQueryOptions. */ @@ -20519,6 +20639,9 @@ export namespace google { /** BigQueryOptions excludedFields. */ public excludedFields: google.privacy.dlp.v2.IFieldId[]; + /** BigQueryOptions includedFields. */ + public includedFields: google.privacy.dlp.v2.IFieldId[]; + /** * Creates a new BigQueryOptions instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-privacy-dlp/protos/protos.js b/packages/google-privacy-dlp/protos/protos.js index 3bd63c66463..3b28cfb33f5 100644 --- a/packages/google-privacy-dlp/protos/protos.js +++ b/packages/google-privacy-dlp/protos/protos.js @@ -4509,6 +4509,7 @@ * @property {Object.|null} [labels] Finding labels * @property {google.protobuf.ITimestamp|null} [jobCreateTime] Finding jobCreateTime * @property {string|null} [jobName] Finding jobName + * @property {string|null} [findingId] Finding findingId */ /** @@ -4623,6 +4624,14 @@ */ Finding.prototype.jobName = ""; + /** + * Finding findingId. + * @member {string} findingId + * @memberof google.privacy.dlp.v2.Finding + * @instance + */ + Finding.prototype.findingId = ""; + /** * Creates a new Finding instance using the specified properties. * @function create @@ -4672,6 +4681,8 @@ writer.uint32(/* id 13, wireType 2 =*/106).string(message.jobName); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 14, wireType 2 =*/114).string(message.name); + if (message.findingId != null && Object.hasOwnProperty.call(message, "findingId")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.findingId); return writer; }; @@ -4761,6 +4772,9 @@ case 13: message.jobName = reader.string(); break; + case 15: + message.findingId = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -4856,6 +4870,9 @@ if (message.jobName != null && message.hasOwnProperty("jobName")) if (!$util.isString(message.jobName)) return "jobName: string expected"; + if (message.findingId != null && message.hasOwnProperty("findingId")) + if (!$util.isString(message.findingId)) + return "findingId: string expected"; return null; }; @@ -4939,6 +4956,8 @@ } if (object.jobName != null) message.jobName = String(object.jobName); + if (object.findingId != null) + message.findingId = String(object.findingId); return message; }; @@ -4969,6 +4988,7 @@ object.jobCreateTime = null; object.jobName = ""; object.name = ""; + object.findingId = ""; } if (message.quote != null && message.hasOwnProperty("quote")) object.quote = message.quote; @@ -4998,6 +5018,8 @@ object.jobName = message.jobName; if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.findingId != null && message.hasOwnProperty("findingId")) + object.findingId = message.findingId; return object; }; @@ -23391,6 +23413,7 @@ * @property {google.privacy.dlp.v2.ICryptoHashConfig|null} [cryptoHashConfig] PrimitiveTransformation cryptoHashConfig * @property {google.privacy.dlp.v2.IDateShiftConfig|null} [dateShiftConfig] PrimitiveTransformation dateShiftConfig * @property {google.privacy.dlp.v2.ICryptoDeterministicConfig|null} [cryptoDeterministicConfig] PrimitiveTransformation cryptoDeterministicConfig + * @property {google.privacy.dlp.v2.IReplaceDictionaryConfig|null} [replaceDictionaryConfig] PrimitiveTransformation replaceDictionaryConfig */ /** @@ -23496,17 +23519,25 @@ */ PrimitiveTransformation.prototype.cryptoDeterministicConfig = null; + /** + * PrimitiveTransformation replaceDictionaryConfig. + * @member {google.privacy.dlp.v2.IReplaceDictionaryConfig|null|undefined} replaceDictionaryConfig + * @memberof google.privacy.dlp.v2.PrimitiveTransformation + * @instance + */ + PrimitiveTransformation.prototype.replaceDictionaryConfig = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * PrimitiveTransformation transformation. - * @member {"replaceConfig"|"redactConfig"|"characterMaskConfig"|"cryptoReplaceFfxFpeConfig"|"fixedSizeBucketingConfig"|"bucketingConfig"|"replaceWithInfoTypeConfig"|"timePartConfig"|"cryptoHashConfig"|"dateShiftConfig"|"cryptoDeterministicConfig"|undefined} transformation + * @member {"replaceConfig"|"redactConfig"|"characterMaskConfig"|"cryptoReplaceFfxFpeConfig"|"fixedSizeBucketingConfig"|"bucketingConfig"|"replaceWithInfoTypeConfig"|"timePartConfig"|"cryptoHashConfig"|"dateShiftConfig"|"cryptoDeterministicConfig"|"replaceDictionaryConfig"|undefined} transformation * @memberof google.privacy.dlp.v2.PrimitiveTransformation * @instance */ Object.defineProperty(PrimitiveTransformation.prototype, "transformation", { - get: $util.oneOfGetter($oneOfFields = ["replaceConfig", "redactConfig", "characterMaskConfig", "cryptoReplaceFfxFpeConfig", "fixedSizeBucketingConfig", "bucketingConfig", "replaceWithInfoTypeConfig", "timePartConfig", "cryptoHashConfig", "dateShiftConfig", "cryptoDeterministicConfig"]), + get: $util.oneOfGetter($oneOfFields = ["replaceConfig", "redactConfig", "characterMaskConfig", "cryptoReplaceFfxFpeConfig", "fixedSizeBucketingConfig", "bucketingConfig", "replaceWithInfoTypeConfig", "timePartConfig", "cryptoHashConfig", "dateShiftConfig", "cryptoDeterministicConfig", "replaceDictionaryConfig"]), set: $util.oneOfSetter($oneOfFields) }); @@ -23556,6 +23587,8 @@ $root.google.privacy.dlp.v2.DateShiftConfig.encode(message.dateShiftConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); if (message.cryptoDeterministicConfig != null && Object.hasOwnProperty.call(message, "cryptoDeterministicConfig")) $root.google.privacy.dlp.v2.CryptoDeterministicConfig.encode(message.cryptoDeterministicConfig, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.replaceDictionaryConfig != null && Object.hasOwnProperty.call(message, "replaceDictionaryConfig")) + $root.google.privacy.dlp.v2.ReplaceDictionaryConfig.encode(message.replaceDictionaryConfig, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); return writer; }; @@ -23623,6 +23656,9 @@ case 12: message.cryptoDeterministicConfig = $root.google.privacy.dlp.v2.CryptoDeterministicConfig.decode(reader, reader.uint32()); break; + case 13: + message.replaceDictionaryConfig = $root.google.privacy.dlp.v2.ReplaceDictionaryConfig.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -23767,6 +23803,16 @@ return "cryptoDeterministicConfig." + error; } } + if (message.replaceDictionaryConfig != null && message.hasOwnProperty("replaceDictionaryConfig")) { + if (properties.transformation === 1) + return "transformation: multiple values"; + properties.transformation = 1; + { + var error = $root.google.privacy.dlp.v2.ReplaceDictionaryConfig.verify(message.replaceDictionaryConfig); + if (error) + return "replaceDictionaryConfig." + error; + } + } return null; }; @@ -23837,6 +23883,11 @@ throw TypeError(".google.privacy.dlp.v2.PrimitiveTransformation.cryptoDeterministicConfig: object expected"); message.cryptoDeterministicConfig = $root.google.privacy.dlp.v2.CryptoDeterministicConfig.fromObject(object.cryptoDeterministicConfig); } + if (object.replaceDictionaryConfig != null) { + if (typeof object.replaceDictionaryConfig !== "object") + throw TypeError(".google.privacy.dlp.v2.PrimitiveTransformation.replaceDictionaryConfig: object expected"); + message.replaceDictionaryConfig = $root.google.privacy.dlp.v2.ReplaceDictionaryConfig.fromObject(object.replaceDictionaryConfig); + } return message; }; @@ -23908,6 +23959,11 @@ if (options.oneofs) object.transformation = "cryptoDeterministicConfig"; } + if (message.replaceDictionaryConfig != null && message.hasOwnProperty("replaceDictionaryConfig")) { + object.replaceDictionaryConfig = $root.google.privacy.dlp.v2.ReplaceDictionaryConfig.toObject(message.replaceDictionaryConfig, options); + if (options.oneofs) + object.transformation = "replaceDictionaryConfig"; + } return object; }; @@ -24805,6 +24861,217 @@ return ReplaceValueConfig; })(); + v2.ReplaceDictionaryConfig = (function() { + + /** + * Properties of a ReplaceDictionaryConfig. + * @memberof google.privacy.dlp.v2 + * @interface IReplaceDictionaryConfig + * @property {google.privacy.dlp.v2.CustomInfoType.Dictionary.IWordList|null} [wordList] ReplaceDictionaryConfig wordList + */ + + /** + * Constructs a new ReplaceDictionaryConfig. + * @memberof google.privacy.dlp.v2 + * @classdesc Represents a ReplaceDictionaryConfig. + * @implements IReplaceDictionaryConfig + * @constructor + * @param {google.privacy.dlp.v2.IReplaceDictionaryConfig=} [properties] Properties to set + */ + function ReplaceDictionaryConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReplaceDictionaryConfig wordList. + * @member {google.privacy.dlp.v2.CustomInfoType.Dictionary.IWordList|null|undefined} wordList + * @memberof google.privacy.dlp.v2.ReplaceDictionaryConfig + * @instance + */ + ReplaceDictionaryConfig.prototype.wordList = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReplaceDictionaryConfig type. + * @member {"wordList"|undefined} type + * @memberof google.privacy.dlp.v2.ReplaceDictionaryConfig + * @instance + */ + Object.defineProperty(ReplaceDictionaryConfig.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["wordList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReplaceDictionaryConfig instance using the specified properties. + * @function create + * @memberof google.privacy.dlp.v2.ReplaceDictionaryConfig + * @static + * @param {google.privacy.dlp.v2.IReplaceDictionaryConfig=} [properties] Properties to set + * @returns {google.privacy.dlp.v2.ReplaceDictionaryConfig} ReplaceDictionaryConfig instance + */ + ReplaceDictionaryConfig.create = function create(properties) { + return new ReplaceDictionaryConfig(properties); + }; + + /** + * Encodes the specified ReplaceDictionaryConfig message. Does not implicitly {@link google.privacy.dlp.v2.ReplaceDictionaryConfig.verify|verify} messages. + * @function encode + * @memberof google.privacy.dlp.v2.ReplaceDictionaryConfig + * @static + * @param {google.privacy.dlp.v2.IReplaceDictionaryConfig} message ReplaceDictionaryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplaceDictionaryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.wordList != null && Object.hasOwnProperty.call(message, "wordList")) + $root.google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList.encode(message.wordList, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReplaceDictionaryConfig message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ReplaceDictionaryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.privacy.dlp.v2.ReplaceDictionaryConfig + * @static + * @param {google.privacy.dlp.v2.IReplaceDictionaryConfig} message ReplaceDictionaryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplaceDictionaryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReplaceDictionaryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.privacy.dlp.v2.ReplaceDictionaryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.privacy.dlp.v2.ReplaceDictionaryConfig} ReplaceDictionaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplaceDictionaryConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.privacy.dlp.v2.ReplaceDictionaryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.wordList = $root.google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReplaceDictionaryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.privacy.dlp.v2.ReplaceDictionaryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.privacy.dlp.v2.ReplaceDictionaryConfig} ReplaceDictionaryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplaceDictionaryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReplaceDictionaryConfig message. + * @function verify + * @memberof google.privacy.dlp.v2.ReplaceDictionaryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReplaceDictionaryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.wordList != null && message.hasOwnProperty("wordList")) { + properties.type = 1; + { + var error = $root.google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList.verify(message.wordList); + if (error) + return "wordList." + error; + } + } + return null; + }; + + /** + * Creates a ReplaceDictionaryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.privacy.dlp.v2.ReplaceDictionaryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.privacy.dlp.v2.ReplaceDictionaryConfig} ReplaceDictionaryConfig + */ + ReplaceDictionaryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.privacy.dlp.v2.ReplaceDictionaryConfig) + return object; + var message = new $root.google.privacy.dlp.v2.ReplaceDictionaryConfig(); + if (object.wordList != null) { + if (typeof object.wordList !== "object") + throw TypeError(".google.privacy.dlp.v2.ReplaceDictionaryConfig.wordList: object expected"); + message.wordList = $root.google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList.fromObject(object.wordList); + } + return message; + }; + + /** + * Creates a plain object from a ReplaceDictionaryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.privacy.dlp.v2.ReplaceDictionaryConfig + * @static + * @param {google.privacy.dlp.v2.ReplaceDictionaryConfig} message ReplaceDictionaryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReplaceDictionaryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.wordList != null && message.hasOwnProperty("wordList")) { + object.wordList = $root.google.privacy.dlp.v2.CustomInfoType.Dictionary.WordList.toObject(message.wordList, options); + if (options.oneofs) + object.type = "wordList"; + } + return object; + }; + + /** + * Converts this ReplaceDictionaryConfig to JSON. + * @function toJSON + * @memberof google.privacy.dlp.v2.ReplaceDictionaryConfig + * @instance + * @returns {Object.} JSON object + */ + ReplaceDictionaryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReplaceDictionaryConfig; + })(); + v2.ReplaceWithInfoTypeConfig = (function() { /** @@ -36987,6 +37254,7 @@ * @property {number|null} [pageSize] ListJobTriggersRequest pageSize * @property {string|null} [orderBy] ListJobTriggersRequest orderBy * @property {string|null} [filter] ListJobTriggersRequest filter + * @property {google.privacy.dlp.v2.DlpJobType|null} [type] ListJobTriggersRequest type * @property {string|null} [locationId] ListJobTriggersRequest locationId */ @@ -37045,6 +37313,14 @@ */ ListJobTriggersRequest.prototype.filter = ""; + /** + * ListJobTriggersRequest type. + * @member {google.privacy.dlp.v2.DlpJobType} type + * @memberof google.privacy.dlp.v2.ListJobTriggersRequest + * @instance + */ + ListJobTriggersRequest.prototype.type = 0; + /** * ListJobTriggersRequest locationId. * @member {string} locationId @@ -37087,6 +37363,8 @@ writer.uint32(/* id 4, wireType 2 =*/34).string(message.orderBy); if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.type); if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.locationId); return writer; @@ -37138,6 +37416,9 @@ case 5: message.filter = reader.string(); break; + case 6: + message.type = reader.int32(); + break; case 7: message.locationId = reader.string(); break; @@ -37191,6 +37472,15 @@ if (message.filter != null && message.hasOwnProperty("filter")) if (!$util.isString(message.filter)) return "filter: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } if (message.locationId != null && message.hasOwnProperty("locationId")) if (!$util.isString(message.locationId)) return "locationId: string expected"; @@ -37219,6 +37509,20 @@ message.orderBy = String(object.orderBy); if (object.filter != null) message.filter = String(object.filter); + switch (object.type) { + case "DLP_JOB_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "INSPECT_JOB": + case 1: + message.type = 1; + break; + case "RISK_ANALYSIS_JOB": + case 2: + message.type = 2; + break; + } if (object.locationId != null) message.locationId = String(object.locationId); return message; @@ -37243,6 +37547,7 @@ object.pageSize = 0; object.orderBy = ""; object.filter = ""; + object.type = options.enums === String ? "DLP_JOB_TYPE_UNSPECIFIED" : 0; object.locationId = ""; } if (message.parent != null && message.hasOwnProperty("parent")) @@ -37255,6 +37560,8 @@ object.orderBy = message.orderBy; if (message.filter != null && message.hasOwnProperty("filter")) object.filter = message.filter; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.privacy.dlp.v2.DlpJobType[message.type] : message.type; if (message.locationId != null && message.hasOwnProperty("locationId")) object.locationId = message.locationId; return object; @@ -45502,6 +45809,7 @@ * @memberof google.privacy.dlp.v2 * @interface IInfoType * @property {string|null} [name] InfoType name + * @property {string|null} [version] InfoType version */ /** @@ -45527,6 +45835,14 @@ */ InfoType.prototype.name = ""; + /** + * InfoType version. + * @member {string} version + * @memberof google.privacy.dlp.v2.InfoType + * @instance + */ + InfoType.prototype.version = ""; + /** * Creates a new InfoType instance using the specified properties. * @function create @@ -45553,6 +45869,8 @@ writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); return writer; }; @@ -45590,6 +45908,9 @@ case 1: message.name = reader.string(); break; + case 2: + message.version = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -45628,6 +45949,9 @@ if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; return null; }; @@ -45645,6 +45969,8 @@ var message = new $root.google.privacy.dlp.v2.InfoType(); if (object.name != null) message.name = String(object.name); + if (object.version != null) + message.version = String(object.version); return message; }; @@ -45661,10 +45987,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.name = ""; + object.version = ""; + } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; return object; }; @@ -50281,6 +50611,7 @@ * @property {number|null} [rowsLimitPercent] BigQueryOptions rowsLimitPercent * @property {google.privacy.dlp.v2.BigQueryOptions.SampleMethod|null} [sampleMethod] BigQueryOptions sampleMethod * @property {Array.|null} [excludedFields] BigQueryOptions excludedFields + * @property {Array.|null} [includedFields] BigQueryOptions includedFields */ /** @@ -50294,6 +50625,7 @@ function BigQueryOptions(properties) { this.identifyingFields = []; this.excludedFields = []; + this.includedFields = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -50348,6 +50680,14 @@ */ BigQueryOptions.prototype.excludedFields = $util.emptyArray; + /** + * BigQueryOptions includedFields. + * @member {Array.} includedFields + * @memberof google.privacy.dlp.v2.BigQueryOptions + * @instance + */ + BigQueryOptions.prototype.includedFields = $util.emptyArray; + /** * Creates a new BigQueryOptions instance using the specified properties. * @function create @@ -50386,6 +50726,9 @@ $root.google.privacy.dlp.v2.FieldId.encode(message.excludedFields[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.rowsLimitPercent != null && Object.hasOwnProperty.call(message, "rowsLimitPercent")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.rowsLimitPercent); + if (message.includedFields != null && message.includedFields.length) + for (var i = 0; i < message.includedFields.length; ++i) + $root.google.privacy.dlp.v2.FieldId.encode(message.includedFields[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -50442,6 +50785,11 @@ message.excludedFields = []; message.excludedFields.push($root.google.privacy.dlp.v2.FieldId.decode(reader, reader.uint32())); break; + case 7: + if (!(message.includedFields && message.includedFields.length)) + message.includedFields = []; + message.includedFields.push($root.google.privacy.dlp.v2.FieldId.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -50515,6 +50863,15 @@ return "excludedFields." + error; } } + if (message.includedFields != null && message.hasOwnProperty("includedFields")) { + if (!Array.isArray(message.includedFields)) + return "includedFields: array expected"; + for (var i = 0; i < message.includedFields.length; ++i) { + var error = $root.google.privacy.dlp.v2.FieldId.verify(message.includedFields[i]); + if (error) + return "includedFields." + error; + } + } return null; }; @@ -50580,6 +50937,16 @@ message.excludedFields[i] = $root.google.privacy.dlp.v2.FieldId.fromObject(object.excludedFields[i]); } } + if (object.includedFields) { + if (!Array.isArray(object.includedFields)) + throw TypeError(".google.privacy.dlp.v2.BigQueryOptions.includedFields: array expected"); + message.includedFields = []; + for (var i = 0; i < object.includedFields.length; ++i) { + if (typeof object.includedFields[i] !== "object") + throw TypeError(".google.privacy.dlp.v2.BigQueryOptions.includedFields: object expected"); + message.includedFields[i] = $root.google.privacy.dlp.v2.FieldId.fromObject(object.includedFields[i]); + } + } return message; }; @@ -50599,6 +50966,7 @@ if (options.arrays || options.defaults) { object.identifyingFields = []; object.excludedFields = []; + object.includedFields = []; } if (options.defaults) { object.tableReference = null; @@ -50631,6 +50999,11 @@ } if (message.rowsLimitPercent != null && message.hasOwnProperty("rowsLimitPercent")) object.rowsLimitPercent = message.rowsLimitPercent; + if (message.includedFields && message.includedFields.length) { + object.includedFields = []; + for (var j = 0; j < message.includedFields.length; ++j) + object.includedFields[j] = $root.google.privacy.dlp.v2.FieldId.toObject(message.includedFields[j], options); + } return object; }; diff --git a/packages/google-privacy-dlp/protos/protos.json b/packages/google-privacy-dlp/protos/protos.json index 21e77b6e7e4..43133dde5f3 100644 --- a/packages/google-privacy-dlp/protos/protos.json +++ b/packages/google-privacy-dlp/protos/protos.json @@ -465,7 +465,7 @@ "options": { "(google.api.http).post": "/v2/{parent=projects/*}/jobTriggers", "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/locations/*}/jobTriggers", + "(google.api.http).additional_bindings.post": "/v2/{parent=organizations/*/locations/*}/jobTriggers", "(google.api.http).additional_bindings.body": "*", "(google.api.method_signature)": "parent,job_trigger" }, @@ -474,10 +474,16 @@ "(google.api.http)": { "post": "/v2/{parent=projects/*}/jobTriggers", "body": "*", - "additional_bindings": { - "post": "/v2/{parent=projects/*/locations/*}/jobTriggers", - "body": "*" - } + "additional_bindings": [ + { + "post": "/v2/{parent=projects/*/locations/*}/jobTriggers", + "body": "*" + }, + { + "post": "/v2/{parent=organizations/*/locations/*}/jobTriggers", + "body": "*" + } + ] } }, { @@ -491,7 +497,7 @@ "options": { "(google.api.http).patch": "/v2/{name=projects/*/jobTriggers/*}", "(google.api.http).body": "*", - "(google.api.http).additional_bindings.patch": "/v2/{name=projects/*/locations/*/jobTriggers/*}", + "(google.api.http).additional_bindings.patch": "/v2/{name=organizations/*/locations/*/jobTriggers/*}", "(google.api.http).additional_bindings.body": "*", "(google.api.method_signature)": "name,job_trigger,update_mask" }, @@ -500,10 +506,16 @@ "(google.api.http)": { "patch": "/v2/{name=projects/*/jobTriggers/*}", "body": "*", - "additional_bindings": { - "patch": "/v2/{name=projects/*/locations/*/jobTriggers/*}", - "body": "*" - } + "additional_bindings": [ + { + "patch": "/v2/{name=projects/*/locations/*/jobTriggers/*}", + "body": "*" + }, + { + "patch": "/v2/{name=organizations/*/locations/*/jobTriggers/*}", + "body": "*" + } + ] } }, { @@ -536,16 +548,21 @@ "responseType": "JobTrigger", "options": { "(google.api.http).get": "/v2/{name=projects/*/jobTriggers/*}", - "(google.api.http).additional_bindings.get": "/v2/{name=projects/*/locations/*/jobTriggers/*}", + "(google.api.http).additional_bindings.get": "/v2/{name=organizations/*/locations/*/jobTriggers/*}", "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { "get": "/v2/{name=projects/*/jobTriggers/*}", - "additional_bindings": { - "get": "/v2/{name=projects/*/locations/*/jobTriggers/*}" - } + "additional_bindings": [ + { + "get": "/v2/{name=projects/*/locations/*/jobTriggers/*}" + }, + { + "get": "/v2/{name=organizations/*/locations/*/jobTriggers/*}" + } + ] } }, { @@ -558,16 +575,21 @@ "responseType": "ListJobTriggersResponse", "options": { "(google.api.http).get": "/v2/{parent=projects/*}/jobTriggers", - "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/locations/*}/jobTriggers", + "(google.api.http).additional_bindings.get": "/v2/{parent=organizations/*/locations/*}/jobTriggers", "(google.api.method_signature)": "parent" }, "parsedOptions": [ { "(google.api.http)": { "get": "/v2/{parent=projects/*}/jobTriggers", - "additional_bindings": { - "get": "/v2/{parent=projects/*/locations/*}/jobTriggers" - } + "additional_bindings": [ + { + "get": "/v2/{parent=projects/*/locations/*}/jobTriggers" + }, + { + "get": "/v2/{parent=organizations/*/locations/*}/jobTriggers" + } + ] } }, { @@ -580,16 +602,21 @@ "responseType": "google.protobuf.Empty", "options": { "(google.api.http).delete": "/v2/{name=projects/*/jobTriggers/*}", - "(google.api.http).additional_bindings.delete": "/v2/{name=projects/*/locations/*/jobTriggers/*}", + "(google.api.http).additional_bindings.delete": "/v2/{name=organizations/*/locations/*/jobTriggers/*}", "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { "delete": "/v2/{name=projects/*/jobTriggers/*}", - "additional_bindings": { - "delete": "/v2/{name=projects/*/locations/*/jobTriggers/*}" - } + "additional_bindings": [ + { + "delete": "/v2/{name=projects/*/locations/*/jobTriggers/*}" + }, + { + "delete": "/v2/{name=organizations/*/locations/*/jobTriggers/*}" + } + ] } }, { @@ -653,16 +680,21 @@ "responseType": "ListDlpJobsResponse", "options": { "(google.api.http).get": "/v2/{parent=projects/*}/dlpJobs", - "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/locations/*}/dlpJobs", + "(google.api.http).additional_bindings.get": "/v2/{parent=organizations/*/locations/*}/dlpJobs", "(google.api.method_signature)": "parent" }, "parsedOptions": [ { "(google.api.http)": { "get": "/v2/{parent=projects/*}/dlpJobs", - "additional_bindings": { - "get": "/v2/{parent=projects/*/locations/*}/dlpJobs" - } + "additional_bindings": [ + { + "get": "/v2/{parent=projects/*/locations/*}/dlpJobs" + }, + { + "get": "/v2/{parent=organizations/*/locations/*}/dlpJobs" + } + ] } }, { @@ -1237,6 +1269,10 @@ "options": { "(google.api.resource_reference).type": "dlp.googleapis.com/DlpJob" } + }, + "findingId": { + "type": "string", + "id": 15 } } }, @@ -2593,7 +2629,8 @@ "timePartConfig", "cryptoHashConfig", "dateShiftConfig", - "cryptoDeterministicConfig" + "cryptoDeterministicConfig", + "replaceDictionaryConfig" ] } }, @@ -2641,6 +2678,10 @@ "cryptoDeterministicConfig": { "type": "CryptoDeterministicConfig", "id": 12 + }, + "replaceDictionaryConfig": { + "type": "ReplaceDictionaryConfig", + "id": 13 } } }, @@ -2697,6 +2738,21 @@ } } }, + "ReplaceDictionaryConfig": { + "oneofs": { + "type": { + "oneof": [ + "wordList" + ] + } + }, + "fields": { + "wordList": { + "type": "CustomInfoType.Dictionary.WordList", + "id": 1 + } + } + }, "ReplaceWithInfoTypeConfig": { "fields": {} }, @@ -3714,6 +3770,10 @@ "type": "string", "id": 5 }, + "type": { + "type": "DlpJobType", + "id": 6 + }, "locationId": { "type": "string", "id": 7 @@ -4416,6 +4476,10 @@ "name": { "type": "string", "id": 1 + }, + "version": { + "type": "string", + "id": 2 } } }, @@ -4759,6 +4823,11 @@ "rule": "repeated", "type": "FieldId", "id": 5 + }, + "includedFields": { + "rule": "repeated", + "type": "FieldId", + "id": 7 } }, "nested": { diff --git a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_dlp_job.js b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_dlp_job.js index f70df421d5f..ad3dc13c9d6 100644 --- a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_dlp_job.js +++ b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.create_dlp_job.js @@ -35,11 +35,12 @@ function main(parent) { */ // const parent = 'abc123' /** - * Set to control what and how to inspect. + * An inspection job scans a storage repository for InfoTypes. */ // const inspectJob = {} /** - * Set to choose what metric to calculate. + * A risk analysis job calculates re-identification risk metrics for a + * BigQuery table. */ // const riskJob = {} /** diff --git a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_job_triggers.js b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_job_triggers.js index ceb30134a77..312f2d92992 100644 --- a/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_job_triggers.js +++ b/packages/google-privacy-dlp/samples/generated/v2/dlp_service.list_job_triggers.js @@ -66,7 +66,7 @@ function main(parent) { * * Restrictions can be combined by `AND` or `OR` logical operators. A * sequence of restrictions implicitly uses `AND`. * * A restriction has the form of `{field} {operator} {value}`. - * * Supported fields/values for inspect jobs: + * * Supported fields/values for inspect triggers: * - `status` - HEALTHY|PAUSED|CANCELLED * - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY * - 'last_run_time` - RFC 3339 formatted timestamp, surrounded by @@ -81,6 +81,10 @@ function main(parent) { * The length of this field should be no more than 500 characters. */ // const filter = 'abc123' + /** + * The type of jobs. Will use `DlpJobType.INSPECT` if not set. + */ + // const type = {} // Imports the Dlp library const {DlpServiceClient} = require('@google-cloud/dlp').v2; diff --git a/packages/google-privacy-dlp/src/v2/dlp_service_client.ts b/packages/google-privacy-dlp/src/v2/dlp_service_client.ts index b70f9d502d8..62ecb43734c 100644 --- a/packages/google-privacy-dlp/src/v2/dlp_service_client.ts +++ b/packages/google-privacy-dlp/src/v2/dlp_service_client.ts @@ -2074,9 +2074,6 @@ export class DlpServiceClient { * Inspect hybrid content and store findings to a trigger. The inspection * will be processed asynchronously. To review the findings monitor the * jobs within the trigger. - * Early access feature is in a pre-release state and might change or have - * limited support. For more information, see - * https://cloud.google.com/products#product-launch-stages. * * @param {Object} request * The request object that will be sent. @@ -2467,9 +2464,10 @@ export class DlpServiceClient { * * parent=projects/example-project/locations/europe-west3 * @param {google.privacy.dlp.v2.InspectJobConfig} request.inspectJob - * Set to control what and how to inspect. + * An inspection job scans a storage repository for InfoTypes. * @param {google.privacy.dlp.v2.RiskAnalysisJobConfig} request.riskJob - * Set to choose what metric to calculate. + * A risk analysis job calculates re-identification risk metrics for a + * BigQuery table. * @param {string} request.jobId * The job id can contain uppercase and lowercase letters, * numbers, and hyphens; that is, it must match the regular @@ -3221,11 +3219,8 @@ export class DlpServiceClient { } /** * Inspect hybrid content and store findings to a job. - * To review the findings inspect the job. Inspection will occur + * To review the findings, inspect the job. Inspection will occur * asynchronously. - * Early access feature is in a pre-release state and might change or have - * limited support. For more information, see - * https://cloud.google.com/products#product-launch-stages. * * @param {Object} request * The request object that will be sent. @@ -3321,9 +3316,6 @@ export class DlpServiceClient { /** * Finish a running hybrid DlpJob. Triggers the finalization steps and running * of any enabled actions that have not yet run. - * Early access feature is in a pre-release state and might change or have - * limited support. For more information, see - * https://cloud.google.com/products#product-launch-stages. * * @param {Object} request * The request object that will be sent. @@ -4067,7 +4059,7 @@ export class DlpServiceClient { * * Restrictions can be combined by `AND` or `OR` logical operators. A * sequence of restrictions implicitly uses `AND`. * * A restriction has the form of `{field} {operator} {value}`. - * * Supported fields/values for inspect jobs: + * * Supported fields/values for inspect triggers: * - `status` - HEALTHY|PAUSED|CANCELLED * - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY * - 'last_run_time` - RFC 3339 formatted timestamp, surrounded by @@ -4083,6 +4075,8 @@ export class DlpServiceClient { * * last_run_time > \"2017-12-12T00:00:00+00:00\" * * The length of this field should be no more than 500 characters. + * @param {google.privacy.dlp.v2.DlpJobType} request.type + * The type of jobs. Will use `DlpJobType.INSPECT` if not set. * @param {string} request.locationId * Deprecated. This field has no effect. * @param {object} [options] @@ -4219,7 +4213,7 @@ export class DlpServiceClient { * * Restrictions can be combined by `AND` or `OR` logical operators. A * sequence of restrictions implicitly uses `AND`. * * A restriction has the form of `{field} {operator} {value}`. - * * Supported fields/values for inspect jobs: + * * Supported fields/values for inspect triggers: * - `status` - HEALTHY|PAUSED|CANCELLED * - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY * - 'last_run_time` - RFC 3339 formatted timestamp, surrounded by @@ -4235,6 +4229,8 @@ export class DlpServiceClient { * * last_run_time > \"2017-12-12T00:00:00+00:00\" * * The length of this field should be no more than 500 characters. + * @param {google.privacy.dlp.v2.DlpJobType} request.type + * The type of jobs. Will use `DlpJobType.INSPECT` if not set. * @param {string} request.locationId * Deprecated. This field has no effect. * @param {object} [options] @@ -4325,7 +4321,7 @@ export class DlpServiceClient { * * Restrictions can be combined by `AND` or `OR` logical operators. A * sequence of restrictions implicitly uses `AND`. * * A restriction has the form of `{field} {operator} {value}`. - * * Supported fields/values for inspect jobs: + * * Supported fields/values for inspect triggers: * - `status` - HEALTHY|PAUSED|CANCELLED * - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY * - 'last_run_time` - RFC 3339 formatted timestamp, surrounded by @@ -4341,6 +4337,8 @@ export class DlpServiceClient { * * last_run_time > \"2017-12-12T00:00:00+00:00\" * * The length of this field should be no more than 500 characters. + * @param {google.privacy.dlp.v2.DlpJobType} request.type + * The type of jobs. Will use `DlpJobType.INSPECT` if not set. * @param {string} request.locationId * Deprecated. This field has no effect. * @param {object} [options]