Skip to content

Commit

Permalink
feat: add synth script and regenerate (#70)
Browse files Browse the repository at this point in the history
JustinBeckwith authored Jun 26, 2018
1 parent 1a382cd commit 613c469
Showing 9 changed files with 1,140 additions and 304 deletions.
489 changes: 330 additions & 159 deletions packages/google-privacy-dlp/package-lock.json

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions packages/google-privacy-dlp/package.json
Original file line number Diff line number Diff line change
@@ -53,13 +53,12 @@
"test": "npm run cover"
},
"dependencies": {
"google-gax": "^0.16.0",
"google-gax": "^0.17.1",
"lodash.merge": "^4.6.0",
"protobufjs": "^6.8.0"
},
"devDependencies": {
"@google-cloud/nodejs-repo-tools": "^2.3.0",
"async": "^2.5.0",
"codecov": "^3.0.0",
"eslint": "^5.0.0",
"eslint-config-prettier": "^2.6.0",
@@ -71,7 +70,6 @@
"mocha": "^5.0.0",
"nyc": "^12.0.2",
"power-assert": "^1.4.4",
"prettier": "^1.7.4",
"through2": "^2.0.3"
"prettier": "^1.7.4"
}
}
315 changes: 270 additions & 45 deletions packages/google-privacy-dlp/protos/google/privacy/dlp/v2/dlp.proto

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -29,7 +29,10 @@ option php_namespace = "Google\\Cloud\\Dlp\\V2";

// Type of information detected by the API.
message InfoType {
// Name of the information type.
// Name of the information type. Either a name of your choosing when
// creating a CustomInfoType, or one of the names listed
// at https://cloud.google.com/dlp/docs/infotypes-reference when specifying
// a built-in type.
string name = 1;
}

@@ -86,13 +89,13 @@ message CustomInfoType {
// 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
// transformation such as `surrogate_info_type`. This custom info type does
// transformation such as `surrogate_info_type`. This CustomInfoType does
// not support the use of `detection_rules`.
message SurrogateType {

}

// Rule for modifying a custom info type to alter behavior under certain
// Rule for modifying a CustomInfoType to alter behavior under certain
// circumstances, depending on the specific details of the rule. Not supported
// for the `surrogate_type` custom info type.
message DetectionRule {
@@ -125,10 +128,10 @@ message CustomInfoType {
}
}

// Detection rule that adjusts the likelihood of findings within a certain
// The rule that adjusts the likelihood of findings within a certain
// proximity of hotwords.
message HotwordRule {
// Regex pattern defining what qualifies as a hotword.
// Regular expression pattern defining what qualifies as a hotword.
Regex hotword_regex = 1;

// Proximity of the finding within which the entire hotword must reside.
@@ -151,29 +154,30 @@ message CustomInfoType {
}
}

// Info type configuration. All custom info types must have configurations
// that do not conflict with built-in info types or other custom info types.
// All CustomInfoTypes must have a name
// that does not conflict with built-in InfoTypes or other CustomInfoTypes.
InfoType info_type = 1;

// Likelihood to return for this custom info type. This base value can be
// Likelihood to return for this CustomInfoType. This base value can be
// altered by a detection rule if the finding meets the criteria specified by
// the rule. Defaults to `VERY_LIKELY` if not specified.
Likelihood likelihood = 6;

oneof type {
// Dictionary-based custom info type.
// A list of phrases to detect as a CustomInfoType.
Dictionary dictionary = 2;

// Regex-based custom info type.
// Regular expression based CustomInfoType.
Regex regex = 3;

// Surrogate info type.
// Message for detecting output from deidentification transformations that
// support reversing.
SurrogateType surrogate_type = 4;
}

// Set of detection rules to apply to all findings of this custom info type.
// Set of detection rules to apply to all findings of this CustomInfoType.
// Rules are applied in order that they are specified. Not supported for the
// `surrogate_type` custom info type.
// `surrogate_type` CustomInfoType.
repeated DetectionRule detection_rules = 7;
}

@@ -223,6 +227,20 @@ message CloudStorageOptions {
string url = 1;
}

