Skip to content

Commit

Permalink
regenerate dlp v2 library
Browse files Browse the repository at this point in the history
  • Loading branch information
crwilcox committed Jul 20, 2018
1 parent 568779a commit 96d81f1
Show file tree
Hide file tree
Showing 15 changed files with 1,883 additions and 1,020 deletions.
4 changes: 2 additions & 2 deletions dlp/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
https://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

Expand Down Expand Up @@ -192,7 +192,7 @@
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,
Expand Down
1 change: 1 addition & 0 deletions dlp/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include README.rst LICENSE
recursive-include google *.json *.proto
recursive-include tests *
global-exclude *.py[co]
global-exclude __pycache__
49 changes: 14 additions & 35 deletions dlp/README.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
Python Client for DLP API (`Alpha`_)
====================================
Python Client for Cloud Data Loss Prevention (DLP) API (`Alpha`_)
=================================================================

`DLP API`_: The Google Data Loss Prevention API provides methods for detection of
`Cloud Data Loss Prevention (DLP) API`_: Provides methods for detection, risk analysis, and de-identification of
privacy-sensitive fragments in text, images, and Google Cloud Platform
storage repositories.

- `Client Library Documentation`_
- `Product Documentation`_

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

Quick Start
Expand All @@ -19,12 +19,14 @@ Quick Start
In order to use this library, you first need to go through the following steps:

1. `Select or create a Cloud Platform project.`_
2. `Enable the DLP API.`_
3. `Setup Authentication.`_
2. `Enable billing for your project.`_
3. `Enable the Cloud Data Loss Prevention (DLP) API.`_
4. `Setup Authentication.`_

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

Installation
~~~~~~~~~~~~
Expand Down Expand Up @@ -61,38 +63,15 @@ Windows
<your-env>\Scripts\activate
<your-env>\Scripts\pip.exe install google-cloud-dlp
Preview
~~~~~~~

DlpServiceClient
^^^^^^^^^^^^^^^^

.. code:: py
from google.cloud import dlp_v2
client = dlp_v2.DlpServiceClient()
name = 'EMAIL_ADDRESS'
info_types_element = {'name': name}
info_types = [info_types_element]
inspect_config = {'info_types': info_types}
type_ = 'text/plain'
value = 'My email is example@example.com.'
items_element = {'type': type_, 'value': value}
items = [items_element]
response = client.inspect_content(inspect_config, items)
Next Steps
~~~~~~~~~~

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

.. _DLP API Product documentation: https://cloud.google.com/dlp
.. _Cloud Data Loss Prevention (DLP) API Product documentation: https://cloud.google.com/dlp
.. _repository’s main README: https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/README.rst
9 changes: 4 additions & 5 deletions dlp/docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
Python Client for Cloud Data Loss Prevention (DLP) API (`Alpha`_)
=================================================================

`Cloud Data Loss Prevention (DLP) API`_: Provides methods for detection of privacy-sensitive fragments in text,
images, and Google Cloud Platform storage repositories.
`Cloud Data Loss Prevention (DLP) API`_: Provides methods for detection, risk analysis, and de-identification of
privacy-sensitive fragments in text, images, and Google Cloud Platform
storage repositories.

- `Client Library Documentation`_
- `Product Documentation`_
Expand Down Expand Up @@ -81,6 +82,4 @@ Api Reference
:maxdepth: 2

gapic/v2/api
gapic/v2/types
changelog

gapic/v2/types
16 changes: 15 additions & 1 deletion dlp/google/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
# 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
#
# 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,
# 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.

try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
__path__ = pkgutil.extend_path(__path__, __name__)
16 changes: 15 additions & 1 deletion dlp/google/cloud/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
# 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
#
# 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,
# 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.

try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
__path__ = pkgutil.extend_path(__path__, __name__)
7 changes: 4 additions & 3 deletions dlp/google/cloud/dlp.py
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,
Expand All @@ -21,4 +21,5 @@
__all__ = (
'enums',
'types',
'DlpServiceClient', )
'DlpServiceClient',
)

0 comments on commit 96d81f1

Please sign in to comment.