Class DlpServiceAsyncClient (3.15.3)

DlpServiceAsyncClient(*, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Union[str, google.cloud.dlp_v2.services.dlp_service.transports.base.DlpServiceTransport] = 'grpc_asyncio', client_options: typing.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>)

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/.

Properties

api_endpoint

Return the API endpoint used by the client instance.

Returns
TypeDescription
strThe API endpoint used by the client instance.

transport

Returns the transport used by the client instance.

Returns
TypeDescription
DlpServiceTransportThe transport used by the client instance.

universe_domain

Return the universe domain used by the client instance.

Returns
TypeDescription
strThe universe domain used by the client instance.

Methods

DlpServiceAsyncClient

DlpServiceAsyncClient(*, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Union[str, google.cloud.dlp_v2.services.dlp_service.transports.base.DlpServiceTransport] = 'grpc_asyncio', client_options: typing.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>)

Instantiates the dlp service async client.

Parameters
NameDescription
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 Optional[Union[google.api_core.client_options.ClientOptions, dict]]

Custom options for the client. 1. The api_endpoint property can be used to override the default endpoint provided by the client when transport is not explicitly provided. Only if this property is not set and transport was not explicitly provided, the endpoint is determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment variable, which have one of the following values: "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). 2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is "true", then the client_cert_source property can be used to provide a client certificate for mTLS 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. 3. The universe_domain property can be used to override the default "googleapis.com" universe. Note that api_endpoint property still takes precedence; and universe_domain is currently not supported for mTLS.

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.

Exceptions
TypeDescription
google.auth.exceptions.MutualTlsChannelErrorIf mutual TLS transport creation failed for any reason.

activate_job_trigger

activate_job_trigger(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.ActivateJobTriggerRequest, dict]
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.types.dlp.DlpJob

Activate a job trigger. Causes the immediate execute of a trigger instead of waiting on the trigger event to occur.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_activate_job_trigger():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.ActivateJobTriggerRequest(
        name="name_value",
    )

    # Make the request
    response = await client.activate_job_trigger(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.ActivateJobTriggerRequest, dict]]

The request object. Request message for ActivateJobTrigger.

retry google.api_core.retry_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.types.DlpJobCombines all of the information about a DLP job.

cancel_dlp_job

cancel_dlp_job(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.CancelDlpJobRequest, dict]
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> None

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_cancel_dlp_job():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.CancelDlpJobRequest(
        name="name_value",
    )

    # Make the request
    await client.cancel_dlp_job(request=request)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.CancelDlpJobRequest, dict]]

The request object. The request message for canceling a DLP job.

retry google.api_core.retry_async.AsyncRetry

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.

common_billing_account_path

common_billing_account_path(billing_account: str) -> str

Returns a fully-qualified billing_account string.

common_folder_path

common_folder_path(folder: str) -> str

Returns a fully-qualified folder string.

common_location_path

common_location_path(project: str, location: str) -> str

Returns a fully-qualified location string.

common_organization_path

common_organization_path(organization: str) -> str

Returns a fully-qualified organization string.

common_project_path

common_project_path(project: str) -> str

Returns a fully-qualified project string.

create_deidentify_template

