Skip to content

Commit

Permalink
feat: regenerated GAPIC v2 code (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-fenster authored Mar 30, 2018
1 parent 4fa73bd commit e041ba0
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 30 deletions.
31 changes: 17 additions & 14 deletions packages/google-privacy-dlp/protos/google/privacy/dlp/v2/dlp.proto
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ option java_package = "com.google.privacy.dlp.v2";
option php_namespace = "Google\\Cloud\\Dlp\\V2";


// The DLP API is a service that allows clients
// The Cloud Data Loss Prevention (DLP) API is a service that allows clients
// to detect the presence of Personally Identifiable Information (PII) and other
// privacy-sensitive data in user-supplied, unstructured data streams, like text
// blocks or images.
Expand Down Expand Up @@ -73,15 +73,17 @@ service DlpService {
};
}

// Re-identify content that has been de-identified.
// Re-identifies content that has been de-identified.
rpc ReidentifyContent(ReidentifyContentRequest) returns (ReidentifyContentResponse) {
option (google.api.http) = {
post: "/v2/{parent=projects/*}/content:reidentify"
body: "*"
};
}

// Returns sensitive information types DLP supports.
// Returns a list of the sensitive information types that the DLP API
// supports. For more information, see [Listing supported predefined
// infoTypes](/dlp/docs/listing-infotypes).
rpc ListInfoTypes(ListInfoTypesRequest) returns (ListInfoTypesResponse) {
option (google.api.http) = {
get: "/v2/infoTypes"
Expand Down Expand Up @@ -133,7 +135,7 @@ service DlpService {
};
}

// Deletes inspect templates.
// Deletes an inspect template.
rpc DeleteInspectTemplate(DeleteInspectTemplateRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v2/{name=organizations/*/inspectTemplates/*}"
Expand All @@ -143,7 +145,7 @@ service DlpService {
};
}

// Creates an Deidentify template for re-using frequently used configuration
// Creates a de-identify template for re-using frequently used configuration
// for Deidentifying content, images, and storage.
rpc CreateDeidentifyTemplate(CreateDeidentifyTemplateRequest) returns (DeidentifyTemplate) {
option (google.api.http) = {
Expand All @@ -156,7 +158,7 @@ service DlpService {
};
}

// Updates the inspect template.
// Updates the de-identify template.
rpc UpdateDeidentifyTemplate(UpdateDeidentifyTemplateRequest) returns (DeidentifyTemplate) {
option (google.api.http) = {
patch: "/v2/{name=organizations/*/deidentifyTemplates/*}"
Expand All @@ -168,7 +170,7 @@ service DlpService {
};
}

// Gets an inspect template.
// Gets a de-identify template.
rpc GetDeidentifyTemplate(GetDeidentifyTemplateRequest) returns (DeidentifyTemplate) {
option (google.api.http) = {
get: "/v2/{name=organizations/*/deidentifyTemplates/*}"
Expand All @@ -178,7 +180,7 @@ service DlpService {
};
}

// Lists inspect templates.
// Lists de-identify templates.
rpc ListDeidentifyTemplates(ListDeidentifyTemplatesRequest) returns (ListDeidentifyTemplatesResponse) {
option (google.api.http) = {
get: "/v2/{parent=organizations/*}/deidentifyTemplates"
Expand All @@ -188,7 +190,7 @@ service DlpService {
};
}

// Deletes inspect templates.
// Deletes a de-identify template.
rpc DeleteDeidentifyTemplate(DeleteDeidentifyTemplateRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v2/{name=organizations/*/deidentifyTemplates/*}"
Expand All @@ -198,8 +200,8 @@ service DlpService {
};
}

// Creates a job to run DLP actions such as scanning storage for sensitive
// information on a set schedule.
// Creates a job trigger to run DLP actions such as scanning storage for
// sensitive information on a set schedule.
rpc CreateJobTrigger(CreateJobTriggerRequest) returns (JobTrigger) {
option (google.api.http) = {
post: "/v2/{parent=projects/*}/jobTriggers"
Expand Down Expand Up @@ -236,7 +238,7 @@ service DlpService {
};
}

// Create a new job to inspect storage or calculate risk metrics [How-to
// Creates a new job to inspect storage or calculate risk metrics [How-to
// guide](/dlp/docs/compute-risk-analysis).
rpc CreateDlpJob(CreateDlpJobRequest) returns (DlpJob) {
option (google.api.http) = {
Expand Down Expand Up @@ -268,7 +270,7 @@ service DlpService {
};
}

// Starts asynchronous cancellation on a long-running DlpJob. The server
// Starts asynchronous cancellation on a long-running DlpJob. The server
// makes a best effort to cancel the DlpJob, but success is not
// guaranteed.
rpc CancelDlpJob(CancelDlpJobRequest) returns (google.protobuf.Empty) {
Expand Down Expand Up @@ -314,7 +316,6 @@ message InspectConfig {

// Restricts what info_types to look for. The values must correspond to
// InfoType values returned by ListInfoTypes or found in documentation.
// Empty info_types runs all enabled detectors.
repeated InfoType info_types = 1;

// Only returns findings equal or above this threshold. The default is
Expand Down Expand Up @@ -343,6 +344,8 @@ message ByteContentItem {
enum BytesType {
BYTES_TYPE_UNSPECIFIED = 0;

IMAGE = 6;

IMAGE_JPEG = 1;

IMAGE_BMP = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ message CustomInfoType {

// Message for detecting output from deidentification transformations
// such as
// [`CryptoReplaceFfxFpeConfig`](/dlp/docs/reference/rest/v2/content/deidentify#CryptoReplaceFfxFpeConfig).
// [`CryptoReplaceFfxFpeConfig`](/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
Expand Down Expand Up @@ -224,6 +224,11 @@ 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.
int64 bytes_limit_per_file = 4;

// List of file type groups to include in the scan.
// If empty, all files are scanned and available data format processors
// are applied.
repeated FileType file_types = 5;
}

// Options defining BigQuery table and row identifiers.
Expand Down Expand Up @@ -387,3 +392,20 @@ enum Likelihood {
// 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 other types.
BINARY_FILE = 1;

// Included file extensions:
// c, cc, cpp, 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, asc, text, brf, vcard, vcs, wml, xml, xsl, xsd,
// yml, yaml.
TEXT_FILE = 2;
}
28 changes: 15 additions & 13 deletions packages/google-privacy-dlp/src/v2/dlp_service_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const path = require('path');
const VERSION = require('../../package.json').version;

/**
* The DLP API is a service that allows clients
* The Cloud Data Loss Prevention (DLP) API is a service that allows clients
* to detect the presence of Personally Identifiable Information (PII) and other
* privacy-sensitive data in user-supplied, unstructured data streams, like text
* blocks or images.
Expand Down Expand Up @@ -451,7 +451,7 @@ class DlpServiceClient {
}

/**
* Re-identify content that has been de-identified.
* Re-identifies content that has been de-identified.
*
* @param {Object} request
* The request object that will be sent.
Expand Down Expand Up @@ -530,7 +530,9 @@ class DlpServiceClient {
}

/**
* Returns sensitive information types DLP supports.
* 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).
*
* @param {Object} request
* The request object that will be sent.
Expand Down Expand Up @@ -901,7 +903,7 @@ class DlpServiceClient {
}

/**
* Deletes inspect templates.
* Deletes an inspect template.
*
* @param {Object} request
* The request object that will be sent.
Expand Down Expand Up @@ -945,7 +947,7 @@ class DlpServiceClient {
}

/**
* Creates an Deidentify template for re-using frequently used configuration
* Creates a de-identify template for re-using frequently used configuration
* for Deidentifying content, images, and storage.
*
* @param {Object} request
Expand Down Expand Up @@ -1006,7 +1008,7 @@ class DlpServiceClient {
}

/**
* Updates the inspect template.
* Updates the de-identify template.
*
* @param {Object} request
* The request object that will be sent.
Expand Down Expand Up @@ -1066,7 +1068,7 @@ class DlpServiceClient {
}

/**
* Gets an inspect template.
* Gets a de-identify template.
*
* @param {Object} request
* The request object that will be sent.
Expand Down Expand Up @@ -1118,7 +1120,7 @@ class DlpServiceClient {
}

/**
* Lists inspect templates.
* Lists de-identify templates.
*
* @param {Object} request
* The request object that will be sent.
Expand Down Expand Up @@ -1273,7 +1275,7 @@ class DlpServiceClient {
}

/**
* Deletes inspect templates.
* Deletes a de-identify template.
*
* @param {Object} request
* The request object that will be sent.
Expand Down Expand Up @@ -1317,7 +1319,7 @@ class DlpServiceClient {
}

/**
* Create a new job to inspect storage or calculate risk metrics [How-to
* Creates a new job to inspect storage or calculate risk metrics [How-to
* guide](https://cloud.google.com/dlp/docs/compute-risk-analysis).
*
* @param {Object} request
Expand Down Expand Up @@ -1664,7 +1666,7 @@ class DlpServiceClient {
}

/**
* Starts asynchronous cancellation on a long-running DlpJob. The server
* Starts asynchronous cancellation on a long-running DlpJob. The server
* makes a best effort to cancel the DlpJob, but success is not
* guaranteed.
*
Expand Down Expand Up @@ -2022,8 +2024,8 @@ class DlpServiceClient {
}

/**
* Creates a job to run DLP actions such as scanning storage for sensitive
* information on a set schedule.
* Creates a job trigger to run DLP actions such as scanning storage for
* sensitive information on a set schedule.
*
* @param {Object} request
* The request object that will be sent.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
* @property {Object[]} infoTypes
* Restricts what info_types to look for. The values must correspond to
* InfoType values returned by ListInfoTypes or found in documentation.
* Empty info_types runs all enabled detectors.
*
* This object should have the same structure as [InfoType]{@link google.privacy.dlp.v2.InfoType}
*
Expand Down Expand Up @@ -134,6 +133,7 @@ var ByteContentItem = {
*/
BytesType: {
BYTES_TYPE_UNSPECIFIED: 0,
IMAGE: 6,
IMAGE_JPEG: 1,
IMAGE_BMP: 2,
IMAGE_PNG: 3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ var CustomInfoType = {
/**
* Message for detecting output from deidentification transformations
* such as
* [`CryptoReplaceFfxFpeConfig`](https://cloud.google.com/dlp/docs/reference/rest/v2/content/deidentify#CryptoReplaceFfxFpeConfig).
* [`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
Expand Down Expand Up @@ -337,6 +337,13 @@ var DatastoreOptions = {
* 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.
*
* @property {number[]} fileTypes
* List of file type groups to include in the scan.
* If empty, all files are scanned and available data format processors
* are applied.
*
* The number should be among the values of [FileType]{@link google.privacy.dlp.v2.FileType}
*
* @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}
Expand Down Expand Up @@ -624,4 +631,33 @@ var Likelihood = {
* Many matching elements.
*/
VERY_LIKELY: 5
};

/**
* Definitions of file type groups to scan.
*
* @enum {number}
* @memberof google.privacy.dlp.v2
*/
var FileType = {

/**
* Includes all files.
*/
FILE_TYPE_UNSPECIFIED: 0,

/**
* Includes all file extensions not covered by other types.
*/
BINARY_FILE: 1,

/**
* Included file extensions:
* c, cc, cpp, 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, asc, text, brf, vcard, vcs, wml, xml, xsl, xsd,
* yml, yaml.
*/
TEXT_FILE: 2
};

0 comments on commit e041ba0

Please sign in to comment.