// How to sample bytes if not all bytes are scanned. Meaningful only when used
// in conjunction with bytes_limit_per_file. If not specified, scanning would
// start from the top.
enum SampleMethod {
SAMPLE_METHOD_UNSPECIFIED = 0;

// Scan from the top (default).
TOP = 1;

// For each file larger than bytes_limit_per_file, randomly pick the offset
// to start scanning. The scanned bytes are contiguous.
RANDOM_START = 2;
}

FileSet file_set = 1;

// Max number of bytes to scan from a file. If a scanned file's size is bigger
@@ -233,9 +251,16 @@ message CloudStorageOptions {
// If empty, all files are scanned and available data format processors
// are applied.
repeated FileType file_types = 5;

SampleMethod sample_method = 6;

// Limits the number of files to scan to this percentage of the input FileSet.
// Number of files scanned is rounded down. Must be between 0 and 100,
// inclusively. Both 0 and 100 means no limit. Defaults to 0.
int32 files_limit_percent = 7;
}

// Message representing a path in Cloud Storage.
// Message representing a single file or path in Cloud Storage.
message CloudStoragePath {
// A url representing a file or path (no wildcards) in Cloud Storage.
// Example: gs://[BUCKET_NAME]/dictionary.txt
@@ -244,6 +269,19 @@ 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.
enum SampleMethod {
SAMPLE_METHOD_UNSPECIFIED = 0;

// Scan from the top (default).
TOP = 1;

// Randomly pick the row to start scanning. The scanned rows are contiguous.
RANDOM_START = 2;
}

// Complete BigQuery table reference.
BigQueryTable table_reference = 1;

@@ -255,6 +293,8 @@ message BigQueryOptions {
// rest of the rows are omitted. If not set, or if set to 0, all rows will be
// scanned. Cannot be used in conjunction with TimespanConfig.
int64 rows_limit = 3;

SampleMethod sample_method = 4;
}

// Shared message indicating Cloud storage type.
@@ -402,7 +442,7 @@ message EntityId {
// 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; information with all likelihoods is included.
// Default value; same as POSSIBLE.
LIKELIHOOD_UNSPECIFIED = 0;

// Few matching elements.
4 changes: 2 additions & 2 deletions packages/google-privacy-dlp/src/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright 2017, Google LLC All rights reserved.
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
105 changes: 80 additions & 25 deletions packages/google-privacy-dlp/src/v2/dlp_service_client.js
Original file line number Diff line number Diff line change
@@ -29,6 +29,9 @@ const VERSION = require('../../package.json').version;
* The service also includes methods for sensitive data redaction and
* scheduling of data scans on Google Cloud Platform based data sets.
*
* To learn more about concepts and find how-to guides see
* https://cloud.google.com/dlp/docs/.
*
* @class
* @memberof v2
*/
@@ -76,14 +79,14 @@ class DlpServiceClient {
// Create a `gaxGrpc` object, with any grpc-specific options
// sent to the client.
opts.scopes = this.constructor.scopes;
var gaxGrpc = gax.grpc(opts);
var gaxGrpc = new gax.GrpcClient(opts);

// Save the auth object to the client, for use by other methods.
this.auth = gaxGrpc.auth;

// Determine the client header string.
var clientHeader = [
`gl-node/${process.version.node}`,
`gl-node/${process.version}`,
`grpc/${gaxGrpc.grpcVersion}`,
`gax/${gax.version}`,
`gapic/${VERSION}`,
@@ -253,8 +256,13 @@ class DlpServiceClient {
/**
* Finds potentially sensitive info in content.
* This method has limits on input size, processing time, and output size.
* [How-to guide for text](https://cloud.google.com/dlp/docs/inspecting-text), [How-to guide for
* images](https://cloud.google.com/dlp/docs/inspecting-images)
*
* When no InfoTypes or CustomInfoTypes are specified in this request, the
* system will automatically choose what detectors to run. By default this may
* be all types, but may change over time as detectors are updated.
*
* For how to guides, see https://cloud.google.com/dlp/docs/inspecting-images
* and https://cloud.google.com/dlp/docs/inspecting-text,
*
* @param {Object} request
* The request object that will be sent.
@@ -317,7 +325,12 @@ class DlpServiceClient {
/**
* Redacts potentially sensitive info from an image.
* This method has limits on input size, processing time, and output size.
* [How-to guide](https://cloud.google.com/dlp/docs/redacting-sensitive-data-images)
* See https://cloud.google.com/dlp/docs/redacting-sensitive-data-images to
* learn more.
*
* When no InfoTypes or CustomInfoTypes are specified in this request, the
* system will automatically choose what detectors to run. By default this may
* be all types, but may change over time as detectors are updated.
*
* @param {Object} request
* The request object that will be sent.
@@ -331,6 +344,9 @@ class DlpServiceClient {
* The configuration for specifying what content to redact from images.
*
* This object should have the same structure as [ImageRedactionConfig]{@link google.privacy.dlp.v2.ImageRedactionConfig}
* @param {boolean} [request.includeFindings]
* Whether the response should include findings along with the redacted
* image.
* @param {Object} [request.byteItem]
* The content must be PNG, JPEG, SVG or BMP.
*
@@ -377,7 +393,12 @@ class DlpServiceClient {
/**
* De-identifies potentially sensitive info from a ContentItem.
* This method has limits on input size and output size.
* [How-to guide](https://cloud.google.com/dlp/docs/deidentify-sensitive-data)
* See https://cloud.google.com/dlp/docs/deidentify-sensitive-data to
* learn more.
*
* When no InfoTypes or CustomInfoTypes are specified in this request, the
* system will automatically choose what detectors to run. By default this may
* be all types, but may change over time as detectors are updated.
*
* @param {Object} request
* The request object that will be sent.
@@ -452,6 +473,9 @@ class DlpServiceClient {

/**
* Re-identifies content that has been de-identified.
* See
* https://cloud.google.com/dlp/docs/pseudonymization#re-identification_in_free_text_code_example
* to learn more.
*
* @param {Object} request
* The request object that will be sent.
@@ -531,8 +555,8 @@ class DlpServiceClient {

/**
* Returns a list of the sensitive information types that the DLP API
* supports. For more information, see [Listing supported predefined
* infoTypes](https://cloud.google.com/dlp/docs/listing-infotypes).
* supports. See https://cloud.google.com/dlp/docs/infotypes-reference to
* learn more.
*
* @param {Object} request
* The request object that will be sent.
@@ -585,6 +609,7 @@ class DlpServiceClient {
/**
* Creates an InspectTemplate for re-using frequently used configuration
* for inspecting content, images, and storage.
* See https://cloud.google.com/dlp/docs/creating-templates to learn more.
*
* @param {Object} request
* The request object that will be sent.
@@ -645,6 +670,7 @@ class DlpServiceClient {

/**
* Updates the InspectTemplate.
* See https://cloud.google.com/dlp/docs/creating-templates to learn more.
*
* @param {Object} request
* The request object that will be sent.
@@ -705,6 +731,7 @@ class DlpServiceClient {

/**
* Gets an InspectTemplate.
* See https://cloud.google.com/dlp/docs/creating-templates to learn more.
*
* @param {Object} request
* The request object that will be sent.
@@ -753,6 +780,7 @@ class DlpServiceClient {

/**
* Lists InspectTemplates.
* See https://cloud.google.com/dlp/docs/creating-templates to learn more.
*
* @param {Object} request
* The request object that will be sent.
@@ -904,6 +932,7 @@ class DlpServiceClient {

/**
* Deletes an InspectTemplate.
* See https://cloud.google.com/dlp/docs/creating-templates to learn more.
*
* @param {Object} request
* The request object that will be sent.
@@ -949,6 +978,8 @@ class DlpServiceClient {
/**
* Creates a DeidentifyTemplate for re-using frequently used configuration
* for de-identifying content, images, and storage.
* See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
* more.
*
* @param {Object} request
* The request object that will be sent.
@@ -1009,6 +1040,8 @@ class DlpServiceClient {

/**
* Updates the DeidentifyTemplate.
* See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
* more.
*
* @param {Object} request
* The request object that will be sent.
@@ -1069,6 +1102,8 @@ class DlpServiceClient {

/**
* Gets a DeidentifyTemplate.
* See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
* more.
*
* @param {Object} request
* The request object that will be sent.
@@ -1121,6 +1156,8 @@ class DlpServiceClient {

/**
* Lists DeidentifyTemplates.
* See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
* more.
*
* @param {Object} request
* The request object that will be sent.
@@ -1276,6 +1313,8 @@ class DlpServiceClient {

/**
* Deletes a DeidentifyTemplate.
* See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
* more.
*
* @param {Object} request
* The request object that will be sent.
@@ -1320,7 +1359,12 @@ class DlpServiceClient {

/**
* Creates a new job to inspect storage or calculate risk metrics.
* [How-to guide](https://cloud.google.com/dlp/docs/compute-risk-analysis).
* See https://cloud.google.com/dlp/docs/inspecting-storage and
* https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
*
* When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the
* system will automatically choose what detectors to run. By default this may
* be all types, but may change over time as detectors are updated.
*
* @param {Object} request
* The request object that will be sent.
@@ -1376,6 +1420,8 @@ class DlpServiceClient {

/**
* Lists DlpJobs that match the specified filter in the request.
* See https://cloud.google.com/dlp/docs/inspecting-storage and
* https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
*
* @param {Object} request
* The request object that will be sent.
@@ -1581,6 +1627,8 @@ class DlpServiceClient {

/**
* Gets the latest state of a long-running DlpJob.
* See https://cloud.google.com/dlp/docs/inspecting-storage and
* https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
*
* @param {Object} request
* The request object that will be sent.
@@ -1629,6 +1677,8 @@ class DlpServiceClient {
* Deletes a long-running DlpJob. This method indicates that the client is
* no longer interested in the DlpJob result. The job will be cancelled if
* possible.
* See https://cloud.google.com/dlp/docs/inspecting-storage and
* https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
*
* @param {Object} request
* The request object that will be sent.
@@ -1669,6 +1719,8 @@ class DlpServiceClient {
* Starts asynchronous cancellation on a long-running DlpJob. The server
* makes a best effort to cancel the DlpJob, but success is not
* guaranteed.
* See https://cloud.google.com/dlp/docs/inspecting-storage and
* https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
*
* @param {Object} request
* The request object that will be sent.
@@ -1707,11 +1759,12 @@ class DlpServiceClient {

/**
* Lists job triggers.
* See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
* The parent resource name, for example projects/my-project-id.
* The parent resource name, for example `projects/my-project-id`.
* @param {number} [request.pageSize]
* The maximum number of resources contained in the underlying API
* response. If page streaming is performed per-resource, this
@@ -1720,18 +1773,17 @@ class DlpServiceClient {
* resources in a page.
* @param {string} [request.orderBy]
* Optional comma separated list of triggeredJob fields to order by,
* followed by 'asc/desc' postfix, i.e.
* `"create_time asc,name desc,schedule_mode asc"`. This list is
* case-insensitive.
* followed by `asc` or `desc` postfix. This list is case-insensitive,
* default sorting order is ascending, redundant space characters are
* insignificant.
*
* Example: `"name asc,schedule_mode desc, status desc"`
* Example: `name asc,update_time, create_time desc`
*
* Supported filters keys and values are:
* Supported fields are:
*
* - `create_time`: corresponds to time the triggeredJob was created.
* - `update_time`: corresponds to time the triggeredJob was last updated.
* - `name`: corresponds to JobTrigger's display name.
* - `status`: corresponds to the triggeredJob status.
* - `name`: corresponds to JobTrigger's name.
* @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.
@@ -1829,7 +1881,7 @@ class DlpServiceClient {
* @param {Object} request
* The request object that will be sent.
* @param {string} request.parent
* The parent resource name, for example projects/my-project-id.
* The parent resource name, for example `projects/my-project-id`.
* @param {number} [request.pageSize]
* The maximum number of resources contained in the underlying API
* response. If page streaming is performed per-resource, this
@@ -1838,18 +1890,17 @@ class DlpServiceClient {
* resources in a page.
* @param {string} [request.orderBy]
* Optional comma separated list of triggeredJob fields to order by,
* followed by 'asc/desc' postfix, i.e.
* `"create_time asc,name desc,schedule_mode asc"`. This list is
* case-insensitive.
* followed by `asc` or `desc` postfix. This list is case-insensitive,
* default sorting order is ascending, redundant space characters are
* insignificant.
*
* Example: `"name asc,schedule_mode desc, status desc"`
* Example: `name asc,update_time, create_time desc`
*
* Supported filters keys and values are:
* Supported fields are:
*
* - `create_time`: corresponds to time the triggeredJob was created.
* - `update_time`: corresponds to time the triggeredJob was last updated.
* - `name`: corresponds to JobTrigger's display name.
* - `status`: corresponds to the triggeredJob status.
* - `name`: corresponds to JobTrigger's name.
* @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.
@@ -1884,6 +1935,7 @@ class DlpServiceClient {

/**
* Gets a job trigger.
* See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
*
* @param {Object} request
* The request object that will be sent.
@@ -1931,6 +1983,7 @@ class DlpServiceClient {

/**
* Deletes a job trigger.
* See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
*
* @param {Object} request
* The request object that will be sent.
@@ -1970,6 +2023,7 @@ class DlpServiceClient {

/**
* Updates a job trigger.
* See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
*
* @param {Object} request
* The request object that will be sent.
@@ -2026,6 +2080,7 @@ class DlpServiceClient {
/**
* Creates a job trigger to run DLP actions such as scanning storage for
* sensitive information on a set schedule.
* See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
*
* @param {Object} request
* The request object that will be sent.
326 changes: 287 additions & 39 deletions packages/google-privacy-dlp/src/v2/doc/google/privacy/dlp/v2/doc_dlp.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -19,7 +19,10 @@
* Type of information detected by the API.
*
* @property {string} name
* Name of the information type.
* Name of the information type. Either a name of your choosing when
* creating a CustomInfoType, or one of the names listed
* at https://cloud.google.com/dlp/docs/infotypes-reference when specifying
* a built-in type.
*
* @typedef InfoType
* @memberof google.privacy.dlp.v2
@@ -34,37 +37,38 @@ var InfoType = {
* sensitive information configurable to the data in question.
*
* @property {Object} infoType
* Info type configuration. All custom info types must have configurations
* that do not conflict with built-in info types or other custom info types.
* All CustomInfoTypes must have a name
* that does not conflict with built-in InfoTypes or other CustomInfoTypes.
*
* This object should have the same structure as [InfoType]{@link google.privacy.dlp.v2.InfoType}
*
* @property {number} likelihood
* Likelihood to return for this custom info type. This base value can be
* Likelihood to return for this CustomInfoType. This base value can be
* altered by a detection rule if the finding meets the criteria specified by
* the rule. Defaults to `VERY_LIKELY` if not specified.
*
* The number should be among the values of [Likelihood]{@link google.privacy.dlp.v2.Likelihood}
*
* @property {Object} dictionary
* Dictionary-based custom info type.
* A list of phrases to detect as a CustomInfoType.
*
* This object should have the same structure as [Dictionary]{@link google.privacy.dlp.v2.Dictionary}
*
* @property {Object} regex
* Regex-based custom info type.
* Regular expression based CustomInfoType.
*
* This object should have the same structure as [Regex]{@link google.privacy.dlp.v2.Regex}
*
* @property {Object} surrogateType
* Surrogate info type.
* Message for detecting output from deidentification transformations that
* support reversing.
*
* This object should have the same structure as [SurrogateType]{@link google.privacy.dlp.v2.SurrogateType}
*
* @property {Object[]} detectionRules
* Set of detection rules to apply to all findings of this custom info type.
* Set of detection rules to apply to all findings of this CustomInfoType.
* Rules are applied in order that they are specified. Not supported for the
* `surrogate_type` custom info type.
* `surrogate_type` CustomInfoType.
*
* This object should have the same structure as [DetectionRule]{@link google.privacy.dlp.v2.DetectionRule}
*
@@ -152,7 +156,7 @@ var CustomInfoType = {
* 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
* transformation such as `surrogate_info_type`. This custom info type does
* transformation such as `surrogate_info_type`. This CustomInfoType does
* not support the use of `detection_rules`.
* @typedef SurrogateType
* @memberof google.privacy.dlp.v2
@@ -163,7 +167,7 @@ var CustomInfoType = {
},

/**
* Rule for modifying a custom info type to alter behavior under certain
* Rule for modifying a CustomInfoType to alter behavior under certain
* circumstances, depending on the specific details of the rule. Not supported
* for the `surrogate_type` custom info type.
*
@@ -225,11 +229,11 @@ var CustomInfoType = {
},

/**
* Detection rule that adjusts the likelihood of findings within a certain
* The rule that adjusts the likelihood of findings within a certain
* proximity of hotwords.
*
* @property {Object} hotwordRegex
* Regex pattern defining what qualifies as a hotword.
* Regular expression pattern defining what qualifies as a hotword.
*
* This object should have the same structure as [Regex]{@link google.privacy.dlp.v2.Regex}
*
@@ -350,6 +354,14 @@ var DatastoreOptions = {
*
* The number should be among the values of [FileType]{@link google.privacy.dlp.v2.FileType}
*
* @property {number} sampleMethod
* The number should be among the values of [SampleMethod]{@link google.privacy.dlp.v2.SampleMethod}
*
* @property {number} filesLimitPercent
* Limits the number of files to scan to this percentage of the input FileSet.
* Number of files scanned is rounded down. Must be between 0 and 100,
* inclusively. Both 0 and 100 means no limit. Defaults to 0.
*
* @typedef CloudStorageOptions
* @memberof google.privacy.dlp.v2
* @see [google.privacy.dlp.v2.CloudStorageOptions definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto}
@@ -370,11 +382,34 @@ var CloudStorageOptions = {
*/
FileSet: {
// This is for documentation. Actual contents will be loaded by gRPC.
},

/**
* How to sample bytes if not all bytes are scanned. Meaningful only when used
* in conjunction with bytes_limit_per_file. If not specified, scanning would
* start from the top.
*
* @enum {number}
* @memberof google.privacy.dlp.v2
*/
SampleMethod: {
SAMPLE_METHOD_UNSPECIFIED: 0,

/**
* Scan from the top (default).
*/
TOP: 1,

/**
* For each file larger than bytes_limit_per_file, randomly pick the offset
* to start scanning. The scanned bytes are contiguous.
*/
RANDOM_START: 2
}
};

/**
* Message representing a path in Cloud Storage.
* Message representing a single file or path in Cloud Storage.
*
* @property {string} path
* A url representing a file or path (no wildcards) in Cloud Storage.
@@ -407,12 +442,37 @@ var CloudStoragePath = {
* rest of the rows are omitted. If not set, or if set to 0, all rows will be
* scanned. Cannot be used in conjunction with TimespanConfig.
*
* @property {number} sampleMethod
* The number should be among the values of [SampleMethod]{@link google.privacy.dlp.v2.SampleMethod}
*
* @typedef BigQueryOptions
* @memberof google.privacy.dlp.v2
* @see [google.privacy.dlp.v2.BigQueryOptions definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/privacy/dlp/v2/storage.proto}
*/
var BigQueryOptions = {
// This is for documentation. Actual contents will be loaded by gRPC.

/**
* 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.
*
* @enum {number}
* @memberof google.privacy.dlp.v2
*/
SampleMethod: {
SAMPLE_METHOD_UNSPECIFIED: 0,

/**
* Scan from the top (default).
*/
TOP: 1,

/**
* Randomly pick the row to start scanning. The scanned rows are contiguous.
*/
RANDOM_START: 2
}
};

/**
@@ -657,7 +717,7 @@ var EntityId = {
var Likelihood = {

/**
* Default value; information with all likelihoods is included.
* Default value; same as POSSIBLE.
*/
LIKELIHOOD_UNSPECIFIED: 0,

39 changes: 39 additions & 0 deletions packages/google-privacy-dlp/synth.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""This script is used to synthesize generated parts of this library."""

import synthtool as s
import synthtool.gcp as gcp
import subprocess

gapic = gcp.GAPICGenerator()

version = 'v2'
library = gapic.node_library('dlp', version,
config_path='/google/privacy/dlp/artman_dlp_v2.yaml'
)
s.copy(library,
excludes=['README.md', 'package.json']
)

'''
Node.js specific cleanup
'''
# Repo Cleanup/Setup
subprocess.run(['npm', 'install'])

# prettify and lint
subprocess.run(['npm', 'run', 'prettier'])
subprocess.run(['npm', 'run', 'lint'])

0 comments on commit 613c469

Please sign in to comment.