create_deidentify_template(
    request: typing.Optional[
        typing.Union[
            google.cloud.dlp_v2.types.dlp.CreateDeidentifyTemplateRequest, dict
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    deidentify_template: typing.Optional[
        google.cloud.dlp_v2.types.dlp.DeidentifyTemplate
    ] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.types.dlp.DeidentifyTemplate

Creates a DeidentifyTemplate for reusing frequently used configuration for de-identifying content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_create_deidentify_template():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.CreateDeidentifyTemplateRequest(
        parent="parent_value",
    )

    # Make the request
    response = await client.create_deidentify_template(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.CreateDeidentifyTemplateRequest, dict]]

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 https://cloud.google.com/dlp/docs/specifying-location__: - Projects scope, location specified: projects/\ PROJECT_ID\ /locations/\ LOCATION_ID - Projects scope, no location specified (defaults to global): projects/\ PROJECT_ID - Organizations scope, location specified: organizations/\ ORG_ID\ /locations/\ LOCATION_ID - Organizations scope, no location specified (defaults to global): organizations/\ ORG_ID The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data: :: parent=projects/example-project/locations/europe-west3 This corresponds to the parent field on the request instance; if request is provided, this should not be set.

deidentify_template DeidentifyTemplate

Required. The DeidentifyTemplate to create. This corresponds to the deidentify_template field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.types.DeidentifyTemplateDeidentifyTemplates contains instructions on how to de-identify content. See https://cloud.google.com/dlp/docs/concepts-templates to learn more.

create_discovery_config

create_discovery_config(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.CreateDiscoveryConfigRequest, dict]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    discovery_config: typing.Optional[
        google.cloud.dlp_v2.types.dlp.DiscoveryConfig
    ] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.types.dlp.DiscoveryConfig

Creates a config for discovery to scan and profile storage.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_create_discovery_config():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    discovery_config = dlp_v2.DiscoveryConfig()
    discovery_config.status = "PAUSED"

    request = dlp_v2.CreateDiscoveryConfigRequest(
        parent="parent_value",
        discovery_config=discovery_config,
    )

    # Make the request
    response = await client.create_discovery_config(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.CreateDiscoveryConfigRequest, dict]]

The request object. Request message for CreateDiscoveryConfig.

parent str

Required. Parent resource name. The format of this value is as follows: projects/\ PROJECT_ID\ /locations/\ LOCATION_ID The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data: :: parent=projects/example-project/locations/europe-west3 This corresponds to the parent field on the request instance; if request is provided, this should not be set.

discovery_config DiscoveryConfig

Required. The DiscoveryConfig to create. This corresponds to the discovery_config field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.types.DiscoveryConfigConfiguration for discovery to scan resources for profile generation. Only one discovery configuration may exist per organization, folder, or project. The generated data profiles are retained according to the [data retention policy] (https://cloud.google.com/dlp/docs/data-profiles#retention).

create_dlp_job

create_dlp_job(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.CreateDlpJobRequest, dict]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    inspect_job: typing.Optional[google.cloud.dlp_v2.types.dlp.InspectJobConfig] = None,
    risk_job: typing.Optional[
        google.cloud.dlp_v2.types.dlp.RiskAnalysisJobConfig
    ] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.types.dlp.DlpJob

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_create_dlp_job():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.CreateDlpJobRequest(
        parent="parent_value",
    )

    # Make the request
    response = await client.create_dlp_job(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.CreateDlpJobRequest, dict]]

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 https://cloud.google.com/dlp/docs/specifying-location__: - Projects scope, location specified: projects/\ PROJECT_ID\ /locations/\ LOCATION_ID - Projects scope, no location specified (defaults to global): projects/\ PROJECT_ID The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data: :: parent=projects/example-project/locations/europe-west3 This corresponds to the parent field on the request instance; if request is provided, this should not be set.

inspect_job InspectJobConfig

An inspection job scans a storage repository for InfoTypes. This corresponds to the inspect_job field on the request instance; if request is provided, this should not be set.

risk_job RiskAnalysisJobConfig

A risk analysis job calculates re-identification risk metrics for a BigQuery table. This corresponds to the risk_job field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.types.DlpJobCombines all of the information about a DLP job.

create_inspect_template

create_inspect_template(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.CreateInspectTemplateRequest, dict]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    inspect_template: typing.Optional[
        google.cloud.dlp_v2.types.dlp.InspectTemplate
    ] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.types.dlp.InspectTemplate

Creates an InspectTemplate for reusing frequently used configuration for inspecting content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_create_inspect_template():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.CreateInspectTemplateRequest(
        parent="parent_value",
    )

    # Make the request
    response = await client.create_inspect_template(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.CreateInspectTemplateRequest, dict]]

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 https://cloud.google.com/dlp/docs/specifying-location__: - Projects scope, location specified: projects/\ PROJECT_ID\ /locations/\ LOCATION_ID - Projects scope, no location specified (defaults to global): projects/\ PROJECT_ID - Organizations scope, location specified: organizations/\ ORG_ID\ /locations/\ LOCATION_ID - Organizations scope, no location specified (defaults to global): organizations/\ ORG_ID The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data: :: parent=projects/example-project/locations/europe-west3 This corresponds to the parent field on the request instance; if request is provided, this should not be set.

inspect_template InspectTemplate

Required. The InspectTemplate to create. This corresponds to the inspect_template field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.types.InspectTemplateThe 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.

create_job_trigger

create_job_trigger(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.CreateJobTriggerRequest, dict]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    job_trigger: typing.Optional[google.cloud.dlp_v2.types.dlp.JobTrigger] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.types.dlp.JobTrigger

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_create_job_trigger():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    job_trigger = dlp_v2.JobTrigger()
    job_trigger.status = "CANCELLED"

    request = dlp_v2.CreateJobTriggerRequest(
        parent="parent_value",
        job_trigger=job_trigger,
    )

    # Make the request
    response = await client.create_job_trigger(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.CreateJobTriggerRequest, dict]]

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 https://cloud.google.com/dlp/docs/specifying-location__: - Projects scope, location specified: projects/\ PROJECT_ID\ /locations/\ LOCATION_ID - Projects scope, no location specified (defaults to global): projects/\ PROJECT_ID The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data: :: parent=projects/example-project/locations/europe-west3 This corresponds to the parent field on the request instance; if request is provided, this should not be set.

job_trigger JobTrigger

Required. The JobTrigger to create. This corresponds to the job_trigger field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.types.JobTriggerContains a configuration to make dlp api calls on a repeating basis. See https://cloud.google.com/dlp/docs/concepts-job-triggers to learn more.

