@@ -2175,6 +2175,157 @@ def cancel_dlp_job(
2175
2175
request , retry = retry , timeout = timeout , metadata = metadata
2176
2176
)
2177
2177
2178
+ def finish_dlp_job (
2179
+ self ,
2180
+ name ,
2181
+ retry = google .api_core .gapic_v1 .method .DEFAULT ,
2182
+ timeout = google .api_core .gapic_v1 .method .DEFAULT ,
2183
+ metadata = None ,
2184
+ ):
2185
+ """
2186
+ Finish a running hybrid DlpJob. Triggers the finalization steps and running
2187
+ of any enabled actions that have not yet run.
2188
+ Early access feature is in a pre-release state and might change or have
2189
+ limited support. For more information, see
2190
+ https://cloud.google.com/products#product-launch-stages.
2191
+
2192
+ Example:
2193
+ >>> from google.cloud import dlp_v2
2194
+ >>>
2195
+ >>> client = dlp_v2.DlpServiceClient()
2196
+ >>>
2197
+ >>> name = client.dlp_job_path('[PROJECT]', '[DLP_JOB]')
2198
+ >>>
2199
+ >>> client.finish_dlp_job(name)
2200
+
2201
+ Args:
2202
+ name (str): Required. The name of the DlpJob resource to be cancelled.
2203
+ retry (Optional[google.api_core.retry.Retry]): A retry object used
2204
+ to retry requests. If ``None`` is specified, requests will
2205
+ be retried using a default configuration.
2206
+ timeout (Optional[float]): The amount of time, in seconds, to wait
2207
+ for the request to complete. Note that if ``retry`` is
2208
+ specified, the timeout applies to each individual attempt.
2209
+ metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
2210
+ that is provided to the method.
2211
+
2212
+ Raises:
2213
+ google.api_core.exceptions.GoogleAPICallError: If the request
2214
+ failed for any reason.
2215
+ google.api_core.exceptions.RetryError: If the request failed due
2216
+ to a retryable error and retry attempts failed.
2217
+ ValueError: If the parameters are invalid.
2218
+ """
2219
+ # Wrap the transport method to add retry and timeout logic.
2220
+ if "finish_dlp_job" not in self ._inner_api_calls :
2221
+ self ._inner_api_calls [
2222
+ "finish_dlp_job"
2223
+ ] = google .api_core .gapic_v1 .method .wrap_method (
2224
+ self .transport .finish_dlp_job ,
2225
+ default_retry = self ._method_configs ["FinishDlpJob" ].retry ,
2226
+ default_timeout = self ._method_configs ["FinishDlpJob" ].timeout ,
2227
+ client_info = self ._client_info ,
2228
+ )
2229
+
2230
+ request = dlp_pb2 .FinishDlpJobRequest (name = name )
2231
+ if metadata is None :
2232
+ metadata = []
2233
+ metadata = list (metadata )
2234
+ try :
2235
+ routing_header = [("name" , name )]
2236
+ except AttributeError :
2237
+ pass
2238
+ else :
2239
+ routing_metadata = google .api_core .gapic_v1 .routing_header .to_grpc_metadata (
2240
+ routing_header
2241
+ )
2242
+ metadata .append (routing_metadata )
2243
+
2244
+ self ._inner_api_calls ["finish_dlp_job" ](
2245
+ request , retry = retry , timeout = timeout , metadata = metadata
2246
+ )
2247
+
2248
+ def hybrid_inspect_dlp_job (
2249
+ self ,
2250
+ name ,
2251
+ hybrid_item = None ,
2252
+ retry = google .api_core .gapic_v1 .method .DEFAULT ,
2253
+ timeout = google .api_core .gapic_v1 .method .DEFAULT ,
2254
+ metadata = None ,
2255
+ ):
2256
+ """
2257
+ Inspect hybrid content and store findings to a job.
2258
+ To review the findings inspect the job. Inspection will occur
2259
+ asynchronously.
2260
+ Early access feature is in a pre-release state and might change or have
2261
+ limited support. For more information, see
2262
+ https://cloud.google.com/products#product-launch-stages.
2263
+
2264
+ Example:
2265
+ >>> from google.cloud import dlp_v2
2266
+ >>>
2267
+ >>> client = dlp_v2.DlpServiceClient()
2268
+ >>>
2269
+ >>> # TODO: Initialize `name`:
2270
+ >>> name = ''
2271
+ >>>
2272
+ >>> response = client.hybrid_inspect_dlp_job(name)
2273
+
2274
+ Args:
2275
+ name (str): Required. Resource name of the job to execute a hybrid inspect on, for
2276
+ example ``projects/dlp-test-project/dlpJob/53234423``.
2277
+ hybrid_item (Union[dict, ~google.cloud.dlp_v2.types.HybridContentItem]): The item to inspect.
2278
+
2279
+ If a dict is provided, it must be of the same form as the protobuf
2280
+ message :class:`~google.cloud.dlp_v2.types.HybridContentItem`
2281
+ retry (Optional[google.api_core.retry.Retry]): A retry object used
2282
+ to retry requests. If ``None`` is specified, requests will
2283
+ be retried using a default configuration.
2284
+ timeout (Optional[float]): The amount of time, in seconds, to wait
2285
+ for the request to complete. Note that if ``retry`` is
2286
+ specified, the timeout applies to each individual attempt.
2287
+ metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
2288
+ that is provided to the method.
2289
+
2290
+ Returns:
2291
+ A :class:`~google.cloud.dlp_v2.types.HybridInspectResponse` instance.
2292
+
2293
+ Raises:
2294
+ google.api_core.exceptions.GoogleAPICallError: If the request
2295
+ failed for any reason.
2296
+ google.api_core.exceptions.RetryError: If the request failed due
2297
+ to a retryable error and retry attempts failed.
2298
+ ValueError: If the parameters are invalid.
2299
+ """
2300
+ # Wrap the transport method to add retry and timeout logic.
2301
+ if "hybrid_inspect_dlp_job" not in self ._inner_api_calls :
2302
+ self ._inner_api_calls [
2303
+ "hybrid_inspect_dlp_job"
2304
+ ] = google .api_core .gapic_v1 .method .wrap_method (
2305
+ self .transport .hybrid_inspect_dlp_job ,
2306
+ default_retry = self ._method_configs ["HybridInspectDlpJob" ].retry ,
2307
+ default_timeout = self ._method_configs ["HybridInspectDlpJob" ].timeout ,
2308
+ client_info = self ._client_info ,
2309
+ )
2310
+
2311
+ request = dlp_pb2 .HybridInspectDlpJobRequest (name = name , hybrid_item = hybrid_item )
2312
+ if metadata is None :
2313
+ metadata = []
2314
+ metadata = list (metadata )
2315
+ try :
2316
+ routing_header = [("name" , name )]
2317
+ except AttributeError :
2318
+ pass
2319
+ else :
2320
+ routing_metadata = google .api_core .gapic_v1 .routing_header .to_grpc_metadata (
2321
+ routing_header
2322
+ )
2323
+ metadata .append (routing_metadata )
2324
+
2325
+ return self ._inner_api_calls ["hybrid_inspect_dlp_job" ](
2326
+ request , retry = retry , timeout = timeout , metadata = metadata
2327
+ )
2328
+
2178
2329
def list_job_triggers (
2179
2330
self ,
2180
2331
parent ,
@@ -2473,6 +2624,89 @@ def delete_job_trigger(
2473
2624
request , retry = retry , timeout = timeout , metadata = metadata
2474
2625
)
2475
2626
2627
+ def hybrid_inspect_job_trigger (
2628
+ self ,
2629
+ name ,
2630
+ hybrid_item = None ,
2631
+ retry = google .api_core .gapic_v1 .method .DEFAULT ,
2632
+ timeout = google .api_core .gapic_v1 .method .DEFAULT ,
2633
+ metadata = None ,
2634
+ ):
2635
+ """
2636
+ Inspect hybrid content and store findings to a trigger. The inspection
2637
+ will be processed asynchronously. To review the findings monitor the
2638
+ jobs within the trigger.
2639
+ Early access feature is in a pre-release state and might change or have
2640
+ limited support. For more information, see
2641
+ https://cloud.google.com/products#product-launch-stages.
2642
+
2643
+ Example:
2644
+ >>> from google.cloud import dlp_v2
2645
+ >>>
2646
+ >>> client = dlp_v2.DlpServiceClient()
2647
+ >>>
2648
+ >>> # TODO: Initialize `name`:
2649
+ >>> name = ''
2650
+ >>>
2651
+ >>> response = client.hybrid_inspect_job_trigger(name)
2652
+
2653
+ Args:
2654
+ name (str): Required. Resource name of the trigger to execute a hybrid inspect on,
2655
+ for example ``projects/dlp-test-project/jobTriggers/53234423``.
2656
+ hybrid_item (Union[dict, ~google.cloud.dlp_v2.types.HybridContentItem]): The item to inspect.
2657
+
2658
+ If a dict is provided, it must be of the same form as the protobuf
2659
+ message :class:`~google.cloud.dlp_v2.types.HybridContentItem`
2660
+ retry (Optional[google.api_core.retry.Retry]): A retry object used
2661
+ to retry requests. If ``None`` is specified, requests will
2662
+ be retried using a default configuration.
2663
+ timeout (Optional[float]): The amount of time, in seconds, to wait
2664
+ for the request to complete. Note that if ``retry`` is
2665
+ specified, the timeout applies to each individual attempt.
2666
+ metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
2667
+ that is provided to the method.
2668
+
2669
+ Returns:
2670
+ A :class:`~google.cloud.dlp_v2.types.HybridInspectResponse` instance.
2671
+
2672
+ Raises:
2673
+ google.api_core.exceptions.GoogleAPICallError: If the request
2674
+ failed for any reason.
2675
+ google.api_core.exceptions.RetryError: If the request failed due
2676
+ to a retryable error and retry attempts failed.
2677
+ ValueError: If the parameters are invalid.
2678
+ """
2679
+ # Wrap the transport method to add retry and timeout logic.
2680
+ if "hybrid_inspect_job_trigger" not in self ._inner_api_calls :
2681
+ self ._inner_api_calls [
2682
+ "hybrid_inspect_job_trigger"
2683
+ ] = google .api_core .gapic_v1 .method .wrap_method (
2684
+ self .transport .hybrid_inspect_job_trigger ,
2685
+ default_retry = self ._method_configs ["HybridInspectJobTrigger" ].retry ,
2686
+ default_timeout = self ._method_configs ["HybridInspectJobTrigger" ].timeout ,
2687
+ client_info = self ._client_info ,
2688
+ )
2689
+
2690
+ request = dlp_pb2 .HybridInspectJobTriggerRequest (
2691
+ name = name , hybrid_item = hybrid_item
2692
+ )
2693
+ if metadata is None :
2694
+ metadata = []
2695
+ metadata = list (metadata )
2696
+ try :
2697
+ routing_header = [("name" , name )]
2698
+ except AttributeError :
2699
+ pass
2700
+ else :
2701
+ routing_metadata = google .api_core .gapic_v1 .routing_header .to_grpc_metadata (
2702
+ routing_header
2703
+ )
2704
+ metadata .append (routing_metadata )
2705
+
2706
+ return self ._inner_api_calls ["hybrid_inspect_job_trigger" ](
2707
+ request , retry = retry , timeout = timeout , metadata = metadata
2708
+ )
2709
+
2476
2710
def update_job_trigger (
2477
2711
self ,
2478
2712
name ,
0 commit comments