Services for Google Cloud Dlp v2 API¶
-
class
google.cloud.dlp_v2.services.dlp_service.
DlpServiceAsyncClient
(*, credentials: google.auth.credentials.Credentials = None, transport: Union[str, google.cloud.dlp_v2.services.dlp_service.transports.base.DlpServiceTransport] = 'grpc_asyncio', client_options: <module 'google.api_core.client_options' from '/workspace/.nox/docs/lib/python3.8/site-packages/google/api_core/client_options.py'> = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = <google.api_core.gapic_v1.client_info.ClientInfo object>)[source]¶ 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. The service also includes methods for sensitive data redaction and scheduling of data scans on Google Cloud Platform based data sets. To learn more about concepts and find how-to guides see https://cloud.google.com/dlp/docs/.
Instantiate the dlp service client.
- Parameters
credentials (Optional[google.auth.credentials.Credentials]) – The authorization credentials to attach to requests. These credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment.
transport (Union[str, DlpServiceTransport]) – The transport to use. If set to None, a transport is chosen automatically.
client_options (ClientOptions) – Custom options for the client. It won’t take effect if a
transport
instance is provided. (1) Theapi_endpoint
property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT environment variable can also be used to override the endpoint: “always” (always use the default mTLS endpoint), “never” (always use the default regular endpoint) and “auto” (auto switch to the default mTLS endpoint if client certificate is present, this is the default value). However, theapi_endpoint
property takes precedence if provided. (2) If GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is “true”, then theclient_cert_source
property can be used to provide client certificate for mutual TLS transport. If not provided, the default SSL client certificate will be used if present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is “false” or not set, no client certificate will be used.
- Raises
google.auth.exceptions.MutualTlsChannelError – If mutual TLS transport creation failed for any reason.
-
async
activate_job_trigger
(request: Optional[google.cloud.dlp_v2.types.dlp.ActivateJobTriggerRequest] = None, *, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.DlpJob[source]¶ Activate a job trigger. Causes the immediate execute of a trigger instead of waiting on the trigger event to occur.
- Parameters
request (
ActivateJobTriggerRequest
) – The request object. Request message for ActivateJobTrigger.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Combines all of the information about a DLP job.
- Return type
DlpJob
-
async
cancel_dlp_job
(request: Optional[google.cloud.dlp_v2.types.dlp.CancelDlpJobRequest] = None, *, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → None[source]¶ Starts asynchronous cancellation on a long-running DlpJob. The server makes a best effort to cancel the DlpJob, but success is not guaranteed. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk- analysis to learn more.
- Parameters
request (
CancelDlpJobRequest
) – The request object. The request message for canceling a DLP job.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
-
static
common_billing_account_path
(billing_account: str) → str¶ Return a fully-qualified billing_account string.
-
static
common_location_path
(project: str, location: str) → str¶ Return a fully-qualified location string.
-
static
common_organization_path
(organization: str) → str¶ Return a fully-qualified organization string.
-
async
create_deidentify_template
(request: Optional[google.cloud.dlp_v2.types.dlp.CreateDeidentifyTemplateRequest] = None, *, parent: Optional[str] = None, deidentify_template: Optional[google.cloud.dlp_v2.types.dlp.DeidentifyTemplate] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.DeidentifyTemplate[source]¶ Creates a DeidentifyTemplate for re-using frequently used configuration for de-identifying content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates- deid to learn more.
- Parameters
request (
CreateDeidentifyTemplateRequest
) – The request object. Request message for CreateDeidentifyTemplate.parent (
str
) –Required. Parent resource name.
The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:
Projects scope, location specified:
projects/
PROJECT_ID/locations/
LOCATION_IDProjects scope, no location specified (defaults to global):
projects/
PROJECT_IDOrganizations scope, location specified:
organizations/
ORG_ID/locations/
LOCATION_IDOrganizations scope, no location specified (defaults to global):
organizations/
ORG_ID
The following example
parent
string specifies a parent project with the identifierexample-project
, and specifies theeurope-west3
location for processing data:parent=projects/example-project/locations/europe-west3
This corresponds to the
parent
field on therequest
instance; ifrequest
is provided, this should not be set.deidentify_template (
DeidentifyTemplate
) – Required. The DeidentifyTemplate to create. This corresponds to thedeidentify_template
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
DeidentifyTemplates contains instructions on how to de-identify content. See https://cloud.google.com/dlp/docs/concepts- templates to learn more.
- Return type
DeidentifyTemplate
-
async
create_dlp_job
(request: Optional[google.cloud.dlp_v2.types.dlp.CreateDlpJobRequest] = None, *, parent: Optional[str] = None, inspect_job: Optional[google.cloud.dlp_v2.types.dlp.InspectJobConfig] = None, risk_job: Optional[google.cloud.dlp_v2.types.dlp.RiskAnalysisJobConfig] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.DlpJob[source]¶ Creates a new job to inspect storage or calculate risk metrics. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.
- Parameters
request (
CreateDlpJobRequest
) – The request object. Request message for CreateDlpJobRequest. Used to initiate long running jobs such as calculating risk metrics or inspecting Google Cloud Storage.parent (
str
) –Required. Parent resource name.
The format of this value varies depending on whether you have specified a processing location:
Projects scope, location specified:
projects/
PROJECT_ID/locations/
LOCATION_IDProjects scope, no location specified (defaults to global):
projects/
PROJECT_ID
The following example
parent
string specifies a parent project with the identifierexample-project
, and specifies theeurope-west3
location for processing data:parent=projects/example-project/locations/europe-west3
This corresponds to the
parent
field on therequest
instance; ifrequest
is provided, this should not be set.inspect_job (
InspectJobConfig
) – Set to control what and how to inspect. This corresponds to theinspect_job
field on therequest
instance; ifrequest
is provided, this should not be set.risk_job (
RiskAnalysisJobConfig
) – Set to choose what metric to calculate. This corresponds to therisk_job
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Combines all of the information about a DLP job.
- Return type
DlpJob
-
async
create_inspect_template
(request: Optional[google.cloud.dlp_v2.types.dlp.CreateInspectTemplateRequest] = None, *, parent: Optional[str] = None, inspect_template: Optional[google.cloud.dlp_v2.types.dlp.InspectTemplate] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.InspectTemplate[source]¶ Creates an InspectTemplate for re-using frequently used configuration for inspecting content, images, and storage. See https://cloud.google.com/dlp/docs/creating- templates to learn more.
- Parameters
request (
CreateInspectTemplateRequest
) – The request object. Request message for CreateInspectTemplate.parent (
str
) –Required. Parent resource name.
The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:
Projects scope, location specified:
projects/
PROJECT_ID/locations/
LOCATION_IDProjects scope, no location specified (defaults to global):
projects/
PROJECT_IDOrganizations scope, location specified:
organizations/
ORG_ID/locations/
LOCATION_IDOrganizations scope, no location specified (defaults to global):
organizations/
ORG_ID
The following example
parent
string specifies a parent project with the identifierexample-project
, and specifies theeurope-west3
location for processing data:parent=projects/example-project/locations/europe-west3
This corresponds to the
parent
field on therequest
instance; ifrequest
is provided, this should not be set.inspect_template (
InspectTemplate
) – Required. The InspectTemplate to create. This corresponds to theinspect_template
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
The inspectTemplate contains a configuration (set of types of sensitive data to be detected) to be used anywhere you otherwise would normally specify InspectConfig. See https://cloud.google.com/dlp/docs/concepts- templates to learn more.
- Return type
InspectTemplate
-
async
create_job_trigger
(request: Optional[google.cloud.dlp_v2.types.dlp.CreateJobTriggerRequest] = None, *, parent: Optional[str] = None, job_trigger: Optional[google.cloud.dlp_v2.types.dlp.JobTrigger] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.JobTrigger[source]¶ Creates a job trigger to run DLP actions such as scanning storage for sensitive information on a set schedule. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
- Parameters
request (
CreateJobTriggerRequest
) – The request object. Request message for CreateJobTrigger.parent (
str
) –Required. Parent resource name.
The format of this value varies depending on whether you have specified a processing location:
Projects scope, location specified:
projects/
PROJECT_ID/locations/
LOCATION_IDProjects scope, no location specified (defaults to global):
projects/
PROJECT_ID
The following example
parent
string specifies a parent project with the identifierexample-project
, and specifies theeurope-west3
location for processing data:parent=projects/example-project/locations/europe-west3
This corresponds to the
parent
field on therequest
instance; ifrequest
is provided, this should not be set.job_trigger (
JobTrigger
) – Required. The JobTrigger to create. This corresponds to thejob_trigger
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Contains a configuration to make dlp api calls on a repeating basis. See https://cloud.google.com/dlp/docs/concepts- job-triggers to learn more.
- Return type
JobTrigger
-
async
create_stored_info_type
(request: Optional[google.cloud.dlp_v2.types.dlp.CreateStoredInfoTypeRequest] = None, *, parent: Optional[str] = None, config: Optional[google.cloud.dlp_v2.types.dlp.StoredInfoTypeConfig] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.StoredInfoType[source]¶ Creates a pre-built stored infoType to be used for inspection. See https://cloud.google.com/dlp/docs/creating-stored- infotypes to learn more.
- Parameters
request (
CreateStoredInfoTypeRequest
) – The request object. Request message for CreateStoredInfoType.parent (
str
) –Required. Parent resource name.
The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:
Projects scope, location specified:
projects/
PROJECT_ID/locations/
LOCATION_IDProjects scope, no location specified (defaults to global):
projects/
PROJECT_IDOrganizations scope, location specified:
organizations/
ORG_ID/locations/
LOCATION_IDOrganizations scope, no location specified (defaults to global):
organizations/
ORG_ID
The following example
parent
string specifies a parent project with the identifierexample-project
, and specifies theeurope-west3
location for processing data:parent=projects/example-project/locations/europe-west3
This corresponds to the
parent
field on therequest
instance; ifrequest
is provided, this should not be set.config (
StoredInfoTypeConfig
) – Required. Configuration of the storedInfoType to create. This corresponds to theconfig
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
StoredInfoType resource message that contains information about the current version and any pending updates.
- Return type
StoredInfoType
-
async
deidentify_content
(request: Optional[google.cloud.dlp_v2.types.dlp.DeidentifyContentRequest] = None, *, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.DeidentifyContentResponse[source]¶ De-identifies potentially sensitive info from a ContentItem. This method has limits on input size and output size. See https://cloud.google.com/dlp/docs/deidentify-sensitive- data to learn more.
When no InfoTypes or CustomInfoTypes are specified in this request, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.
- Parameters
request (
DeidentifyContentRequest
) – The request object. Request to de-identify a list of items.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Results of de-identifying a ContentItem.
- Return type
DeidentifyContentResponse
-
static
deidentify_template_path
(organization: str, deidentify_template: str) → str¶ Return a fully-qualified deidentify_template string.
-
async
delete_deidentify_template
(request: Optional[google.cloud.dlp_v2.types.dlp.DeleteDeidentifyTemplateRequest] = None, *, name: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → None[source]¶ Deletes a DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating- templates-deid to learn more.
- Parameters
request (
DeleteDeidentifyTemplateRequest
) – The request object. Request message for DeleteDeidentifyTemplate.name (
str
) – Required. Resource name of the organization and deidentify template to be deleted, for exampleorganizations/433245324/deidentifyTemplates/432452342
or projects/project-id/deidentifyTemplates/432452342. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
-
async
delete_dlp_job
(request: Optional[google.cloud.dlp_v2.types.dlp.DeleteDlpJobRequest] = None, *, name: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → None[source]¶ 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. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk- analysis to learn more.
- Parameters
request (
DeleteDlpJobRequest
) – The request object. The request message for deleting a DLP job.name (
str
) – Required. The name of the DlpJob resource to be deleted. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
-
async
delete_inspect_template
(request: Optional[google.cloud.dlp_v2.types.dlp.DeleteInspectTemplateRequest] = None, *, name: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → None[source]¶ Deletes an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more.
- Parameters
request (
DeleteInspectTemplateRequest
) – The request object. Request message for DeleteInspectTemplate.name (
str
) – Required. Resource name of the organization and inspectTemplate to be deleted, for exampleorganizations/433245324/inspectTemplates/432452342
or projects/project-id/inspectTemplates/432452342. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
-
async
delete_job_trigger
(request: Optional[google.cloud.dlp_v2.types.dlp.DeleteJobTriggerRequest] = None, *, name: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → None[source]¶ Deletes a job trigger. See https://cloud.google.com/dlp/docs/creating-job- triggers to learn more.
- Parameters
request (
DeleteJobTriggerRequest
) – The request object. Request message for DeleteJobTrigger.name (
str
) – Required. Resource name of the project and the triggeredJob, for exampleprojects/dlp-test-project/jobTriggers/53234423
. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
-
async
delete_stored_info_type
(request: Optional[google.cloud.dlp_v2.types.dlp.DeleteStoredInfoTypeRequest] = None, *, name: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → None[source]¶ Deletes a stored infoType. See https://cloud.google.com/dlp/docs/creating-stored- infotypes to learn more.
- Parameters
request (
DeleteStoredInfoTypeRequest
) – The request object. Request message for DeleteStoredInfoType.name (
str
) – Required. Resource name of the organization and storedInfoType to be deleted, for exampleorganizations/433245324/storedInfoTypes/432452342
or projects/project-id/storedInfoTypes/432452342. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
-
static
finding_path
(project: str, location: str, finding: str) → str¶ Return a fully-qualified finding string.
-
async
finish_dlp_job
(request: Optional[google.cloud.dlp_v2.types.dlp.FinishDlpJobRequest] = None, *, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → None[source]¶ Finish a running hybrid DlpJob. Triggers the finalization steps and running of any enabled actions that have not yet run. Early access feature is in a pre- release state and might change or have limited support. For more information, see https://cloud.google.com/products#product-launch-stages.
- Parameters
request (
FinishDlpJobRequest
) – The request object. The request message for finishing a DLP hybrid job.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
-
classmethod
from_service_account_file
(filename: str, *args, **kwargs)¶ Creates an instance of this client using the provided credentials file.
- Parameters
filename (str) – The path to the service account private key json file.
args – Additional arguments to pass to the constructor.
kwargs – Additional arguments to pass to the constructor.
- Returns
The constructed client.
- Return type
-
classmethod
from_service_account_json
(filename: str, *args, **kwargs)¶ Creates an instance of this client using the provided credentials file.
- Parameters
filename (str) – The path to the service account private key json file.
args – Additional arguments to pass to the constructor.
kwargs – Additional arguments to pass to the constructor.
- Returns
The constructed client.
- Return type
-
async
get_deidentify_template
(request: Optional[google.cloud.dlp_v2.types.dlp.GetDeidentifyTemplateRequest] = None, *, name: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.DeidentifyTemplate[source]¶ Gets a DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating- templates-deid to learn more.
- Parameters
request (
GetDeidentifyTemplateRequest
) – The request object. Request message for GetDeidentifyTemplate.name (
str
) – Required. Resource name of the organization and deidentify template to be read, for exampleorganizations/433245324/deidentifyTemplates/432452342
or projects/project-id/deidentifyTemplates/432452342. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
DeidentifyTemplates contains instructions on how to de-identify content. See https://cloud.google.com/dlp/docs/concepts- templates to learn more.
- Return type
DeidentifyTemplate
-
async
get_dlp_job
(request: Optional[google.cloud.dlp_v2.types.dlp.GetDlpJobRequest] = None, *, name: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.DlpJob[source]¶ Gets the latest state of a long-running DlpJob. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk- analysis to learn more.
- Parameters
request (
GetDlpJobRequest
) – The request object. The request message for [DlpJobs.GetDlpJob][].name (
str
) – Required. The name of the DlpJob resource. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Combines all of the information about a DLP job.
- Return type
DlpJob
-
async
get_inspect_template
(request: Optional[google.cloud.dlp_v2.types.dlp.GetInspectTemplateRequest] = None, *, name: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.InspectTemplate[source]¶ Gets an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more.
- Parameters
request (
GetInspectTemplateRequest
) – The request object. Request message for GetInspectTemplate.name (
str
) – Required. Resource name of the organization and inspectTemplate to be read, for exampleorganizations/433245324/inspectTemplates/432452342
or projects/project-id/inspectTemplates/432452342. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
The inspectTemplate contains a configuration (set of types of sensitive data to be detected) to be used anywhere you otherwise would normally specify InspectConfig. See https://cloud.google.com/dlp/docs/concepts- templates to learn more.
- Return type
InspectTemplate
-
async
get_job_trigger
(request: Optional[google.cloud.dlp_v2.types.dlp.GetJobTriggerRequest] = None, *, name: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.JobTrigger[source]¶ Gets a job trigger. See https://cloud.google.com/dlp/docs/creating-job- triggers to learn more.
- Parameters
request (
GetJobTriggerRequest
) – The request object. Request message for GetJobTrigger.name (
str
) – Required. Resource name of the project and the triggeredJob, for exampleprojects/dlp-test-project/jobTriggers/53234423
. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Contains a configuration to make dlp api calls on a repeating basis. See https://cloud.google.com/dlp/docs/concepts- job-triggers to learn more.
- Return type
JobTrigger
-
async
get_stored_info_type
(request: Optional[google.cloud.dlp_v2.types.dlp.GetStoredInfoTypeRequest] = None, *, name: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.StoredInfoType[source]¶ Gets a stored infoType. See https://cloud.google.com/dlp/docs/creating-stored- infotypes to learn more.
- Parameters
request (
GetStoredInfoTypeRequest
) – The request object. Request message for GetStoredInfoType.name (
str
) – Required. Resource name of the organization and storedInfoType to be read, for exampleorganizations/433245324/storedInfoTypes/432452342
or projects/project-id/storedInfoTypes/432452342. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
StoredInfoType resource message that contains information about the current version and any pending updates.
- Return type
StoredInfoType
-
get_transport_class
() → Type[google.cloud.dlp_v2.services.dlp_service.transports.base.DlpServiceTransport]¶ Return an appropriate transport class.
- Parameters
label – The name of the desired transport. If none is provided, then the first transport in the registry is used.
- Returns
The transport class to use.
-
async
hybrid_inspect_dlp_job
(request: Optional[google.cloud.dlp_v2.types.dlp.HybridInspectDlpJobRequest] = None, *, name: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.HybridInspectResponse[source]¶ Inspect hybrid content and store findings to a job. To review the findings inspect the job. Inspection will occur asynchronously. Early access feature is in a pre-release state and might change or have limited support. For more information, see https://cloud.google.com/products#product-launch-stages.
- Parameters
request (
HybridInspectDlpJobRequest
) – The request object. Request to search for potentially sensitive info in a custom location.name (
str
) – Required. Resource name of the job to execute a hybrid inspect on, for exampleprojects/dlp-test-project/dlpJob/53234423
. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Quota exceeded errors will be thrown once quota has been met.
- Return type
HybridInspectResponse
-
async
hybrid_inspect_job_trigger
(request: Optional[google.cloud.dlp_v2.types.dlp.HybridInspectJobTriggerRequest] = None, *, name: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.HybridInspectResponse[source]¶ Inspect hybrid content and store findings to a trigger. The inspection will be processed asynchronously. To review the findings monitor the jobs within the trigger. Early access feature is in a pre-release state and might change or have limited support. For more information, see https://cloud.google.com/products#product-launch-stages.
- Parameters
request (
HybridInspectJobTriggerRequest
) – The request object. Request to search for potentially sensitive info in a custom location.name (
str
) – Required. Resource name of the trigger to execute a hybrid inspect on, for exampleprojects/dlp-test-project/jobTriggers/53234423
. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Quota exceeded errors will be thrown once quota has been met.
- Return type
HybridInspectResponse
-
async
inspect_content
(request: Optional[google.cloud.dlp_v2.types.dlp.InspectContentRequest] = None, *, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.InspectContentResponse[source]¶ Finds potentially sensitive info in content. This method has limits on input size, processing time, and output size. When no InfoTypes or CustomInfoTypes are specified in this request, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated. For how to guides, see https://cloud.google.com/dlp/docs/inspecting-images and https://cloud.google.com/dlp/docs/inspecting-text,
- Parameters
request (
InspectContentRequest
) – The request object. Request to search for potentially sensitive info in a ContentItem.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Results of inspecting an item.
- Return type
InspectContentResponse
-
static
inspect_template_path
(organization: str, inspect_template: str) → str¶ Return a fully-qualified inspect_template string.
-
static
job_trigger_path
(project: str, job_trigger: str) → str¶ Return a fully-qualified job_trigger string.
-
async
list_deidentify_templates
(request: Optional[google.cloud.dlp_v2.types.dlp.ListDeidentifyTemplatesRequest] = None, *, parent: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.services.dlp_service.pagers.ListDeidentifyTemplatesAsyncPager[source]¶ Lists DeidentifyTemplates. See https://cloud.google.com/dlp/docs/creating- templates-deid to learn more.
- Parameters
request (
ListDeidentifyTemplatesRequest
) – The request object. Request message for ListDeidentifyTemplates.parent (
str
) –Required. Parent resource name.
The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:
Projects scope, location specified:
projects/
PROJECT_ID/locations/
LOCATION_IDProjects scope, no location specified (defaults to global):
projects/
PROJECT_IDOrganizations scope, location specified:
organizations/
ORG_ID/locations/
LOCATION_IDOrganizations scope, no location specified (defaults to global):
organizations/
ORG_ID
The following example
parent
string specifies a parent project with the identifierexample-project
, and specifies theeurope-west3
location for processing data:parent=projects/example-project/locations/europe-west3
This corresponds to the
parent
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Response message for ListDeidentifyTemplates. Iterating over this object will yield results and resolve additional pages automatically.
- Return type
ListDeidentifyTemplatesAsyncPager
-
async
list_dlp_jobs
(request: Optional[google.cloud.dlp_v2.types.dlp.ListDlpJobsRequest] = None, *, parent: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.services.dlp_service.pagers.ListDlpJobsAsyncPager[source]¶ Lists DlpJobs that match the specified filter in the request. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
- Parameters
request (
ListDlpJobsRequest
) – The request object. The request message for listing DLP jobs.parent (
str
) –Required. Parent resource name.
The format of this value varies depending on whether you have specified a processing location:
Projects scope, location specified:
projects/
PROJECT_ID/locations/
LOCATION_IDProjects scope, no location specified (defaults to global):
projects/
PROJECT_ID
The following example
parent
string specifies a parent project with the identifierexample-project
, and specifies theeurope-west3
location for processing data:parent=projects/example-project/locations/europe-west3
This corresponds to the
parent
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
The response message for listing DLP jobs. Iterating over this object will yield results and resolve additional pages automatically.
- Return type
ListDlpJobsAsyncPager
-
async
list_info_types
(request: Optional[google.cloud.dlp_v2.types.dlp.ListInfoTypesRequest] = None, *, parent: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.ListInfoTypesResponse[source]¶ Returns a list of the sensitive information types that the DLP API supports. See https://cloud.google.com/dlp/docs/infotypes-reference to learn more.
- Parameters
request (
ListInfoTypesRequest
) – The request object. Request for the list of infoTypes.parent (
str
) –The parent resource name.
The format of this value is as follows:
locations/<var>LOCATION_ID</var>
This corresponds to the
parent
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Response to the ListInfoTypes request.
- Return type
ListInfoTypesResponse
-
async
list_inspect_templates
(request: Optional[google.cloud.dlp_v2.types.dlp.ListInspectTemplatesRequest] = None, *, parent: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.services.dlp_service.pagers.ListInspectTemplatesAsyncPager[source]¶ Lists InspectTemplates. See https://cloud.google.com/dlp/docs/creating-templates to learn more.
- Parameters
request (
ListInspectTemplatesRequest
) – The request object. Request message for ListInspectTemplates.parent (
str
) –Required. Parent resource name.
The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:
Projects scope, location specified:
projects/
PROJECT_ID/locations/
LOCATION_IDProjects scope, no location specified (defaults to global):
projects/
PROJECT_IDOrganizations scope, location specified:
organizations/
ORG_ID/locations/
LOCATION_IDOrganizations scope, no location specified (defaults to global):
organizations/
ORG_ID
The following example
parent
string specifies a parent project with the identifierexample-project
, and specifies theeurope-west3
location for processing data:parent=projects/example-project/locations/europe-west3
This corresponds to the
parent
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Response message for ListInspectTemplates. Iterating over this object will yield results and resolve additional pages automatically.
- Return type
ListInspectTemplatesAsyncPager
-
async
list_job_triggers
(request: Optional[google.cloud.dlp_v2.types.dlp.ListJobTriggersRequest] = None, *, parent: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.services.dlp_service.pagers.ListJobTriggersAsyncPager[source]¶ Lists job triggers. See https://cloud.google.com/dlp/docs/creating-job- triggers to learn more.
- Parameters
request (
ListJobTriggersRequest
) – The request object. Request message for ListJobTriggers.parent (
str
) –Required. Parent resource name.
The format of this value varies depending on whether you have specified a processing location:
Projects scope, location specified:
projects/
PROJECT_ID/locations/
LOCATION_IDProjects scope, no location specified (defaults to global):
projects/
PROJECT_ID
The following example
parent
string specifies a parent project with the identifierexample-project
, and specifies theeurope-west3
location for processing data:parent=projects/example-project/locations/europe-west3
This corresponds to the
parent
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Response message for ListJobTriggers. Iterating over this object will yield results and resolve additional pages automatically.
- Return type
ListJobTriggersAsyncPager
-
async
list_stored_info_types
(request: Optional[google.cloud.dlp_v2.types.dlp.ListStoredInfoTypesRequest] = None, *, parent: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.services.dlp_service.pagers.ListStoredInfoTypesAsyncPager[source]¶ Lists stored infoTypes. See https://cloud.google.com/dlp/docs/creating-stored- infotypes to learn more.
- Parameters
request (
ListStoredInfoTypesRequest
) – The request object. Request message for ListStoredInfoTypes.parent (
str
) –Required. Parent resource name.
The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:
Projects scope, location specified:
projects/
PROJECT_ID/locations/
LOCATION_IDProjects scope, no location specified (defaults to global):
projects/
PROJECT_IDOrganizations scope, location specified:
organizations/
ORG_ID/locations/
LOCATION_IDOrganizations scope, no location specified (defaults to global):
organizations/
ORG_ID
The following example
parent
string specifies a parent project with the identifierexample-project
, and specifies theeurope-west3
location for processing data:parent=projects/example-project/locations/europe-west3
This corresponds to the
parent
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Response message for ListStoredInfoTypes. Iterating over this object will yield results and resolve additional pages automatically.
- Return type
ListStoredInfoTypesAsyncPager
-
static
parse_common_billing_account_path
(path: str) → Dict[str, str]¶ Parse a billing_account path into its component segments.
-
static
parse_common_folder_path
(path: str) → Dict[str, str]¶ Parse a folder path into its component segments.
-
static
parse_common_location_path
(path: str) → Dict[str, str]¶ Parse a location path into its component segments.
-
static
parse_common_organization_path
(path: str) → Dict[str, str]¶ Parse a organization path into its component segments.
-
static
parse_common_project_path
(path: str) → Dict[str, str]¶ Parse a project path into its component segments.
-
static
parse_deidentify_template_path
(path: str) → Dict[str, str]¶ Parse a deidentify_template path into its component segments.
-
static
parse_dlp_content_path
(path: str) → Dict[str, str]¶ Parse a dlp_content path into its component segments.
-
static
parse_dlp_job_path
(path: str) → Dict[str, str]¶ Parse a dlp_job path into its component segments.
-
static
parse_finding_path
(path: str) → Dict[str, str]¶ Parse a finding path into its component segments.
-
static
parse_inspect_template_path
(path: str) → Dict[str, str]¶ Parse a inspect_template path into its component segments.
-
static
parse_job_trigger_path
(path: str) → Dict[str, str]¶ Parse a job_trigger path into its component segments.
-
static
parse_stored_info_type_path
(path: str) → Dict[str, str]¶ Parse a stored_info_type path into its component segments.
-
async
redact_image
(request: Optional[google.cloud.dlp_v2.types.dlp.RedactImageRequest] = None, *, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.RedactImageResponse[source]¶ Redacts potentially sensitive info from an image. This method has limits on input size, processing time, and output size. See https://cloud.google.com/dlp/docs/redacting-sensitive- data-images to learn more.
When no InfoTypes or CustomInfoTypes are specified in this request, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.
- Parameters
request (
RedactImageRequest
) – The request object. Request to search for potentially sensitive info in an image and redact it by covering it with a colored rectangle.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Results of redacting an image.
- Return type
RedactImageResponse
-
async
reidentify_content
(request: Optional[google.cloud.dlp_v2.types.dlp.ReidentifyContentRequest] = None, *, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.ReidentifyContentResponse[source]¶ Re-identifies content that has been de-identified. See https://cloud.google.com/dlp/docs/pseudonymization#re-identification_in_free_text_code_example to learn more.
- Parameters
request (
ReidentifyContentRequest
) – The request object. Request to re-identify an item.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Results of re-identifying a item.
- Return type
ReidentifyContentResponse
-
static
stored_info_type_path
(organization: str, stored_info_type: str) → str¶ Return a fully-qualified stored_info_type string.
-
property
transport
¶ Return the transport used by the client instance.
- Returns
The transport used by the client instance.
- Return type
DlpServiceTransport
-
async
update_deidentify_template
(request: Optional[google.cloud.dlp_v2.types.dlp.UpdateDeidentifyTemplateRequest] = None, *, name: Optional[str] = None, deidentify_template: Optional[google.cloud.dlp_v2.types.dlp.DeidentifyTemplate] = None, update_mask: Optional[google.protobuf.field_mask_pb2.FieldMask] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.DeidentifyTemplate[source]¶ Updates the DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating- templates-deid to learn more.
- Parameters
request (
UpdateDeidentifyTemplateRequest
) – The request object. Request message for UpdateDeidentifyTemplate.name (
str
) – Required. Resource name of organization and deidentify template to be updated, for exampleorganizations/433245324/deidentifyTemplates/432452342
or projects/project-id/deidentifyTemplates/432452342. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.deidentify_template (
DeidentifyTemplate
) – New DeidentifyTemplate value. This corresponds to thedeidentify_template
field on therequest
instance; ifrequest
is provided, this should not be set.update_mask (
FieldMask
) – Mask to control which fields get updated. This corresponds to theupdate_mask
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
DeidentifyTemplates contains instructions on how to de-identify content. See https://cloud.google.com/dlp/docs/concepts- templates to learn more.
- Return type
DeidentifyTemplate
-
async
update_inspect_template
(request: Optional[google.cloud.dlp_v2.types.dlp.UpdateInspectTemplateRequest] = None, *, name: Optional[str] = None, inspect_template: Optional[google.cloud.dlp_v2.types.dlp.InspectTemplate] = None, update_mask: Optional[google.protobuf.field_mask_pb2.FieldMask] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.InspectTemplate[source]¶ Updates the InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more.
- Parameters
request (
UpdateInspectTemplateRequest
) – The request object. Request message for UpdateInspectTemplate.name (
str
) – Required. Resource name of organization and inspectTemplate to be updated, for exampleorganizations/433245324/inspectTemplates/432452342
or projects/project-id/inspectTemplates/432452342. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.inspect_template (
InspectTemplate
) – New InspectTemplate value. This corresponds to theinspect_template
field on therequest
instance; ifrequest
is provided, this should not be set.update_mask (
FieldMask
) – Mask to control which fields get updated. This corresponds to theupdate_mask
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
The inspectTemplate contains a configuration (set of types of sensitive data to be detected) to be used anywhere you otherwise would normally specify InspectConfig. See https://cloud.google.com/dlp/docs/concepts- templates to learn more.
- Return type
InspectTemplate
-
async
update_job_trigger
(request: Optional[google.cloud.dlp_v2.types.dlp.UpdateJobTriggerRequest] = None, *, name: Optional[str] = None, job_trigger: Optional[google.cloud.dlp_v2.types.dlp.JobTrigger] = None, update_mask: Optional[google.protobuf.field_mask_pb2.FieldMask] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.JobTrigger[source]¶ Updates a job trigger. See https://cloud.google.com/dlp/docs/creating-job- triggers to learn more.
- Parameters
request (
UpdateJobTriggerRequest
) – The request object. Request message for UpdateJobTrigger.name (
str
) – Required. Resource name of the project and the triggeredJob, for exampleprojects/dlp-test-project/jobTriggers/53234423
. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.job_trigger (
JobTrigger
) – New JobTrigger value. This corresponds to thejob_trigger
field on therequest
instance; ifrequest
is provided, this should not be set.update_mask (
FieldMask
) – Mask to control which fields get updated. This corresponds to theupdate_mask
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Contains a configuration to make dlp api calls on a repeating basis. See https://cloud.google.com/dlp/docs/concepts- job-triggers to learn more.
- Return type
JobTrigger
-
async
update_stored_info_type
(request: Optional[google.cloud.dlp_v2.types.dlp.UpdateStoredInfoTypeRequest] = None, *, name: Optional[str] = None, config: Optional[google.cloud.dlp_v2.types.dlp.StoredInfoTypeConfig] = None, update_mask: Optional[google.protobuf.field_mask_pb2.FieldMask] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.StoredInfoType[source]¶ Updates the stored infoType by creating a new version. The existing version will continue to be used until the new version is ready. See https://cloud.google.com/dlp/docs/creating-stored- infotypes to learn more.
- Parameters
request (
UpdateStoredInfoTypeRequest
) – The request object. Request message for UpdateStoredInfoType.name (
str
) – Required. Resource name of organization and storedInfoType to be updated, for exampleorganizations/433245324/storedInfoTypes/432452342
or projects/project-id/storedInfoTypes/432452342. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.config (
StoredInfoTypeConfig
) – Updated configuration for the storedInfoType. If not provided, a new version of the storedInfoType will be created with the existing configuration. This corresponds to theconfig
field on therequest
instance; ifrequest
is provided, this should not be set.update_mask (
FieldMask
) – Mask to control which fields get updated. This corresponds to theupdate_mask
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
StoredInfoType resource message that contains information about the current version and any pending updates.
- Return type
StoredInfoType
-
class
google.cloud.dlp_v2.services.dlp_service.
DlpServiceClient
(*, credentials: Optional[google.auth.credentials.Credentials] = None, transport: Optional[Union[str, google.cloud.dlp_v2.services.dlp_service.transports.base.DlpServiceTransport]] = None, client_options: Optional[google.api_core.client_options.ClientOptions] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = <google.api_core.gapic_v1.client_info.ClientInfo object>)[source]¶ 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. The service also includes methods for sensitive data redaction and scheduling of data scans on Google Cloud Platform based data sets. To learn more about concepts and find how-to guides see https://cloud.google.com/dlp/docs/.
Instantiate the dlp service client.
- Parameters
credentials (Optional[google.auth.credentials.Credentials]) – The authorization credentials to attach to requests. These credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment.
transport (Union[str, DlpServiceTransport]) – The transport to use. If set to None, a transport is chosen automatically.
client_options (client_options_lib.ClientOptions) – Custom options for the client. It won’t take effect if a
transport
instance is provided. (1) Theapi_endpoint
property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT environment variable can also be used to override the endpoint: “always” (always use the default mTLS endpoint), “never” (always use the default regular endpoint) and “auto” (auto switch to the default mTLS endpoint if client certificate is present, this is the default value). However, theapi_endpoint
property takes precedence if provided. (2) If GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is “true”, then theclient_cert_source
property can be used to provide client certificate for mutual TLS transport. If not provided, the default SSL client certificate will be used if present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is “false” or not set, no client certificate will be used.client_info (google.api_core.gapic_v1.client_info.ClientInfo) – The client info used to send a user-agent string along with API requests. If
None
, then default info will be used. Generally, you only need to set this if you’re developing your own client library.
- Raises
google.auth.exceptions.MutualTLSChannelError – If mutual TLS transport creation failed for any reason.
-
activate_job_trigger
(request: Optional[google.cloud.dlp_v2.types.dlp.ActivateJobTriggerRequest] = None, *, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.DlpJob[source]¶ Activate a job trigger. Causes the immediate execute of a trigger instead of waiting on the trigger event to occur.
- Parameters
request (
ActivateJobTriggerRequest
) – The request object. Request message for ActivateJobTrigger.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Combines all of the information about a DLP job.
- Return type
DlpJob
-
cancel_dlp_job
(request: Optional[google.cloud.dlp_v2.types.dlp.CancelDlpJobRequest] = None, *, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → None[source]¶ Starts asynchronous cancellation on a long-running DlpJob. The server makes a best effort to cancel the DlpJob, but success is not guaranteed. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk- analysis to learn more.
- Parameters
request (
CancelDlpJobRequest
) – The request object. The request message for canceling a DLP job.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
-
static
common_billing_account_path
(billing_account: str) → str[source]¶ Return a fully-qualified billing_account string.
-
static
common_location_path
(project: str, location: str) → str[source]¶ Return a fully-qualified location string.
-
static
common_organization_path
(organization: str) → str[source]¶ Return a fully-qualified organization string.
-
create_deidentify_template
(request: Optional[google.cloud.dlp_v2.types.dlp.CreateDeidentifyTemplateRequest] = None, *, parent: Optional[str] = None, deidentify_template: Optional[google.cloud.dlp_v2.types.dlp.DeidentifyTemplate] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.DeidentifyTemplate[source]¶ Creates a DeidentifyTemplate for re-using frequently used configuration for de-identifying content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates- deid to learn more.
- Parameters
request (
CreateDeidentifyTemplateRequest
) – The request object. Request message for CreateDeidentifyTemplate.parent (
str
) –Required. Parent resource name.
The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:
Projects scope, location specified:
projects/
PROJECT_ID/locations/
LOCATION_IDProjects scope, no location specified (defaults to global):
projects/
PROJECT_IDOrganizations scope, location specified:
organizations/
ORG_ID/locations/
LOCATION_IDOrganizations scope, no location specified (defaults to global):
organizations/
ORG_ID
The following example
parent
string specifies a parent project with the identifierexample-project
, and specifies theeurope-west3
location for processing data:parent=projects/example-project/locations/europe-west3
This corresponds to the
parent
field on therequest
instance; ifrequest
is provided, this should not be set.deidentify_template (
DeidentifyTemplate
) – Required. The DeidentifyTemplate to create. This corresponds to thedeidentify_template
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
DeidentifyTemplates contains instructions on how to de-identify content. See https://cloud.google.com/dlp/docs/concepts- templates to learn more.
- Return type
DeidentifyTemplate
-
create_dlp_job
(request: Optional[google.cloud.dlp_v2.types.dlp.CreateDlpJobRequest] = None, *, parent: Optional[str] = None, inspect_job: Optional[google.cloud.dlp_v2.types.dlp.InspectJobConfig] = None, risk_job: Optional[google.cloud.dlp_v2.types.dlp.RiskAnalysisJobConfig] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.DlpJob[source]¶ Creates a new job to inspect storage or calculate risk metrics. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more. When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.
- Parameters
request (
CreateDlpJobRequest
) – The request object. Request message for CreateDlpJobRequest. Used to initiate long running jobs such as calculating risk metrics or inspecting Google Cloud Storage.parent (
str
) –Required. Parent resource name.
The format of this value varies depending on whether you have specified a processing location:
Projects scope, location specified:
projects/
PROJECT_ID/locations/
LOCATION_IDProjects scope, no location specified (defaults to global):
projects/
PROJECT_ID
The following example
parent
string specifies a parent project with the identifierexample-project
, and specifies theeurope-west3
location for processing data:parent=projects/example-project/locations/europe-west3
This corresponds to the
parent
field on therequest
instance; ifrequest
is provided, this should not be set.inspect_job (
InspectJobConfig
) – Set to control what and how to inspect. This corresponds to theinspect_job
field on therequest
instance; ifrequest
is provided, this should not be set.risk_job (
RiskAnalysisJobConfig
) – Set to choose what metric to calculate. This corresponds to therisk_job
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Combines all of the information about a DLP job.
- Return type
DlpJob
-
create_inspect_template
(request: Optional[google.cloud.dlp_v2.types.dlp.CreateInspectTemplateRequest] = None, *, parent: Optional[str] = None, inspect_template: Optional[google.cloud.dlp_v2.types.dlp.InspectTemplate] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.InspectTemplate[source]¶ Creates an InspectTemplate for re-using frequently used configuration for inspecting content, images, and storage. See https://cloud.google.com/dlp/docs/creating- templates to learn more.
- Parameters
request (
CreateInspectTemplateRequest
) – The request object. Request message for CreateInspectTemplate.parent (
str
) –Required. Parent resource name.
The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:
Projects scope, location specified:
projects/
PROJECT_ID/locations/
LOCATION_IDProjects scope, no location specified (defaults to global):
projects/
PROJECT_IDOrganizations scope, location specified:
organizations/
ORG_ID/locations/
LOCATION_IDOrganizations scope, no location specified (defaults to global):
organizations/
ORG_ID
The following example
parent
string specifies a parent project with the identifierexample-project
, and specifies theeurope-west3
location for processing data:parent=projects/example-project/locations/europe-west3
This corresponds to the
parent
field on therequest
instance; ifrequest
is provided, this should not be set.inspect_template (
InspectTemplate
) – Required. The InspectTemplate to create. This corresponds to theinspect_template
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
The inspectTemplate contains a configuration (set of types of sensitive data to be detected) to be used anywhere you otherwise would normally specify InspectConfig. See https://cloud.google.com/dlp/docs/concepts- templates to learn more.
- Return type
InspectTemplate
-
create_job_trigger
(request: Optional[google.cloud.dlp_v2.types.dlp.CreateJobTriggerRequest] = None, *, parent: Optional[str] = None, job_trigger: Optional[google.cloud.dlp_v2.types.dlp.JobTrigger] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.JobTrigger[source]¶ Creates a job trigger to run DLP actions such as scanning storage for sensitive information on a set schedule. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
- Parameters
request (
CreateJobTriggerRequest
) – The request object. Request message for CreateJobTrigger.parent (
str
) –Required. Parent resource name.
The format of this value varies depending on whether you have specified a processing location:
Projects scope, location specified:
projects/
PROJECT_ID/locations/
LOCATION_IDProjects scope, no location specified (defaults to global):
projects/
PROJECT_ID
The following example
parent
string specifies a parent project with the identifierexample-project
, and specifies theeurope-west3
location for processing data:parent=projects/example-project/locations/europe-west3
This corresponds to the
parent
field on therequest
instance; ifrequest
is provided, this should not be set.job_trigger (
JobTrigger
) – Required. The JobTrigger to create. This corresponds to thejob_trigger
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Contains a configuration to make dlp api calls on a repeating basis. See https://cloud.google.com/dlp/docs/concepts- job-triggers to learn more.
- Return type
JobTrigger
-
create_stored_info_type
(request: Optional[google.cloud.dlp_v2.types.dlp.CreateStoredInfoTypeRequest] = None, *, parent: Optional[str] = None, config: Optional[google.cloud.dlp_v2.types.dlp.StoredInfoTypeConfig] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.StoredInfoType[source]¶ Creates a pre-built stored infoType to be used for inspection. See https://cloud.google.com/dlp/docs/creating-stored- infotypes to learn more.
- Parameters
request (
CreateStoredInfoTypeRequest
) – The request object. Request message for CreateStoredInfoType.parent (
str
) –Required. Parent resource name.
The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:
Projects scope, location specified:
projects/
PROJECT_ID/locations/
LOCATION_IDProjects scope, no location specified (defaults to global):
projects/
PROJECT_IDOrganizations scope, location specified:
organizations/
ORG_ID/locations/
LOCATION_IDOrganizations scope, no location specified (defaults to global):
organizations/
ORG_ID
The following example
parent
string specifies a parent project with the identifierexample-project
, and specifies theeurope-west3
location for processing data:parent=projects/example-project/locations/europe-west3
This corresponds to the
parent
field on therequest
instance; ifrequest
is provided, this should not be set.config (
StoredInfoTypeConfig
) – Required. Configuration of the storedInfoType to create. This corresponds to theconfig
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
StoredInfoType resource message that contains information about the current version and any pending updates.
- Return type
StoredInfoType
-
deidentify_content
(request: Optional[google.cloud.dlp_v2.types.dlp.DeidentifyContentRequest] = None, *, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.DeidentifyContentResponse[source]¶ De-identifies potentially sensitive info from a ContentItem. This method has limits on input size and output size. See https://cloud.google.com/dlp/docs/deidentify-sensitive- data to learn more.
When no InfoTypes or CustomInfoTypes are specified in this request, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.
- Parameters
request (
DeidentifyContentRequest
) – The request object. Request to de-identify a list of items.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Results of de-identifying a ContentItem.
- Return type
DeidentifyContentResponse
-
static
deidentify_template_path
(organization: str, deidentify_template: str) → str[source]¶ Return a fully-qualified deidentify_template string.
-
delete_deidentify_template
(request: Optional[google.cloud.dlp_v2.types.dlp.DeleteDeidentifyTemplateRequest] = None, *, name: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → None[source]¶ Deletes a DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating- templates-deid to learn more.
- Parameters
request (
DeleteDeidentifyTemplateRequest
) – The request object. Request message for DeleteDeidentifyTemplate.name (
str
) – Required. Resource name of the organization and deidentify template to be deleted, for exampleorganizations/433245324/deidentifyTemplates/432452342
or projects/project-id/deidentifyTemplates/432452342. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
-
delete_dlp_job
(request: Optional[google.cloud.dlp_v2.types.dlp.DeleteDlpJobRequest] = None, *, name: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → None[source]¶ 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. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk- analysis to learn more.
- Parameters
request (
DeleteDlpJobRequest
) – The request object. The request message for deleting a DLP job.name (
str
) – Required. The name of the DlpJob resource to be deleted. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
-
delete_inspect_template
(request: Optional[google.cloud.dlp_v2.types.dlp.DeleteInspectTemplateRequest] = None, *, name: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → None[source]¶ Deletes an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more.
- Parameters
request (
DeleteInspectTemplateRequest
) – The request object. Request message for DeleteInspectTemplate.name (
str
) – Required. Resource name of the organization and inspectTemplate to be deleted, for exampleorganizations/433245324/inspectTemplates/432452342
or projects/project-id/inspectTemplates/432452342. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
-
delete_job_trigger
(request: Optional[google.cloud.dlp_v2.types.dlp.DeleteJobTriggerRequest] = None, *, name: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → None[source]¶ Deletes a job trigger. See https://cloud.google.com/dlp/docs/creating-job- triggers to learn more.
- Parameters
request (
DeleteJobTriggerRequest
) – The request object. Request message for DeleteJobTrigger.name (
str
) – Required. Resource name of the project and the triggeredJob, for exampleprojects/dlp-test-project/jobTriggers/53234423
. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
-
delete_stored_info_type
(request: Optional[google.cloud.dlp_v2.types.dlp.DeleteStoredInfoTypeRequest] = None, *, name: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → None[source]¶ Deletes a stored infoType. See https://cloud.google.com/dlp/docs/creating-stored- infotypes to learn more.
- Parameters
request (
DeleteStoredInfoTypeRequest
) – The request object. Request message for DeleteStoredInfoType.name (
str
) – Required. Resource name of the organization and storedInfoType to be deleted, for exampleorganizations/433245324/storedInfoTypes/432452342
or projects/project-id/storedInfoTypes/432452342. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
-
static
dlp_job_path
(project: str, dlp_job: str) → str[source]¶ Return a fully-qualified dlp_job string.
-
static
finding_path
(project: str, location: str, finding: str) → str[source]¶ Return a fully-qualified finding string.
-
finish_dlp_job
(request: Optional[google.cloud.dlp_v2.types.dlp.FinishDlpJobRequest] = None, *, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → None[source]¶ Finish a running hybrid DlpJob. Triggers the finalization steps and running of any enabled actions that have not yet run. Early access feature is in a pre- release state and might change or have limited support. For more information, see https://cloud.google.com/products#product-launch-stages.
- Parameters
request (
FinishDlpJobRequest
) – The request object. The request message for finishing a DLP hybrid job.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
-
classmethod
from_service_account_file
(filename: str, *args, **kwargs)[source]¶ Creates an instance of this client using the provided credentials file.
- Parameters
filename (str) – The path to the service account private key json file.
args – Additional arguments to pass to the constructor.
kwargs – Additional arguments to pass to the constructor.
- Returns
The constructed client.
- Return type
-
classmethod
from_service_account_json
(filename: str, *args, **kwargs)¶ Creates an instance of this client using the provided credentials file.
- Parameters
filename (str) – The path to the service account private key json file.
args – Additional arguments to pass to the constructor.
kwargs – Additional arguments to pass to the constructor.
- Returns
The constructed client.
- Return type
-
get_deidentify_template
(request: Optional[google.cloud.dlp_v2.types.dlp.GetDeidentifyTemplateRequest] = None, *, name: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.DeidentifyTemplate[source]¶ Gets a DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating- templates-deid to learn more.
- Parameters
request (
GetDeidentifyTemplateRequest
) – The request object. Request message for GetDeidentifyTemplate.name (
str
) – Required. Resource name of the organization and deidentify template to be read, for exampleorganizations/433245324/deidentifyTemplates/432452342
or projects/project-id/deidentifyTemplates/432452342. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
DeidentifyTemplates contains instructions on how to de-identify content. See https://cloud.google.com/dlp/docs/concepts- templates to learn more.
- Return type
DeidentifyTemplate
-
get_dlp_job
(request: Optional[google.cloud.dlp_v2.types.dlp.GetDlpJobRequest] = None, *, name: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.DlpJob[source]¶ Gets the latest state of a long-running DlpJob. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk- analysis to learn more.
- Parameters
request (
GetDlpJobRequest
) – The request object. The request message for [DlpJobs.GetDlpJob][].name (
str
) – Required. The name of the DlpJob resource. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Combines all of the information about a DLP job.
- Return type
DlpJob
-
get_inspect_template
(request: Optional[google.cloud.dlp_v2.types.dlp.GetInspectTemplateRequest] = None, *, name: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.InspectTemplate[source]¶ Gets an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more.
- Parameters
request (
GetInspectTemplateRequest
) – The request object. Request message for GetInspectTemplate.name (
str
) – Required. Resource name of the organization and inspectTemplate to be read, for exampleorganizations/433245324/inspectTemplates/432452342
or projects/project-id/inspectTemplates/432452342. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
The inspectTemplate contains a configuration (set of types of sensitive data to be detected) to be used anywhere you otherwise would normally specify InspectConfig. See https://cloud.google.com/dlp/docs/concepts- templates to learn more.
- Return type
InspectTemplate
-
get_job_trigger
(request: Optional[google.cloud.dlp_v2.types.dlp.GetJobTriggerRequest] = None, *, name: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.JobTrigger[source]¶ Gets a job trigger. See https://cloud.google.com/dlp/docs/creating-job- triggers to learn more.
- Parameters
request (
GetJobTriggerRequest
) – The request object. Request message for GetJobTrigger.name (
str
) – Required. Resource name of the project and the triggeredJob, for exampleprojects/dlp-test-project/jobTriggers/53234423
. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Contains a configuration to make dlp api calls on a repeating basis. See https://cloud.google.com/dlp/docs/concepts- job-triggers to learn more.
- Return type
JobTrigger
-
get_stored_info_type
(request: Optional[google.cloud.dlp_v2.types.dlp.GetStoredInfoTypeRequest] = None, *, name: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.StoredInfoType[source]¶ Gets a stored infoType. See https://cloud.google.com/dlp/docs/creating-stored- infotypes to learn more.
- Parameters
request (
GetStoredInfoTypeRequest
) – The request object. Request message for GetStoredInfoType.name (
str
) – Required. Resource name of the organization and storedInfoType to be read, for exampleorganizations/433245324/storedInfoTypes/432452342
or projects/project-id/storedInfoTypes/432452342. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
StoredInfoType resource message that contains information about the current version and any pending updates.
- Return type
StoredInfoType
-
hybrid_inspect_dlp_job
(request: Optional[google.cloud.dlp_v2.types.dlp.HybridInspectDlpJobRequest] = None, *, name: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.HybridInspectResponse[source]¶ Inspect hybrid content and store findings to a job. To review the findings inspect the job. Inspection will occur asynchronously. Early access feature is in a pre-release state and might change or have limited support. For more information, see https://cloud.google.com/products#product-launch-stages.
- Parameters
request (
HybridInspectDlpJobRequest
) – The request object. Request to search for potentially sensitive info in a custom location.name (
str
) – Required. Resource name of the job to execute a hybrid inspect on, for exampleprojects/dlp-test-project/dlpJob/53234423
. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Quota exceeded errors will be thrown once quota has been met.
- Return type
HybridInspectResponse
-
hybrid_inspect_job_trigger
(request: Optional[google.cloud.dlp_v2.types.dlp.HybridInspectJobTriggerRequest] = None, *, name: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.HybridInspectResponse[source]¶ Inspect hybrid content and store findings to a trigger. The inspection will be processed asynchronously. To review the findings monitor the jobs within the trigger. Early access feature is in a pre-release state and might change or have limited support. For more information, see https://cloud.google.com/products#product-launch-stages.
- Parameters
request (
HybridInspectJobTriggerRequest
) – The request object. Request to search for potentially sensitive info in a custom location.name (
str
) – Required. Resource name of the trigger to execute a hybrid inspect on, for exampleprojects/dlp-test-project/jobTriggers/53234423
. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Quota exceeded errors will be thrown once quota has been met.
- Return type
HybridInspectResponse
-
inspect_content
(request: Optional[google.cloud.dlp_v2.types.dlp.InspectContentRequest] = None, *, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.InspectContentResponse[source]¶ Finds potentially sensitive info in content. This method has limits on input size, processing time, and output size. When no InfoTypes or CustomInfoTypes are specified in this request, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated. For how to guides, see https://cloud.google.com/dlp/docs/inspecting-images and https://cloud.google.com/dlp/docs/inspecting-text,
- Parameters
request (
InspectContentRequest
) – The request object. Request to search for potentially sensitive info in a ContentItem.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Results of inspecting an item.
- Return type
InspectContentResponse
-
static
inspect_template_path
(organization: str, inspect_template: str) → str[source]¶ Return a fully-qualified inspect_template string.
-
static
job_trigger_path
(project: str, job_trigger: str) → str[source]¶ Return a fully-qualified job_trigger string.
-
list_deidentify_templates
(request: Optional[google.cloud.dlp_v2.types.dlp.ListDeidentifyTemplatesRequest] = None, *, parent: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.services.dlp_service.pagers.ListDeidentifyTemplatesPager[source]¶ Lists DeidentifyTemplates. See https://cloud.google.com/dlp/docs/creating- templates-deid to learn more.
- Parameters
request (
ListDeidentifyTemplatesRequest
) – The request object. Request message for ListDeidentifyTemplates.parent (
str
) –Required. Parent resource name.
The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:
Projects scope, location specified:
projects/
PROJECT_ID/locations/
LOCATION_IDProjects scope, no location specified (defaults to global):
projects/
PROJECT_IDOrganizations scope, location specified:
organizations/
ORG_ID/locations/
LOCATION_IDOrganizations scope, no location specified (defaults to global):
organizations/
ORG_ID
The following example
parent
string specifies a parent project with the identifierexample-project
, and specifies theeurope-west3
location for processing data:parent=projects/example-project/locations/europe-west3
This corresponds to the
parent
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Response message for ListDeidentifyTemplates. Iterating over this object will yield results and resolve additional pages automatically.
- Return type
ListDeidentifyTemplatesPager
-
list_dlp_jobs
(request: Optional[google.cloud.dlp_v2.types.dlp.ListDlpJobsRequest] = None, *, parent: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.services.dlp_service.pagers.ListDlpJobsPager[source]¶ Lists DlpJobs that match the specified filter in the request. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
- Parameters
request (
ListDlpJobsRequest
) – The request object. The request message for listing DLP jobs.parent (
str
) –Required. Parent resource name.
The format of this value varies depending on whether you have specified a processing location:
Projects scope, location specified:
projects/
PROJECT_ID/locations/
LOCATION_IDProjects scope, no location specified (defaults to global):
projects/
PROJECT_ID
The following example
parent
string specifies a parent project with the identifierexample-project
, and specifies theeurope-west3
location for processing data:parent=projects/example-project/locations/europe-west3
This corresponds to the
parent
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
The response message for listing DLP jobs. Iterating over this object will yield results and resolve additional pages automatically.
- Return type
ListDlpJobsPager
-
list_info_types
(request: Optional[google.cloud.dlp_v2.types.dlp.ListInfoTypesRequest] = None, *, parent: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.ListInfoTypesResponse[source]¶ Returns a list of the sensitive information types that the DLP API supports. See https://cloud.google.com/dlp/docs/infotypes-reference to learn more.
- Parameters
request (
ListInfoTypesRequest
) – The request object. Request for the list of infoTypes.parent (
str
) –The parent resource name.
The format of this value is as follows:
locations/<var>LOCATION_ID</var>
This corresponds to the
parent
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Response to the ListInfoTypes request.
- Return type
ListInfoTypesResponse
-
list_inspect_templates
(request: Optional[google.cloud.dlp_v2.types.dlp.ListInspectTemplatesRequest] = None, *, parent: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.services.dlp_service.pagers.ListInspectTemplatesPager[source]¶ Lists InspectTemplates. See https://cloud.google.com/dlp/docs/creating-templates to learn more.
- Parameters
request (
ListInspectTemplatesRequest
) – The request object. Request message for ListInspectTemplates.parent (
str
) –Required. Parent resource name.
The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:
Projects scope, location specified:
projects/
PROJECT_ID/locations/
LOCATION_IDProjects scope, no location specified (defaults to global):
projects/
PROJECT_IDOrganizations scope, location specified:
organizations/
ORG_ID/locations/
LOCATION_IDOrganizations scope, no location specified (defaults to global):
organizations/
ORG_ID
The following example
parent
string specifies a parent project with the identifierexample-project
, and specifies theeurope-west3
location for processing data:parent=projects/example-project/locations/europe-west3
This corresponds to the
parent
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Response message for ListInspectTemplates. Iterating over this object will yield results and resolve additional pages automatically.
- Return type
ListInspectTemplatesPager
-
list_job_triggers
(request: Optional[google.cloud.dlp_v2.types.dlp.ListJobTriggersRequest] = None, *, parent: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.services.dlp_service.pagers.ListJobTriggersPager[source]¶ Lists job triggers. See https://cloud.google.com/dlp/docs/creating-job- triggers to learn more.
- Parameters
request (
ListJobTriggersRequest
) – The request object. Request message for ListJobTriggers.parent (
str
) –Required. Parent resource name.
The format of this value varies depending on whether you have specified a processing location:
Projects scope, location specified:
projects/
PROJECT_ID/locations/
LOCATION_IDProjects scope, no location specified (defaults to global):
projects/
PROJECT_ID
The following example
parent
string specifies a parent project with the identifierexample-project
, and specifies theeurope-west3
location for processing data:parent=projects/example-project/locations/europe-west3
This corresponds to the
parent
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Response message for ListJobTriggers. Iterating over this object will yield results and resolve additional pages automatically.
- Return type
ListJobTriggersPager
-
list_stored_info_types
(request: Optional[google.cloud.dlp_v2.types.dlp.ListStoredInfoTypesRequest] = None, *, parent: Optional[str] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.services.dlp_service.pagers.ListStoredInfoTypesPager[source]¶ Lists stored infoTypes. See https://cloud.google.com/dlp/docs/creating-stored- infotypes to learn more.
- Parameters
request (
ListStoredInfoTypesRequest
) – The request object. Request message for ListStoredInfoTypes.parent (
str
) –Required. Parent resource name.
The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location:
Projects scope, location specified:
projects/
PROJECT_ID/locations/
LOCATION_IDProjects scope, no location specified (defaults to global):
projects/
PROJECT_IDOrganizations scope, location specified:
organizations/
ORG_ID/locations/
LOCATION_IDOrganizations scope, no location specified (defaults to global):
organizations/
ORG_ID
The following example
parent
string specifies a parent project with the identifierexample-project
, and specifies theeurope-west3
location for processing data:parent=projects/example-project/locations/europe-west3
This corresponds to the
parent
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Response message for ListStoredInfoTypes. Iterating over this object will yield results and resolve additional pages automatically.
- Return type
ListStoredInfoTypesPager
-
static
parse_common_billing_account_path
(path: str) → Dict[str, str][source]¶ Parse a billing_account path into its component segments.
-
static
parse_common_folder_path
(path: str) → Dict[str, str][source]¶ Parse a folder path into its component segments.
-
static
parse_common_location_path
(path: str) → Dict[str, str][source]¶ Parse a location path into its component segments.
-
static
parse_common_organization_path
(path: str) → Dict[str, str][source]¶ Parse a organization path into its component segments.
-
static
parse_common_project_path
(path: str) → Dict[str, str][source]¶ Parse a project path into its component segments.
-
static
parse_deidentify_template_path
(path: str) → Dict[str, str][source]¶ Parse a deidentify_template path into its component segments.
-
static
parse_dlp_content_path
(path: str) → Dict[str, str][source]¶ Parse a dlp_content path into its component segments.
-
static
parse_dlp_job_path
(path: str) → Dict[str, str][source]¶ Parse a dlp_job path into its component segments.
-
static
parse_finding_path
(path: str) → Dict[str, str][source]¶ Parse a finding path into its component segments.
-
static
parse_inspect_template_path
(path: str) → Dict[str, str][source]¶ Parse a inspect_template path into its component segments.
-
static
parse_job_trigger_path
(path: str) → Dict[str, str][source]¶ Parse a job_trigger path into its component segments.
-
static
parse_stored_info_type_path
(path: str) → Dict[str, str][source]¶ Parse a stored_info_type path into its component segments.
-
redact_image
(request: Optional[google.cloud.dlp_v2.types.dlp.RedactImageRequest] = None, *, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.RedactImageResponse[source]¶ Redacts potentially sensitive info from an image. This method has limits on input size, processing time, and output size. See https://cloud.google.com/dlp/docs/redacting-sensitive- data-images to learn more.
When no InfoTypes or CustomInfoTypes are specified in this request, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.
- Parameters
request (
RedactImageRequest
) – The request object. Request to search for potentially sensitive info in an image and redact it by covering it with a colored rectangle.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Results of redacting an image.
- Return type
RedactImageResponse
-
reidentify_content
(request: Optional[google.cloud.dlp_v2.types.dlp.ReidentifyContentRequest] = None, *, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.ReidentifyContentResponse[source]¶ Re-identifies content that has been de-identified. See https://cloud.google.com/dlp/docs/pseudonymization#re-identification_in_free_text_code_example to learn more.
- Parameters
request (
ReidentifyContentRequest
) – The request object. Request to re-identify an item.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Results of re-identifying a item.
- Return type
ReidentifyContentResponse
-
static
stored_info_type_path
(organization: str, stored_info_type: str) → str[source]¶ Return a fully-qualified stored_info_type string.
-
property
transport
¶ Return the transport used by the client instance.
- Returns
The transport used by the client instance.
- Return type
DlpServiceTransport
-
update_deidentify_template
(request: Optional[google.cloud.dlp_v2.types.dlp.UpdateDeidentifyTemplateRequest] = None, *, name: Optional[str] = None, deidentify_template: Optional[google.cloud.dlp_v2.types.dlp.DeidentifyTemplate] = None, update_mask: Optional[google.protobuf.field_mask_pb2.FieldMask] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.DeidentifyTemplate[source]¶ Updates the DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating- templates-deid to learn more.
- Parameters
request (
UpdateDeidentifyTemplateRequest
) – The request object. Request message for UpdateDeidentifyTemplate.name (
str
) – Required. Resource name of organization and deidentify template to be updated, for exampleorganizations/433245324/deidentifyTemplates/432452342
or projects/project-id/deidentifyTemplates/432452342. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.deidentify_template (
DeidentifyTemplate
) – New DeidentifyTemplate value. This corresponds to thedeidentify_template
field on therequest
instance; ifrequest
is provided, this should not be set.update_mask (
FieldMask
) – Mask to control which fields get updated. This corresponds to theupdate_mask
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
DeidentifyTemplates contains instructions on how to de-identify content. See https://cloud.google.com/dlp/docs/concepts- templates to learn more.
- Return type
DeidentifyTemplate
-
update_inspect_template
(request: Optional[google.cloud.dlp_v2.types.dlp.UpdateInspectTemplateRequest] = None, *, name: Optional[str] = None, inspect_template: Optional[google.cloud.dlp_v2.types.dlp.InspectTemplate] = None, update_mask: Optional[google.protobuf.field_mask_pb2.FieldMask] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.InspectTemplate[source]¶ Updates the InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more.
- Parameters
request (
UpdateInspectTemplateRequest
) – The request object. Request message for UpdateInspectTemplate.name (
str
) – Required. Resource name of organization and inspectTemplate to be updated, for exampleorganizations/433245324/inspectTemplates/432452342
or projects/project-id/inspectTemplates/432452342. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.inspect_template (
InspectTemplate
) – New InspectTemplate value. This corresponds to theinspect_template
field on therequest
instance; ifrequest
is provided, this should not be set.update_mask (
FieldMask
) – Mask to control which fields get updated. This corresponds to theupdate_mask
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
The inspectTemplate contains a configuration (set of types of sensitive data to be detected) to be used anywhere you otherwise would normally specify InspectConfig. See https://cloud.google.com/dlp/docs/concepts- templates to learn more.
- Return type
InspectTemplate
-
update_job_trigger
(request: Optional[google.cloud.dlp_v2.types.dlp.UpdateJobTriggerRequest] = None, *, name: Optional[str] = None, job_trigger: Optional[google.cloud.dlp_v2.types.dlp.JobTrigger] = None, update_mask: Optional[google.protobuf.field_mask_pb2.FieldMask] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.JobTrigger[source]¶ Updates a job trigger. See https://cloud.google.com/dlp/docs/creating-job- triggers to learn more.
- Parameters
request (
UpdateJobTriggerRequest
) – The request object. Request message for UpdateJobTrigger.name (
str
) – Required. Resource name of the project and the triggeredJob, for exampleprojects/dlp-test-project/jobTriggers/53234423
. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.job_trigger (
JobTrigger
) – New JobTrigger value. This corresponds to thejob_trigger
field on therequest
instance; ifrequest
is provided, this should not be set.update_mask (
FieldMask
) – Mask to control which fields get updated. This corresponds to theupdate_mask
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
Contains a configuration to make dlp api calls on a repeating basis. See https://cloud.google.com/dlp/docs/concepts- job-triggers to learn more.
- Return type
JobTrigger
-
update_stored_info_type
(request: Optional[google.cloud.dlp_v2.types.dlp.UpdateStoredInfoTypeRequest] = None, *, name: Optional[str] = None, config: Optional[google.cloud.dlp_v2.types.dlp.StoredInfoTypeConfig] = None, update_mask: Optional[google.protobuf.field_mask_pb2.FieldMask] = None, retry: google.api_core.retry.Retry = <object object>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ()) → google.cloud.dlp_v2.types.dlp.StoredInfoType[source]¶ Updates the stored infoType by creating a new version. The existing version will continue to be used until the new version is ready. See https://cloud.google.com/dlp/docs/creating-stored- infotypes to learn more.
- Parameters
request (
UpdateStoredInfoTypeRequest
) – The request object. Request message for UpdateStoredInfoType.name (
str
) – Required. Resource name of organization and storedInfoType to be updated, for exampleorganizations/433245324/storedInfoTypes/432452342
or projects/project-id/storedInfoTypes/432452342. This corresponds to thename
field on therequest
instance; ifrequest
is provided, this should not be set.config (
StoredInfoTypeConfig
) – Updated configuration for the storedInfoType. If not provided, a new version of the storedInfoType will be created with the existing configuration. This corresponds to theconfig
field on therequest
instance; ifrequest
is provided, this should not be set.update_mask (
FieldMask
) – Mask to control which fields get updated. This corresponds to theupdate_mask
field on therequest
instance; ifrequest
is provided, this should not be set.retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.
timeout (float) – The timeout for this request.
metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- Returns
StoredInfoType resource message that contains information about the current version and any pending updates.
- Return type
StoredInfoType