create_stored_info_type

create_stored_info_type(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.CreateStoredInfoTypeRequest, dict]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    config: typing.Optional[google.cloud.dlp_v2.types.dlp.StoredInfoTypeConfig] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.types.dlp.StoredInfoType

Creates a pre-built stored infoType to be used for inspection. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_create_stored_info_type():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.CreateStoredInfoTypeRequest(
        parent="parent_value",
    )

    # Make the request
    response = await client.create_stored_info_type(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.CreateStoredInfoTypeRequest, dict]]

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 https://cloud.google.com/dlp/docs/specifying-location__: - Projects scope, location specified: projects/\ PROJECT_ID\ /locations/\ LOCATION_ID - Projects scope, no location specified (defaults to global): projects/\ PROJECT_ID - Organizations scope, location specified: organizations/\ ORG_ID\ /locations/\ LOCATION_ID - Organizations scope, no location specified (defaults to global): organizations/\ ORG_ID The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data: :: parent=projects/example-project/locations/europe-west3 This corresponds to the parent field on the request instance; if request is provided, this should not be set.

config StoredInfoTypeConfig

Required. Configuration of the storedInfoType to create. This corresponds to the config field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.types.StoredInfoTypeStoredInfoType resource message that contains information about the current version and any pending updates.

deidentify_content

deidentify_content(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.DeidentifyContentRequest, dict]
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.types.dlp.DeidentifyContentResponse

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_deidentify_content():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.DeidentifyContentRequest(
    )

    # Make the request
    response = await client.deidentify_content(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.DeidentifyContentRequest, dict]]

The request object. Request to de-identify a ContentItem.

retry google.api_core.retry_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.types.DeidentifyContentResponseResults of de-identifying a ContentItem.

deidentify_template_path

deidentify_template_path(organization: str, deidentify_template: str) -> str

Returns a fully-qualified deidentify_template string.

delete_deidentify_template

delete_deidentify_template(
    request: typing.Optional[
        typing.Union[
            google.cloud.dlp_v2.types.dlp.DeleteDeidentifyTemplateRequest, dict
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> None

Deletes a DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_delete_deidentify_template():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.DeleteDeidentifyTemplateRequest(
        name="name_value",
    )

    # Make the request
    await client.delete_deidentify_template(request=request)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.DeleteDeidentifyTemplateRequest, dict]]

The request object. Request message for DeleteDeidentifyTemplate.

name str

Required. Resource name of the organization and deidentify template to be deleted, for example organizations/433245324/deidentifyTemplates/432452342 or projects/project-id/deidentifyTemplates/432452342. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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_discovery_config

delete_discovery_config(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.DeleteDiscoveryConfigRequest, dict]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> None

Deletes a discovery configuration.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_delete_discovery_config():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.DeleteDiscoveryConfigRequest(
        name="name_value",
    )

    # Make the request
    await client.delete_discovery_config(request=request)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.DeleteDiscoveryConfigRequest, dict]]

The request object. Request message for DeleteDiscoveryConfig.

name str

Required. Resource name of the project and the config, for example projects/dlp-test-project/discoveryConfigs/53234423. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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

delete_dlp_job(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.DeleteDlpJobRequest, dict]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> None

Deletes a long-running DlpJob. This method indicates that the client is no longer interested in the DlpJob result. The job will be canceled if possible. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_delete_dlp_job():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.DeleteDlpJobRequest(
        name="name_value",
    )

    # Make the request
    await client.delete_dlp_job(request=request)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.DeleteDlpJobRequest, dict]]

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 the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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

delete_inspect_template(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.DeleteInspectTemplateRequest, dict]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> None

Deletes an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_delete_inspect_template():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.DeleteInspectTemplateRequest(
        name="name_value",
    )

    # Make the request
    await client.delete_inspect_template(request=request)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.DeleteInspectTemplateRequest, dict]]

The request object. Request message for DeleteInspectTemplate.

name str

Required. Resource name of the organization and inspectTemplate to be deleted, for example organizations/433245324/inspectTemplates/432452342 or projects/project-id/inspectTemplates/432452342. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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

delete_job_trigger(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.DeleteJobTriggerRequest, dict]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> None

Deletes a job trigger. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_delete_job_trigger():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.DeleteJobTriggerRequest(
        name="name_value",
    )

    # Make the request
    await client.delete_job_trigger(request=request)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.DeleteJobTriggerRequest, dict]]

The request object. Request message for DeleteJobTrigger.

name str

Required. Resource name of the project and the triggeredJob, for example projects/dlp-test-project/jobTriggers/53234423. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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

delete_stored_info_type(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.DeleteStoredInfoTypeRequest, dict]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> None

Deletes a stored infoType. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_delete_stored_info_type():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.DeleteStoredInfoTypeRequest(
        name="name_value",
    )

    # Make the request
    await client.delete_stored_info_type(request=request)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.DeleteStoredInfoTypeRequest, dict]]

