Skip to content

Commit 3c0208a

Browse files
authored
Update synth.py (#112)
* update synth.py * run synth.py to update API (googleapis/googleapis@a4b52a278) and templates
1 parent 0eda336 commit 3c0208a

File tree

7 files changed

+694
-36
lines changed

7 files changed

+694
-36
lines changed

packages/google-privacy-dlp/.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
- image: 'node:6'
6060
user: node
6161
steps: &unit_tests_steps
62-
- checkout
62+
- checkout
6363
- run: &npm_install_and_link
6464
name: Install and link the module
6565
command: |-
@@ -69,7 +69,7 @@ jobs:
6969
NPM_CONFIG_PREFIX: /home/node/.npm-global
7070
- run: npm test
7171
- run: node_modules/.bin/codecov
72-
72+
7373
node8:
7474
docker:
7575
- image: 'node:8'

packages/google-privacy-dlp/CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ may be reported by opening an issue
4040
or contacting one or more of the project maintainers.
4141

4242
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0,
43-
available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)
43+
available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)

packages/google-privacy-dlp/protos/google/privacy/dlp/v2/dlp.proto

Lines changed: 242 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2018 Google Inc.
1+
// Copyright 2018 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -333,6 +333,71 @@ service DlpService {
333333
body: "*"
334334
};
335335
}
336+
337+
// Creates a pre-built stored infoType to be used for inspection.
338+
// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
339+
// learn more.
340+
rpc CreateStoredInfoType(CreateStoredInfoTypeRequest) returns (StoredInfoType) {
341+
option (google.api.http) = {
342+
post: "/v2/{parent=organizations/*}/storedInfoTypes"
343+
body: "*"
344+
additional_bindings {
345+
post: "/v2/{parent=projects/*}/storedInfoTypes"
346+
body: "*"
347+
}
348+
};
349+
}
350+
351+
// Updates the stored infoType by creating a new version. The existing version
352+
// will continue to be used until the new version is ready.
353+
// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
354+
// learn more.
355+
rpc UpdateStoredInfoType(UpdateStoredInfoTypeRequest) returns (StoredInfoType) {
356+
option (google.api.http) = {
357+
patch: "/v2/{name=organizations/*/storedInfoTypes/*}"
358+
body: "*"
359+
additional_bindings {
360+
patch: "/v2/{name=projects/*/storedInfoTypes/*}"
361+
body: "*"
362+
}
363+
};
364+
}
365+
366+
// Gets a stored infoType.
367+
// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
368+
// learn more.
369+
rpc GetStoredInfoType(GetStoredInfoTypeRequest) returns (StoredInfoType) {
370+
option (google.api.http) = {
371+
get: "/v2/{name=organizations/*/storedInfoTypes/*}"
372+
additional_bindings {
373+
get: "/v2/{name=projects/*/storedInfoTypes/*}"
374+
}
375+
};
376+
}
377+
378+
// Lists stored infoTypes.
379+
// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
380+
// learn more.
381+
rpc ListStoredInfoTypes(ListStoredInfoTypesRequest) returns (ListStoredInfoTypesResponse) {
382+
option (google.api.http) = {
383+
get: "/v2/{parent=organizations/*}/storedInfoTypes"
384+
additional_bindings {
385+
get: "/v2/{parent=projects/*}/storedInfoTypes"
386+
}
387+
};
388+
}
389+
390+
// Deletes a stored infoType.
391+
// See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
392+
// learn more.
393+
rpc DeleteStoredInfoType(DeleteStoredInfoTypeRequest) returns (google.protobuf.Empty) {
394+
option (google.api.http) = {
395+
delete: "/v2/{name=organizations/*/storedInfoTypes/*}"
396+
additional_bindings {
397+
delete: "/v2/{name=projects/*/storedInfoTypes/*}"
398+
}
399+
};
400+
}
336401
}
337402

