As of January 1, 2020 this library no longer supports Python 2 on the latest released version. Library versions released prior to that date will continue to be available. For more information please visit Python 2 support on Google Cloud.

DlpService

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

Sensitive Data Protection provides access to a powerful sensitive data inspection, classification, and de-identification platform that works on text, images, and Google Cloud storage repositories. To learn more about concepts and find how-to guides see https://cloud.google.com/sensitive-data-protection/docs/.

Instantiates the dlp service async client.

Parameters
  • credentials (Optional[google.auth.credentials.Credentials]) – The authorization credentials to attach to requests. These credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment.

  • transport (Optional[Union[str,DlpServiceTransport,Callable[..., DlpServiceTransport]]]) – The transport to use, or a Callable that constructs and returns a new transport to use. If a Callable is given, it will be called with the same set of initialization arguments as used in the DlpServiceTransport constructor. 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.

Raises

google.auth.exceptions.MutualTlsChannelError – If mutual TLS transport creation failed for any reason.

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

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

# 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
  • 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

Combines all of the information about a DLP job.

Return type

google.cloud.dlp_v2.types.DlpJob

property api_endpoint

Return the API endpoint used by the client instance.

Returns

The API endpoint used by the client instance.

Return type

str

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

Starts asynchronous cancellation on a long-running DlpJob. The server makes a best effort to cancel the DlpJob, but success is not guaranteed. See https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage and https://cloud.google.com/sensitive-data-protection/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
  • 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.

static column_data_profile_path(organization: str, location: str, column_data_profile: str) str

Returns a fully-qualified column_data_profile string.

static common_billing_account_path(billing_account: str) str

Returns a fully-qualified billing_account string.

static common_folder_path(folder: str) str

Returns a fully-qualified folder string.

static common_location_path(project: str, location: str) str

Returns a fully-qualified location string.

static common_organization_path(organization: str) str

Returns a fully-qualified organization string.

static common_project_path(project: str) str

Returns a fully-qualified project string.

static connection_path(project: str, location: str, connection: str) str

Returns a fully-qualified connection string.