The request object. Request message for DeleteStoredInfoType.

name str

Required. Resource name of the organization and storedInfoType to be deleted, for example organizations/433245324/storedInfoTypes/432452342 or projects/project-id/storedInfoTypes/432452342. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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.

discovery_config_path

discovery_config_path(project: str, location: str, discovery_config: str) -> str

Returns a fully-qualified discovery_config string.

dlp_content_path

dlp_content_path(project: str) -> str

Returns a fully-qualified dlp_content string.

dlp_job_path

dlp_job_path(project: str, dlp_job: str) -> str

Returns a fully-qualified dlp_job string.

finding_path

finding_path(project: str, location: str, finding: str) -> str

Returns a fully-qualified finding string.

finish_dlp_job

finish_dlp_job(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.FinishDlpJobRequest, dict]
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> None

Finish a running hybrid DlpJob. Triggers the finalization steps and running of any enabled actions that have not yet run.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_finish_dlp_job():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.FinishDlpJobRequest(
        name="name_value",
    )

    # Make the request
    await client.finish_dlp_job(request=request)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.FinishDlpJobRequest, dict]]

The request object. The request message for finishing a DLP hybrid job.

retry google.api_core.retry_async.AsyncRetry

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.

from_service_account_file

from_service_account_file(filename: str, *args, **kwargs)

Creates an instance of this client using the provided credentials file.

Parameter
NameDescription
filename str

The path to the service account private key json file.

Returns
TypeDescription
DlpServiceAsyncClientThe constructed client.

from_service_account_info

from_service_account_info(info: dict, *args, **kwargs)

Creates an instance of this client using the provided credentials info.

Parameter
NameDescription
info dict

The service account private key info.

Returns
TypeDescription
DlpServiceAsyncClientThe constructed client.

from_service_account_json

from_service_account_json(filename: str, *args, **kwargs)

Creates an instance of this client using the provided credentials file.

Parameter
NameDescription
filename str

The path to the service account private key json file.

Returns
TypeDescription
DlpServiceAsyncClientThe constructed client.

get_deidentify_template

get_deidentify_template(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.GetDeidentifyTemplateRequest, dict]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.types.dlp.DeidentifyTemplate

Gets a DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_get_deidentify_template():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.GetDeidentifyTemplateRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_deidentify_template(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.GetDeidentifyTemplateRequest, dict]]

The request object. Request message for GetDeidentifyTemplate.

name str

Required. Resource name of the organization and deidentify template to be read, for example organizations/433245324/deidentifyTemplates/432452342 or projects/project-id/deidentifyTemplates/432452342. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.types.DeidentifyTemplateDeidentifyTemplates contains instructions on how to de-identify content. See https://cloud.google.com/dlp/docs/concepts-templates to learn more.

get_discovery_config

get_discovery_config(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.GetDiscoveryConfigRequest, dict]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.types.dlp.DiscoveryConfig

Gets a discovery configuration.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_get_discovery_config():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.GetDiscoveryConfigRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_discovery_config(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.GetDiscoveryConfigRequest, dict]]

The request object. Request message for GetDiscoveryConfig.

name str

Required. Resource name of the project and the configuration, for example projects/dlp-test-project/discoveryConfigs/53234423. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.types.DiscoveryConfigConfiguration for discovery to scan resources for profile generation. Only one discovery configuration may exist per organization, folder, or project. The generated data profiles are retained according to the [data retention policy] (https://cloud.google.com/dlp/docs/data-profiles#retention).

get_dlp_job

get_dlp_job(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.GetDlpJobRequest, dict]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.types.dlp.DlpJob

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_get_dlp_job():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.GetDlpJobRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_dlp_job(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.GetDlpJobRequest, dict]]

The request object. The request message for [DlpJobs.GetDlpJob][].

name str

Required. The name of the DlpJob resource. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.types.DlpJobCombines all of the information about a DLP job.

get_inspect_template

get_inspect_template(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.GetInspectTemplateRequest, dict]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.types.dlp.InspectTemplate

Gets an InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_get_inspect_template():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.GetInspectTemplateRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_inspect_template(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.GetInspectTemplateRequest, dict]]

The request object. Request message for GetInspectTemplate.

name str

Required. Resource name of the organization and inspectTemplate to be read, for example organizations/433245324/inspectTemplates/432452342 or projects/project-id/inspectTemplates/432452342. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.types.InspectTemplateThe 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.

get_job_trigger

get_job_trigger(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.GetJobTriggerRequest, dict]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.types.dlp.JobTrigger

Gets a job trigger. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_get_job_trigger():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.GetJobTriggerRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_job_trigger(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.GetJobTriggerRequest, dict]]

The request object. Request message for GetJobTrigger.

name str