338403
// Configuration description of the scanning process.
@@ -375,6 +440,11 @@ message InspectConfig {
375440
// When no InfoTypes or CustomInfoTypes are specified in a request, the
376441
// system may automatically choose what detectors to run. By default this may
377442
// be all types, but may change over time as detectors are updated.
443+
//
444+
// The special InfoType name "ALL_BASIC" can be used to trigger all detectors,
445+
// but may change over time as new InfoTypes are added. If you need precise
446+
// control and predictability as to what detectors are run you should specify
447+
// specific InfoTypes listed in the reference.
378448
repeated InfoType info_types = 1;
379449

380450
// Only returns findings equal or above this threshold. The default is
@@ -2597,6 +2667,157 @@ message DeleteDeidentifyTemplateRequest {
25972667
string name = 1;
25982668
}
25992669

2670+
// Configuration for a custom dictionary created from a data source of any size
2671+
// up to the maximum size defined in the
2672+
// [limits](https://cloud.google.com/dlp/limits) page. The artifacts of
2673+
// dictionary creation are stored in the specified Google Cloud Storage
2674+
// location. Consider using `CustomInfoType.Dictionary` for smaller dictionaries
2675+
// that satisfy the size requirements.
2676+
message LargeCustomDictionaryConfig {
2677+
// Location to store dictionary artifacts in Google Cloud Storage. These files
2678+
// will only be accessible by project owners and the DLP API. If any of these
2679+
// artifacts are modified, the dictionary is considered invalid and can no
2680+
// longer be used.
2681+
CloudStoragePath output_path = 1;
2682+
2683+
oneof source {
2684+
// Set of files containing newline-delimited lists of dictionary phrases.
2685+
CloudStorageFileSet cloud_storage_file_set = 2;
2686+
2687+
// Field in a BigQuery table where each cell represents a dictionary phrase.
2688+
BigQueryField big_query_field = 3;
2689+
}
2690+
}
2691+
2692+
// Configuration for a StoredInfoType.
2693+
message StoredInfoTypeConfig {
2694+
// Display name of the StoredInfoType (max 256 characters).
2695+
string display_name = 1;
2696+
2697+
// Description of the StoredInfoType (max 256 characters).
2698+
string description = 2;
2699+
2700+
oneof type {
2701+
// StoredInfoType where findings are defined by a dictionary of phrases.
2702+
LargeCustomDictionaryConfig large_custom_dictionary = 3;
2703+
}
2704+
}
2705+
2706+
// Version of a StoredInfoType, including the configuration used to build it,
2707+
// create timestamp, and current state.
2708+
message StoredInfoTypeVersion {
2709+
// StoredInfoType configuration.
2710+
StoredInfoTypeConfig config = 1;
2711+
2712+
// Create timestamp of the version. Read-only, determined by the system
2713+
// when the version is created.
2714+
google.protobuf.Timestamp create_time = 2;
2715+
2716+
// Stored info type version state. Read-only, updated by the system
2717+
// during dictionary creation.
2718+
StoredInfoTypeState state = 3;
2719+
2720+
// Errors that occurred when creating this storedInfoType version, or
2721+
// anomalies detected in the storedInfoType data that render it unusable. Only
2722+
// the five most recent errors will be displayed, with the most recent error
2723+
// appearing first.
2724+
// <p>For example, some of the data for stored custom dictionaries is put in
2725+
// the user's Google Cloud Storage bucket, and if this data is modified or
2726+
// deleted by the user or another system, the dictionary becomes invalid.
2727+
// <p>If any errors occur, fix the problem indicated by the error message and
2728+
// use the UpdateStoredInfoType API method to create another version of the
2729+
// storedInfoType to continue using it, reusing the same `config` if it was
2730+
// not the source of the error.
2731+
repeated Error errors = 4;
2732+
}
2733+
2734+
// StoredInfoType resource message that contains information about the current
2735+
// version and any pending updates.
2736+
message StoredInfoType {
2737+
// Resource name.
2738+
string name = 1;
2739+
2740+
// Current version of the stored info type.
2741+
StoredInfoTypeVersion current_version = 2;
2742+
2743+
// Pending versions of the stored info type. Empty if no versions are
2744+
// pending.
2745+
repeated StoredInfoTypeVersion pending_versions = 3;
2746+
}
2747+
2748+
// Request message for CreateStoredInfoType.
2749+
message CreateStoredInfoTypeRequest {
2750+
// The parent resource name, for example projects/my-project-id or
2751+
// organizations/my-org-id.
2752+
string parent = 1;
2753+
2754+
// Configuration of the storedInfoType to create.
2755+
StoredInfoTypeConfig config = 2;
2756+
2757+
// The storedInfoType ID can contain uppercase and lowercase letters,
2758+
// numbers, and hyphens; that is, it must match the regular
2759+
// expression: `[a-zA-Z\\d-]+`. The maximum length is 100
2760+
// characters. Can be empty to allow the system to generate one.
2761+
string stored_info_type_id = 3;
2762+
}
2763+
2764+
// Request message for UpdateStoredInfoType.
2765+
message UpdateStoredInfoTypeRequest {
2766+
// Resource name of organization and storedInfoType to be updated, for
2767+
// example `organizations/433245324/storedInfoTypes/432452342` or
2768+
// projects/project-id/storedInfoTypes/432452342.
2769+
string name = 1;
2770+
2771+
// Updated configuration for the storedInfoType. If not provided, a new
2772+
// version of the storedInfoType will be created with the existing
2773+
// configuration.
2774+
StoredInfoTypeConfig config = 2;
2775+
2776+
// Mask to control which fields get updated.
2777+
google.protobuf.FieldMask update_mask = 3;
2778+
}
2779+
2780+
// Request message for GetStoredInfoType.
2781+
message GetStoredInfoTypeRequest {
2782+
// Resource name of the organization and storedInfoType to be read, for
2783+
// example `organizations/433245324/storedInfoTypes/432452342` or
2784+
// projects/project-id/storedInfoTypes/432452342.
2785+
string name = 1;
2786+
}
2787+
2788+
// Request message for ListStoredInfoTypes.
2789+
message ListStoredInfoTypesRequest {
2790+
// The parent resource name, for example projects/my-project-id or
2791+
// organizations/my-org-id.
2792+
string parent = 1;
2793+
2794+
// Optional page token to continue retrieval. Comes from previous call
2795+
// to `ListStoredInfoTypes`.
2796+
string page_token = 2;
2797+
2798+
// Optional size of the page, can be limited by server. If zero server returns
2799+
// a page of max size 100.
2800+
int32 page_size = 3;
2801+
}
2802+
2803+
// Response message for ListStoredInfoTypes.
2804+
message ListStoredInfoTypesResponse {
2805+
// List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
2806+
repeated StoredInfoType stored_info_types = 1;
2807+
2808+
// If the next page is available then the next page token to be used
2809+
// in following ListStoredInfoTypes request.
2810+
string next_page_token = 2;
2811+
}
2812+
2813+
// Request message for DeleteStoredInfoType.
2814+
message DeleteStoredInfoTypeRequest {
2815+
// Resource name of the organization and storedInfoType to be deleted, for
2816+
// example `organizations/433245324/storedInfoTypes/432452342` or
2817+
// projects/project-id/storedInfoTypes/432452342.
2818+
string name = 1;
2819+
}
2820+
26002821
// Options describing which parts of the provided content should be scanned.
26012822
enum ContentOption {
26022823
// Includes entire content of a file or a data stream.
@@ -2656,3 +2877,23 @@ enum DlpJobType {
26562877
// The job executed a Risk Analysis computation.
26572878
RISK_ANALYSIS_JOB = 2;
26582879
}
2880+
2881+
// State of a StoredInfoType version.
2882+
enum StoredInfoTypeState {
2883+
STORED_INFO_TYPE_STATE_UNSPECIFIED = 0;
2884+
2885+
// StoredInfoType version is being created.
2886+
PENDING = 1;
2887+
2888+
// StoredInfoType version is ready for use.
2889+
READY = 2;
2890+
2891+
// StoredInfoType creation failed. All relevant error messages are returned in
2892+
// the `StoredInfoTypeVersion` message.
2893+
FAILED = 3;
2894+
2895+
// StoredInfoType is no longer valid because artifacts stored in
2896+
// user-controlled storage were modified. To fix an invalid StoredInfoType,
2897+
// use the `UpdateStoredInfoType` method to create a new version.
2898+
INVALID = 4;
2899+
}

0 commit comments

Comments
 (0)