Skip to content

Commit c087f09

Browse files
author
Jon Wayne Parrott
authored
Re-generate DLP (googleapis#5131)
* Regenerate DLP v2 Command log: ``` set DEST ~/workspace/google-cloud-python/dlp cd /tmp git clone git@github.com:googleapis/googleapis.git cd googleapis artman --root (pwd) --config google/privacy/dlp/artman_dlp_v2.yaml generate python_gapic set SRC ./artman-genfiles/python/dlp-v2 set IMPORT_PKG dlp_v2 cp -r $SRC/docs $DEST cp -r $SRC/google/cloud/$IMPORT_PKG $DEST/google/cloud/ mkdir -p $DEST/tests/unit/gapic cp -r $SRC/tests/unit/gapic $DEST/tests/unit ``` * Manually fix protos * Manually fix docs * Add coding
1 parent d44dc25 commit c087f09

File tree

8 files changed

+1074
-1724
lines changed

8 files changed

+1074
-1724
lines changed

dlp/docs/gapic/v2/api.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Client for DLP API
2-
==================
1+
Client for Cloud Data Loss Prevention (DLP) API
2+
===============================================
33

44
.. automodule:: google.cloud.dlp_v2
55
:members:

dlp/docs/gapic/v2/types.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Types for DLP API Client
2-
========================
1+
Types for Cloud Data Loss Prevention (DLP) API Client
2+
=====================================================
33

44
.. automodule:: google.cloud.dlp_v2.types
55
:members:

dlp/docs/index.rst

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
Python Client for DLP API (`Alpha`_)
2-
====================================
1+
Python Client for Cloud Data Loss Prevention (DLP) API (`Alpha`_)
2+
=================================================================
33

4-
`DLP API`_:
4+
`Cloud Data Loss Prevention (DLP) API`_: Provides methods for detection of privacy-sensitive fragments in text,
5+
images, and Google Cloud Platform storage repositories.
56

67
- `Client Library Documentation`_
78
- `Product Documentation`_
89

910
.. _Alpha: https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/README.rst
10-
.. _DLP API: https://cloud.google.com/dlp
11+
.. _Cloud Data Loss Prevention (DLP) API: https://cloud.google.com/dlp
1112
.. _Client Library Documentation: https://googlecloudplatform.github.io/google-cloud-python/stable/dlp/usage.html
1213
.. _Product Documentation: https://cloud.google.com/dlp
1314

@@ -18,12 +19,12 @@ In order to use this library, you first need to go through the following steps:
1819

1920
1. `Select or create a Cloud Platform project.`_
2021
2. `Enable billing for your project.`_
21-
3. `Enable the DLP API.`_
22+
3. `Enable the Cloud Data Loss Prevention (DLP) API.`_
2223
4. `Setup Authentication.`_
2324

2425
.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project
2526
.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project
26-
.. _Enable the DLP API.: https://cloud.google.com/dlp
27+
.. _Enable the Cloud Data Loss Prevention (DLP) API.: https://cloud.google.com/dlp
2728
.. _Setup Authentication.: https://googlecloudplatform.github.io/google-cloud-python/stable/core/auth.html
2829

2930
Installation
@@ -64,14 +65,14 @@ Windows
6465
Next Steps
6566
~~~~~~~~~~
6667

67-
- Read the `Client Library Documentation`_ for DLP API
68+
- Read the `Client Library Documentation`_ for Cloud Data Loss Prevention (DLP) API
6869
API to see other available methods on the client.
69-
- Read the `DLP API Product documentation`_ to learn
70+
- Read the `Cloud Data Loss Prevention (DLP) API Product documentation`_ to learn
7071
more about the product and see How-to Guides.
7172
- View this `repository’s main README`_ to see the full list of Cloud
7273
APIs that we cover.
7374

74-
.. _DLP API Product documentation: https://cloud.google.com/dlp
75+
.. _Cloud Data Loss Prevention (DLP) API Product documentation: https://cloud.google.com/dlp
7576
.. _repository’s main README: https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/README.rst
7677

7778
Api Reference

dlp/google/cloud/dlp_v2/gapic/dlp_service_client.py

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from google.cloud.dlp_v2.gapic import dlp_service_client_config
2828
from google.cloud.dlp_v2.gapic import enums
2929
from google.cloud.dlp_v2.proto import dlp_pb2
30+
from google.cloud.dlp_v2.proto import dlp_pb2_grpc
3031
from google.protobuf import empty_pb2
3132
from google.protobuf import field_mask_pb2
3233

@@ -36,7 +37,7 @@
3637

3738
class DlpServiceClient(object):
3839
"""
39-
The DLP API is a service that allows clients
40+
The Cloud Data Loss Prevention (DLP) API is a service that allows clients
4041
to detect the presence of Personally Identifiable Information (PII) and other
4142
privacy-sensitive data in user-supplied, unstructured data streams, like text
4243
blocks or images.
@@ -167,7 +168,7 @@ def __init__(self,
167168
)
168169

169170
# Create the gRPC stubs.
170-
self.dlp_service_stub = (dlp_pb2.DlpServiceStub(channel))
171+
self.dlp_service_stub = (dlp_pb2_grpc.DlpServiceStub(channel))
171172

172173
if client_info is None:
173174
client_info = (
@@ -562,7 +563,7 @@ def reidentify_content(self,
562563
timeout=google.api_core.gapic_v1.method.DEFAULT,
563564
metadata=None):
564565
"""
565-
Re-identify content that has been de-identified.
566+
Re-identifies content that has been de-identified.
566567
567568
Example:
568569
>>> from google.cloud import dlp_v2
@@ -583,7 +584,7 @@ def reidentify_content(self,
583584
reverse. This requires that only reversible transformations
584585
be provided here. The reversible transformations are::
585586
586-
- ``CryptoReplaceFfxFpeConfig``
587+
- ``CryptoReplaceFfxFpeConfig``
587588
588589
If a dict is provided, it must be of the same form as the protobuf
589590
message :class:`~google.cloud.dlp_v2.types.DeidentifyConfig`
@@ -644,7 +645,9 @@ def list_info_types(self,
644645
timeout=google.api_core.gapic_v1.method.DEFAULT,
645646
metadata=None):
646647
"""
647-
Returns sensitive information types DLP supports.
648+
Returns a list of the sensitive information types that the DLP API
649+
supports. For more information, see [Listing supported predefined
650+
infoTypes](/dlp/docs/listing-infotypes).
648651
649652
Example:
650653
>>> from google.cloud import dlp_v2
@@ -940,7 +943,7 @@ def delete_inspect_template(
940943
timeout=google.api_core.gapic_v1.method.DEFAULT,
941944
metadata=None):
942945
"""
943-
Deletes inspect templates.
946+
Deletes an inspect template.
944947
945948
Example:
946949
>>> from google.cloud import dlp_v2
@@ -987,7 +990,7 @@ def create_deidentify_template(
987990
timeout=google.api_core.gapic_v1.method.DEFAULT,
988991
metadata=None):
989992
"""
990-
Creates an Deidentify template for re-using frequently used configuration
993+
Creates a de-identify template for re-using frequently used configuration
991994
for Deidentifying content, images, and storage.
992995
993996
Example:
@@ -1048,7 +1051,7 @@ def update_deidentify_template(
10481051
timeout=google.api_core.gapic_v1.method.DEFAULT,
10491052
metadata=None):
10501053
"""
1051-
Updates the inspect template.
1054+
Updates the de-identify template.
10521055
10531056
Example:
10541057
>>> from google.cloud import dlp_v2
@@ -1106,7 +1109,7 @@ def get_deidentify_template(
11061109
timeout=google.api_core.gapic_v1.method.DEFAULT,
11071110
metadata=None):
11081111
"""
1109-
Gets an inspect template.
1112+
Gets a de-identify template.
11101113
11111114
Example:
11121115
>>> from google.cloud import dlp_v2
@@ -1155,7 +1158,7 @@ def list_deidentify_templates(
11551158
timeout=google.api_core.gapic_v1.method.DEFAULT,
11561159
metadata=None):
11571160
"""
1158-
Lists inspect templates.
1161+
Lists de-identify templates.
11591162
11601163
Example:
11611164
>>> from google.cloud import dlp_v2
@@ -1234,7 +1237,7 @@ def delete_deidentify_template(
12341237
timeout=google.api_core.gapic_v1.method.DEFAULT,
12351238
metadata=None):
12361239
"""
1237-
Deletes inspect templates.
1240+
Deletes a de-identify template.
12381241
12391242
Example:
12401243
>>> from google.cloud import dlp_v2
@@ -1281,7 +1284,7 @@ def create_dlp_job(self,
12811284
timeout=google.api_core.gapic_v1.method.DEFAULT,
12821285
metadata=None):
12831286
"""
1284-
Create a new job to inspect storage or calculate risk metrics [How-to
1287+
Creates a new job to inspect storage or calculate risk metrics [How-to
12851288
guide](/dlp/docs/compute-risk-analysis).
12861289
12871290
Example:
@@ -1546,7 +1549,7 @@ def cancel_dlp_job(self,
15461549
timeout=google.api_core.gapic_v1.method.DEFAULT,
15471550
metadata=None):
15481551
"""
1549-
Starts asynchronous cancellation on a long-running DlpJob. The server
1552+
Starts asynchronous cancellation on a long-running DlpJob. The server
15501553
makes a best effort to cancel the DlpJob, but success is not
15511554
guaranteed.
15521555
@@ -1833,8 +1836,8 @@ def create_job_trigger(self,
18331836
timeout=google.api_core.gapic_v1.method.DEFAULT,
18341837
metadata=None):
18351838
"""
1836-
Creates a job to run DLP actions such as scanning storage for sensitive
1837-
information on a set schedule.
1839+
Creates a job trigger to run DLP actions such as scanning storage for
1840+
sensitive information on a set schedule.
18381841
18391842
Example:
18401843
>>> from google.cloud import dlp_v2

dlp/google/cloud/dlp_v2/gapic/enums.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,25 @@ class Likelihood(object):
3535
VERY_LIKELY = 5
3636

3737

38+
class FileType(object):
39+
"""
40+
Definitions of file type groups to scan.
41+
42+
Attributes:
43+
FILE_TYPE_UNSPECIFIED (int): Includes all files.
44+
BINARY_FILE (int): Includes all file extensions not covered by other types.
45+
TEXT_FILE (int): Included file extensions:
46+
c, cc, cpp, cxx, c++, cs, css, dart, eml, go, h, hh, hpp, hxx, h++, hs,
47+
html, htm, shtml, shtm, xhtml, lhs, ini, java, js, json, ocaml, md, mkd,
48+
markdown, m, ml, mli, pl, pm, php, phtml, pht, py, pyw, rb, rbw, rs, rc,
49+
scala, sh, sql, tex, txt, asc, text, brf, vcard, vcs, wml, xml, xsl, xsd,
50+
yml, yaml.
51+
"""
52+
FILE_TYPE_UNSPECIFIED = 0
53+
BINARY_FILE = 1
54+
TEXT_FILE = 2
55+
56+
3857
class DayOfWeek(object):
3958
"""
4059
Represents a day of week.
@@ -130,13 +149,15 @@ class BytesType(object):
130149
"""
131150
Attributes:
132151
BYTES_TYPE_UNSPECIFIED (int)
152+
IMAGE (int)
133153
IMAGE_JPEG (int)
134154
IMAGE_BMP (int)
135155
IMAGE_PNG (int)
136156
IMAGE_SVG (int)
137157
TEXT_UTF8 (int)
138158
"""
139159
BYTES_TYPE_UNSPECIFIED = 0
160+
IMAGE = 6
140161
IMAGE_JPEG = 1
141162
IMAGE_BMP = 2
142163
IMAGE_PNG = 3

dlp/google/cloud/dlp_v2/proto/dlp_pb2.py

Lines changed: 880 additions & 1589 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dlp/google/cloud/dlp_v2/proto/dlp_pb2_grpc.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
22
import grpc
33

4-
import google.cloud.privacy.dlp_v2.proto.dlp_pb2 as google_dot_cloud_dot_privacy_dot_dlp__v2_dot_proto_dot_dlp__pb2
5-
import google.protobuf.empty_pb2 as google_dot_protobuf_dot_empty__pb2
4+
from google.cloud.dlp_v2.proto import dlp_pb2 as google_dot_cloud_dot_privacy_dot_dlp__v2_dot_proto_dot_dlp__pb2
5+
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
66

77

88
class DlpServiceStub(object):
9-
"""The DLP API is a service that allows clients
9+
"""The Cloud Data Loss Prevention (DLP) API is a service that allows clients
1010
to detect the presence of Personally Identifiable Information (PII) and other
1111
privacy-sensitive data in user-supplied, unstructured data streams, like text
1212
blocks or images.
@@ -148,7 +148,7 @@ def __init__(self, channel):
148148

149149

150150
class DlpServiceServicer(object):
151-
"""The DLP API is a service that allows clients
151+
"""The Cloud Data Loss Prevention (DLP) API is a service that allows clients
152152
to detect the presence of Personally Identifiable Information (PII) and other
153153
privacy-sensitive data in user-supplied, unstructured data streams, like text
154154
blocks or images.
@@ -185,14 +185,16 @@ def DeidentifyContent(self, request, context):
185185
raise NotImplementedError('Method not implemented!')
186186

187187
def ReidentifyContent(self, request, context):
188-
"""Re-identify content that has been de-identified.
188+
"""Re-identifies content that has been de-identified.
189189
"""
190190
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
191191
context.set_details('Method not implemented!')
192192
raise NotImplementedError('Method not implemented!')
193193

194194
def ListInfoTypes(self, request, context):
195-
"""Returns sensitive information types DLP supports.
195+
"""Returns a list of the sensitive information types that the DLP API
196+
supports. For more information, see [Listing supported predefined
197+
infoTypes](/dlp/docs/listing-infotypes).
196198
"""
197199
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
198200
context.set_details('Method not implemented!')
@@ -228,51 +230,51 @@ def ListInspectTemplates(self, request, context):
228230
raise NotImplementedError('Method not implemented!')
229231

230232
def DeleteInspectTemplate(self, request, context):
231-
"""Deletes inspect templates.
233+
"""Deletes an inspect template.
232234
"""
233235
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
234236
context.set_details('Method not implemented!')
235237
raise NotImplementedError('Method not implemented!')
236238

237239
def CreateDeidentifyTemplate(self, request, context):
238-
"""Creates an Deidentify template for re-using frequently used configuration
240+
"""Creates a de-identify template for re-using frequently used configuration
239241
for Deidentifying content, images, and storage.
240242
"""
241243
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
242244
context.set_details('Method not implemented!')
243245
raise NotImplementedError('Method not implemented!')
244246

245247
def UpdateDeidentifyTemplate(self, request, context):
246-
"""Updates the inspect template.
248+
"""Updates the de-identify template.
247249
"""
248250
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
249251
context.set_details('Method not implemented!')
250252
raise NotImplementedError('Method not implemented!')
251253

252254
def GetDeidentifyTemplate(self, request, context):
253-
"""Gets an inspect template.
255+
"""Gets a de-identify template.
254256
"""
255257
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
256258
context.set_details('Method not implemented!')
257259
raise NotImplementedError('Method not implemented!')
258260

259261
def ListDeidentifyTemplates(self, request, context):
260-
"""Lists inspect templates.
262+
"""Lists de-identify templates.
261263
"""
262264
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
263265
context.set_details('Method not implemented!')
264266
raise NotImplementedError('Method not implemented!')
265267

266268
def DeleteDeidentifyTemplate(self, request, context):
267-
"""Deletes inspect templates.
269+
"""Deletes a de-identify template.
268270
"""
269271
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
270272
context.set_details('Method not implemented!')
271273
raise NotImplementedError('Method not implemented!')
272274

273275
def CreateJobTrigger(self, request, context):
274-
"""Creates a job to run DLP actions such as scanning storage for sensitive
275-
information on a set schedule.
276+
"""Creates a job trigger to run DLP actions such as scanning storage for
277+
sensitive information on a set schedule.
276278
"""
277279
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
278280
context.set_details('Method not implemented!')
@@ -307,7 +309,7 @@ def DeleteJobTrigger(self, request, context):
307309
raise NotImplementedError('Method not implemented!')
308310

309311
def CreateDlpJob(self, request, context):
310-
"""Create a new job to inspect storage or calculate risk metrics [How-to
312+
"""Creates a new job to inspect storage or calculate risk metrics [How-to
311313
guide](/dlp/docs/compute-risk-analysis).
312314
"""
313315
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
@@ -338,7 +340,7 @@ def DeleteDlpJob(self, request, context):
338340
raise NotImplementedError('Method not implemented!')
339341

340342
def CancelDlpJob(self, request, context):
341-
"""Starts asynchronous cancellation on a long-running DlpJob. The server
343+
"""Starts asynchronous cancellation on a long-running DlpJob. The server
342344
makes a best effort to cancel the DlpJob, but success is not
343345
guaranteed.
344346
"""

0 commit comments

Comments
 (0)