Required. Resource name of the project and the triggeredJob, for example projects/dlp-test-project/jobTriggers/53234423. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.types.JobTriggerContains a configuration to make dlp api calls on a repeating basis. See https://cloud.google.com/dlp/docs/concepts-job-triggers to learn more.

get_mtls_endpoint_and_cert_source

get_mtls_endpoint_and_cert_source(
    client_options: typing.Optional[
        google.api_core.client_options.ClientOptions
    ] = None,
)

Return the API endpoint and client cert source for mutual TLS.

The client cert source is determined in the following order: (1) if GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is not "true", the client cert source is None. (2) if client_options.client_cert_source is provided, use the provided one; if the default client cert source exists, use the default one; otherwise the client cert source is None.

The API endpoint is determined in the following order: (1) if client_options.api_endpoint if provided, use the provided one. (2) if GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is "always", use the default mTLS endpoint; if the environment variable is "never", use the default API endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise use the default API endpoint.

More details can be found at https://google.aip.dev/auth/4114.

Parameter
NameDescription
client_options google.api_core.client_options.ClientOptions

Custom options for the client. Only the api_endpoint and client_cert_source properties may be used in this method.

Exceptions
TypeDescription
google.auth.exceptions.MutualTLSChannelErrorIf any errors happen.
Returns
TypeDescription
Tuple[str, Callable[[], Tuple[bytes, bytes]]]returns the API endpoint and the client cert source to use.

get_stored_info_type

get_stored_info_type(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.GetStoredInfoTypeRequest, dict]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.types.dlp.StoredInfoType

Gets a stored infoType. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_get_stored_info_type():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.GetStoredInfoTypeRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_stored_info_type(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.GetStoredInfoTypeRequest, dict]]

The request object. Request message for GetStoredInfoType.

name str

Required. Resource name of the organization and storedInfoType to be read, for example organizations/433245324/storedInfoTypes/432452342 or projects/project-id/storedInfoTypes/432452342. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.types.StoredInfoTypeStoredInfoType resource message that contains information about the current version and any pending updates.

get_transport_class

get_transport_class() -> (
    typing.Type[
        google.cloud.dlp_v2.services.dlp_service.transports.base.DlpServiceTransport
    ]
)

Returns an appropriate transport class.

Parameter
NameDescription
label typing.Optional[str]

The name of the desired transport. If none is provided, then the first transport in the registry is used.

hybrid_inspect_dlp_job

hybrid_inspect_dlp_job(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.HybridInspectDlpJobRequest, dict]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.types.dlp.HybridInspectResponse

Inspect hybrid content and store findings to a job. To review the findings, inspect the job. Inspection will occur asynchronously.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_hybrid_inspect_dlp_job():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.HybridInspectDlpJobRequest(
        name="name_value",
    )

    # Make the request
    response = await client.hybrid_inspect_dlp_job(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.HybridInspectDlpJobRequest, dict]]

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 example projects/dlp-test-project/dlpJob/53234423. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.types.HybridInspectResponseQuota exceeded errors will be thrown once quota has been met.

hybrid_inspect_job_trigger

hybrid_inspect_job_trigger(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.HybridInspectJobTriggerRequest, dict]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.types.dlp.HybridInspectResponse

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_hybrid_inspect_job_trigger():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.HybridInspectJobTriggerRequest(
        name="name_value",
    )

    # Make the request
    response = await client.hybrid_inspect_job_trigger(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.HybridInspectJobTriggerRequest, dict]]

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 example projects/dlp-test-project/jobTriggers/53234423. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.types.HybridInspectResponseQuota exceeded errors will be thrown once quota has been met.

inspect_content

inspect_content(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.InspectContentRequest, dict]
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.types.dlp.InspectContentResponse

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,

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_inspect_content():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.InspectContentRequest(
    )

    # Make the request
    response = await client.inspect_content(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.InspectContentRequest, dict]]

The request object. Request to search for potentially sensitive info in a ContentItem.

retry google.api_core.retry_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.types.InspectContentResponseResults of inspecting an item.

inspect_template_path

inspect_template_path(organization: str, inspect_template: str) -> str

Returns a fully-qualified inspect_template string.

job_trigger_path

job_trigger_path(project: str, job_trigger: str) -> str

Returns a fully-qualified job_trigger string.

list_deidentify_templates

list_deidentify_templates(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.ListDeidentifyTemplatesRequest, dict]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.services.dlp_service.pagers.ListDeidentifyTemplatesAsyncPager