async create_connection(request: Optional[Union[google.cloud.dlp_v2.types.dlp.CreateConnectionRequest, dict]] = None, *, parent: Optional[str] = None, connection: Optional[google.cloud.dlp_v2.types.dlp.Connection] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.types.dlp.Connection[source]

Create a Connection to an external data source.

# 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_connection():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    connection = dlp_v2.Connection()
    connection.cloud_sql.username_password.username = "username_value"
    connection.cloud_sql.username_password.password_secret_version_name = "password_secret_version_name_value"
    connection.cloud_sql.max_connections = 1608
    connection.cloud_sql.database_engine = "DATABASE_ENGINE_POSTGRES"
    connection.state = "ERROR"

    request = dlp_v2.CreateConnectionRequest(
        parent="parent_value",
        connection=connection,
    )

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

    # Handle the response
    print(response)
Parameters
  • request (Optional[Union[google.cloud.dlp_v2.types.CreateConnectionRequest, dict]]) – The request object. Request message for CreateConnection.

  • parent (str) –

    Required. Parent resource name.

    The format of this value varies depending on the scope of the request (project or organization):

    • Projects scope: projects/{project_id}/locations/{location_id}

    • Organizations scope: organizations/{org_id}/locations/{location_id}

    This corresponds to the parent field on the request instance; if request is provided, this should not be set.

  • connection (google.cloud.dlp_v2.types.Connection) – Required. The connection resource. This corresponds to the connection 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

A data connection to allow DLP to profile data in locations that require additional configuration.

Return type

google.cloud.dlp_v2.types.Connection

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

Creates a DeidentifyTemplate for reusing frequently used configuration for de-identifying content, images, and storage. See https://cloud.google.com/sensitive-data-protection/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
  • 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:

    • 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 (google.cloud.dlp_v2.types.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

DeidentifyTemplates contains instructions on how to de-identify content. See https://cloud.google.com/sensitive-data-protection/docs/concepts-templates to learn more.

Return type

google.cloud.dlp_v2.types.DeidentifyTemplate

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

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
  • 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 varies depending on the scope of the request (project or organization):

    • Projects scope: projects/{project_id}/locations/{location_id}

    • Organizations scope: organizations/{org_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 (google.cloud.dlp_v2.types.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

Configuration 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/sensitive-data-protection/docs/data-profiles#retention).

Return type

google.cloud.dlp_v2.types.DiscoveryConfig

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

Creates a new job to inspect storage or calculate risk metrics. See https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage and https://cloud.google.com/sensitive-data-protection/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
  • 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:

    • 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 (google.cloud.dlp_v2.types.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 (google.cloud.dlp_v2.types.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

Combines all of the information about a DLP job.

Return type

google.cloud.dlp_v2.types.DlpJob

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

Creates an InspectTemplate for reusing frequently used configuration for inspecting content, images, and storage. See https://cloud.google.com/sensitive-data-protection/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
  • 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:

    • 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 (google.cloud.dlp_v2.types.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

The inspectTemplate contains a configuration (set of types of sensitive data to be detected) to be used anywhere you otherwise would normally specify InspectConfig. See https://cloud.google.com/sensitive-data-protection/docs/concepts-templates to learn more.

Return type

google.cloud.dlp_v2.types.InspectTemplate

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

Creates a job trigger to run DLP actions such as scanning storage for sensitive information on a set schedule. See https://cloud.google.com/sensitive-data-protection/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
  • 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:

    • 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 (google.cloud.dlp_v2.types.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

Contains a configuration to make API calls on a repeating basis. See https://cloud.google.com/sensitive-data-protection/docs/concepts-job-triggers to learn more.

Return type

google.cloud.dlp_v2.types.JobTrigger

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

Creates a pre-built stored infoType to be used for inspection. See https://cloud.google.com/sensitive-data-protection/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
  • 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:

    • 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 (google.cloud.dlp_v2.types.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

StoredInfoType resource message that contains information about the current version and any pending updates.

Return type

google.cloud.dlp_v2.types.StoredInfoType

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

De-identifies potentially sensitive info from a ContentItem. This method has limits on input size and output size. See https://cloud.google.com/sensitive-data-protection/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
  • 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

Results of de-identifying a ContentItem.

Return type

google.cloud.dlp_v2.types.DeidentifyContentResponse

static deidentify_template_path(organization: str, deidentify_template: str) str

Returns a fully-qualified deidentify_template string.

async delete_connection(request: Optional[Union[google.cloud.dlp_v2.types.dlp.DeleteConnectionRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) None[source]

Delete a Connection.

# 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_connection():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

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

    # Make the request
    await client.delete_connection(request=request)
Parameters
  • request (Optional[Union[google.cloud.dlp_v2.types.DeleteConnectionRequest, dict]]) – The request object. Request message for DeleteConnection.

  • name (str) –

    Required. Resource name of the Connection to be deleted, in the format: projects/{project}/locations/{location}/connections/{connection}.

    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.

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

Deletes a DeidentifyTemplate. See https://cloud.google.com/sensitive-data-protection/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
  • 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.

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

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

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

Deletes a long-running DlpJob. This method indicates that the client is no longer interested in the DlpJob result. The job will be canceled if possible. See https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage and https://cloud.google.com/sensitive-data-protection/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
  • 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.

async delete_file_store_data_profile(request: Optional[Union[google.cloud.dlp_v2.types.dlp.DeleteFileStoreDataProfileRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) None[source]

Delete a FileStoreDataProfile. Will not prevent the profile from being regenerated if the resource is still included in 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_file_store_data_profile():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

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

    # Make the request
    await client.delete_file_store_data_profile(request=request)
Parameters
  • request (Optional[Union[google.cloud.dlp_v2.types.DeleteFileStoreDataProfileRequest, dict]]) – The request object. Request message for DeleteFileStoreProfile.

  • name (str) –

    Required. Resource name of the file store data profile.

    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.

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

Deletes an InspectTemplate. See https://cloud.google.com/sensitive-data-protection/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
  • 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.

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

Deletes a job trigger. See https://cloud.google.com/sensitive-data-protection/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
  • 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.

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

Deletes a stored infoType. See https://cloud.google.com/sensitive-data-protection/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
  • 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.

async delete_table_data_profile(request: Optional[Union[google.cloud.dlp_v2.types.dlp.DeleteTableDataProfileRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) None[source]

Delete a TableDataProfile. Will not prevent the profile from being regenerated if the table is still included in 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_table_data_profile():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

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

    # Make the request
    await client.delete_table_data_profile(request=request)
Parameters
  • request (Optional[Union[google.cloud.dlp_v2.types.DeleteTableDataProfileRequest, dict]]) – The request object. Request message for DeleteTableProfile.

  • name (str) –

    Required. Resource name of the table data profile.

    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.

static discovery_config_path(project: str, location: str, discovery_config: str) str

Returns a fully-qualified discovery_config string.

static dlp_content_path(project: str) str

Returns a fully-qualified dlp_content string.

static dlp_job_path(project: str, dlp_job: str) str

Returns a fully-qualified dlp_job string.

static file_store_data_profile_path(organization: str, location: str, file_store_data_profile: str) str

Returns a fully-qualified file_store_data_profile string.

static finding_path(project: str, location: str, finding: str) str

Returns a fully-qualified finding string.

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

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

# 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
  • 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.

classmethod from_service_account_file(filename: str, *args, **kwargs)[source]
Creates an instance of this client using the provided credentials

file.

Parameters
  • filename (str) – The path to the service account private key json file.

  • args – Additional arguments to pass to the constructor.

  • kwargs – Additional arguments to pass to the constructor.

Returns

The constructed client.

Return type

DlpServiceAsyncClient

classmethod from_service_account_info(info: dict, *args, **kwargs)[source]
Creates an instance of this client using the provided credentials

info.

Parameters
  • info (dict) – The service account private key info.

  • args – Additional arguments to pass to the constructor.

  • kwargs – Additional arguments to pass to the constructor.

Returns

The constructed client.

Return type

DlpServiceAsyncClient

classmethod from_service_account_json(filename: str, *args, **kwargs)
Creates an instance of this client using the provided credentials

file.

Parameters
  • filename (str) – The path to the service account private key json file.

  • args – Additional arguments to pass to the constructor.

  • kwargs – Additional arguments to pass to the constructor.

Returns

The constructed client.

Return type

DlpServiceAsyncClient

async get_column_data_profile(request: Optional[Union[google.cloud.dlp_v2.types.dlp.GetColumnDataProfileRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.types.dlp.ColumnDataProfile[source]

Gets a column data profile.

# 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_column_data_profile():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

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

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

    # Handle the response
    print(response)
Parameters
  • request (Optional[Union[google.cloud.dlp_v2.types.GetColumnDataProfileRequest, dict]]) – The request object. Request to get a column data profile.

  • name (str) –

    Required. Resource name, for example organizations/12345/locations/us/columnDataProfiles/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

The profile for a scanned column within a table.

Return type

google.cloud.dlp_v2.types.ColumnDataProfile

async get_connection(request: Optional[Union[google.cloud.dlp_v2.types.dlp.GetConnectionRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.types.dlp.Connection[source]

Get a Connection by name.

# 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_connection():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

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

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

    # Handle the response
    print(response)
Parameters
  • request (Optional[Union[google.cloud.dlp_v2.types.GetConnectionRequest, dict]]) – The request object. Request message for GetConnection.

  • name (str) –

    Required. Resource name in the format: projects/{project}/locations/{location}/connections/{connection}.

    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

A data connection to allow DLP to profile data in locations that require additional configuration.

Return type

google.cloud.dlp_v2.types.Connection

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

Gets a DeidentifyTemplate. See https://cloud.google.com/sensitive-data-protection/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
  • 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

DeidentifyTemplates contains instructions on how to de-identify content. See https://cloud.google.com/sensitive-data-protection/docs/concepts-templates to learn more.

Return type

google.cloud.dlp_v2.types.DeidentifyTemplate

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

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
  • 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

Configuration 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/sensitive-data-protection/docs/data-profiles#retention).

Return type

google.cloud.dlp_v2.types.DiscoveryConfig

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

Gets the latest state of a long-running DlpJob. See https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage and https://cloud.google.com/sensitive-data-protection/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
  • 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

Combines all of the information about a DLP job.

Return type

google.cloud.dlp_v2.types.DlpJob

async get_file_store_data_profile(request: Optional[Union[google.cloud.dlp_v2.types.dlp.GetFileStoreDataProfileRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.types.dlp.FileStoreDataProfile[source]

Gets a file store data profile.

# 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_file_store_data_profile():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

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

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

    # Handle the response
    print(response)
Parameters
  • request (Optional[Union[google.cloud.dlp_v2.types.GetFileStoreDataProfileRequest, dict]]) – The request object. Request to get a file store data profile.

  • name (str) –

    Required. Resource name, for example organizations/12345/locations/us/fileStoreDataProfiles/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

The profile for a file store.

  • Cloud Storage: maps 1:1 with a bucket.

  • Amazon S3: maps 1:1 with a bucket.

Return type

google.cloud.dlp_v2.types.FileStoreDataProfile

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

Gets an InspectTemplate. See https://cloud.google.com/sensitive-data-protection/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
  • 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

The inspectTemplate contains a configuration (set of types of sensitive data to be detected) to be used anywhere you otherwise would normally specify InspectConfig. See https://cloud.google.com/sensitive-data-protection/docs/concepts-templates to learn more.

Return type

google.cloud.dlp_v2.types.InspectTemplate

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

Gets a job trigger. See https://cloud.google.com/sensitive-data-protection/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
  • 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

Contains a configuration to make API calls on a repeating basis. See https://cloud.google.com/sensitive-data-protection/docs/concepts-job-triggers to learn more.

Return type

google.cloud.dlp_v2.types.JobTrigger

classmethod get_mtls_endpoint_and_cert_source(client_options: Optional[google.api_core.client_options.ClientOptions] = None)[source]

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.

Parameters

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.

Returns

returns the API endpoint and the

client cert source to use.

Return type

Tuple[str, Callable[[], Tuple[bytes, bytes]]]

Raises

google.auth.exceptions.MutualTLSChannelError – If any errors happen.

async get_project_data_profile(request: Optional[Union[google.cloud.dlp_v2.types.dlp.GetProjectDataProfileRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.types.dlp.ProjectDataProfile[source]

Gets a project data profile.

# 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_project_data_profile():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

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

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

    # Handle the response
    print(response)
Parameters
  • request (Optional[Union[google.cloud.dlp_v2.types.GetProjectDataProfileRequest, dict]]) – The request object. Request to get a project data profile.

  • name (str) –

    Required. Resource name, for example organizations/12345/locations/us/projectDataProfiles/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

An aggregated profile for this project, based on the resources profiled within it.

Return type

google.cloud.dlp_v2.types.ProjectDataProfile

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

Gets a stored infoType. See https://cloud.google.com/sensitive-data-protection/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
  • 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

StoredInfoType resource message that contains information about the current version and any pending updates.

Return type

google.cloud.dlp_v2.types.StoredInfoType

async get_table_data_profile(request: Optional[Union[google.cloud.dlp_v2.types.dlp.GetTableDataProfileRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.types.dlp.TableDataProfile[source]

Gets a table data profile.

# 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_table_data_profile():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

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

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

    # Handle the response
    print(response)
Parameters
  • request (Optional[Union[google.cloud.dlp_v2.types.GetTableDataProfileRequest, dict]]) – The request object. Request to get a table data profile.

  • name (str) –

    Required. Resource name, for example organizations/12345/locations/us/tableDataProfiles/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

The profile for a scanned table.

Return type

google.cloud.dlp_v2.types.TableDataProfile

classmethod get_transport_class(label: Optional[str] = None) Type[google.cloud.dlp_v2.services.dlp_service.transports.base.DlpServiceTransport]

Returns an appropriate transport class.

Parameters

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

Returns

The transport class to use.

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

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

# 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
  • 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

Quota exceeded errors will be thrown once quota has been met.

Return type

google.cloud.dlp_v2.types.HybridInspectResponse

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

Inspect hybrid content and store findings to a trigger. The inspection will be processed asynchronously. To review the findings monitor the jobs within the trigger.

# 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
  • 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

Quota exceeded errors will be thrown once quota has been met.

Return type

google.cloud.dlp_v2.types.HybridInspectResponse

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

Finds potentially sensitive info in content. This method has limits on input size, processing time, and output size.

When no InfoTypes or CustomInfoTypes are specified in this request, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.

For how to guides, see https://cloud.google.com/sensitive-data-protection/docs/inspecting-images and https://cloud.google.com/sensitive-data-protection/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
  • 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

Results of inspecting an item.

Return type

google.cloud.dlp_v2.types.InspectContentResponse

static inspect_template_path(organization: str, inspect_template: str) str

Returns a fully-qualified inspect_template string.

static job_trigger_path(project: str, job_trigger: str) str

Returns a fully-qualified job_trigger string.

async list_column_data_profiles(request: Optional[Union[google.cloud.dlp_v2.types.dlp.ListColumnDataProfilesRequest, dict]] = None, *, parent: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.services.dlp_service.pagers.ListColumnDataProfilesAsyncPager[source]

Lists column data profiles for an organization.

# 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_column_data_profiles():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

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

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

    # Handle the response
    async for response in page_result:
        print(response)
Parameters
  • request (Optional[Union[google.cloud.dlp_v2.types.ListColumnDataProfilesRequest, dict]]) – The request object. Request to list the profiles generated for a given organization or project.

  • parent (str) –

    Required. Resource name of the organization or project, for example organizations/433245324/locations/europe or projects/project-id/locations/asia.

    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

List of profiles generated for a given organization or project. Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.dlp_v2.services.dlp_service.pagers.ListColumnDataProfilesAsyncPager

async list_connections(request: Optional[Union[google.cloud.dlp_v2.types.dlp.ListConnectionsRequest, dict]] = None, *, parent: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.services.dlp_service.pagers.ListConnectionsAsyncPager[source]

Lists Connections in a parent. Use SearchConnections to see all connections within an organization.

# 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_connections():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

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

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

    # Handle the response
    async for response in page_result:
        print(response)
Parameters
  • request (Optional[Union[google.cloud.dlp_v2.types.ListConnectionsRequest, dict]]) – The request object. Request message for ListConnections.

  • parent (str) –

    Required. Resource name of the organization or project, for example, organizations/433245324/locations/europe or projects/project-id/locations/asia.

    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

Response message for ListConnections.

Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.dlp_v2.services.dlp_service.pagers.ListConnectionsAsyncPager

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

Lists DeidentifyTemplates. See https://cloud.google.com/sensitive-data-protection/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
  • 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:

    • 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

Response message for ListDeidentifyTemplates. Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.dlp_v2.services.dlp_service.pagers.ListDeidentifyTemplatesAsyncPager

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

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
  • 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

Response message for ListDiscoveryConfigs. Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.dlp_v2.services.dlp_service.pagers.ListDiscoveryConfigsAsyncPager

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

Lists DlpJobs that match the specified filter in the request. See https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage and https://cloud.google.com/sensitive-data-protection/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
  • 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:

    • 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

The response message for listing DLP jobs. Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.dlp_v2.services.dlp_service.pagers.ListDlpJobsAsyncPager

async list_file_store_data_profiles(request: Optional[Union[google.cloud.dlp_v2.types.dlp.ListFileStoreDataProfilesRequest, dict]] = None, *, parent: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.services.dlp_service.pagers.ListFileStoreDataProfilesAsyncPager[source]

Lists file store data profiles for an organization.

# 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_file_store_data_profiles():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

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

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

    # Handle the response
    async for response in page_result:
        print(response)
Parameters
  • request (Optional[Union[google.cloud.dlp_v2.types.ListFileStoreDataProfilesRequest, dict]]) – The request object. Request to list the file store profiles generated for a given organization or project.

  • parent (str) –

    Required. Resource name of the organization or project, for example organizations/433245324/locations/europe or projects/project-id/locations/asia.

    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

List of file store data profiles generated for a given organization or project.

Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.dlp_v2.services.dlp_service.pagers.ListFileStoreDataProfilesAsyncPager

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

Returns a list of the sensitive information types that DLP API supports. See https://cloud.google.com/sensitive-data-protection/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
  • 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

Response to the ListInfoTypes request.

Return type

google.cloud.dlp_v2.types.ListInfoTypesResponse

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

Lists InspectTemplates. See https://cloud.google.com/sensitive-data-protection/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
  • 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:

    • 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

Response message for ListInspectTemplates. Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.dlp_v2.services.dlp_service.pagers.ListInspectTemplatesAsyncPager

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

Lists job triggers. See https://cloud.google.com/sensitive-data-protection/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
  • 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:

    • 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

Response message for ListJobTriggers.

Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.dlp_v2.services.dlp_service.pagers.ListJobTriggersAsyncPager

async list_project_data_profiles(request: Optional[Union[google.cloud.dlp_v2.types.dlp.ListProjectDataProfilesRequest, dict]] = None, *, parent: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.services.dlp_service.pagers.ListProjectDataProfilesAsyncPager[source]

Lists project data profiles for an organization.

# 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_project_data_profiles():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

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

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

    # Handle the response
    async for response in page_result:
        print(response)
Parameters
  • request (Optional[Union[google.cloud.dlp_v2.types.ListProjectDataProfilesRequest, dict]]) – The request object. Request to list the profiles generated for a given organization or project.

  • parent (str) – Required. organizations/{org_id}/locations/{loc_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

List of profiles generated for a given organization or project. Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.dlp_v2.services.dlp_service.pagers.ListProjectDataProfilesAsyncPager

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

Lists stored infoTypes. See https://cloud.google.com/sensitive-data-protection/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
  • 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:

    • 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

Response message for ListStoredInfoTypes. Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.dlp_v2.services.dlp_service.pagers.ListStoredInfoTypesAsyncPager

async list_table_data_profiles(request: Optional[Union[google.cloud.dlp_v2.types.dlp.ListTableDataProfilesRequest, dict]] = None, *, parent: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.services.dlp_service.pagers.ListTableDataProfilesAsyncPager[source]

Lists table data profiles for an organization.

# 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_table_data_profiles():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

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

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

    # Handle the response
    async for response in page_result:
        print(response)
Parameters
  • request (Optional[Union[google.cloud.dlp_v2.types.ListTableDataProfilesRequest, dict]]) – The request object. Request to list the profiles generated for a given organization or project.

  • parent (str) –

    Required. Resource name of the organization or project, for example organizations/433245324/locations/europe or projects/project-id/locations/asia.

    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

List of profiles generated for a given organization or project. Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.dlp_v2.services.dlp_service.pagers.ListTableDataProfilesAsyncPager

static parse_column_data_profile_path(path: str) Dict[str, str]

Parses a column_data_profile path into its component segments.

static parse_common_billing_account_path(path: str) Dict[str, str]

Parse a billing_account path into its component segments.

static parse_common_folder_path(path: str) Dict[str, str]

Parse a folder path into its component segments.

static parse_common_location_path(path: str) Dict[str, str]

Parse a location path into its component segments.

static parse_common_organization_path(path: str) Dict[str, str]

Parse a organization path into its component segments.

static parse_common_project_path(path: str) Dict[str, str]

Parse a project path into its component segments.

static parse_connection_path(path: str) Dict[str, str]

Parses a connection path into its component segments.

static parse_deidentify_template_path(path: str) Dict[str, str]

Parses a deidentify_template path into its component segments.

static parse_discovery_config_path(path: str) Dict[str, str]

Parses a discovery_config path into its component segments.

static parse_dlp_content_path(path: str) Dict[str, str]

Parses a dlp_content path into its component segments.

static parse_dlp_job_path(path: str) Dict[str, str]

Parses a dlp_job path into its component segments.

static parse_file_store_data_profile_path(path: str) Dict[str, str]

Parses a file_store_data_profile path into its component segments.

static parse_finding_path(path: str) Dict[str, str]

Parses a finding path into its component segments.

static parse_inspect_template_path(path: str) Dict[str, str]

Parses a inspect_template path into its component segments.

static parse_job_trigger_path(path: str) Dict[str, str]

Parses a job_trigger path into its component segments.

static parse_project_data_profile_path(path: str) Dict[str, str]

Parses a project_data_profile path into its component segments.

static parse_stored_info_type_path(path: str) Dict[str, str]

Parses a stored_info_type path into its component segments.

static parse_table_data_profile_path(path: str) Dict[str, str]

Parses a table_data_profile path into its component segments.

static project_data_profile_path(organization: str, location: str, project_data_profile: str) str

Returns a fully-qualified project_data_profile string.

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

Redacts potentially sensitive info from an image. This method has limits on input size, processing time, and output size. See https://cloud.google.com/sensitive-data-protection/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
  • 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

Results of redacting an image.

Return type

google.cloud.dlp_v2.types.RedactImageResponse

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

Re-identifies content that has been de-identified. See https://cloud.google.com/sensitive-data-protection/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
  • 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

Results of re-identifying an item.

Return type

google.cloud.dlp_v2.types.ReidentifyContentResponse

async search_connections(request: Optional[Union[google.cloud.dlp_v2.types.dlp.SearchConnectionsRequest, dict]] = None, *, parent: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.services.dlp_service.pagers.SearchConnectionsAsyncPager[source]

Searches for Connections in a parent.

# 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_search_connections():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

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

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

    # Handle the response
    async for response in page_result:
        print(response)
Parameters
  • request (Optional[Union[google.cloud.dlp_v2.types.SearchConnectionsRequest, dict]]) – The request object. Request message for SearchConnections.

  • parent (str) –

    Required. Resource name of the organization or project with a wildcard location, for example, organizations/433245324/locations/- or projects/project-id/locations/-.

    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

Response message for SearchConnections. Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.dlp_v2.services.dlp_service.pagers.SearchConnectionsAsyncPager

static stored_info_type_path(organization: str, stored_info_type: str) str

Returns a fully-qualified stored_info_type string.

static table_data_profile_path(organization: str, location: str, table_data_profile: str) str

Returns a fully-qualified table_data_profile string.

property transport: google.cloud.dlp_v2.services.dlp_service.transports.base.DlpServiceTransport

Returns the transport used by the client instance.

Returns

The transport used by the client instance.

Return type

DlpServiceTransport

property universe_domain: str

Return the universe domain used by the client instance.

Returns

The universe domain used

by the client instance.

Return type

str

async update_connection(request: Optional[Union[google.cloud.dlp_v2.types.dlp.UpdateConnectionRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.types.dlp.Connection[source]

Update a Connection.

# 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_connection():
    # Create a client
    client = dlp_v2.DlpServiceAsyncClient()

    # Initialize request argument(s)
    connection = dlp_v2.Connection()
    connection.cloud_sql.username_password.username = "username_value"
    connection.cloud_sql.username_password.password_secret_version_name = "password_secret_version_name_value"
    connection.cloud_sql.max_connections = 1608
    connection.cloud_sql.database_engine = "DATABASE_ENGINE_POSTGRES"
    connection.state = "ERROR"

    request = dlp_v2.UpdateConnectionRequest(
        name="name_value",
        connection=connection,
    )

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

    # Handle the response
    print(response)
Parameters
  • request (Optional[Union[google.cloud.dlp_v2.types.UpdateConnectionRequest, dict]]) – The request object. Request message for UpdateConnection.

  • name (str) –

    Required. Resource name in the format: projects/{project}/locations/{location}/connections/{connection}.

    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

A data connection to allow DLP to profile data in locations that require additional configuration.

Return type

google.cloud.dlp_v2.types.Connection

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

Updates the DeidentifyTemplate. See https://cloud.google.com/sensitive-data-protection/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
  • 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 (google.cloud.dlp_v2.types.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

DeidentifyTemplates contains instructions on how to de-identify content. See https://cloud.google.com/sensitive-data-protection/docs/concepts-templates to learn more.

Return type

google.cloud.dlp_v2.types.DeidentifyTemplate

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

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
  • 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 (google.cloud.dlp_v2.types.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

Configuration 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/sensitive-data-protection/docs/data-profiles#retention).

Return type

google.cloud.dlp_v2.types.DiscoveryConfig

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

Updates the InspectTemplate. See https://cloud.google.com/sensitive-data-protection/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
  • 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 (google.cloud.dlp_v2.types.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

The inspectTemplate contains a configuration (set of types of sensitive data to be detected) to be used anywhere you otherwise would normally specify InspectConfig. See https://cloud.google.com/sensitive-data-protection/docs/concepts-templates to learn more.

Return type

google.cloud.dlp_v2.types.InspectTemplate

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

Updates a job trigger. See https://cloud.google.com/sensitive-data-protection/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
  • 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 (google.cloud.dlp_v2.types.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

Contains a configuration to make API calls on a repeating basis. See https://cloud.google.com/sensitive-data-protection/docs/concepts-job-triggers to learn more.

Return type

google.cloud.dlp_v2.types.JobTrigger

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

Updates the stored infoType by creating a new version. The existing version will continue to be used until the new version is ready. See https://cloud.google.com/sensitive-data-protection/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
  • 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 (google.cloud.dlp_v2.types.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

StoredInfoType resource message that contains information about the current version and any pending updates.

Return type

google.cloud.dlp_v2.types.StoredInfoType

class google.cloud.dlp_v2.services.dlp_service.DlpServiceClient(*, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[typing.Union[str, google.cloud.dlp_v2.services.dlp_service.transports.base.DlpServiceTransport, typing.Callable[[...], google.cloud.dlp_v2.services.dlp_service.transports.base.DlpServiceTransport]]] = None, client_options: typing.Optional[typing.Union[google.api_core.client_options.ClientOptions, dict]] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = <google.api_core.gapic_v1.client_info.ClientInfo object>)[source]

Sensitive Data Protection provides access to a powerful sensitive data inspection, classification, and de-identification platform that works on text, images, and Google Cloud storage repositories. To learn more about concepts and find how-to guides see https://cloud.google.com/sensitive-data-protection/docs/.

Instantiates the dlp service client.

Parameters
  • credentials (Optional[google.auth.credentials.Credentials]) – The authorization credentials to attach to requests. These credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment.

  • transport (Optional[Union[str,DlpServiceTransport,Callable[..., DlpServiceTransport]]]) – The transport to use, or a Callable that constructs and returns a new transport. If a Callable is given, it will be called with the same set of initialization arguments as used in the DlpServiceTransport constructor. 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 the 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.

Raises

google.auth.exceptions.MutualTLSChannelError – If mutual TLS transport creation failed for any reason.

__exit__(type, value, traceback)[source]

Releases underlying transport’s resources.

Warning

ONLY use as a context manager if the transport is NOT shared with other clients! Exiting the with block will CLOSE the transport and may cause errors in other clients!

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

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

# 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

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

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

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

    # Handle the response
    print(response)
Parameters
Returns

Combines all of the information about a DLP job.

Return type

google.cloud.dlp_v2.types.DlpJob

property api_endpoint

Return the API endpoint used by the client instance.

Returns

The API endpoint used by the client instance.

Return type

str

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

Starts asynchronous cancellation on a long-running DlpJob. The server makes a best effort to cancel the DlpJob, but success is not guaranteed. See https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage and https://cloud.google.com/sensitive-data-protection/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

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

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

    # Make the request
    client.cancel_dlp_job(request=request)
Parameters
static column_data_profile_path(organization: str, location: str, column_data_profile: str) str[source]

Returns a fully-qualified column_data_profile string.

static common_billing_account_path(billing_account: str) str[source]

Returns a fully-qualified billing_account string.

static common_folder_path(folder: str) str[source]

Returns a fully-qualified folder string.

static common_location_path(project: str, location: str) str[source]

Returns a fully-qualified location string.

static common_organization_path(organization: str) str[source]

Returns a fully-qualified organization string.

static common_project_path(project: str) str[source]

Returns a fully-qualified project string.

static connection_path(project: str, location: str, connection: str) str[source]

Returns a fully-qualified connection string.

create_connection(request: Optional[Union[google.cloud.dlp_v2.types.dlp.CreateConnectionRequest, dict]] = None, *, parent: Optional[str] = None, connection: Optional[google.cloud.dlp_v2.types.dlp.Connection] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.types.dlp.Connection[source]

Create a Connection to an external data source.

# 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

def sample_create_connection():
    # Create a client
    client = dlp_v2.DlpServiceClient()

    # Initialize request argument(s)
    connection = dlp_v2.Connection()
    connection.cloud_sql.username_password.username = "username_value"
    connection.cloud_sql.username_password.password_secret_version_name = "password_secret_version_name_value"
    connection.cloud_sql.max_connections = 1608
    connection.cloud_sql.database_engine = "DATABASE_ENGINE_POSTGRES"
    connection.state = "ERROR"

    request = dlp_v2.CreateConnectionRequest(
        parent="parent_value",
        connection=connection,
    )

    # Make the request
    response = client.create_connection(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Union[google.cloud.dlp_v2.types.CreateConnectionRequest, dict]) – The request object. Request message for CreateConnection.

  • parent (str) –

    Required. Parent resource name.

    The format of this value varies depending on the scope of the request (project or organization):

    • Projects scope: projects/{project_id}/locations/{location_id}

    • Organizations scope: organizations/{org_id}/locations/{location_id}

    This corresponds to the parent field on the request instance; if request is provided, this should not be set.

  • connection (google.cloud.dlp_v2.types.Connection) – Required. The connection resource. This corresponds to the connection field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

A data connection to allow DLP to profile data in locations that require additional configuration.

Return type

google.cloud.dlp_v2.types.Connection

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

Creates a DeidentifyTemplate for reusing frequently used configuration for de-identifying content, images, and storage. See https://cloud.google.com/sensitive-data-protection/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

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

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

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

    # Handle the response
    print(response)
Parameters
  • request (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:

    • 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 (google.cloud.dlp_v2.types.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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

DeidentifyTemplates contains instructions on how to de-identify content. See https://cloud.google.com/sensitive-data-protection/docs/concepts-templates to learn more.

Return type

google.cloud.dlp_v2.types.DeidentifyTemplate

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

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

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

    # 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 = client.create_discovery_config(request=request)

    # Handle the response
    print(response)
Parameters
  • request (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 varies depending on the scope of the request (project or organization):

    • Projects scope: projects/{project_id}/locations/{location_id}

    • Organizations scope: organizations/{org_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 (google.cloud.dlp_v2.types.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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

Configuration 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/sensitive-data-protection/docs/data-profiles#retention).

Return type

google.cloud.dlp_v2.types.DiscoveryConfig

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

Creates a new job to inspect storage or calculate risk metrics. See https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage and https://cloud.google.com/sensitive-data-protection/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

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

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

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

    # Handle the response
    print(response)
Parameters
  • request (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:

    • 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 (google.cloud.dlp_v2.types.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 (google.cloud.dlp_v2.types.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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

Combines all of the information about a DLP job.

Return type

google.cloud.dlp_v2.types.DlpJob

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

Creates an InspectTemplate for reusing frequently used configuration for inspecting content, images, and storage. See https://cloud.google.com/sensitive-data-protection/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

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

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

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

    # Handle the response
    print(response)
Parameters
  • request (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:

    • 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 (google.cloud.dlp_v2.types.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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

The inspectTemplate contains a configuration (set of types of sensitive data to be detected) to be used anywhere you otherwise would normally specify InspectConfig. See https://cloud.google.com/sensitive-data-protection/docs/concepts-templates to learn more.

Return type

google.cloud.dlp_v2.types.InspectTemplate

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

Creates a job trigger to run DLP actions such as scanning storage for sensitive information on a set schedule. See https://cloud.google.com/sensitive-data-protection/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

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

    # 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 = client.create_job_trigger(request=request)

    # Handle the response
    print(response)
Parameters
  • request (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:

    • 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 (google.cloud.dlp_v2.types.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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

Contains a configuration to make API calls on a repeating basis. See https://cloud.google.com/sensitive-data-protection/docs/concepts-job-triggers to learn more.

Return type

google.cloud.dlp_v2.types.JobTrigger

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

Creates a pre-built stored infoType to be used for inspection. See https://cloud.google.com/sensitive-data-protection/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

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

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

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

    # Handle the response
    print(response)
Parameters
  • request (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:

    • 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 (google.cloud.dlp_v2.types.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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

StoredInfoType resource message that contains information about the current version and any pending updates.

Return type

google.cloud.dlp_v2.types.StoredInfoType

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

De-identifies potentially sensitive info from a ContentItem. This method has limits on input size and output size. See https://cloud.google.com/sensitive-data-protection/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

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

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

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

    # Handle the response
    print(response)
Parameters
Returns

Results of de-identifying a ContentItem.

Return type

google.cloud.dlp_v2.types.DeidentifyContentResponse

static deidentify_template_path(organization: str, deidentify_template: str) str[source]

Returns a fully-qualified deidentify_template string.

delete_connection(request: Optional[Union[google.cloud.dlp_v2.types.dlp.DeleteConnectionRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) None[source]

Delete a Connection.

# 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

def sample_delete_connection():
    # Create a client
    client = dlp_v2.DlpServiceClient()

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

    # Make the request
    client.delete_connection(request=request)
Parameters
  • request (Union[google.cloud.dlp_v2.types.DeleteConnectionRequest, dict]) – The request object. Request message for DeleteConnection.

  • name (str) –

    Required. Resource name of the Connection to be deleted, in the format: projects/{project}/locations/{location}/connections/{connection}.

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

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

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

Deletes a DeidentifyTemplate. See https://cloud.google.com/sensitive-data-protection/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

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

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

    # Make the request
    client.delete_deidentify_template(request=request)
Parameters
  • request (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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

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

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

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

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

    # Make the request
    client.delete_discovery_config(request=request)
Parameters
  • request (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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

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

Deletes a long-running DlpJob. This method indicates that the client is no longer interested in the DlpJob result. The job will be canceled if possible. See https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage and https://cloud.google.com/sensitive-data-protection/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

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

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

    # Make the request
    client.delete_dlp_job(request=request)
Parameters
  • request (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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

delete_file_store_data_profile(request: Optional[Union[google.cloud.dlp_v2.types.dlp.DeleteFileStoreDataProfileRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) None[source]

Delete a FileStoreDataProfile. Will not prevent the profile from being regenerated if the resource is still included in 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

def sample_delete_file_store_data_profile():
    # Create a client
    client = dlp_v2.DlpServiceClient()

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

    # Make the request
    client.delete_file_store_data_profile(request=request)
Parameters
  • request (Union[google.cloud.dlp_v2.types.DeleteFileStoreDataProfileRequest, dict]) – The request object. Request message for DeleteFileStoreProfile.

  • name (str) –

    Required. Resource name of the file store data profile.

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

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

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

Deletes an InspectTemplate. See https://cloud.google.com/sensitive-data-protection/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

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

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

    # Make the request
    client.delete_inspect_template(request=request)
Parameters
  • request (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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

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

Deletes a job trigger. See https://cloud.google.com/sensitive-data-protection/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

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

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

    # Make the request
    client.delete_job_trigger(request=request)
Parameters
  • request (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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

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

Deletes a stored infoType. See https://cloud.google.com/sensitive-data-protection/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

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

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

    # Make the request
    client.delete_stored_info_type(request=request)
Parameters
  • request (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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

delete_table_data_profile(request: Optional[Union[google.cloud.dlp_v2.types.dlp.DeleteTableDataProfileRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) None[source]

Delete a TableDataProfile. Will not prevent the profile from being regenerated if the table is still included in 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

def sample_delete_table_data_profile():
    # Create a client
    client = dlp_v2.DlpServiceClient()

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

    # Make the request
    client.delete_table_data_profile(request=request)
Parameters
  • request (Union[google.cloud.dlp_v2.types.DeleteTableDataProfileRequest, dict]) – The request object. Request message for DeleteTableProfile.

  • name (str) –

    Required. Resource name of the table data profile.

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

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

static discovery_config_path(project: str, location: str, discovery_config: str) str[source]

Returns a fully-qualified discovery_config string.

static dlp_content_path(project: str) str[source]

Returns a fully-qualified dlp_content string.

static dlp_job_path(project: str, dlp_job: str) str[source]

Returns a fully-qualified dlp_job string.

static file_store_data_profile_path(organization: str, location: str, file_store_data_profile: str) str[source]

Returns a fully-qualified file_store_data_profile string.

static finding_path(project: str, location: str, finding: str) str[source]

Returns a fully-qualified finding string.

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

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

# 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

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

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

    # Make the request
    client.finish_dlp_job(request=request)
Parameters
classmethod from_service_account_file(filename: str, *args, **kwargs)[source]
Creates an instance of this client using the provided credentials

file.

Parameters
  • filename (str) – The path to the service account private key json file.

  • args – Additional arguments to pass to the constructor.

  • kwargs – Additional arguments to pass to the constructor.

Returns

The constructed client.

Return type

DlpServiceClient

classmethod from_service_account_info(info: dict, *args, **kwargs)[source]
Creates an instance of this client using the provided credentials

info.

Parameters
  • info (dict) – The service account private key info.

  • args – Additional arguments to pass to the constructor.

  • kwargs – Additional arguments to pass to the constructor.

Returns

The constructed client.

Return type

DlpServiceClient

classmethod from_service_account_json(filename: str, *args, **kwargs)
Creates an instance of this client using the provided credentials

file.

Parameters
  • filename (str) – The path to the service account private key json file.

  • args – Additional arguments to pass to the constructor.

  • kwargs – Additional arguments to pass to the constructor.

Returns

The constructed client.

Return type

DlpServiceClient

get_column_data_profile(request: Optional[Union[google.cloud.dlp_v2.types.dlp.GetColumnDataProfileRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.types.dlp.ColumnDataProfile[source]

Gets a column data profile.

# 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

def sample_get_column_data_profile():
    # Create a client
    client = dlp_v2.DlpServiceClient()

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

    # Make the request
    response = client.get_column_data_profile(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Union[google.cloud.dlp_v2.types.GetColumnDataProfileRequest, dict]) – The request object. Request to get a column data profile.

  • name (str) –

    Required. Resource name, for example organizations/12345/locations/us/columnDataProfiles/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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

The profile for a scanned column within a table.

Return type

google.cloud.dlp_v2.types.ColumnDataProfile

get_connection(request: Optional[Union[google.cloud.dlp_v2.types.dlp.GetConnectionRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.types.dlp.Connection[source]

Get a Connection by name.

# 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

def sample_get_connection():
    # Create a client
    client = dlp_v2.DlpServiceClient()

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

    # Make the request
    response = client.get_connection(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Union[google.cloud.dlp_v2.types.GetConnectionRequest, dict]) – The request object. Request message for GetConnection.

  • name (str) –

    Required. Resource name in the format: projects/{project}/locations/{location}/connections/{connection}.

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

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

A data connection to allow DLP to profile data in locations that require additional configuration.

Return type

google.cloud.dlp_v2.types.Connection

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

Gets a DeidentifyTemplate. See https://cloud.google.com/sensitive-data-protection/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

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

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

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

    # Handle the response
    print(response)
Parameters
  • request (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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

DeidentifyTemplates contains instructions on how to de-identify content. See https://cloud.google.com/sensitive-data-protection/docs/concepts-templates to learn more.

Return type

google.cloud.dlp_v2.types.DeidentifyTemplate

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

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

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

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

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

    # Handle the response
    print(response)
Parameters
  • request (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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

Configuration 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/sensitive-data-protection/docs/data-profiles#retention).

Return type

google.cloud.dlp_v2.types.DiscoveryConfig

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

Gets the latest state of a long-running DlpJob. See https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage and https://cloud.google.com/sensitive-data-protection/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

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

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

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

    # Handle the response
    print(response)
Parameters
  • request (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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

Combines all of the information about a DLP job.

Return type

google.cloud.dlp_v2.types.DlpJob

get_file_store_data_profile(request: Optional[Union[google.cloud.dlp_v2.types.dlp.GetFileStoreDataProfileRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.types.dlp.FileStoreDataProfile[source]

Gets a file store data profile.

# 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

def sample_get_file_store_data_profile():
    # Create a client
    client = dlp_v2.DlpServiceClient()

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

    # Make the request
    response = client.get_file_store_data_profile(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Union[google.cloud.dlp_v2.types.GetFileStoreDataProfileRequest, dict]) – The request object. Request to get a file store data profile.

  • name (str) –

    Required. Resource name, for example organizations/12345/locations/us/fileStoreDataProfiles/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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

The profile for a file store.

  • Cloud Storage: maps 1:1 with a bucket.

  • Amazon S3: maps 1:1 with a bucket.

Return type

google.cloud.dlp_v2.types.FileStoreDataProfile

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

Gets an InspectTemplate. See https://cloud.google.com/sensitive-data-protection/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

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

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

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

    # Handle the response
    print(response)
Parameters
  • request (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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

The inspectTemplate contains a configuration (set of types of sensitive data to be detected) to be used anywhere you otherwise would normally specify InspectConfig. See https://cloud.google.com/sensitive-data-protection/docs/concepts-templates to learn more.

Return type

google.cloud.dlp_v2.types.InspectTemplate

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

Gets a job trigger. See https://cloud.google.com/sensitive-data-protection/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

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

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

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

    # Handle the response
    print(response)
Parameters
  • request (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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

Contains a configuration to make API calls on a repeating basis. See https://cloud.google.com/sensitive-data-protection/docs/concepts-job-triggers to learn more.

Return type

google.cloud.dlp_v2.types.JobTrigger

classmethod get_mtls_endpoint_and_cert_source(client_options: Optional[google.api_core.client_options.ClientOptions] = None)[source]

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

Parameters

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.

Returns

returns the API endpoint and the

client cert source to use.

Return type

Tuple[str, Callable[[], Tuple[bytes, bytes]]]

Raises

google.auth.exceptions.MutualTLSChannelError – If any errors happen.

get_project_data_profile(request: Optional[Union[google.cloud.dlp_v2.types.dlp.GetProjectDataProfileRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.types.dlp.ProjectDataProfile[source]

Gets a project data profile.

# 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

def sample_get_project_data_profile():
    # Create a client
    client = dlp_v2.DlpServiceClient()

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

    # Make the request
    response = client.get_project_data_profile(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Union[google.cloud.dlp_v2.types.GetProjectDataProfileRequest, dict]) – The request object. Request to get a project data profile.

  • name (str) –

    Required. Resource name, for example organizations/12345/locations/us/projectDataProfiles/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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

An aggregated profile for this project, based on the resources profiled within it.

Return type

google.cloud.dlp_v2.types.ProjectDataProfile

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

Gets a stored infoType. See https://cloud.google.com/sensitive-data-protection/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

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

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

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

    # Handle the response
    print(response)
Parameters
  • request (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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

StoredInfoType resource message that contains information about the current version and any pending updates.

Return type

google.cloud.dlp_v2.types.StoredInfoType

get_table_data_profile(request: Optional[Union[google.cloud.dlp_v2.types.dlp.GetTableDataProfileRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.types.dlp.TableDataProfile[source]

Gets a table data profile.

# 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

def sample_get_table_data_profile():
    # Create a client
    client = dlp_v2.DlpServiceClient()

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

    # Make the request
    response = client.get_table_data_profile(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Union[google.cloud.dlp_v2.types.GetTableDataProfileRequest, dict]) – The request object. Request to get a table data profile.

  • name (str) –

    Required. Resource name, for example organizations/12345/locations/us/tableDataProfiles/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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

The profile for a scanned table.

Return type

google.cloud.dlp_v2.types.TableDataProfile

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

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

# 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

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

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

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

    # Handle the response
    print(response)
Parameters
  • request (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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

Quota exceeded errors will be thrown once quota has been met.

Return type

google.cloud.dlp_v2.types.HybridInspectResponse

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

Inspect hybrid content and store findings to a trigger. The inspection will be processed asynchronously. To review the findings monitor the jobs within the trigger.

# 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

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

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

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

    # Handle the response
    print(response)
Parameters
  • request (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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

Quota exceeded errors will be thrown once quota has been met.

Return type

google.cloud.dlp_v2.types.HybridInspectResponse

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

Finds potentially sensitive info in content. This method has limits on input size, processing time, and output size.

When no InfoTypes or CustomInfoTypes are specified in this request, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.

For how to guides, see https://cloud.google.com/sensitive-data-protection/docs/inspecting-images and https://cloud.google.com/sensitive-data-protection/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

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

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

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

    # Handle the response
    print(response)
Parameters
Returns

Results of inspecting an item.

Return type

google.cloud.dlp_v2.types.InspectContentResponse

static inspect_template_path(organization: str, inspect_template: str) str[source]

Returns a fully-qualified inspect_template string.

static job_trigger_path(project: str, job_trigger: str) str[source]

Returns a fully-qualified job_trigger string.

list_column_data_profiles(request: Optional[Union[google.cloud.dlp_v2.types.dlp.ListColumnDataProfilesRequest, dict]] = None, *, parent: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.services.dlp_service.pagers.ListColumnDataProfilesPager[source]

Lists column data profiles for an organization.

# 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

def sample_list_column_data_profiles():
    # Create a client
    client = dlp_v2.DlpServiceClient()

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

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

    # Handle the response
    for response in page_result:
        print(response)
Parameters
  • request (Union[google.cloud.dlp_v2.types.ListColumnDataProfilesRequest, dict]) – The request object. Request to list the profiles generated for a given organization or project.

  • parent (str) –

    Required. Resource name of the organization or project, for example organizations/433245324/locations/europe or projects/project-id/locations/asia.

    This corresponds to the parent field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

List of profiles generated for a given organization or project. Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.dlp_v2.services.dlp_service.pagers.ListColumnDataProfilesPager

list_connections(request: Optional[Union[google.cloud.dlp_v2.types.dlp.ListConnectionsRequest, dict]] = None, *, parent: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.services.dlp_service.pagers.ListConnectionsPager[source]

Lists Connections in a parent. Use SearchConnections to see all connections within an organization.

# 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

def sample_list_connections():
    # Create a client
    client = dlp_v2.DlpServiceClient()

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

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

    # Handle the response
    for response in page_result:
        print(response)
Parameters
  • request (Union[google.cloud.dlp_v2.types.ListConnectionsRequest, dict]) – The request object. Request message for ListConnections.

  • parent (str) –

    Required. Resource name of the organization or project, for example, organizations/433245324/locations/europe or projects/project-id/locations/asia.

    This corresponds to the parent field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

Response message for ListConnections.

Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.dlp_v2.services.dlp_service.pagers.ListConnectionsPager

list_deidentify_templates(request: Optional[Union[google.cloud.dlp_v2.types.dlp.ListDeidentifyTemplatesRequest, dict]] = None, *, parent: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.services.dlp_service.pagers.ListDeidentifyTemplatesPager[source]

Lists DeidentifyTemplates. See https://cloud.google.com/sensitive-data-protection/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

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

    # 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
    for response in page_result:
        print(response)
Parameters
  • request (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:

    • 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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

Response message for ListDeidentifyTemplates. Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.dlp_v2.services.dlp_service.pagers.ListDeidentifyTemplatesPager

list_discovery_configs(request: Optional[Union[google.cloud.dlp_v2.types.dlp.ListDiscoveryConfigsRequest, dict]] = None, *, parent: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.services.dlp_service.pagers.ListDiscoveryConfigsPager[source]

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

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

    # 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
    for response in page_result:
        print(response)
Parameters
  • request (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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

Response message for ListDiscoveryConfigs. Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.dlp_v2.services.dlp_service.pagers.ListDiscoveryConfigsPager

list_dlp_jobs(request: Optional[Union[google.cloud.dlp_v2.types.dlp.ListDlpJobsRequest, dict]] = None, *, parent: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.services.dlp_service.pagers.ListDlpJobsPager[source]

Lists DlpJobs that match the specified filter in the request. See https://cloud.google.com/sensitive-data-protection/docs/inspecting-storage and https://cloud.google.com/sensitive-data-protection/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

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

    # 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
    for response in page_result:
        print(response)
Parameters
  • request (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:

    • 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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

The response message for listing DLP jobs. Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.dlp_v2.services.dlp_service.pagers.ListDlpJobsPager

list_file_store_data_profiles(request: Optional[Union[google.cloud.dlp_v2.types.dlp.ListFileStoreDataProfilesRequest, dict]] = None, *, parent: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.services.dlp_service.pagers.ListFileStoreDataProfilesPager[source]

Lists file store data profiles for an organization.

# 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

def sample_list_file_store_data_profiles():
    # Create a client
    client = dlp_v2.DlpServiceClient()

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

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

    # Handle the response
    for response in page_result:
        print(response)
Parameters
  • request (Union[google.cloud.dlp_v2.types.ListFileStoreDataProfilesRequest, dict]) – The request object. Request to list the file store profiles generated for a given organization or project.

  • parent (str) –

    Required. Resource name of the organization or project, for example organizations/433245324/locations/europe or projects/project-id/locations/asia.

    This corresponds to the parent field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

List of file store data profiles generated for a given organization or project.

Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.dlp_v2.services.dlp_service.pagers.ListFileStoreDataProfilesPager

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

Returns a list of the sensitive information types that DLP API supports. See https://cloud.google.com/sensitive-data-protection/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

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

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

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

    # Handle the response
    print(response)
Parameters
  • request (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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

Response to the ListInfoTypes request.

Return type

google.cloud.dlp_v2.types.ListInfoTypesResponse

list_inspect_templates(request: Optional[Union[google.cloud.dlp_v2.types.dlp.ListInspectTemplatesRequest, dict]] = None, *, parent: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.services.dlp_service.pagers.ListInspectTemplatesPager[source]

Lists InspectTemplates. See https://cloud.google.com/sensitive-data-protection/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

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

    # 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
    for response in page_result:
        print(response)
Parameters
  • request (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:

    • 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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

Response message for ListInspectTemplates. Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.dlp_v2.services.dlp_service.pagers.ListInspectTemplatesPager

list_job_triggers(request: Optional[Union[google.cloud.dlp_v2.types.dlp.ListJobTriggersRequest, dict]] = None, *, parent: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.services.dlp_service.pagers.ListJobTriggersPager[source]

Lists job triggers. See https://cloud.google.com/sensitive-data-protection/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

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

    # 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
    for response in page_result:
        print(response)
Parameters
  • request (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:

    • 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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

Response message for ListJobTriggers.

Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.dlp_v2.services.dlp_service.pagers.ListJobTriggersPager

list_project_data_profiles(request: Optional[Union[google.cloud.dlp_v2.types.dlp.ListProjectDataProfilesRequest, dict]] = None, *, parent: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.services.dlp_service.pagers.ListProjectDataProfilesPager[source]

Lists project data profiles for an organization.

# 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

def sample_list_project_data_profiles():
    # Create a client
    client = dlp_v2.DlpServiceClient()

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

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

    # Handle the response
    for response in page_result:
        print(response)
Parameters
  • request (Union[google.cloud.dlp_v2.types.ListProjectDataProfilesRequest, dict]) – The request object. Request to list the profiles generated for a given organization or project.

  • parent (str) – Required. organizations/{org_id}/locations/{loc_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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

List of profiles generated for a given organization or project. Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.dlp_v2.services.dlp_service.pagers.ListProjectDataProfilesPager

list_stored_info_types(request: Optional[Union[google.cloud.dlp_v2.types.dlp.ListStoredInfoTypesRequest, dict]] = None, *, parent: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.services.dlp_service.pagers.ListStoredInfoTypesPager[source]

Lists stored infoTypes. See https://cloud.google.com/sensitive-data-protection/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

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

    # 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
    for response in page_result:
        print(response)
Parameters
  • request (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:

    • 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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

Response message for ListStoredInfoTypes. Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.dlp_v2.services.dlp_service.pagers.ListStoredInfoTypesPager

list_table_data_profiles(request: Optional[Union[google.cloud.dlp_v2.types.dlp.ListTableDataProfilesRequest, dict]] = None, *, parent: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.services.dlp_service.pagers.ListTableDataProfilesPager[source]

Lists table data profiles for an organization.

# 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

def sample_list_table_data_profiles():
    # Create a client
    client = dlp_v2.DlpServiceClient()

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

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

    # Handle the response
    for response in page_result:
        print(response)
Parameters
  • request (Union[google.cloud.dlp_v2.types.ListTableDataProfilesRequest, dict]) – The request object. Request to list the profiles generated for a given organization or project.

  • parent (str) –

    Required. Resource name of the organization or project, for example organizations/433245324/locations/europe or projects/project-id/locations/asia.

    This corresponds to the parent field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

List of profiles generated for a given organization or project. Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.dlp_v2.services.dlp_service.pagers.ListTableDataProfilesPager

static parse_column_data_profile_path(path: str) Dict[str, str][source]

Parses a column_data_profile path into its component segments.

static parse_common_billing_account_path(path: str) Dict[str, str][source]

Parse a billing_account path into its component segments.

static parse_common_folder_path(path: str) Dict[str, str][source]

Parse a folder path into its component segments.

static parse_common_location_path(path: str) Dict[str, str][source]

Parse a location path into its component segments.

static parse_common_organization_path(path: str) Dict[str, str][source]

Parse a organization path into its component segments.

static parse_common_project_path(path: str) Dict[str, str][source]

Parse a project path into its component segments.

static parse_connection_path(path: str) Dict[str, str][source]

Parses a connection path into its component segments.

static parse_deidentify_template_path(path: str) Dict[str, str][source]

Parses a deidentify_template path into its component segments.

static parse_discovery_config_path(path: str) Dict[str, str][source]

Parses a discovery_config path into its component segments.

static parse_dlp_content_path(path: str) Dict[str, str][source]

Parses a dlp_content path into its component segments.

static parse_dlp_job_path(path: str) Dict[str, str][source]

Parses a dlp_job path into its component segments.

static parse_file_store_data_profile_path(path: str) Dict[str, str][source]

Parses a file_store_data_profile path into its component segments.

static parse_finding_path(path: str) Dict[str, str][source]

Parses a finding path into its component segments.

static parse_inspect_template_path(path: str) Dict[str, str][source]

Parses a inspect_template path into its component segments.

static parse_job_trigger_path(path: str) Dict[str, str][source]

Parses a job_trigger path into its component segments.

static parse_project_data_profile_path(path: str) Dict[str, str][source]

Parses a project_data_profile path into its component segments.

static parse_stored_info_type_path(path: str) Dict[str, str][source]

Parses a stored_info_type path into its component segments.

static parse_table_data_profile_path(path: str) Dict[str, str][source]

Parses a table_data_profile path into its component segments.

static project_data_profile_path(organization: str, location: str, project_data_profile: str) str[source]

Returns a fully-qualified project_data_profile string.

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

Redacts potentially sensitive info from an image. This method has limits on input size, processing time, and output size. See https://cloud.google.com/sensitive-data-protection/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

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

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

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

    # Handle the response
    print(response)
Parameters
  • request (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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

Results of redacting an image.

Return type

google.cloud.dlp_v2.types.RedactImageResponse

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

Re-identifies content that has been de-identified. See https://cloud.google.com/sensitive-data-protection/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

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

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

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

    # Handle the response
    print(response)
Parameters
Returns

Results of re-identifying an item.

Return type

google.cloud.dlp_v2.types.ReidentifyContentResponse

search_connections(request: Optional[Union[google.cloud.dlp_v2.types.dlp.SearchConnectionsRequest, dict]] = None, *, parent: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.services.dlp_service.pagers.SearchConnectionsPager[source]

Searches for Connections in a parent.

# 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

def sample_search_connections():
    # Create a client
    client = dlp_v2.DlpServiceClient()

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

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

    # Handle the response
    for response in page_result:
        print(response)
Parameters
  • request (Union[google.cloud.dlp_v2.types.SearchConnectionsRequest, dict]) – The request object. Request message for SearchConnections.

  • parent (str) –

    Required. Resource name of the organization or project with a wildcard location, for example, organizations/433245324/locations/- or projects/project-id/locations/-.

    This corresponds to the parent field on the request instance; if request is provided, this should not be set.

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

Response message for SearchConnections. Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.dlp_v2.services.dlp_service.pagers.SearchConnectionsPager

static stored_info_type_path(organization: str, stored_info_type: str) str[source]

Returns a fully-qualified stored_info_type string.

static table_data_profile_path(organization: str, location: str, table_data_profile: str) str[source]

Returns a fully-qualified table_data_profile string.

property transport: google.cloud.dlp_v2.services.dlp_service.transports.base.DlpServiceTransport

Returns the transport used by the client instance.

Returns

The transport used by the client

instance.

Return type

DlpServiceTransport

property universe_domain: str

Return the universe domain used by the client instance.

Returns

The universe domain used by the client instance.

Return type

str

update_connection(request: Optional[Union[google.cloud.dlp_v2.types.dlp.UpdateConnectionRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.dlp_v2.types.dlp.Connection[source]

Update a Connection.

# 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

def sample_update_connection():
    # Create a client
    client = dlp_v2.DlpServiceClient()

    # Initialize request argument(s)
    connection = dlp_v2.Connection()
    connection.cloud_sql.username_password.username = "username_value"
    connection.cloud_sql.username_password.password_secret_version_name = "password_secret_version_name_value"
    connection.cloud_sql.max_connections = 1608
    connection.cloud_sql.database_engine = "DATABASE_ENGINE_POSTGRES"
    connection.state = "ERROR"

    request = dlp_v2.UpdateConnectionRequest(
        name="name_value",
        connection=connection,
    )

    # Make the request
    response = client.update_connection(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Union[google.cloud.dlp_v2.types.UpdateConnectionRequest, dict]) – The request object. Request message for UpdateConnection.

  • name (str) –

    Required. Resource name in the format: projects/{project}/locations/{location}/connections/{connection}.

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

  • retry (google.api_core.retry.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

A data connection to allow DLP to profile data in locations that require additional configuration.

Return type

google.cloud.dlp_v2.types.Connection

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

Updates the DeidentifyTemplate. See https://cloud.google.com/sensitive-data-protection/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

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

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

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

    # Handle the response
    print(response)
Parameters
  • request (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 (google.cloud.dlp_v2.types.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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

DeidentifyTemplates contains instructions on how to de-identify content. See https://cloud.google.com/sensitive-data-protection/docs/concepts-templates to learn more.

Return type

google.cloud.dlp_v2.types.DeidentifyTemplate

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

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

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

    # 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 = client.update_discovery_config(request=request)

    # Handle the response
    print(response)
Parameters
  • request (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 (google.cloud.dlp_v2.types.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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

Configuration 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/sensitive-data-protection/docs/data-profiles#retention).

Return type

google.cloud.dlp_v2.types.DiscoveryConfig

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

Updates the InspectTemplate. See https://cloud.google.com/sensitive-data-protection/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

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

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

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

    # Handle the response
    print(response)
Parameters
  • request (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 (google.cloud.dlp_v2.types.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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

The inspectTemplate contains a configuration (set of types of sensitive data to be detected) to be used anywhere you otherwise would normally specify InspectConfig. See https://cloud.google.com/sensitive-data-protection/docs/concepts-templates to learn more.

Return type

google.cloud.dlp_v2.types.InspectTemplate

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

Updates a job trigger. See https://cloud.google.com/sensitive-data-protection/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

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

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

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

    # Handle the response
    print(response)
Parameters
  • request (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 (google.cloud.dlp_v2.types.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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

Contains a configuration to make API calls on a repeating basis. See https://cloud.google.com/sensitive-data-protection/docs/concepts-job-triggers to learn more.

Return type

google.cloud.dlp_v2.types.JobTrigger

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

Updates the stored infoType by creating a new version. The existing version will continue to be used until the new version is ready. See https://cloud.google.com/sensitive-data-protection/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

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

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

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

    # Handle the response
    print(response)
Parameters
  • request (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 (google.cloud.dlp_v2.types.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.Retry) – Designation of what errors, if any, should be retried.

  • timeout (float) – The timeout for this request.

  • metadata (Sequence[Tuple[str, str]]) – Strings which should be sent along with the request as metadata.

Returns

StoredInfoType resource message that contains information about the current version and any pending updates.

Return type

google.cloud.dlp_v2.types.StoredInfoType

class google.cloud.dlp_v2.services.dlp_service.pagers.ListColumnDataProfilesAsyncPager(method: Callable[[...], Awaitable[google.cloud.dlp_v2.types.dlp.ListColumnDataProfilesResponse]], request: google.cloud.dlp_v2.types.dlp.ListColumnDataProfilesRequest, response: google.cloud.dlp_v2.types.dlp.ListColumnDataProfilesResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_column_data_profiles requests.

This class thinly wraps an initial google.cloud.dlp_v2.types.ListColumnDataProfilesResponse object, and provides an __aiter__ method to iterate through its column_data_profiles field.

If there are more pages, the __aiter__ method will make additional ListColumnDataProfiles requests and continue to iterate through the column_data_profiles field on the corresponding responses.

All the usual google.cloud.dlp_v2.types.ListColumnDataProfilesResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiates the pager.

Parameters
class google.cloud.dlp_v2.services.dlp_service.pagers.ListColumnDataProfilesPager(method: Callable[[...], google.cloud.dlp_v2.types.dlp.ListColumnDataProfilesResponse], request: google.cloud.dlp_v2.types.dlp.ListColumnDataProfilesRequest, response: google.cloud.dlp_v2.types.dlp.ListColumnDataProfilesResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_column_data_profiles requests.

This class thinly wraps an initial google.cloud.dlp_v2.types.ListColumnDataProfilesResponse object, and provides an __iter__ method to iterate through its column_data_profiles field.

If there are more pages, the __iter__ method will make additional ListColumnDataProfiles requests and continue to iterate through the column_data_profiles field on the corresponding responses.

All the usual google.cloud.dlp_v2.types.ListColumnDataProfilesResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiate the pager.

Parameters
class google.cloud.dlp_v2.services.dlp_service.pagers.ListConnectionsAsyncPager(method: Callable[[...], Awaitable[google.cloud.dlp_v2.types.dlp.ListConnectionsResponse]], request: google.cloud.dlp_v2.types.dlp.ListConnectionsRequest, response: google.cloud.dlp_v2.types.dlp.ListConnectionsResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_connections requests.

This class thinly wraps an initial google.cloud.dlp_v2.types.ListConnectionsResponse object, and provides an __aiter__ method to iterate through its connections field.

If there are more pages, the __aiter__ method will make additional ListConnections requests and continue to iterate through the connections field on the corresponding responses.

All the usual google.cloud.dlp_v2.types.ListConnectionsResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiates the pager.

Parameters
class google.cloud.dlp_v2.services.dlp_service.pagers.ListConnectionsPager(method: Callable[[...], google.cloud.dlp_v2.types.dlp.ListConnectionsResponse], request: google.cloud.dlp_v2.types.dlp.ListConnectionsRequest, response: google.cloud.dlp_v2.types.dlp.ListConnectionsResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_connections requests.

This class thinly wraps an initial google.cloud.dlp_v2.types.ListConnectionsResponse object, and provides an __iter__ method to iterate through its connections field.

If there are more pages, the __iter__ method will make additional ListConnections requests and continue to iterate through the connections field on the corresponding responses.

All the usual google.cloud.dlp_v2.types.ListConnectionsResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiate the pager.

Parameters
class google.cloud.dlp_v2.services.dlp_service.pagers.ListDeidentifyTemplatesAsyncPager(method: Callable[[...], Awaitable[google.cloud.dlp_v2.types.dlp.ListDeidentifyTemplatesResponse]], request: google.cloud.dlp_v2.types.dlp.ListDeidentifyTemplatesRequest, response: google.cloud.dlp_v2.types.dlp.ListDeidentifyTemplatesResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_deidentify_templates requests.

This class thinly wraps an initial google.cloud.dlp_v2.types.ListDeidentifyTemplatesResponse object, and provides an __aiter__ method to iterate through its deidentify_templates field.

If there are more pages, the __aiter__ method will make additional ListDeidentifyTemplates requests and continue to iterate through the deidentify_templates field on the corresponding responses.

All the usual google.cloud.dlp_v2.types.ListDeidentifyTemplatesResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiates the pager.

Parameters
class google.cloud.dlp_v2.services.dlp_service.pagers.ListDeidentifyTemplatesPager(method: Callable[[...], google.cloud.dlp_v2.types.dlp.ListDeidentifyTemplatesResponse], request: google.cloud.dlp_v2.types.dlp.ListDeidentifyTemplatesRequest, response: google.cloud.dlp_v2.types.dlp.ListDeidentifyTemplatesResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_deidentify_templates requests.

This class thinly wraps an initial google.cloud.dlp_v2.types.ListDeidentifyTemplatesResponse object, and provides an __iter__ method to iterate through its deidentify_templates field.

If there are more pages, the __iter__ method will make additional ListDeidentifyTemplates requests and continue to iterate through the deidentify_templates field on the corresponding responses.

All the usual google.cloud.dlp_v2.types.ListDeidentifyTemplatesResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiate the pager.

Parameters
class google.cloud.dlp_v2.services.dlp_service.pagers.ListDiscoveryConfigsAsyncPager(method: Callable[[...], Awaitable[google.cloud.dlp_v2.types.dlp.ListDiscoveryConfigsResponse]], request: google.cloud.dlp_v2.types.dlp.ListDiscoveryConfigsRequest, response: google.cloud.dlp_v2.types.dlp.ListDiscoveryConfigsResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_discovery_configs requests.

This class thinly wraps an initial google.cloud.dlp_v2.types.ListDiscoveryConfigsResponse object, and provides an __aiter__ method to iterate through its discovery_configs field.

If there are more pages, the __aiter__ method will make additional ListDiscoveryConfigs requests and continue to iterate through the discovery_configs field on the corresponding responses.

All the usual google.cloud.dlp_v2.types.ListDiscoveryConfigsResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiates the pager.

Parameters
class google.cloud.dlp_v2.services.dlp_service.pagers.ListDiscoveryConfigsPager(method: Callable[[...], google.cloud.dlp_v2.types.dlp.ListDiscoveryConfigsResponse], request: google.cloud.dlp_v2.types.dlp.ListDiscoveryConfigsRequest, response: google.cloud.dlp_v2.types.dlp.ListDiscoveryConfigsResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_discovery_configs requests.

This class thinly wraps an initial google.cloud.dlp_v2.types.ListDiscoveryConfigsResponse object, and provides an __iter__ method to iterate through its discovery_configs field.

If there are more pages, the __iter__ method will make additional ListDiscoveryConfigs requests and continue to iterate through the discovery_configs field on the corresponding responses.

All the usual google.cloud.dlp_v2.types.ListDiscoveryConfigsResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiate the pager.

Parameters
class google.cloud.dlp_v2.services.dlp_service.pagers.ListDlpJobsAsyncPager(method: Callable[[...], Awaitable[google.cloud.dlp_v2.types.dlp.ListDlpJobsResponse]], request: google.cloud.dlp_v2.types.dlp.ListDlpJobsRequest, response: google.cloud.dlp_v2.types.dlp.ListDlpJobsResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_dlp_jobs requests.

This class thinly wraps an initial google.cloud.dlp_v2.types.ListDlpJobsResponse object, and provides an __aiter__ method to iterate through its jobs field.

If there are more pages, the __aiter__ method will make additional ListDlpJobs requests and continue to iterate through the jobs field on the corresponding responses.

All the usual google.cloud.dlp_v2.types.ListDlpJobsResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiates the pager.

Parameters
class google.cloud.dlp_v2.services.dlp_service.pagers.ListDlpJobsPager(method: Callable[[...], google.cloud.dlp_v2.types.dlp.ListDlpJobsResponse], request: google.cloud.dlp_v2.types.dlp.ListDlpJobsRequest, response: google.cloud.dlp_v2.types.dlp.ListDlpJobsResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_dlp_jobs requests.

This class thinly wraps an initial google.cloud.dlp_v2.types.ListDlpJobsResponse object, and provides an __iter__ method to iterate through its jobs field.

If there are more pages, the __iter__ method will make additional ListDlpJobs requests and continue to iterate through the jobs field on the corresponding responses.

All the usual google.cloud.dlp_v2.types.ListDlpJobsResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiate the pager.

Parameters
class google.cloud.dlp_v2.services.dlp_service.pagers.ListFileStoreDataProfilesAsyncPager(method: Callable[[...], Awaitable[google.cloud.dlp_v2.types.dlp.ListFileStoreDataProfilesResponse]], request: google.cloud.dlp_v2.types.dlp.ListFileStoreDataProfilesRequest, response: google.cloud.dlp_v2.types.dlp.ListFileStoreDataProfilesResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_file_store_data_profiles requests.

This class thinly wraps an initial google.cloud.dlp_v2.types.ListFileStoreDataProfilesResponse object, and provides an __aiter__ method to iterate through its file_store_data_profiles field.

If there are more pages, the __aiter__ method will make additional ListFileStoreDataProfiles requests and continue to iterate through the file_store_data_profiles field on the corresponding responses.

All the usual google.cloud.dlp_v2.types.ListFileStoreDataProfilesResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiates the pager.

Parameters
class google.cloud.dlp_v2.services.dlp_service.pagers.ListFileStoreDataProfilesPager(method: Callable[[...], google.cloud.dlp_v2.types.dlp.ListFileStoreDataProfilesResponse], request: google.cloud.dlp_v2.types.dlp.ListFileStoreDataProfilesRequest, response: google.cloud.dlp_v2.types.dlp.ListFileStoreDataProfilesResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_file_store_data_profiles requests.

This class thinly wraps an initial google.cloud.dlp_v2.types.ListFileStoreDataProfilesResponse object, and provides an __iter__ method to iterate through its file_store_data_profiles field.

If there are more pages, the __iter__ method will make additional ListFileStoreDataProfiles requests and continue to iterate through the file_store_data_profiles field on the corresponding responses.

All the usual google.cloud.dlp_v2.types.ListFileStoreDataProfilesResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiate the pager.

Parameters
class google.cloud.dlp_v2.services.dlp_service.pagers.ListInspectTemplatesAsyncPager(method: Callable[[...], Awaitable[google.cloud.dlp_v2.types.dlp.ListInspectTemplatesResponse]], request: google.cloud.dlp_v2.types.dlp.ListInspectTemplatesRequest, response: google.cloud.dlp_v2.types.dlp.ListInspectTemplatesResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_inspect_templates requests.

This class thinly wraps an initial google.cloud.dlp_v2.types.ListInspectTemplatesResponse object, and provides an __aiter__ method to iterate through its inspect_templates field.

If there are more pages, the __aiter__ method will make additional ListInspectTemplates requests and continue to iterate through the inspect_templates field on the corresponding responses.

All the usual google.cloud.dlp_v2.types.ListInspectTemplatesResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiates the pager.

Parameters
class google.cloud.dlp_v2.services.dlp_service.pagers.ListInspectTemplatesPager(method: Callable[[...], google.cloud.dlp_v2.types.dlp.ListInspectTemplatesResponse], request: google.cloud.dlp_v2.types.dlp.ListInspectTemplatesRequest, response: google.cloud.dlp_v2.types.dlp.ListInspectTemplatesResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_inspect_templates requests.

This class thinly wraps an initial google.cloud.dlp_v2.types.ListInspectTemplatesResponse object, and provides an __iter__ method to iterate through its inspect_templates field.

If there are more pages, the __iter__ method will make additional ListInspectTemplates requests and continue to iterate through the inspect_templates field on the corresponding responses.

All the usual google.cloud.dlp_v2.types.ListInspectTemplatesResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiate the pager.

Parameters
class google.cloud.dlp_v2.services.dlp_service.pagers.ListJobTriggersAsyncPager(method: Callable[[...], Awaitable[google.cloud.dlp_v2.types.dlp.ListJobTriggersResponse]], request: google.cloud.dlp_v2.types.dlp.ListJobTriggersRequest, response: google.cloud.dlp_v2.types.dlp.ListJobTriggersResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_job_triggers requests.

This class thinly wraps an initial google.cloud.dlp_v2.types.ListJobTriggersResponse object, and provides an __aiter__ method to iterate through its job_triggers field.

If there are more pages, the __aiter__ method will make additional ListJobTriggers requests and continue to iterate through the job_triggers field on the corresponding responses.

All the usual google.cloud.dlp_v2.types.ListJobTriggersResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiates the pager.

Parameters
class google.cloud.dlp_v2.services.dlp_service.pagers.ListJobTriggersPager(method: Callable[[...], google.cloud.dlp_v2.types.dlp.ListJobTriggersResponse], request: google.cloud.dlp_v2.types.dlp.ListJobTriggersRequest, response: google.cloud.dlp_v2.types.dlp.ListJobTriggersResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_job_triggers requests.

This class thinly wraps an initial google.cloud.dlp_v2.types.ListJobTriggersResponse object, and provides an __iter__ method to iterate through its job_triggers field.

If there are more pages, the __iter__ method will make additional ListJobTriggers requests and continue to iterate through the job_triggers field on the corresponding responses.

All the usual google.cloud.dlp_v2.types.ListJobTriggersResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiate the pager.

Parameters
class google.cloud.dlp_v2.services.dlp_service.pagers.ListProjectDataProfilesAsyncPager(method: Callable[[...], Awaitable[google.cloud.dlp_v2.types.dlp.ListProjectDataProfilesResponse]], request: google.cloud.dlp_v2.types.dlp.ListProjectDataProfilesRequest, response: google.cloud.dlp_v2.types.dlp.ListProjectDataProfilesResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_project_data_profiles requests.

This class thinly wraps an initial google.cloud.dlp_v2.types.ListProjectDataProfilesResponse object, and provides an __aiter__ method to iterate through its project_data_profiles field.

If there are more pages, the __aiter__ method will make additional ListProjectDataProfiles requests and continue to iterate through the project_data_profiles field on the corresponding responses.

All the usual google.cloud.dlp_v2.types.ListProjectDataProfilesResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiates the pager.

Parameters
class google.cloud.dlp_v2.services.dlp_service.pagers.ListProjectDataProfilesPager(method: Callable[[...], google.cloud.dlp_v2.types.dlp.ListProjectDataProfilesResponse], request: google.cloud.dlp_v2.types.dlp.ListProjectDataProfilesRequest, response: google.cloud.dlp_v2.types.dlp.ListProjectDataProfilesResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_project_data_profiles requests.

This class thinly wraps an initial google.cloud.dlp_v2.types.ListProjectDataProfilesResponse object, and provides an __iter__ method to iterate through its project_data_profiles field.

If there are more pages, the __iter__ method will make additional ListProjectDataProfiles requests and continue to iterate through the project_data_profiles field on the corresponding responses.

All the usual google.cloud.dlp_v2.types.ListProjectDataProfilesResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiate the pager.

Parameters
class google.cloud.dlp_v2.services.dlp_service.pagers.ListStoredInfoTypesAsyncPager(method: Callable[[...], Awaitable[google.cloud.dlp_v2.types.dlp.ListStoredInfoTypesResponse]], request: google.cloud.dlp_v2.types.dlp.ListStoredInfoTypesRequest, response: google.cloud.dlp_v2.types.dlp.ListStoredInfoTypesResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_stored_info_types requests.

This class thinly wraps an initial google.cloud.dlp_v2.types.ListStoredInfoTypesResponse object, and provides an __aiter__ method to iterate through its stored_info_types field.

If there are more pages, the __aiter__ method will make additional ListStoredInfoTypes requests and continue to iterate through the stored_info_types field on the corresponding responses.

All the usual google.cloud.dlp_v2.types.ListStoredInfoTypesResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiates the pager.

Parameters
class google.cloud.dlp_v2.services.dlp_service.pagers.ListStoredInfoTypesPager(method: Callable[[...], google.cloud.dlp_v2.types.dlp.ListStoredInfoTypesResponse], request: google.cloud.dlp_v2.types.dlp.ListStoredInfoTypesRequest, response: google.cloud.dlp_v2.types.dlp.ListStoredInfoTypesResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_stored_info_types requests.

This class thinly wraps an initial google.cloud.dlp_v2.types.ListStoredInfoTypesResponse object, and provides an __iter__ method to iterate through its stored_info_types field.

If there are more pages, the __iter__ method will make additional ListStoredInfoTypes requests and continue to iterate through the stored_info_types field on the corresponding responses.

All the usual google.cloud.dlp_v2.types.ListStoredInfoTypesResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiate the pager.

Parameters
class google.cloud.dlp_v2.services.dlp_service.pagers.ListTableDataProfilesAsyncPager(method: Callable[[...], Awaitable[google.cloud.dlp_v2.types.dlp.ListTableDataProfilesResponse]], request: google.cloud.dlp_v2.types.dlp.ListTableDataProfilesRequest, response: google.cloud.dlp_v2.types.dlp.ListTableDataProfilesResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_table_data_profiles requests.

This class thinly wraps an initial google.cloud.dlp_v2.types.ListTableDataProfilesResponse object, and provides an __aiter__ method to iterate through its table_data_profiles field.

If there are more pages, the __aiter__ method will make additional ListTableDataProfiles requests and continue to iterate through the table_data_profiles field on the corresponding responses.

All the usual google.cloud.dlp_v2.types.ListTableDataProfilesResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiates the pager.

Parameters
class google.cloud.dlp_v2.services.dlp_service.pagers.ListTableDataProfilesPager(method: Callable[[...], google.cloud.dlp_v2.types.dlp.ListTableDataProfilesResponse], request: google.cloud.dlp_v2.types.dlp.ListTableDataProfilesRequest, response: google.cloud.dlp_v2.types.dlp.ListTableDataProfilesResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_table_data_profiles requests.

This class thinly wraps an initial google.cloud.dlp_v2.types.ListTableDataProfilesResponse object, and provides an __iter__ method to iterate through its table_data_profiles field.

If there are more pages, the __iter__ method will make additional ListTableDataProfiles requests and continue to iterate through the table_data_profiles field on the corresponding responses.

All the usual google.cloud.dlp_v2.types.ListTableDataProfilesResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiate the pager.

Parameters
class google.cloud.dlp_v2.services.dlp_service.pagers.SearchConnectionsAsyncPager(method: Callable[[...], Awaitable[google.cloud.dlp_v2.types.dlp.SearchConnectionsResponse]], request: google.cloud.dlp_v2.types.dlp.SearchConnectionsRequest, response: google.cloud.dlp_v2.types.dlp.SearchConnectionsResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through search_connections requests.

This class thinly wraps an initial google.cloud.dlp_v2.types.SearchConnectionsResponse object, and provides an __aiter__ method to iterate through its connections field.

If there are more pages, the __aiter__ method will make additional SearchConnections requests and continue to iterate through the connections field on the corresponding responses.

All the usual google.cloud.dlp_v2.types.SearchConnectionsResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiates the pager.

Parameters
class google.cloud.dlp_v2.services.dlp_service.pagers.SearchConnectionsPager(method: Callable[[...], google.cloud.dlp_v2.types.dlp.SearchConnectionsResponse], request: google.cloud.dlp_v2.types.dlp.SearchConnectionsRequest, response: google.cloud.dlp_v2.types.dlp.SearchConnectionsResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through search_connections requests.

This class thinly wraps an initial google.cloud.dlp_v2.types.SearchConnectionsResponse object, and provides an __iter__ method to iterate through its connections field.

If there are more pages, the __iter__ method will make additional SearchConnections requests and continue to iterate through the connections field on the corresponding responses.

All the usual google.cloud.dlp_v2.types.SearchConnectionsResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiate the pager.

Parameters