Skip to content
This repository has been archived by the owner on Dec 10, 2023. It is now read-only.

Commit

Permalink
feat: add Deidentify action (#438)
Browse files Browse the repository at this point in the history
* feat: add Deidentify action

PiperOrigin-RevId: 471923438

Source-Link: googleapis/googleapis@62995d0

Source-Link: googleapis/googleapis-gen@96ba173
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTZiYTE3MzFjNzEyYTY5Mzk5NWRlNzUzNzg5NDg3ODFhZjI4MzczOSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Sep 6, 2022
1 parent d0cf45d commit c28073b
Show file tree
Hide file tree
Showing 9 changed files with 891 additions and 178 deletions.
28 changes: 26 additions & 2 deletions google/cloud/dlp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
HybridInspectResponse,
HybridInspectStatistics,
ImageLocation,
ImageTransformations,
InfoTypeCategory,
InfoTypeDescription,
InfoTypeStats,
Expand Down Expand Up @@ -128,6 +129,7 @@
RecordCondition,
RecordLocation,
RecordSuppression,
RecordTransformation,
RecordTransformations,
RedactConfig,
RedactImageRequest,
Expand All @@ -141,7 +143,6 @@
ResourceVisibility,
RiskAnalysisJobConfig,
Schedule,
SensitivityScore,
StatisticalTable,
StorageMetadataLabel,
StoredInfoType,
Expand All @@ -153,9 +154,18 @@
TableDataProfile,
TableLocation,
TimePartConfig,
TransformationConfig,
TransformationContainerType,
TransformationDescription,
TransformationDetails,
TransformationDetailsStorageConfig,
TransformationErrorHandling,
TransformationLocation,
TransformationOverview,
TransformationResultStatus,
TransformationResultStatusType,
TransformationSummary,
TransformationType,
TransientCryptoKey,
UnwrappedCryptoKey,
UpdateDeidentifyTemplateRequest,
Expand All @@ -164,6 +174,7 @@
UpdateStoredInfoTypeRequest,
Value,
ValueFrequency,
VersionDescription,
)
from google.cloud.dlp_v2.types.storage import (
BigQueryField,
Expand All @@ -187,6 +198,7 @@
Likelihood,
PartitionId,
RecordKey,
SensitivityScore,
StorageConfig,
StoredType,
TableOptions,
Expand Down Expand Up @@ -256,6 +268,7 @@
"HybridInspectResponse",
"HybridInspectStatistics",
"ImageLocation",
"ImageTransformations",
"InfoTypeCategory",
"InfoTypeDescription",
"InfoTypeStats",
Expand Down Expand Up @@ -300,6 +313,7 @@
"RecordCondition",
"RecordLocation",
"RecordSuppression",
"RecordTransformation",
"RecordTransformations",
"RedactConfig",
"RedactImageRequest",
Expand All @@ -311,7 +325,6 @@
"ReplaceWithInfoTypeConfig",
"RiskAnalysisJobConfig",
"Schedule",
"SensitivityScore",
"StatisticalTable",
"StorageMetadataLabel",
"StoredInfoType",
Expand All @@ -322,8 +335,14 @@
"TableDataProfile",
"TableLocation",
"TimePartConfig",
"TransformationConfig",
"TransformationDescription",
"TransformationDetails",
"TransformationDetailsStorageConfig",
"TransformationErrorHandling",
"TransformationLocation",
"TransformationOverview",
"TransformationResultStatus",
"TransformationSummary",
"TransientCryptoKey",
"UnwrappedCryptoKey",
Expand All @@ -333,6 +352,7 @@
"UpdateStoredInfoTypeRequest",
"Value",
"ValueFrequency",
"VersionDescription",
"ContentOption",
"DlpJobType",
"EncryptionStatus",
Expand All @@ -342,6 +362,9 @@
"RelationalOperator",
"ResourceVisibility",
"StoredInfoTypeState",
"TransformationContainerType",
"TransformationResultStatusType",
"TransformationType",
"BigQueryField",
"BigQueryKey",
"BigQueryOptions",
Expand All @@ -361,6 +384,7 @@
"KindExpression",
"PartitionId",
"RecordKey",
"SensitivityScore",
"StorageConfig",
"StoredType",
"TableOptions",
Expand Down
26 changes: 25 additions & 1 deletion google/cloud/dlp_v2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
HybridInspectResponse,
HybridInspectStatistics,
ImageLocation,
ImageTransformations,
InfoTypeCategory,
InfoTypeDescription,
InfoTypeStats,
Expand Down Expand Up @@ -127,6 +128,7 @@
RecordCondition,
RecordLocation,
RecordSuppression,
RecordTransformation,
RecordTransformations,
RedactConfig,
RedactImageRequest,
Expand All @@ -140,7 +142,6 @@
ResourceVisibility,
RiskAnalysisJobConfig,
Schedule,
SensitivityScore,
StatisticalTable,
StorageMetadataLabel,
StoredInfoType,
Expand All @@ -152,9 +153,18 @@
TableDataProfile,
TableLocation,
TimePartConfig,
TransformationConfig,
TransformationContainerType,
TransformationDescription,
TransformationDetails,
TransformationDetailsStorageConfig,
TransformationErrorHandling,
TransformationLocation,
TransformationOverview,
TransformationResultStatus,
TransformationResultStatusType,
TransformationSummary,
TransformationType,
TransientCryptoKey,
UnwrappedCryptoKey,
UpdateDeidentifyTemplateRequest,
Expand All @@ -163,6 +173,7 @@
UpdateStoredInfoTypeRequest,
Value,
ValueFrequency,
VersionDescription,
)
from .types.storage import (
BigQueryField,
Expand All @@ -186,6 +197,7 @@
Likelihood,
PartitionId,
RecordKey,
SensitivityScore,
StorageConfig,
StoredType,
TableOptions,
Expand Down Expand Up @@ -273,6 +285,7 @@
"HybridInspectStatistics",
"HybridOptions",
"ImageLocation",
"ImageTransformations",
"InfoType",
"InfoTypeCategory",
"InfoTypeDescription",
Expand Down Expand Up @@ -326,6 +339,7 @@
"RecordKey",
"RecordLocation",
"RecordSuppression",
"RecordTransformation",
"RecordTransformations",
"RedactConfig",
"RedactImageRequest",
Expand Down Expand Up @@ -354,9 +368,18 @@
"TableLocation",
"TableOptions",
"TimePartConfig",
"TransformationConfig",
"TransformationContainerType",
"TransformationDescription",
"TransformationDetails",
"TransformationDetailsStorageConfig",
"TransformationErrorHandling",
"TransformationLocation",
"TransformationOverview",
"TransformationResultStatus",
"TransformationResultStatusType",
"TransformationSummary",
"TransformationType",
"TransientCryptoKey",
"UnwrappedCryptoKey",
"UpdateDeidentifyTemplateRequest",
Expand All @@ -365,4 +388,5 @@
"UpdateStoredInfoTypeRequest",
"Value",
"ValueFrequency",
"VersionDescription",
)
18 changes: 7 additions & 11 deletions google/cloud/dlp_v2/services/dlp_service/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,8 @@ async def sample_deidentify_content():
Args:
request (Union[google.cloud.dlp_v2.types.DeidentifyContentRequest, dict]):
The request object. Request to de-identify a list of
items.
The request object. Request to de-identify a
ContentItem.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
Expand Down Expand Up @@ -540,7 +540,7 @@ async def sample_reidentify_content():
Returns:
google.cloud.dlp_v2.types.ReidentifyContentResponse:
Results of re-identifying a item.
Results of re-identifying an item.
"""
# Create or coerce a protobuf request object.
request = dlp.ReidentifyContentRequest(request)
Expand Down Expand Up @@ -590,7 +590,7 @@ async def list_info_types(
metadata: Sequence[Tuple[str, str]] = (),
) -> dlp.ListInfoTypesResponse:
r"""Returns a list of the sensitive information types
that the DLP API supports. See
that DLP API supports. See
https://cloud.google.com/dlp/docs/infotypes-reference to
learn more.
Expand Down Expand Up @@ -695,7 +695,7 @@ async def create_inspect_template(
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> dlp.InspectTemplate:
r"""Creates an InspectTemplate for re-using frequently
r"""Creates an InspectTemplate for reusing frequently
used configuration for inspecting content, images, and
storage. See
https://cloud.google.com/dlp/docs/creating-templates to
Expand Down Expand Up @@ -1306,7 +1306,7 @@ async def create_deidentify_template(
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> dlp.DeidentifyTemplate:
r"""Creates a DeidentifyTemplate for re-using frequently
r"""Creates a DeidentifyTemplate for reusing frequently
used configuration for de-identifying content, images,
and storage. See
https://cloud.google.com/dlp/docs/creating-templates-deid
Expand Down Expand Up @@ -3073,7 +3073,7 @@ async def delete_dlp_job(
) -> None:
r"""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.
result. The job will be canceled if possible.
See https://cloud.google.com/dlp/docs/inspecting-storage
and
https://cloud.google.com/dlp/docs/compute-risk-analysis
Expand Down Expand Up @@ -3644,10 +3644,6 @@ async def sample_list_stored_info_types():
``projects/``\ PROJECT_ID\ ``/locations/``\ LOCATION_ID
- Projects scope, no location specified (defaults to
global): ``projects/``\ PROJECT_ID
- Organizations scope, location specified:
``organizations/``\ ORG_ID\ ``/locations/``\ LOCATION_ID
- Organizations scope, no location specified (defaults
to global): ``organizations/``\ ORG_ID
The following example ``parent`` string specifies a
parent project with the identifier ``example-project``,
Expand Down
18 changes: 7 additions & 11 deletions google/cloud/dlp_v2/services/dlp_service/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,8 +752,8 @@ def sample_deidentify_content():
Args:
request (Union[google.cloud.dlp_v2.types.DeidentifyContentRequest, dict]):
The request object. Request to de-identify a list of
items.
The request object. Request to de-identify a
ContentItem.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
Expand Down Expand Up @@ -837,7 +837,7 @@ def sample_reidentify_content():
Returns:
google.cloud.dlp_v2.types.ReidentifyContentResponse:
Results of re-identifying a item.
Results of re-identifying an item.
"""
# Create or coerce a protobuf request object.
# Minor optimization to avoid making a copy if the user passes
Expand Down Expand Up @@ -878,7 +878,7 @@ def list_info_types(
metadata: Sequence[Tuple[str, str]] = (),
) -> dlp.ListInfoTypesResponse:
r"""Returns a list of the sensitive information types
that the DLP API supports. See
that DLP API supports. See
https://cloud.google.com/dlp/docs/infotypes-reference to
learn more.
Expand Down Expand Up @@ -973,7 +973,7 @@ def create_inspect_template(
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> dlp.InspectTemplate:
r"""Creates an InspectTemplate for re-using frequently
r"""Creates an InspectTemplate for reusing frequently
used configuration for inspecting content, images, and
storage. See
https://cloud.google.com/dlp/docs/creating-templates to
Expand Down Expand Up @@ -1554,7 +1554,7 @@ def create_deidentify_template(
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> dlp.DeidentifyTemplate:
r"""Creates a DeidentifyTemplate for re-using frequently
r"""Creates a DeidentifyTemplate for reusing frequently
used configuration for de-identifying content, images,
and storage. See
https://cloud.google.com/dlp/docs/creating-templates-deid
Expand Down Expand Up @@ -3252,7 +3252,7 @@ def delete_dlp_job(
) -> None:
r"""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.
result. The job will be canceled if possible.
See https://cloud.google.com/dlp/docs/inspecting-storage
and
https://cloud.google.com/dlp/docs/compute-risk-analysis
Expand Down Expand Up @@ -3804,10 +3804,6 @@ def sample_list_stored_info_types():
``projects/``\ PROJECT_ID\ ``/locations/``\ LOCATION_ID
- Projects scope, no location specified (defaults to
global): ``projects/``\ PROJECT_ID
- Organizations scope, location specified:
``organizations/``\ ORG_ID\ ``/locations/``\ LOCATION_ID
- Organizations scope, no location specified (defaults
to global): ``organizations/``\ ORG_ID
The following example ``parent`` string specifies a
parent project with the identifier ``example-project``,
Expand Down
8 changes: 4 additions & 4 deletions google/cloud/dlp_v2/services/dlp_service/transports/grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def list_info_types(
r"""Return a callable for the list info types method over gRPC.
Returns a list of the sensitive information types
that the DLP API supports. See
that DLP API supports. See
https://cloud.google.com/dlp/docs/infotypes-reference to
learn more.
Expand Down Expand Up @@ -406,7 +406,7 @@ def create_inspect_template(
) -> Callable[[dlp.CreateInspectTemplateRequest], dlp.InspectTemplate]:
r"""Return a callable for the create inspect template method over gRPC.
Creates an InspectTemplate for re-using frequently
Creates an InspectTemplate for reusing frequently
used configuration for inspecting content, images, and
storage. See
https://cloud.google.com/dlp/docs/creating-templates to
Expand Down Expand Up @@ -548,7 +548,7 @@ def create_deidentify_template(
) -> Callable[[dlp.CreateDeidentifyTemplateRequest], dlp.DeidentifyTemplate]:
r"""Return a callable for the create deidentify template method over gRPC.
Creates a DeidentifyTemplate for re-using frequently
Creates a DeidentifyTemplate for reusing frequently
used configuration for de-identifying content, images,
and storage. See
https://cloud.google.com/dlp/docs/creating-templates-deid
Expand Down Expand Up @@ -987,7 +987,7 @@ def delete_dlp_job(self) -> Callable[[dlp.DeleteDlpJobRequest], empty_pb2.Empty]
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.
result. The job will be canceled if possible.
See https://cloud.google.com/dlp/docs/inspecting-storage
and
https://cloud.google.com/dlp/docs/compute-risk-analysis
Expand Down
Loading

0 comments on commit c28073b

Please sign in to comment.