Lists DeidentifyTemplates. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_list_deidentify_templates():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.ListDeidentifyTemplatesRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_deidentify_templates(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.ListDeidentifyTemplatesRequest, dict]]

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 https://cloud.google.com/dlp/docs/specifying-location__: - Projects scope, location specified: projects/\ PROJECT_ID\ /locations/\ LOCATION_ID - Projects scope, no location specified (defaults to global): projects/\ PROJECT_ID - Organizations scope, location specified: organizations/\ ORG_ID\ /locations/\ LOCATION_ID - Organizations scope, no location specified (defaults to global): organizations/\ ORG_ID The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data: :: parent=projects/example-project/locations/europe-west3 This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.services.dlp_service.pagers.ListDeidentifyTemplatesAsyncPagerResponse message for ListDeidentifyTemplates. Iterating over this object will yield results and resolve additional pages automatically.

list_discovery_configs

list_discovery_configs(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.ListDiscoveryConfigsRequest, dict]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.services.dlp_service.pagers.ListDiscoveryConfigsAsyncPager

Lists discovery configurations.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_list_discovery_configs():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.ListDiscoveryConfigsRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_discovery_configs(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.ListDiscoveryConfigsRequest, dict]]

The request object. Request message for ListDiscoveryConfigs.

parent str

Required. Parent resource name. The format of this value is as follows: projects/\ PROJECT_ID\ /locations/\ LOCATION_ID The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data: :: parent=projects/example-project/locations/europe-west3 This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.services.dlp_service.pagers.ListDiscoveryConfigsAsyncPagerResponse message for ListDiscoveryConfigs. Iterating over this object will yield results and resolve additional pages automatically.

list_dlp_jobs

list_dlp_jobs(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.ListDlpJobsRequest, dict]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.services.dlp_service.pagers.ListDlpJobsAsyncPager

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_list_dlp_jobs():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.ListDlpJobsRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_dlp_jobs(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.ListDlpJobsRequest, dict]]

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 https://cloud.google.com/dlp/docs/specifying-location__: - Projects scope, location specified: projects/\ PROJECT_ID\ /locations/\ LOCATION_ID - Projects scope, no location specified (defaults to global): projects/\ PROJECT_ID The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data: :: parent=projects/example-project/locations/europe-west3 This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.services.dlp_service.pagers.ListDlpJobsAsyncPagerThe response message for listing DLP jobs. Iterating over this object will yield results and resolve additional pages automatically.

list_info_types

list_info_types(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.ListInfoTypesRequest, dict]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.types.dlp.ListInfoTypesResponse

Returns a list of the sensitive information types that DLP API supports. See https://cloud.google.com/dlp/docs/infotypes-reference to learn more.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_list_info_types():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.ListInfoTypesRequest(
    )

    # Make the request
    response = await client.list_info_types(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.ListInfoTypesRequest, dict]]

The request object. Request for the list of infoTypes.

parent str

The parent resource name. The format of this value is as follows: :: locations/LOCATION_ID This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.types.ListInfoTypesResponseResponse to the ListInfoTypes request.

list_inspect_templates

list_inspect_templates(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.ListInspectTemplatesRequest, dict]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.services.dlp_service.pagers.ListInspectTemplatesAsyncPager

Lists InspectTemplates. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_list_inspect_templates():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.ListInspectTemplatesRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_inspect_templates(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.ListInspectTemplatesRequest, dict]]

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 https://cloud.google.com/dlp/docs/specifying-location__: - Projects scope, location specified: projects/\ PROJECT_ID\ /locations/\ LOCATION_ID - Projects scope, no location specified (defaults to global): projects/\ PROJECT_ID - Organizations scope, location specified: organizations/\ ORG_ID\ /locations/\ LOCATION_ID - Organizations scope, no location specified (defaults to global): organizations/\ ORG_ID The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data: :: parent=projects/example-project/locations/europe-west3 This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.services.dlp_service.pagers.ListInspectTemplatesAsyncPagerResponse message for ListInspectTemplates. Iterating over this object will yield results and resolve additional pages automatically.

list_job_triggers

list_job_triggers(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.ListJobTriggersRequest, dict]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.services.dlp_service.pagers.ListJobTriggersAsyncPager

Lists job triggers. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_list_job_triggers():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.ListJobTriggersRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_job_triggers(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.ListJobTriggersRequest, dict]]

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 https://cloud.google.com/dlp/docs/specifying-location__: - Projects scope, location specified: projects/\ PROJECT_ID\ /locations/\ LOCATION_ID - Projects scope, no location specified (defaults to global): projects/\ PROJECT_ID The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data: :: parent=projects/example-project/locations/europe-west3 This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.services.dlp_service.pagers.ListJobTriggersAsyncPagerResponse message for ListJobTriggers. Iterating over this object will yield results and resolve additional pages automatically.

list_stored_info_types

list_stored_info_types(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.ListStoredInfoTypesRequest, dict]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.services.dlp_service.pagers.ListStoredInfoTypesAsyncPager

