From 957d095867cb08208ba707e9c547427540b262ec Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Tue, 26 Feb 2019 06:38:52 -0800 Subject: [PATCH] feat: add support for triggers and matching types (#243) --- .../protos/google/privacy/dlp/v2/dlp.proto | 227 +++++++++++------- .../google/privacy/dlp/v2/storage.proto | 102 ++++---- .../src/v2/dlp_service_client.js | 52 ++++ .../v2/doc/google/privacy/dlp/v2/doc_dlp.js | 81 ++++++- .../doc/google/privacy/dlp/v2/doc_storage.js | 32 ++- packages/google-privacy-dlp/synth.metadata | 6 +- 6 files changed, 359 insertions(+), 141 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 e2858d6f652..cdf9d19fc70 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 @@ -280,6 +280,15 @@ service DlpService { }; } + // Activate a job trigger. Causes the immediate execute of a trigger + // instead of waiting on the trigger event to occur. + rpc ActivateJobTrigger(ActivateJobTriggerRequest) returns (DlpJob) { + option (google.api.http) = { + post: "/v2/{name=projects/*/jobTriggers/*}:activate" + body: "*" + }; + } + // Creates a new job to inspect storage or calculate risk metrics. // See https://cloud.google.com/dlp/docs/inspecting-storage and // https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. @@ -432,6 +441,18 @@ message ExclusionRule { MatchingType matching_type = 4; } +// Options describing which parts of the provided content should be scanned. +enum ContentOption { + // Includes entire content of a file or a data stream. + CONTENT_UNSPECIFIED = 0; + + // Text content within the data, excluding any metadata. + CONTENT_TEXT = 1; + + // Images found in the data. + CONTENT_IMAGE = 2; +} + // A single inspection rule to be applied to infoTypes, specified in // `InspectionRuleSet`. message InspectionRule { @@ -474,12 +495,12 @@ message InspectConfig { // Max number of findings that will be returned for each item scanned. // When set within `InspectDataSourceRequest`, - // the maximum returned is 1000 regardless if this is set higher. + // the maximum returned is 2000 regardless if this is set higher. // When set within `InspectContentRequest`, this field is ignored. int32 max_findings_per_item = 1; // Max number of findings that will be returned per request/job. - // When set within `InspectContentRequest`, the maximum returned is 1000 + // When set within `InspectContentRequest`, the maximum returned is 2000 // regardless if this is set higher. int32 max_findings_per_request = 2; @@ -645,6 +666,35 @@ message Location { repeated ContentLocation content_locations = 7; } +// Type of the match which can be applied to different ways of matching, like +// Dictionary, regular expression and intersecting with findings of another +// info type. +enum MatchingType { + // Invalid. + MATCHING_TYPE_UNSPECIFIED = 0; + + // Full match. + // + // - Dictionary: join of Dictionary results matched complete finding quote + // - Regex: all regex matches fill a finding quote start to end + // - Exclude info type: completely inside affecting info types findings + MATCHING_TYPE_FULL_MATCH = 1; + + // Partial match. + // + // - Dictionary: at least one of the tokens in the finding matches + // - Regex: substring of the finding matches + // - Exclude info type: intersects with affecting info types findings + MATCHING_TYPE_PARTIAL_MATCH = 2; + + // Inverse match. + // + // - Dictionary: no tokens in the finding match the dictionary + // - Regex: finding doesn't match the regex + // - Exclude info type: no intersection with affecting info types findings + MATCHING_TYPE_INVERSE_MATCH = 3; +} + // Findings container location data. message ContentLocation { // Name of the container where the finding is located. @@ -1019,6 +1069,10 @@ message InfoTypeDescription { // Which parts of the API supports this InfoType. repeated InfoTypeSupportedBy supported_by = 3; + + // Description of the infotype. Translated when language is provided in the + // request. + string description = 4; } // Request for the list of infoTypes. @@ -1652,9 +1706,10 @@ message TimePartConfig { // Pseudonymization method that generates surrogates via cryptographic hashing. // Uses SHA-256. // The key size must be either 32 or 64 bytes. -// Outputs a 32 byte digest as an uppercase hex string -// (for example, 41D1567F7F99F1DC2A5FAB886DEE5BEE). +// Outputs a base64 encoded representation of the hashed output +// (for example, L7k0BHmF1ha5U3NfGykjro4xWi1MPVQPjhMAZbSV9mM=). // Currently, only string and integer values can be hashed. +// See https://cloud.google.com/dlp/docs/pseudonymization to learn more. message CryptoHashConfig { // The key used by the hash function. CryptoKey crypto_key = 1; @@ -1933,6 +1988,17 @@ message UnwrappedCryptoKey { bytes key = 1; } +// Parts of the APIs which use certain infoTypes. +enum InfoTypeSupportedBy { + ENUM_TYPE_UNSPECIFIED = 0; + + // Supported by the inspect operations. + INSPECT = 1; + + // Supported by the risk analysis operations. + RISK_ANALYSIS = 2; +} + // Include to use an existing data crypto key wrapped by KMS. // Authorization requires the following IAM permissions when sending a request // to perform a crypto transformation using a kms-wrapped crypto key: @@ -2048,7 +2114,8 @@ message RecordSuppression { message RecordCondition { // The field type of `value` and `field` do not need to match to be // considered equal, but not all comparisons are possible. - // + // EQUAL_TO and NOT_EQUAL_TO attempt to compare even with incompatible types, + // but all other comparisons are invalid with incompatible types. // A `value` of type: // // - `string` can be compared against all other types @@ -2135,7 +2202,7 @@ message TransformationSummary { ERROR = 2; } - // Set if the transformation was limited to a specific info_type. + // Set if the transformation was limited to a specific InfoType. InfoType info_type = 1; // Set if the transformation was limited to a specific FieldId. @@ -2340,6 +2407,12 @@ message Action { } + // Enable email notification to project owners and editors on jobs's + // completion/failure. + message JobNotificationEmails { + + } + oneof action { // Save resulting findings in a provided location. SaveFindings save_findings = 1; @@ -2349,6 +2422,10 @@ message Action { // Publish summary to Cloud Security Command Center (Alpha). PublishSummaryToCscc publish_summary_to_cscc = 3; + + // Enable email notification to project owners and editors on job‘s + // completion/failure. + JobNotificationEmails job_notification_emails = 8; } } @@ -2453,6 +2530,13 @@ message CreateJobTriggerRequest { string trigger_id = 3; } +// Request message for ActivateJobTrigger. +message ActivateJobTriggerRequest { + // Resource name of the trigger to activate, for example + // `projects/dlp-test-project/jobTriggers/53234423`. + string name = 1; +} + // Request message for UpdateJobTrigger. message UpdateJobTriggerRequest { // Resource name of the project and the triggeredJob, for example @@ -2518,10 +2602,37 @@ message ListJobTriggersRequest { // // - `create_time`: corresponds to time the JobTrigger was created. // - `update_time`: corresponds to time the JobTrigger was last updated. + // - `last_run_time`: corresponds to the last time the JobTrigger ran. // - `name`: corresponds to JobTrigger's name. // - `display_name`: corresponds to JobTrigger's display name. // - `status`: corresponds to JobTrigger's status. string order_by = 4; + + // Optional. Allows filtering. + // + // Supported syntax: + // + // * Filter expressions are made up of one or more restrictions. + // * Restrictions can be combined by `AND` or `OR` logical operators. A + // sequence of restrictions implicitly uses `AND`. + // * A restriction has the form of ` `. + // * Supported fields/values for inspect jobs: + // - `status` - HEALTHY|PAUSED|CANCELLED + // - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY + // - 'last_run_time` - RFC 3339 formatted timestamp, surrounded by + // quotation marks. Nanoseconds are ignored. + // - 'error_count' - Number of errors that have occurred while running. + // * The operator must be `=` or `!=` for status and inspected_storage. + // + // Examples: + // + // * inspected_storage = cloud_storage AND status = HEALTHY + // * inspected_storage = cloud_storage OR inspected_storage = bigquery + // * inspected_storage = cloud_storage AND (state = PAUSED OR state = HEALTHY) + // * last_run_time > \"2017-12-12T00:00:00+00:00\" + // + // The length of this field should be no more than 500 characters. + string filter = 5; } // Response message for ListJobTriggers. @@ -2619,6 +2730,32 @@ message GetDlpJobRequest { string name = 1; } +// Operators available for comparing the value of fields. +enum RelationalOperator { + RELATIONAL_OPERATOR_UNSPECIFIED = 0; + + // Equal. Attempts to match even with incompatible types. + EQUAL_TO = 1; + + // Not equal to. Attempts to match even with incompatible types. + NOT_EQUAL_TO = 2; + + // Greater than. + GREATER_THAN = 3; + + // Less than. + LESS_THAN = 4; + + // Greater than or equals. + GREATER_THAN_OR_EQUALS = 5; + + // Less than or equals. + LESS_THAN_OR_EQUALS = 6; + + // Exists + EXISTS = 7; +} + // The request message for listing DLP jobs. message ListDlpJobsRequest { // The parent resource name, for example projects/my-project-id. @@ -2949,84 +3086,6 @@ message DeleteStoredInfoTypeRequest { string name = 1; } -// Options describing which parts of the provided content should be scanned. -enum ContentOption { - // Includes entire content of a file or a data stream. - CONTENT_UNSPECIFIED = 0; - - // Text content within the data, excluding any metadata. - CONTENT_TEXT = 1; - - // Images found in the data. - CONTENT_IMAGE = 2; -} - -// Type of the match which can be applied to different ways of matching, like -// Dictionary, regular expression and intersecting with findings of another -// info type. -enum MatchingType { - // Invalid. - MATCHING_TYPE_UNSPECIFIED = 0; - - // Full match. - // - // - Dictionary: join of Dictionary results matched complete finding quote - // - Regex: all regex matches fill a finding quote start to end - // - Exclude info type: completely inside affecting info types findings - MATCHING_TYPE_FULL_MATCH = 1; - - // Partial match. - // - // - Dictionary: at least one of the tokens in the finding matches - // - Regex: substring of the finding matches - // - Exclude info type: intersects with affecting info types findings - MATCHING_TYPE_PARTIAL_MATCH = 2; - - // Inverse match. - // - // - Dictionary: no tokens in the finding match the dictionary - // - Regex: finding doesn't match the regex - // - Exclude info type: no intersection with affecting info types findings - MATCHING_TYPE_INVERSE_MATCH = 3; -} - -// Parts of the APIs which use certain infoTypes. -enum InfoTypeSupportedBy { - ENUM_TYPE_UNSPECIFIED = 0; - - // Supported by the inspect operations. - INSPECT = 1; - - // Supported by the risk analysis operations. - RISK_ANALYSIS = 2; -} - -// Operators available for comparing the value of fields. -enum RelationalOperator { - RELATIONAL_OPERATOR_UNSPECIFIED = 0; - - // Equal. - EQUAL_TO = 1; - - // Not equal to. - NOT_EQUAL_TO = 2; - - // Greater than. - GREATER_THAN = 3; - - // Less than. - LESS_THAN = 4; - - // Greater than or equals. - GREATER_THAN_OR_EQUALS = 5; - - // Less than or equals. - LESS_THAN_OR_EQUALS = 6; - - // Exists - EXISTS = 7; -} - // An enum to represent the various type of DLP jobs. enum DlpJobType { DLP_JOB_TYPE_UNSPECIFIED = 0; 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 e7b540cbb86..9993c25fce9 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 @@ -50,6 +50,26 @@ message StoredType { google.protobuf.Timestamp create_time = 2; } +// Categorization of results based on how likely they are to represent a match, +// based on the number of elements they contain which imply a match. +enum Likelihood { + // Default value; same as POSSIBLE. + LIKELIHOOD_UNSPECIFIED = 0; + + // Few matching elements. + VERY_UNLIKELY = 1; + + UNLIKELY = 2; + + // Some matching elements. + POSSIBLE = 3; + + LIKELY = 4; + + // Many matching elements. + VERY_LIKELY = 5; +} + // Custom information type provided by the user. Used to find domain-specific // sensitive information configurable to the data in question. message CustomInfoType { @@ -101,6 +121,10 @@ message CustomInfoType { // (https://github.com/google/re2/wiki/Syntax) can be found under the // google/re2 repository on GitHub. string pattern = 1; + + // 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; } // Message for detecting output from deidentification transformations @@ -321,8 +345,15 @@ message CloudStorageOptions { // Set of files to scan. message FileSet { // The Cloud Storage url of the file(s) to scan, in the format - // `gs:///`. Trailing wildcard in the path is allowed. Exactly - // one of `url` or `regex_file_set` must be set. + // `gs:///`. 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. string url = 1; // The regex-filtered set of files to scan. Exactly one of `url` or @@ -389,8 +420,8 @@ message CloudStoragePath { // Options defining BigQuery table and row identifiers. message BigQueryOptions { // How to sample rows if not all rows are scanned. Meaningful only when used - // in conjunction with rows_limit. If not specified, scanning would start - // from the top. + // in conjunction with either rows_limit or rows_limit_percent. If not + // specified, scanning would start from the top. enum SampleMethod { SAMPLE_METHOD_UNSPECIFIED = 0; @@ -472,6 +503,28 @@ message StorageConfig { TimespanConfig timespan_config = 6; } +// Definitions of file type groups to scan. +enum FileType { + // Includes all files. + FILE_TYPE_UNSPECIFIED = 0; + + // Includes all file extensions not covered by text file types. + 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. + TEXT_FILE = 2; + + // Included file extensions: + // bmp, gif, jpg, jpeg, jpe, png. + // bytes_limit_per_file has no effect on image files. + IMAGE = 3; +} + // Row key for identifying a record in BigQuery table. message BigQueryKey { // Complete BigQuery table reference. @@ -543,6 +596,10 @@ message RecordKey { BigQueryKey big_query_key = 3; } + + // Values of identifying columns in the given row. Order of values matches + // the order of field identifiers specified in the scanning request. + repeated string id_values = 5; } // Message defining the location of a BigQuery table. A table is uniquely @@ -580,40 +637,3 @@ message EntityId { // Composite key indicating which field contains the entity identifier. FieldId field = 1; } - -// Categorization of results based on how likely they are to represent a match, -// based on the number of elements they contain which imply a match. -enum Likelihood { - // Default value; same as POSSIBLE. - LIKELIHOOD_UNSPECIFIED = 0; - - // Few matching elements. - VERY_UNLIKELY = 1; - - UNLIKELY = 2; - - // Some matching elements. - POSSIBLE = 3; - - LIKELY = 4; - - // Many matching elements. - VERY_LIKELY = 5; -} - -// Definitions of file type groups to scan. -enum FileType { - // Includes all files. - FILE_TYPE_UNSPECIFIED = 0; - - // Includes all file extensions not covered by text file types. - 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. - TEXT_FILE = 2; -} diff --git a/packages/google-privacy-dlp/src/v2/dlp_service_client.js b/packages/google-privacy-dlp/src/v2/dlp_service_client.js index 28052482ca5..0df80832039 100644 --- a/packages/google-privacy-dlp/src/v2/dlp_service_client.js +++ b/packages/google-privacy-dlp/src/v2/dlp_service_client.js @@ -1887,9 +1887,35 @@ class DlpServiceClient { * * - `create_time`: corresponds to time the JobTrigger was created. * - `update_time`: corresponds to time the JobTrigger was last updated. + * - `last_run_time`: corresponds to the last time the JobTrigger ran. * - `name`: corresponds to JobTrigger's name. * - `display_name`: corresponds to JobTrigger's display name. * - `status`: corresponds to JobTrigger's status. + * @param {string} [request.filter] + * Optional. Allows filtering. + * + * Supported syntax: + * + * * Filter expressions are made up of one or more restrictions. + * * Restrictions can be combined by `AND` or `OR` logical operators. A + * sequence of restrictions implicitly uses `AND`. + * * A restriction has the form of ` `. + * * Supported fields/values for inspect jobs: + * - `status` - HEALTHY|PAUSED|CANCELLED + * - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY + * - 'last_run_time` - RFC 3339 formatted timestamp, surrounded by + * quotation marks. Nanoseconds are ignored. + * - 'error_count' - Number of errors that have occurred while running. + * * The operator must be `=` or `!=` for status and inspected_storage. + * + * Examples: + * + * * inspected_storage = cloud_storage AND status = HEALTHY + * * inspected_storage = cloud_storage OR inspected_storage = bigquery + * * inspected_storage = cloud_storage AND (state = PAUSED OR state = HEALTHY) + * * last_run_time > \"2017-12-12T00:00:00+00:00\" + * + * The length of this field should be no more than 500 characters. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. @@ -2006,9 +2032,35 @@ class DlpServiceClient { * * - `create_time`: corresponds to time the JobTrigger was created. * - `update_time`: corresponds to time the JobTrigger was last updated. + * - `last_run_time`: corresponds to the last time the JobTrigger ran. * - `name`: corresponds to JobTrigger's name. * - `display_name`: corresponds to JobTrigger's display name. * - `status`: corresponds to JobTrigger's status. + * @param {string} [request.filter] + * Optional. Allows filtering. + * + * Supported syntax: + * + * * Filter expressions are made up of one or more restrictions. + * * Restrictions can be combined by `AND` or `OR` logical operators. A + * sequence of restrictions implicitly uses `AND`. + * * A restriction has the form of ` `. + * * Supported fields/values for inspect jobs: + * - `status` - HEALTHY|PAUSED|CANCELLED + * - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY + * - 'last_run_time` - RFC 3339 formatted timestamp, surrounded by + * quotation marks. Nanoseconds are ignored. + * - 'error_count' - Number of errors that have occurred while running. + * * The operator must be `=` or `!=` for status and inspected_storage. + * + * Examples: + * + * * inspected_storage = cloud_storage AND status = HEALTHY + * * inspected_storage = cloud_storage OR inspected_storage = bigquery + * * inspected_storage = cloud_storage AND (state = PAUSED OR state = HEALTHY) + * * last_run_time > \"2017-12-12T00:00:00+00:00\" + * + * The length of this field should be no more than 500 characters. * @param {Object} [options] * Optional parameters. You can override the default settings for this call, e.g, timeout, * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the details. diff --git a/packages/google-privacy-dlp/src/v2/doc/google/privacy/dlp/v2/doc_dlp.js b/packages/google-privacy-dlp/src/v2/doc/google/privacy/dlp/v2/doc_dlp.js index 55939fa1e8a..e500ab70078 100644 --- a/packages/google-privacy-dlp/src/v2/doc/google/privacy/dlp/v2/doc_dlp.js +++ b/packages/google-privacy-dlp/src/v2/doc/google/privacy/dlp/v2/doc_dlp.js @@ -182,12 +182,12 @@ const InspectConfig = { * @property {number} maxFindingsPerItem * Max number of findings that will be returned for each item scanned. * When set within `InspectDataSourceRequest`, - * the maximum returned is 1000 regardless if this is set higher. + * the maximum returned is 2000 regardless if this is set higher. * When set within `InspectContentRequest`, this field is ignored. * * @property {number} maxFindingsPerRequest * Max number of findings that will be returned per request/job. - * When set within `InspectContentRequest`, the maximum returned is 1000 + * When set within `InspectContentRequest`, the maximum returned is 2000 * regardless if this is set higher. * * @property {Object[]} maxFindingsPerInfoType @@ -1048,6 +1048,10 @@ const InspectDataSourceDetails = { * * The number should be among the values of [InfoTypeSupportedBy]{@link google.privacy.dlp.v2.InfoTypeSupportedBy} * + * @property {string} description + * Description of the infotype. Translated when language is provided in the + * request. + * * @typedef InfoTypeDescription * @memberof google.privacy.dlp.v2 * @see [google.privacy.dlp.v2.InfoTypeDescription definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} @@ -2129,9 +2133,10 @@ const TimePartConfig = { * Pseudonymization method that generates surrogates via cryptographic hashing. * Uses SHA-256. * The key size must be either 32 or 64 bytes. - * Outputs a 32 byte digest as an uppercase hex string - * (for example, 41D1567F7F99F1DC2A5FAB886DEE5BEE). + * Outputs a base64 encoded representation of the hashed output + * (for example, L7k0BHmF1ha5U3NfGykjro4xWi1MPVQPjhMAZbSV9mM=). * Currently, only string and integer values can be hashed. + * See https://cloud.google.com/dlp/docs/pseudonymization to learn more. * * @property {Object} cryptoKey * The key used by the hash function. @@ -2759,7 +2764,8 @@ const RecordCondition = { /** * The field type of `value` and `field` do not need to match to be * considered equal, but not all comparisons are possible. - * + * EQUAL_TO and NOT_EQUAL_TO attempt to compare even with incompatible types, + * but all other comparisons are invalid with incompatible types. * A `value` of type: * * - `string` can be compared against all other types @@ -2868,7 +2874,7 @@ const TransformationOverview = { * will be set. * * @property {Object} infoType - * Set if the transformation was limited to a specific info_type. + * Set if the transformation was limited to a specific InfoType. * * This object should have the same structure as [InfoType]{@link google.privacy.dlp.v2.InfoType} * @@ -3191,6 +3197,12 @@ const JobTrigger = { * * This object should have the same structure as [PublishSummaryToCscc]{@link google.privacy.dlp.v2.PublishSummaryToCscc} * + * @property {Object} jobNotificationEmails + * Enable email notification to project owners and editors on job‘s + * completion/failure. + * + * This object should have the same structure as [JobNotificationEmails]{@link google.privacy.dlp.v2.JobNotificationEmails} + * * @typedef Action * @memberof google.privacy.dlp.v2 * @see [google.privacy.dlp.v2.Action definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} @@ -3250,6 +3262,17 @@ const Action = { */ PublishSummaryToCscc: { // This is for documentation. Actual contents will be loaded by gRPC. + }, + + /** + * Enable email notification to project owners and editors on jobs's + * completion/failure. + * @typedef JobNotificationEmails + * @memberof google.privacy.dlp.v2 + * @see [google.privacy.dlp.v2.Action.JobNotificationEmails definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} + */ + JobNotificationEmails: { + // This is for documentation. Actual contents will be loaded by gRPC. } }; @@ -3420,6 +3443,21 @@ const CreateJobTriggerRequest = { // This is for documentation. Actual contents will be loaded by gRPC. }; +/** + * Request message for ActivateJobTrigger. + * + * @property {string} name + * Resource name of the trigger to activate, for example + * `projects/dlp-test-project/jobTriggers/53234423`. + * + * @typedef ActivateJobTriggerRequest + * @memberof google.privacy.dlp.v2 + * @see [google.privacy.dlp.v2.ActivateJobTriggerRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} + */ +const ActivateJobTriggerRequest = { + // This is for documentation. Actual contents will be loaded by gRPC. +}; + /** * Request message for UpdateJobTrigger. * @@ -3514,10 +3552,37 @@ const CreateDlpJobRequest = { * * - `create_time`: corresponds to time the JobTrigger was created. * - `update_time`: corresponds to time the JobTrigger was last updated. + * - `last_run_time`: corresponds to the last time the JobTrigger ran. * - `name`: corresponds to JobTrigger's name. * - `display_name`: corresponds to JobTrigger's display name. * - `status`: corresponds to JobTrigger's status. * + * @property {string} filter + * Optional. Allows filtering. + * + * Supported syntax: + * + * * Filter expressions are made up of one or more restrictions. + * * Restrictions can be combined by `AND` or `OR` logical operators. A + * sequence of restrictions implicitly uses `AND`. + * * A restriction has the form of ` `. + * * Supported fields/values for inspect jobs: + * - `status` - HEALTHY|PAUSED|CANCELLED + * - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY + * - 'last_run_time` - RFC 3339 formatted timestamp, surrounded by + * quotation marks. Nanoseconds are ignored. + * - 'error_count' - Number of errors that have occurred while running. + * * The operator must be `=` or `!=` for status and inspected_storage. + * + * Examples: + * + * * inspected_storage = cloud_storage AND status = HEALTHY + * * inspected_storage = cloud_storage OR inspected_storage = bigquery + * * inspected_storage = cloud_storage AND (state = PAUSED OR state = HEALTHY) + * * last_run_time > \"2017-12-12T00:00:00+00:00\" + * + * The length of this field should be no more than 500 characters. + * * @typedef ListJobTriggersRequest * @memberof google.privacy.dlp.v2 * @see [google.privacy.dlp.v2.ListJobTriggersRequest definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/dlp.proto} @@ -4339,12 +4404,12 @@ const RelationalOperator = { RELATIONAL_OPERATOR_UNSPECIFIED: 0, /** - * Equal. + * Equal. Attempts to match even with incompatible types. */ EQUAL_TO: 1, /** - * Not equal to. + * Not equal to. Attempts to match even with incompatible types. */ NOT_EQUAL_TO: 2, diff --git a/packages/google-privacy-dlp/src/v2/doc/google/privacy/dlp/v2/doc_storage.js b/packages/google-privacy-dlp/src/v2/doc/google/privacy/dlp/v2/doc_storage.js index ec69f194e0e..84f00c299de 100644 --- a/packages/google-privacy-dlp/src/v2/doc/google/privacy/dlp/v2/doc_storage.js +++ b/packages/google-privacy-dlp/src/v2/doc/google/privacy/dlp/v2/doc_storage.js @@ -186,6 +186,10 @@ const CustomInfoType = { * (https://github.com/google/re2/wiki/Syntax) can be found under the * google/re2 repository on GitHub. * + * @property {number[]} groupIndexes + * The index of the submatch to extract as findings. When not + * specified, the entire match is returned. No more than 3 may be included. + * * @typedef Regex * @memberof google.privacy.dlp.v2 * @see [google.privacy.dlp.v2.CustomInfoType.Regex definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} @@ -512,8 +516,15 @@ const CloudStorageOptions = { * * @property {string} url * The Cloud Storage url of the file(s) to scan, in the format - * `gs:///`. Trailing wildcard in the path is allowed. Exactly - * one of `url` or `regex_file_set` must be set. + * `gs:///`. 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. * * @property {Object} regexFileSet * The regex-filtered set of files to scan. Exactly one of `url` or @@ -628,8 +639,8 @@ const BigQueryOptions = { /** * How to sample rows if not all rows are scanned. Meaningful only when used - * in conjunction with rows_limit. If not specified, scanning would start - * from the top. + * in conjunction with either rows_limit or rows_limit_percent. If not + * specified, scanning would start from the top. * * @enum {number} * @memberof google.privacy.dlp.v2 @@ -830,6 +841,10 @@ const Key = { * @property {Object} bigQueryKey * This object should have the same structure as [BigQueryKey]{@link google.privacy.dlp.v2.BigQueryKey} * + * @property {string[]} idValues + * Values of identifying columns in the given row. Order of values matches + * the order of field identifiers specified in the scanning request. + * * @typedef RecordKey * @memberof google.privacy.dlp.v2 * @see [google.privacy.dlp.v2.RecordKey definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto} @@ -930,7 +945,14 @@ const FileType = { * rb, rbw, rs, rc, scala, sh, sql, tex, txt, text, tsv, vcard, vcs, wml, * xml, xsl, xsd, yml, yaml. */ - TEXT_FILE: 2 + TEXT_FILE: 2, + + /** + * Included file extensions: + * bmp, gif, jpg, jpeg, jpe, png. + * bytes_limit_per_file has no effect on image files. + */ + IMAGE: 3 }; /** diff --git a/packages/google-privacy-dlp/synth.metadata b/packages/google-privacy-dlp/synth.metadata index 040f99f9357..275caf86bb6 100644 --- a/packages/google-privacy-dlp/synth.metadata +++ b/packages/google-privacy-dlp/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-02-13T12:14:41.166799Z", + "updateTime": "2019-02-20T12:12:56.680743Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "ca61898878f0926dd9dcc68ba90764f17133efe4", - "internalRef": "233680013" + "sha": "96cb68536cdb3c1d95c624ec0d32466cfd5fd882", + "internalRef": "234655328" } }, {