Lists stored infoTypes. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_list_stored_info_types():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.ListStoredInfoTypesRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_stored_info_types(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.ListStoredInfoTypesRequest, dict]]

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 https://cloud.google.com/dlp/docs/specifying-location__: - Projects scope, location specified: projects/\ PROJECT_ID\ /locations/\ LOCATION_ID - Projects scope, no location specified (defaults to global): projects/\ PROJECT_ID The following example parent string specifies a parent project with the identifier example-project, and specifies the europe-west3 location for processing data: :: parent=projects/example-project/locations/europe-west3 This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.services.dlp_service.pagers.ListStoredInfoTypesAsyncPagerResponse message for ListStoredInfoTypes. Iterating over this object will yield results and resolve additional pages automatically.

parse_common_billing_account_path

parse_common_billing_account_path(path: str) -> typing.Dict[str, str]

Parse a billing_account path into its component segments.

parse_common_folder_path

parse_common_folder_path(path: str) -> typing.Dict[str, str]

Parse a folder path into its component segments.

parse_common_location_path

parse_common_location_path(path: str) -> typing.Dict[str, str]

Parse a location path into its component segments.

parse_common_organization_path

parse_common_organization_path(path: str) -> typing.Dict[str, str]

Parse a organization path into its component segments.

parse_common_project_path

parse_common_project_path(path: str) -> typing.Dict[str, str]

Parse a project path into its component segments.

parse_deidentify_template_path

parse_deidentify_template_path(path: str) -> typing.Dict[str, str]

Parses a deidentify_template path into its component segments.

parse_discovery_config_path

parse_discovery_config_path(path: str) -> typing.Dict[str, str]

Parses a discovery_config path into its component segments.

parse_dlp_content_path

parse_dlp_content_path(path: str) -> typing.Dict[str, str]

Parses a dlp_content path into its component segments.

parse_dlp_job_path

parse_dlp_job_path(path: str) -> typing.Dict[str, str]

Parses a dlp_job path into its component segments.

parse_finding_path

parse_finding_path(path: str) -> typing.Dict[str, str]

Parses a finding path into its component segments.

parse_inspect_template_path

parse_inspect_template_path(path: str) -> typing.Dict[str, str]

Parses a inspect_template path into its component segments.

parse_job_trigger_path

parse_job_trigger_path(path: str) -> typing.Dict[str, str]

Parses a job_trigger path into its component segments.

parse_stored_info_type_path

parse_stored_info_type_path(path: str) -> typing.Dict[str, str]

Parses a stored_info_type path into its component segments.

redact_image

redact_image(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.RedactImageRequest, dict]
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.types.dlp.RedactImageResponse

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_redact_image():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.RedactImageRequest(
    )

    # Make the request
    response = await client.redact_image(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.RedactImageRequest, dict]]

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_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.types.RedactImageResponseResults of redacting an image.

reidentify_content

reidentify_content(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.ReidentifyContentRequest, dict]
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.types.dlp.ReidentifyContentResponse

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_reidentify_content():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.ReidentifyContentRequest(
        parent="parent_value",
    )

    # Make the request
    response = await client.reidentify_content(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.ReidentifyContentRequest, dict]]

The request object. Request to re-identify an item.

retry google.api_core.retry_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.types.ReidentifyContentResponseResults of re-identifying an item.

stored_info_type_path

stored_info_type_path(organization: str, stored_info_type: str) -> str

Returns a fully-qualified stored_info_type string.

update_deidentify_template

update_deidentify_template(
    request: typing.Optional[
        typing.Union[
            google.cloud.dlp_v2.types.dlp.UpdateDeidentifyTemplateRequest, dict
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    deidentify_template: typing.Optional[
        google.cloud.dlp_v2.types.dlp.DeidentifyTemplate
    ] = None,
    update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.types.dlp.DeidentifyTemplate

Updates the DeidentifyTemplate. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_update_deidentify_template():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.UpdateDeidentifyTemplateRequest(
        name="name_value",
    )

    # Make the request
    response = await client.update_deidentify_template(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.UpdateDeidentifyTemplateRequest, dict]]

The request object. Request message for UpdateDeidentifyTemplate.

name str

Required. Resource name of organization and deidentify template to be updated, for example organizations/433245324/deidentifyTemplates/432452342 or projects/project-id/deidentifyTemplates/432452342. This corresponds to the name field on the request instance; if request is provided, this should not be set.

deidentify_template DeidentifyTemplate

New DeidentifyTemplate value. This corresponds to the deidentify_template field on the request instance; if request is provided, this should not be set.

update_mask google.protobuf.field_mask_pb2.FieldMask

Mask to control which fields get updated. This corresponds to the update_mask field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.types.DeidentifyTemplateDeidentifyTemplates contains instructions on how to de-identify content. See https://cloud.google.com/dlp/docs/concepts-templates to learn more.

update_discovery_config

update_discovery_config(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.UpdateDiscoveryConfigRequest, dict]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    discovery_config: typing.Optional[
        google.cloud.dlp_v2.types.dlp.DiscoveryConfig
    ] = None,
    update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.types.dlp.DiscoveryConfig

Updates a discovery configuration.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_update_discovery_config():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    discovery_config = dlp_v2.DiscoveryConfig()
    discovery_config.status = "PAUSED"

    request = dlp_v2.UpdateDiscoveryConfigRequest(
        name="name_value",
        discovery_config=discovery_config,
    )

    # Make the request
    response = await client.update_discovery_config(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.UpdateDiscoveryConfigRequest, dict]]

The request object. Request message for UpdateDiscoveryConfig.

name str

Required. Resource name of the project and the configuration, for example projects/dlp-test-project/discoveryConfigs/53234423. This corresponds to the name field on the request instance; if request is provided, this should not be set.

discovery_config DiscoveryConfig

Required. New DiscoveryConfig value. This corresponds to the discovery_config field on the request instance; if request is provided, this should not be set.

update_mask google.protobuf.field_mask_pb2.FieldMask

Mask to control which fields get updated. This corresponds to the update_mask field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.types.DiscoveryConfigConfiguration for discovery to scan resources for profile generation. Only one discovery configuration may exist per organization, folder, or project. The generated data profiles are retained according to the [data retention policy] (https://cloud.google.com/dlp/docs/data-profiles#retention).

update_inspect_template

update_inspect_template(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.UpdateInspectTemplateRequest, dict]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    inspect_template: typing.Optional[
        google.cloud.dlp_v2.types.dlp.InspectTemplate
    ] = None,
    update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.types.dlp.InspectTemplate

Updates the InspectTemplate. See https://cloud.google.com/dlp/docs/creating-templates to learn more.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_update_inspect_template():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.UpdateInspectTemplateRequest(
        name="name_value",
    )

    # Make the request
    response = await client.update_inspect_template(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.UpdateInspectTemplateRequest, dict]]

The request object. Request message for UpdateInspectTemplate.

name str

Required. Resource name of organization and inspectTemplate to be updated, for example organizations/433245324/inspectTemplates/432452342 or projects/project-id/inspectTemplates/432452342. This corresponds to the name field on the request instance; if request is provided, this should not be set.

inspect_template InspectTemplate

New InspectTemplate value. This corresponds to the inspect_template field on the request instance; if request is provided, this should not be set.

update_mask google.protobuf.field_mask_pb2.FieldMask

Mask to control which fields get updated. This corresponds to the update_mask field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.types.InspectTemplateThe 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.

update_job_trigger

update_job_trigger(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.UpdateJobTriggerRequest, dict]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    job_trigger: typing.Optional[google.cloud.dlp_v2.types.dlp.JobTrigger] = None,
    update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.types.dlp.JobTrigger

Updates a job trigger. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_update_job_trigger():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.UpdateJobTriggerRequest(
        name="name_value",
    )

    # Make the request
    response = await client.update_job_trigger(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.UpdateJobTriggerRequest, dict]]

The request object. Request message for UpdateJobTrigger.

name str

Required. Resource name of the project and the triggeredJob, for example projects/dlp-test-project/jobTriggers/53234423. This corresponds to the name field on the request instance; if request is provided, this should not be set.

job_trigger JobTrigger

New JobTrigger value. This corresponds to the job_trigger field on the request instance; if request is provided, this should not be set.

update_mask google.protobuf.field_mask_pb2.FieldMask

Mask to control which fields get updated. This corresponds to the update_mask field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.types.JobTriggerContains a configuration to make dlp api calls on a repeating basis. See https://cloud.google.com/dlp/docs/concepts-job-triggers to learn more.

update_stored_info_type

update_stored_info_type(
    request: typing.Optional[
        typing.Union[google.cloud.dlp_v2.types.dlp.UpdateStoredInfoTypeRequest, dict]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    config: typing.Optional[google.cloud.dlp_v2.types.dlp.StoredInfoTypeConfig] = None,
    update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.dlp_v2.types.dlp.StoredInfoType

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dlp_v2

async def sample_update_stored_info_type():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    request = dlp_v2.UpdateStoredInfoTypeRequest(
        name="name_value",
    )

    # Make the request
    response = await client.update_stored_info_type(request=request)

    # Handle the response
    print(response)
Parameters
NameDescription
request Optional[Union[google.cloud.dlp_v2.types.UpdateStoredInfoTypeRequest, dict]]

The request object. Request message for UpdateStoredInfoType.

name str

Required. Resource name of organization and storedInfoType to be updated, for example organizations/433245324/storedInfoTypes/432452342 or projects/project-id/storedInfoTypes/432452342. This corresponds to the name field on the request instance; if request 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 the config field on the request instance; if request is provided, this should not be set.

update_mask google.protobuf.field_mask_pb2.FieldMask

Mask to control which fields get updated. This corresponds to the update_mask field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

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
TypeDescription
google.cloud.dlp_v2.types.StoredInfoTypeStoredInfoType resource message that contains information about the current version and any pending updates.