google-cloud-dlp-v2 0.15.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3455 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/privacy/dlp/v2/dlp_pb"
21
+ require "google/cloud/dlp/v2/dlp_service/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module Dlp
27
+ module V2
28
+ module DlpService
29
+ module Rest
30
+ ##
31
+ # REST client for the DlpService service.
32
+ #
33
+ # The Cloud Data Loss Prevention (DLP) API is a service that allows clients
34
+ # to detect the presence of Personally Identifiable Information (PII) and other
35
+ # privacy-sensitive data in user-supplied, unstructured data streams, like text
36
+ # blocks or images.
37
+ # The service also includes methods for sensitive data redaction and
38
+ # scheduling of data scans on Google Cloud Platform based data sets.
39
+ #
40
+ # To learn more about concepts and find how-to guides see
41
+ # https://cloud.google.com/dlp/docs/.
42
+ #
43
+ class Client
44
+ include Paths
45
+
46
+ # @private
47
+ attr_reader :dlp_service_stub
48
+
49
+ ##
50
+ # Configure the DlpService Client class.
51
+ #
52
+ # See {::Google::Cloud::Dlp::V2::DlpService::Rest::Client::Configuration}
53
+ # for a description of the configuration fields.
54
+ #
55
+ # @example
56
+ #
57
+ # # Modify the configuration for all DlpService clients
58
+ # ::Google::Cloud::Dlp::V2::DlpService::Rest::Client.configure do |config|
59
+ # config.timeout = 10.0
60
+ # end
61
+ #
62
+ # @yield [config] Configure the Client client.
63
+ # @yieldparam config [Client::Configuration]
64
+ #
65
+ # @return [Client::Configuration]
66
+ #
67
+ def self.configure
68
+ @configure ||= begin
69
+ namespace = ["Google", "Cloud", "Dlp", "V2"]
70
+ parent_config = while namespace.any?
71
+ parent_name = namespace.join "::"
72
+ parent_const = const_get parent_name
73
+ break parent_const.configure if parent_const.respond_to? :configure
74
+ namespace.pop
75
+ end
76
+ default_config = Client::Configuration.new parent_config
77
+
78
+ default_config.rpcs.inspect_content.timeout = 300.0
79
+ default_config.rpcs.inspect_content.retry_policy = {
80
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
81
+ }
82
+
83
+ default_config.rpcs.redact_image.timeout = 300.0
84
+ default_config.rpcs.redact_image.retry_policy = {
85
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
86
+ }
87
+
88
+ default_config.rpcs.deidentify_content.timeout = 300.0
89
+ default_config.rpcs.deidentify_content.retry_policy = {
90
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
91
+ }
92
+
93
+ default_config.rpcs.reidentify_content.timeout = 300.0
94
+ default_config.rpcs.reidentify_content.retry_policy = {
95
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
96
+ }
97
+
98
+ default_config.rpcs.list_info_types.timeout = 300.0
99
+ default_config.rpcs.list_info_types.retry_policy = {
100
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
101
+ }
102
+
103
+ default_config.rpcs.create_inspect_template.timeout = 300.0
104
+
105
+ default_config.rpcs.update_inspect_template.timeout = 300.0
106
+
107
+ default_config.rpcs.get_inspect_template.timeout = 300.0
108
+ default_config.rpcs.get_inspect_template.retry_policy = {
109
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
110
+ }
111
+
112
+ default_config.rpcs.list_inspect_templates.timeout = 300.0
113
+ default_config.rpcs.list_inspect_templates.retry_policy = {
114
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
115
+ }
116
+
117
+ default_config.rpcs.delete_inspect_template.timeout = 300.0
118
+ default_config.rpcs.delete_inspect_template.retry_policy = {
119
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
120
+ }
121
+
122
+ default_config.rpcs.create_deidentify_template.timeout = 300.0
123
+
124
+ default_config.rpcs.update_deidentify_template.timeout = 300.0
125
+
126
+ default_config.rpcs.get_deidentify_template.timeout = 300.0
127
+ default_config.rpcs.get_deidentify_template.retry_policy = {
128
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
129
+ }
130
+
131
+ default_config.rpcs.list_deidentify_templates.timeout = 300.0
132
+ default_config.rpcs.list_deidentify_templates.retry_policy = {
133
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
134
+ }
135
+
136
+ default_config.rpcs.delete_deidentify_template.timeout = 300.0
137
+ default_config.rpcs.delete_deidentify_template.retry_policy = {
138
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
139
+ }
140
+
141
+ default_config.rpcs.create_job_trigger.timeout = 300.0
142
+
143
+ default_config.rpcs.update_job_trigger.timeout = 300.0
144
+
145
+ default_config.rpcs.hybrid_inspect_job_trigger.timeout = 300.0
146
+
147
+ default_config.rpcs.get_job_trigger.timeout = 300.0
148
+ default_config.rpcs.get_job_trigger.retry_policy = {
149
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
150
+ }
151
+
152
+ default_config.rpcs.list_job_triggers.timeout = 300.0
153
+ default_config.rpcs.list_job_triggers.retry_policy = {
154
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
155
+ }
156
+
157
+ default_config.rpcs.delete_job_trigger.timeout = 300.0
158
+ default_config.rpcs.delete_job_trigger.retry_policy = {
159
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
160
+ }
161
+
162
+ default_config.rpcs.activate_job_trigger.timeout = 300.0
163
+
164
+ default_config.rpcs.create_dlp_job.timeout = 300.0
165
+
166
+ default_config.rpcs.list_dlp_jobs.timeout = 300.0
167
+ default_config.rpcs.list_dlp_jobs.retry_policy = {
168
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
169
+ }
170
+
171
+ default_config.rpcs.get_dlp_job.timeout = 300.0
172
+ default_config.rpcs.get_dlp_job.retry_policy = {
173
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
174
+ }
175
+
176
+ default_config.rpcs.delete_dlp_job.timeout = 300.0
177
+ default_config.rpcs.delete_dlp_job.retry_policy = {
178
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
179
+ }
180
+
181
+ default_config.rpcs.cancel_dlp_job.timeout = 300.0
182
+
183
+ default_config.rpcs.create_stored_info_type.timeout = 300.0
184
+
185
+ default_config.rpcs.update_stored_info_type.timeout = 300.0
186
+
187
+ default_config.rpcs.get_stored_info_type.timeout = 300.0
188
+ default_config.rpcs.get_stored_info_type.retry_policy = {
189
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
190
+ }
191
+
192
+ default_config.rpcs.list_stored_info_types.timeout = 300.0
193
+ default_config.rpcs.list_stored_info_types.retry_policy = {
194
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
195
+ }
196
+
197
+ default_config.rpcs.delete_stored_info_type.timeout = 300.0
198
+ default_config.rpcs.delete_stored_info_type.retry_policy = {
199
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
200
+ }
201
+
202
+ default_config.rpcs.hybrid_inspect_dlp_job.timeout = 300.0
203
+
204
+ default_config.rpcs.finish_dlp_job.timeout = 300.0
205
+
206
+ default_config
207
+ end
208
+ yield @configure if block_given?
209
+ @configure
210
+ end
211
+
212
+ ##
213
+ # Configure the DlpService Client instance.
214
+ #
215
+ # The configuration is set to the derived mode, meaning that values can be changed,
216
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
217
+ # should be made on {Client.configure}.
218
+ #
219
+ # See {::Google::Cloud::Dlp::V2::DlpService::Rest::Client::Configuration}
220
+ # for a description of the configuration fields.
221
+ #
222
+ # @yield [config] Configure the Client client.
223
+ # @yieldparam config [Client::Configuration]
224
+ #
225
+ # @return [Client::Configuration]
226
+ #
227
+ def configure
228
+ yield @config if block_given?
229
+ @config
230
+ end
231
+
232
+ ##
233
+ # Create a new DlpService REST client object.
234
+ #
235
+ # @example
236
+ #
237
+ # # Create a client using the default configuration
238
+ # client = ::Google::Cloud::Dlp::V2::DlpService::Rest::Client.new
239
+ #
240
+ # # Create a client using a custom configuration
241
+ # client = ::Google::Cloud::Dlp::V2::DlpService::Rest::Client.new do |config|
242
+ # config.timeout = 10.0
243
+ # end
244
+ #
245
+ # @yield [config] Configure the DlpService client.
246
+ # @yieldparam config [Client::Configuration]
247
+ #
248
+ def initialize
249
+ # Create the configuration object
250
+ @config = Configuration.new Client.configure
251
+
252
+ # Yield the configuration if needed
253
+ yield @config if block_given?
254
+
255
+ # Create credentials
256
+ credentials = @config.credentials
257
+ # Use self-signed JWT if the endpoint is unchanged from default,
258
+ # but only if the default endpoint does not have a region prefix.
259
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
260
+ !@config.endpoint.split(".").first.include?("-")
261
+ credentials ||= Credentials.default scope: @config.scope,
262
+ enable_self_signed_jwt: enable_self_signed_jwt
263
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
264
+ credentials = Credentials.new credentials, scope: @config.scope
265
+ end
266
+
267
+ @quota_project_id = @config.quota_project
268
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
269
+
270
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
271
+ config.credentials = credentials
272
+ config.quota_project = @quota_project_id
273
+ config.endpoint = @config.endpoint
274
+ end
275
+
276
+ @dlp_service_stub = ::Google::Cloud::Dlp::V2::DlpService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
277
+ end
278
+
279
+ ##
280
+ # Get the associated client for mix-in of the Locations.
281
+ #
282
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
283
+ #
284
+ attr_reader :location_client
285
+
286
+ # Service calls
287
+
288
+ ##
289
+ # Finds potentially sensitive info in content.
290
+ # This method has limits on input size, processing time, and output size.
291
+ #
292
+ # When no InfoTypes or CustomInfoTypes are specified in this request, the
293
+ # system will automatically choose what detectors to run. By default this may
294
+ # be all types, but may change over time as detectors are updated.
295
+ #
296
+ # For how to guides, see https://cloud.google.com/dlp/docs/inspecting-images
297
+ # and https://cloud.google.com/dlp/docs/inspecting-text,
298
+ #
299
+ # @overload inspect_content(request, options = nil)
300
+ # Pass arguments to `inspect_content` via a request object, either of type
301
+ # {::Google::Cloud::Dlp::V2::InspectContentRequest} or an equivalent Hash.
302
+ #
303
+ # @param request [::Google::Cloud::Dlp::V2::InspectContentRequest, ::Hash]
304
+ # A request object representing the call parameters. Required. To specify no
305
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
306
+ # @param options [::Gapic::CallOptions, ::Hash]
307
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
308
+ #
309
+ # @overload inspect_content(parent: nil, inspect_config: nil, item: nil, inspect_template_name: nil, location_id: nil)
310
+ # Pass arguments to `inspect_content` via keyword arguments. Note that at
311
+ # least one keyword argument is required. To specify no parameters, or to keep all
312
+ # the default parameter values, pass an empty Hash as a request object (see above).
313
+ #
314
+ # @param parent [::String]
315
+ # Parent resource name.
316
+ #
317
+ # The format of this value varies depending on whether you have [specified a
318
+ # processing
319
+ # location](https://cloud.google.com/dlp/docs/specifying-location):
320
+ #
321
+ # + Projects scope, location specified:<br/>
322
+ # `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
323
+ # + Projects scope, no location specified (defaults to global):<br/>
324
+ # `projects/`<var>PROJECT_ID</var>
325
+ #
326
+ # The following example `parent` string specifies a parent project with the
327
+ # identifier `example-project`, and specifies the `europe-west3` location
328
+ # for processing data:
329
+ #
330
+ # parent=projects/example-project/locations/europe-west3
331
+ # @param inspect_config [::Google::Cloud::Dlp::V2::InspectConfig, ::Hash]
332
+ # Configuration for the inspector. What specified here will override
333
+ # the template referenced by the inspect_template_name argument.
334
+ # @param item [::Google::Cloud::Dlp::V2::ContentItem, ::Hash]
335
+ # The item to inspect.
336
+ # @param inspect_template_name [::String]
337
+ # Template to use. Any configuration directly specified in
338
+ # inspect_config will override those set in the template. Singular fields
339
+ # that are set in this request will replace their corresponding fields in the
340
+ # template. Repeated fields are appended. Singular sub-messages and groups
341
+ # are recursively merged.
342
+ # @param location_id [::String]
343
+ # Deprecated. This field has no effect.
344
+ # @yield [result, operation] Access the result along with the TransportOperation object
345
+ # @yieldparam result [::Google::Cloud::Dlp::V2::InspectContentResponse]
346
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
347
+ #
348
+ # @return [::Google::Cloud::Dlp::V2::InspectContentResponse]
349
+ #
350
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
351
+ def inspect_content request, options = nil
352
+ raise ::ArgumentError, "request must be provided" if request.nil?
353
+
354
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::InspectContentRequest
355
+
356
+ # Converts hash and nil to an options object
357
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
358
+
359
+ # Customize the options with defaults
360
+ call_metadata = @config.rpcs.inspect_content.metadata.to_h
361
+
362
+ # Set x-goog-api-client and x-goog-user-project headers
363
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
364
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
365
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
366
+ transports_version_send: [:rest]
367
+
368
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
369
+
370
+ options.apply_defaults timeout: @config.rpcs.inspect_content.timeout,
371
+ metadata: call_metadata,
372
+ retry_policy: @config.rpcs.inspect_content.retry_policy
373
+
374
+ options.apply_defaults timeout: @config.timeout,
375
+ metadata: @config.metadata,
376
+ retry_policy: @config.retry_policy
377
+
378
+ @dlp_service_stub.inspect_content request, options do |result, operation|
379
+ yield result, operation if block_given?
380
+ return result
381
+ end
382
+ rescue ::Gapic::Rest::Error => e
383
+ raise ::Google::Cloud::Error.from_error(e)
384
+ end
385
+
386
+ ##
387
+ # Redacts potentially sensitive info from an image.
388
+ # This method has limits on input size, processing time, and output size.
389
+ # See https://cloud.google.com/dlp/docs/redacting-sensitive-data-images to
390
+ # learn more.
391
+ #
392
+ # When no InfoTypes or CustomInfoTypes are specified in this request, the
393
+ # system will automatically choose what detectors to run. By default this may
394
+ # be all types, but may change over time as detectors are updated.
395
+ #
396
+ # @overload redact_image(request, options = nil)
397
+ # Pass arguments to `redact_image` via a request object, either of type
398
+ # {::Google::Cloud::Dlp::V2::RedactImageRequest} or an equivalent Hash.
399
+ #
400
+ # @param request [::Google::Cloud::Dlp::V2::RedactImageRequest, ::Hash]
401
+ # A request object representing the call parameters. Required. To specify no
402
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
403
+ # @param options [::Gapic::CallOptions, ::Hash]
404
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
405
+ #
406
+ # @overload redact_image(parent: nil, location_id: nil, inspect_config: nil, image_redaction_configs: nil, include_findings: nil, byte_item: nil)
407
+ # Pass arguments to `redact_image` via keyword arguments. Note that at
408
+ # least one keyword argument is required. To specify no parameters, or to keep all
409
+ # the default parameter values, pass an empty Hash as a request object (see above).
410
+ #
411
+ # @param parent [::String]
412
+ # Parent resource name.
413
+ #
414
+ # The format of this value varies depending on whether you have [specified a
415
+ # processing
416
+ # location](https://cloud.google.com/dlp/docs/specifying-location):
417
+ #
418
+ # + Projects scope, location specified:<br/>
419
+ # `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
420
+ # + Projects scope, no location specified (defaults to global):<br/>
421
+ # `projects/`<var>PROJECT_ID</var>
422
+ #
423
+ # The following example `parent` string specifies a parent project with the
424
+ # identifier `example-project`, and specifies the `europe-west3` location
425
+ # for processing data:
426
+ #
427
+ # parent=projects/example-project/locations/europe-west3
428
+ # @param location_id [::String]
429
+ # Deprecated. This field has no effect.
430
+ # @param inspect_config [::Google::Cloud::Dlp::V2::InspectConfig, ::Hash]
431
+ # Configuration for the inspector.
432
+ # @param image_redaction_configs [::Array<::Google::Cloud::Dlp::V2::RedactImageRequest::ImageRedactionConfig, ::Hash>]
433
+ # The configuration for specifying what content to redact from images.
434
+ # @param include_findings [::Boolean]
435
+ # Whether the response should include findings along with the redacted
436
+ # image.
437
+ # @param byte_item [::Google::Cloud::Dlp::V2::ByteContentItem, ::Hash]
438
+ # The content must be PNG, JPEG, SVG or BMP.
439
+ # @yield [result, operation] Access the result along with the TransportOperation object
440
+ # @yieldparam result [::Google::Cloud::Dlp::V2::RedactImageResponse]
441
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
442
+ #
443
+ # @return [::Google::Cloud::Dlp::V2::RedactImageResponse]
444
+ #
445
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
446
+ def redact_image request, options = nil
447
+ raise ::ArgumentError, "request must be provided" if request.nil?
448
+
449
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::RedactImageRequest
450
+
451
+ # Converts hash and nil to an options object
452
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
453
+
454
+ # Customize the options with defaults
455
+ call_metadata = @config.rpcs.redact_image.metadata.to_h
456
+
457
+ # Set x-goog-api-client and x-goog-user-project headers
458
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
459
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
460
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
461
+ transports_version_send: [:rest]
462
+
463
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
464
+
465
+ options.apply_defaults timeout: @config.rpcs.redact_image.timeout,
466
+ metadata: call_metadata,
467
+ retry_policy: @config.rpcs.redact_image.retry_policy
468
+
469
+ options.apply_defaults timeout: @config.timeout,
470
+ metadata: @config.metadata,
471
+ retry_policy: @config.retry_policy
472
+
473
+ @dlp_service_stub.redact_image request, options do |result, operation|
474
+ yield result, operation if block_given?
475
+ return result
476
+ end
477
+ rescue ::Gapic::Rest::Error => e
478
+ raise ::Google::Cloud::Error.from_error(e)
479
+ end
480
+
481
+ ##
482
+ # De-identifies potentially sensitive info from a ContentItem.
483
+ # This method has limits on input size and output size.
484
+ # See https://cloud.google.com/dlp/docs/deidentify-sensitive-data to
485
+ # learn more.
486
+ #
487
+ # When no InfoTypes or CustomInfoTypes are specified in this request, the
488
+ # system will automatically choose what detectors to run. By default this may
489
+ # be all types, but may change over time as detectors are updated.
490
+ #
491
+ # @overload deidentify_content(request, options = nil)
492
+ # Pass arguments to `deidentify_content` via a request object, either of type
493
+ # {::Google::Cloud::Dlp::V2::DeidentifyContentRequest} or an equivalent Hash.
494
+ #
495
+ # @param request [::Google::Cloud::Dlp::V2::DeidentifyContentRequest, ::Hash]
496
+ # A request object representing the call parameters. Required. To specify no
497
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
498
+ # @param options [::Gapic::CallOptions, ::Hash]
499
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
500
+ #
501
+ # @overload deidentify_content(parent: nil, deidentify_config: nil, inspect_config: nil, item: nil, inspect_template_name: nil, deidentify_template_name: nil, location_id: nil)
502
+ # Pass arguments to `deidentify_content` via keyword arguments. Note that at
503
+ # least one keyword argument is required. To specify no parameters, or to keep all
504
+ # the default parameter values, pass an empty Hash as a request object (see above).
505
+ #
506
+ # @param parent [::String]
507
+ # Parent resource name.
508
+ #
509
+ # The format of this value varies depending on whether you have [specified a
510
+ # processing
511
+ # location](https://cloud.google.com/dlp/docs/specifying-location):
512
+ #
513
+ # + Projects scope, location specified:<br/>
514
+ # `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
515
+ # + Projects scope, no location specified (defaults to global):<br/>
516
+ # `projects/`<var>PROJECT_ID</var>
517
+ #
518
+ # The following example `parent` string specifies a parent project with the
519
+ # identifier `example-project`, and specifies the `europe-west3` location
520
+ # for processing data:
521
+ #
522
+ # parent=projects/example-project/locations/europe-west3
523
+ # @param deidentify_config [::Google::Cloud::Dlp::V2::DeidentifyConfig, ::Hash]
524
+ # Configuration for the de-identification of the content item.
525
+ # Items specified here will override the template referenced by the
526
+ # deidentify_template_name argument.
527
+ # @param inspect_config [::Google::Cloud::Dlp::V2::InspectConfig, ::Hash]
528
+ # Configuration for the inspector.
529
+ # Items specified here will override the template referenced by the
530
+ # inspect_template_name argument.
531
+ # @param item [::Google::Cloud::Dlp::V2::ContentItem, ::Hash]
532
+ # The item to de-identify. Will be treated as text.
533
+ #
534
+ # This value must be of type
535
+ # {::Google::Cloud::Dlp::V2::Table Table} if your
536
+ # {::Google::Cloud::Dlp::V2::DeidentifyContentRequest#deidentify_config deidentify_config}
537
+ # is a
538
+ # {::Google::Cloud::Dlp::V2::RecordTransformations RecordTransformations}
539
+ # object.
540
+ # @param inspect_template_name [::String]
541
+ # Template to use. Any configuration directly specified in
542
+ # inspect_config will override those set in the template. Singular fields
543
+ # that are set in this request will replace their corresponding fields in the
544
+ # template. Repeated fields are appended. Singular sub-messages and groups
545
+ # are recursively merged.
546
+ # @param deidentify_template_name [::String]
547
+ # Template to use. Any configuration directly specified in
548
+ # deidentify_config will override those set in the template. Singular fields
549
+ # that are set in this request will replace their corresponding fields in the
550
+ # template. Repeated fields are appended. Singular sub-messages and groups
551
+ # are recursively merged.
552
+ # @param location_id [::String]
553
+ # Deprecated. This field has no effect.
554
+ # @yield [result, operation] Access the result along with the TransportOperation object
555
+ # @yieldparam result [::Google::Cloud::Dlp::V2::DeidentifyContentResponse]
556
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
557
+ #
558
+ # @return [::Google::Cloud::Dlp::V2::DeidentifyContentResponse]
559
+ #
560
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
561
+ def deidentify_content request, options = nil
562
+ raise ::ArgumentError, "request must be provided" if request.nil?
563
+
564
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::DeidentifyContentRequest
565
+
566
+ # Converts hash and nil to an options object
567
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
568
+
569
+ # Customize the options with defaults
570
+ call_metadata = @config.rpcs.deidentify_content.metadata.to_h
571
+
572
+ # Set x-goog-api-client and x-goog-user-project headers
573
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
574
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
575
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
576
+ transports_version_send: [:rest]
577
+
578
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
579
+
580
+ options.apply_defaults timeout: @config.rpcs.deidentify_content.timeout,
581
+ metadata: call_metadata,
582
+ retry_policy: @config.rpcs.deidentify_content.retry_policy
583
+
584
+ options.apply_defaults timeout: @config.timeout,
585
+ metadata: @config.metadata,
586
+ retry_policy: @config.retry_policy
587
+
588
+ @dlp_service_stub.deidentify_content request, options do |result, operation|
589
+ yield result, operation if block_given?
590
+ return result
591
+ end
592
+ rescue ::Gapic::Rest::Error => e
593
+ raise ::Google::Cloud::Error.from_error(e)
594
+ end
595
+
596
+ ##
597
+ # Re-identifies content that has been de-identified.
598
+ # See
599
+ # https://cloud.google.com/dlp/docs/pseudonymization#re-identification_in_free_text_code_example
600
+ # to learn more.
601
+ #
602
+ # @overload reidentify_content(request, options = nil)
603
+ # Pass arguments to `reidentify_content` via a request object, either of type
604
+ # {::Google::Cloud::Dlp::V2::ReidentifyContentRequest} or an equivalent Hash.
605
+ #
606
+ # @param request [::Google::Cloud::Dlp::V2::ReidentifyContentRequest, ::Hash]
607
+ # A request object representing the call parameters. Required. To specify no
608
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
609
+ # @param options [::Gapic::CallOptions, ::Hash]
610
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
611
+ #
612
+ # @overload reidentify_content(parent: nil, reidentify_config: nil, inspect_config: nil, item: nil, inspect_template_name: nil, reidentify_template_name: nil, location_id: nil)
613
+ # Pass arguments to `reidentify_content` via keyword arguments. Note that at
614
+ # least one keyword argument is required. To specify no parameters, or to keep all
615
+ # the default parameter values, pass an empty Hash as a request object (see above).
616
+ #
617
+ # @param parent [::String]
618
+ # Required. Parent resource name.
619
+ #
620
+ # The format of this value varies depending on whether you have [specified a
621
+ # processing
622
+ # location](https://cloud.google.com/dlp/docs/specifying-location):
623
+ #
624
+ # + Projects scope, location specified:<br/>
625
+ # `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
626
+ # + Projects scope, no location specified (defaults to global):<br/>
627
+ # `projects/`<var>PROJECT_ID</var>
628
+ #
629
+ # The following example `parent` string specifies a parent project with the
630
+ # identifier `example-project`, and specifies the `europe-west3` location
631
+ # for processing data:
632
+ #
633
+ # parent=projects/example-project/locations/europe-west3
634
+ # @param reidentify_config [::Google::Cloud::Dlp::V2::DeidentifyConfig, ::Hash]
635
+ # Configuration for the re-identification of the content item.
636
+ # This field shares the same proto message type that is used for
637
+ # de-identification, however its usage here is for the reversal of the
638
+ # previous de-identification. Re-identification is performed by examining
639
+ # the transformations used to de-identify the items and executing the
640
+ # reverse. This requires that only reversible transformations
641
+ # be provided here. The reversible transformations are:
642
+ #
643
+ # - `CryptoDeterministicConfig`
644
+ # - `CryptoReplaceFfxFpeConfig`
645
+ # @param inspect_config [::Google::Cloud::Dlp::V2::InspectConfig, ::Hash]
646
+ # Configuration for the inspector.
647
+ # @param item [::Google::Cloud::Dlp::V2::ContentItem, ::Hash]
648
+ # The item to re-identify. Will be treated as text.
649
+ # @param inspect_template_name [::String]
650
+ # Template to use. Any configuration directly specified in
651
+ # `inspect_config` will override those set in the template. Singular fields
652
+ # that are set in this request will replace their corresponding fields in the
653
+ # template. Repeated fields are appended. Singular sub-messages and groups
654
+ # are recursively merged.
655
+ # @param reidentify_template_name [::String]
656
+ # Template to use. References an instance of `DeidentifyTemplate`.
657
+ # Any configuration directly specified in `reidentify_config` or
658
+ # `inspect_config` will override those set in the template. The
659
+ # `DeidentifyTemplate` used must include only reversible transformations.
660
+ # Singular fields that are set in this request will replace their
661
+ # corresponding fields in the template. Repeated fields are appended.
662
+ # Singular sub-messages and groups are recursively merged.
663
+ # @param location_id [::String]
664
+ # Deprecated. This field has no effect.
665
+ # @yield [result, operation] Access the result along with the TransportOperation object
666
+ # @yieldparam result [::Google::Cloud::Dlp::V2::ReidentifyContentResponse]
667
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
668
+ #
669
+ # @return [::Google::Cloud::Dlp::V2::ReidentifyContentResponse]
670
+ #
671
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
672
+ def reidentify_content request, options = nil
673
+ raise ::ArgumentError, "request must be provided" if request.nil?
674
+
675
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::ReidentifyContentRequest
676
+
677
+ # Converts hash and nil to an options object
678
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
679
+
680
+ # Customize the options with defaults
681
+ call_metadata = @config.rpcs.reidentify_content.metadata.to_h
682
+
683
+ # Set x-goog-api-client and x-goog-user-project headers
684
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
685
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
686
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
687
+ transports_version_send: [:rest]
688
+
689
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
690
+
691
+ options.apply_defaults timeout: @config.rpcs.reidentify_content.timeout,
692
+ metadata: call_metadata,
693
+ retry_policy: @config.rpcs.reidentify_content.retry_policy
694
+
695
+ options.apply_defaults timeout: @config.timeout,
696
+ metadata: @config.metadata,
697
+ retry_policy: @config.retry_policy
698
+
699
+ @dlp_service_stub.reidentify_content request, options do |result, operation|
700
+ yield result, operation if block_given?
701
+ return result
702
+ end
703
+ rescue ::Gapic::Rest::Error => e
704
+ raise ::Google::Cloud::Error.from_error(e)
705
+ end
706
+
707
+ ##
708
+ # Returns a list of the sensitive information types that DLP API
709
+ # supports. See https://cloud.google.com/dlp/docs/infotypes-reference to
710
+ # learn more.
711
+ #
712
+ # @overload list_info_types(request, options = nil)
713
+ # Pass arguments to `list_info_types` via a request object, either of type
714
+ # {::Google::Cloud::Dlp::V2::ListInfoTypesRequest} or an equivalent Hash.
715
+ #
716
+ # @param request [::Google::Cloud::Dlp::V2::ListInfoTypesRequest, ::Hash]
717
+ # A request object representing the call parameters. Required. To specify no
718
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
719
+ # @param options [::Gapic::CallOptions, ::Hash]
720
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
721
+ #
722
+ # @overload list_info_types(parent: nil, language_code: nil, filter: nil, location_id: nil)
723
+ # Pass arguments to `list_info_types` via keyword arguments. Note that at
724
+ # least one keyword argument is required. To specify no parameters, or to keep all
725
+ # the default parameter values, pass an empty Hash as a request object (see above).
726
+ #
727
+ # @param parent [::String]
728
+ # The parent resource name.
729
+ #
730
+ # The format of this value is as follows:
731
+ #
732
+ # locations/<var>LOCATION_ID</var>
733
+ # @param language_code [::String]
734
+ # BCP-47 language code for localized infoType friendly
735
+ # names. If omitted, or if localized strings are not available,
736
+ # en-US strings will be returned.
737
+ # @param filter [::String]
738
+ # filter to only return infoTypes supported by certain parts of the
739
+ # API. Defaults to supported_by=INSPECT.
740
+ # @param location_id [::String]
741
+ # Deprecated. This field has no effect.
742
+ # @yield [result, operation] Access the result along with the TransportOperation object
743
+ # @yieldparam result [::Google::Cloud::Dlp::V2::ListInfoTypesResponse]
744
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
745
+ #
746
+ # @return [::Google::Cloud::Dlp::V2::ListInfoTypesResponse]
747
+ #
748
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
749
+ def list_info_types request, options = nil
750
+ raise ::ArgumentError, "request must be provided" if request.nil?
751
+
752
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::ListInfoTypesRequest
753
+
754
+ # Converts hash and nil to an options object
755
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
756
+
757
+ # Customize the options with defaults
758
+ call_metadata = @config.rpcs.list_info_types.metadata.to_h
759
+
760
+ # Set x-goog-api-client and x-goog-user-project headers
761
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
762
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
763
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
764
+ transports_version_send: [:rest]
765
+
766
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
767
+
768
+ options.apply_defaults timeout: @config.rpcs.list_info_types.timeout,
769
+ metadata: call_metadata,
770
+ retry_policy: @config.rpcs.list_info_types.retry_policy
771
+
772
+ options.apply_defaults timeout: @config.timeout,
773
+ metadata: @config.metadata,
774
+ retry_policy: @config.retry_policy
775
+
776
+ @dlp_service_stub.list_info_types request, options do |result, operation|
777
+ yield result, operation if block_given?
778
+ return result
779
+ end
780
+ rescue ::Gapic::Rest::Error => e
781
+ raise ::Google::Cloud::Error.from_error(e)
782
+ end
783
+
784
+ ##
785
+ # Creates an InspectTemplate for reusing frequently used configuration
786
+ # for inspecting content, images, and storage.
787
+ # See https://cloud.google.com/dlp/docs/creating-templates to learn more.
788
+ #
789
+ # @overload create_inspect_template(request, options = nil)
790
+ # Pass arguments to `create_inspect_template` via a request object, either of type
791
+ # {::Google::Cloud::Dlp::V2::CreateInspectTemplateRequest} or an equivalent Hash.
792
+ #
793
+ # @param request [::Google::Cloud::Dlp::V2::CreateInspectTemplateRequest, ::Hash]
794
+ # A request object representing the call parameters. Required. To specify no
795
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
796
+ # @param options [::Gapic::CallOptions, ::Hash]
797
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
798
+ #
799
+ # @overload create_inspect_template(parent: nil, inspect_template: nil, template_id: nil, location_id: nil)
800
+ # Pass arguments to `create_inspect_template` via keyword arguments. Note that at
801
+ # least one keyword argument is required. To specify no parameters, or to keep all
802
+ # the default parameter values, pass an empty Hash as a request object (see above).
803
+ #
804
+ # @param parent [::String]
805
+ # Required. Parent resource name.
806
+ #
807
+ # The format of this value varies depending on the scope of the request
808
+ # (project or organization) and whether you have [specified a processing
809
+ # location](https://cloud.google.com/dlp/docs/specifying-location):
810
+ #
811
+ # + Projects scope, location specified:<br/>
812
+ # `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
813
+ # + Projects scope, no location specified (defaults to global):<br/>
814
+ # `projects/`<var>PROJECT_ID</var>
815
+ # + Organizations scope, location specified:<br/>
816
+ # `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var>
817
+ # + Organizations scope, no location specified (defaults to global):<br/>
818
+ # `organizations/`<var>ORG_ID</var>
819
+ #
820
+ # The following example `parent` string specifies a parent project with the
821
+ # identifier `example-project`, and specifies the `europe-west3` location
822
+ # for processing data:
823
+ #
824
+ # parent=projects/example-project/locations/europe-west3
825
+ # @param inspect_template [::Google::Cloud::Dlp::V2::InspectTemplate, ::Hash]
826
+ # Required. The InspectTemplate to create.
827
+ # @param template_id [::String]
828
+ # The template id can contain uppercase and lowercase letters,
829
+ # numbers, and hyphens; that is, it must match the regular
830
+ # expression: `[a-zA-Z\d-_]+`. The maximum length is 100
831
+ # characters. Can be empty to allow the system to generate one.
832
+ # @param location_id [::String]
833
+ # Deprecated. This field has no effect.
834
+ # @yield [result, operation] Access the result along with the TransportOperation object
835
+ # @yieldparam result [::Google::Cloud::Dlp::V2::InspectTemplate]
836
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
837
+ #
838
+ # @return [::Google::Cloud::Dlp::V2::InspectTemplate]
839
+ #
840
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
841
+ def create_inspect_template request, options = nil
842
+ raise ::ArgumentError, "request must be provided" if request.nil?
843
+
844
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::CreateInspectTemplateRequest
845
+
846
+ # Converts hash and nil to an options object
847
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
848
+
849
+ # Customize the options with defaults
850
+ call_metadata = @config.rpcs.create_inspect_template.metadata.to_h
851
+
852
+ # Set x-goog-api-client and x-goog-user-project headers
853
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
854
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
855
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
856
+ transports_version_send: [:rest]
857
+
858
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
859
+
860
+ options.apply_defaults timeout: @config.rpcs.create_inspect_template.timeout,
861
+ metadata: call_metadata,
862
+ retry_policy: @config.rpcs.create_inspect_template.retry_policy
863
+
864
+ options.apply_defaults timeout: @config.timeout,
865
+ metadata: @config.metadata,
866
+ retry_policy: @config.retry_policy
867
+
868
+ @dlp_service_stub.create_inspect_template request, options do |result, operation|
869
+ yield result, operation if block_given?
870
+ return result
871
+ end
872
+ rescue ::Gapic::Rest::Error => e
873
+ raise ::Google::Cloud::Error.from_error(e)
874
+ end
875
+
876
+ ##
877
+ # Updates the InspectTemplate.
878
+ # See https://cloud.google.com/dlp/docs/creating-templates to learn more.
879
+ #
880
+ # @overload update_inspect_template(request, options = nil)
881
+ # Pass arguments to `update_inspect_template` via a request object, either of type
882
+ # {::Google::Cloud::Dlp::V2::UpdateInspectTemplateRequest} or an equivalent Hash.
883
+ #
884
+ # @param request [::Google::Cloud::Dlp::V2::UpdateInspectTemplateRequest, ::Hash]
885
+ # A request object representing the call parameters. Required. To specify no
886
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
887
+ # @param options [::Gapic::CallOptions, ::Hash]
888
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
889
+ #
890
+ # @overload update_inspect_template(name: nil, inspect_template: nil, update_mask: nil)
891
+ # Pass arguments to `update_inspect_template` via keyword arguments. Note that at
892
+ # least one keyword argument is required. To specify no parameters, or to keep all
893
+ # the default parameter values, pass an empty Hash as a request object (see above).
894
+ #
895
+ # @param name [::String]
896
+ # Required. Resource name of organization and inspectTemplate to be updated, for
897
+ # example `organizations/433245324/inspectTemplates/432452342` or
898
+ # projects/project-id/inspectTemplates/432452342.
899
+ # @param inspect_template [::Google::Cloud::Dlp::V2::InspectTemplate, ::Hash]
900
+ # New InspectTemplate value.
901
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
902
+ # Mask to control which fields get updated.
903
+ # @yield [result, operation] Access the result along with the TransportOperation object
904
+ # @yieldparam result [::Google::Cloud::Dlp::V2::InspectTemplate]
905
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
906
+ #
907
+ # @return [::Google::Cloud::Dlp::V2::InspectTemplate]
908
+ #
909
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
910
+ def update_inspect_template request, options = nil
911
+ raise ::ArgumentError, "request must be provided" if request.nil?
912
+
913
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::UpdateInspectTemplateRequest
914
+
915
+ # Converts hash and nil to an options object
916
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
917
+
918
+ # Customize the options with defaults
919
+ call_metadata = @config.rpcs.update_inspect_template.metadata.to_h
920
+
921
+ # Set x-goog-api-client and x-goog-user-project headers
922
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
923
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
924
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
925
+ transports_version_send: [:rest]
926
+
927
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
928
+
929
+ options.apply_defaults timeout: @config.rpcs.update_inspect_template.timeout,
930
+ metadata: call_metadata,
931
+ retry_policy: @config.rpcs.update_inspect_template.retry_policy
932
+
933
+ options.apply_defaults timeout: @config.timeout,
934
+ metadata: @config.metadata,
935
+ retry_policy: @config.retry_policy
936
+
937
+ @dlp_service_stub.update_inspect_template request, options do |result, operation|
938
+ yield result, operation if block_given?
939
+ return result
940
+ end
941
+ rescue ::Gapic::Rest::Error => e
942
+ raise ::Google::Cloud::Error.from_error(e)
943
+ end
944
+
945
+ ##
946
+ # Gets an InspectTemplate.
947
+ # See https://cloud.google.com/dlp/docs/creating-templates to learn more.
948
+ #
949
+ # @overload get_inspect_template(request, options = nil)
950
+ # Pass arguments to `get_inspect_template` via a request object, either of type
951
+ # {::Google::Cloud::Dlp::V2::GetInspectTemplateRequest} or an equivalent Hash.
952
+ #
953
+ # @param request [::Google::Cloud::Dlp::V2::GetInspectTemplateRequest, ::Hash]
954
+ # A request object representing the call parameters. Required. To specify no
955
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
956
+ # @param options [::Gapic::CallOptions, ::Hash]
957
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
958
+ #
959
+ # @overload get_inspect_template(name: nil)
960
+ # Pass arguments to `get_inspect_template` via keyword arguments. Note that at
961
+ # least one keyword argument is required. To specify no parameters, or to keep all
962
+ # the default parameter values, pass an empty Hash as a request object (see above).
963
+ #
964
+ # @param name [::String]
965
+ # Required. Resource name of the organization and inspectTemplate to be read, for
966
+ # example `organizations/433245324/inspectTemplates/432452342` or
967
+ # projects/project-id/inspectTemplates/432452342.
968
+ # @yield [result, operation] Access the result along with the TransportOperation object
969
+ # @yieldparam result [::Google::Cloud::Dlp::V2::InspectTemplate]
970
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
971
+ #
972
+ # @return [::Google::Cloud::Dlp::V2::InspectTemplate]
973
+ #
974
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
975
+ def get_inspect_template request, options = nil
976
+ raise ::ArgumentError, "request must be provided" if request.nil?
977
+
978
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::GetInspectTemplateRequest
979
+
980
+ # Converts hash and nil to an options object
981
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
982
+
983
+ # Customize the options with defaults
984
+ call_metadata = @config.rpcs.get_inspect_template.metadata.to_h
985
+
986
+ # Set x-goog-api-client and x-goog-user-project headers
987
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
988
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
989
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
990
+ transports_version_send: [:rest]
991
+
992
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
993
+
994
+ options.apply_defaults timeout: @config.rpcs.get_inspect_template.timeout,
995
+ metadata: call_metadata,
996
+ retry_policy: @config.rpcs.get_inspect_template.retry_policy
997
+
998
+ options.apply_defaults timeout: @config.timeout,
999
+ metadata: @config.metadata,
1000
+ retry_policy: @config.retry_policy
1001
+
1002
+ @dlp_service_stub.get_inspect_template request, options do |result, operation|
1003
+ yield result, operation if block_given?
1004
+ return result
1005
+ end
1006
+ rescue ::Gapic::Rest::Error => e
1007
+ raise ::Google::Cloud::Error.from_error(e)
1008
+ end
1009
+
1010
+ ##
1011
+ # Lists InspectTemplates.
1012
+ # See https://cloud.google.com/dlp/docs/creating-templates to learn more.
1013
+ #
1014
+ # @overload list_inspect_templates(request, options = nil)
1015
+ # Pass arguments to `list_inspect_templates` via a request object, either of type
1016
+ # {::Google::Cloud::Dlp::V2::ListInspectTemplatesRequest} or an equivalent Hash.
1017
+ #
1018
+ # @param request [::Google::Cloud::Dlp::V2::ListInspectTemplatesRequest, ::Hash]
1019
+ # A request object representing the call parameters. Required. To specify no
1020
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1021
+ # @param options [::Gapic::CallOptions, ::Hash]
1022
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1023
+ #
1024
+ # @overload list_inspect_templates(parent: nil, page_token: nil, page_size: nil, order_by: nil, location_id: nil)
1025
+ # Pass arguments to `list_inspect_templates` via keyword arguments. Note that at
1026
+ # least one keyword argument is required. To specify no parameters, or to keep all
1027
+ # the default parameter values, pass an empty Hash as a request object (see above).
1028
+ #
1029
+ # @param parent [::String]
1030
+ # Required. Parent resource name.
1031
+ #
1032
+ # The format of this value varies depending on the scope of the request
1033
+ # (project or organization) and whether you have [specified a processing
1034
+ # location](https://cloud.google.com/dlp/docs/specifying-location):
1035
+ #
1036
+ # + Projects scope, location specified:<br/>
1037
+ # `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
1038
+ # + Projects scope, no location specified (defaults to global):<br/>
1039
+ # `projects/`<var>PROJECT_ID</var>
1040
+ # + Organizations scope, location specified:<br/>
1041
+ # `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var>
1042
+ # + Organizations scope, no location specified (defaults to global):<br/>
1043
+ # `organizations/`<var>ORG_ID</var>
1044
+ #
1045
+ # The following example `parent` string specifies a parent project with the
1046
+ # identifier `example-project`, and specifies the `europe-west3` location
1047
+ # for processing data:
1048
+ #
1049
+ # parent=projects/example-project/locations/europe-west3
1050
+ # @param page_token [::String]
1051
+ # Page token to continue retrieval. Comes from previous call
1052
+ # to `ListInspectTemplates`.
1053
+ # @param page_size [::Integer]
1054
+ # Size of the page, can be limited by the server. If zero server returns
1055
+ # a page of max size 100.
1056
+ # @param order_by [::String]
1057
+ # Comma separated list of fields to order by,
1058
+ # followed by `asc` or `desc` postfix. This list is case-insensitive,
1059
+ # default sorting order is ascending, redundant space characters are
1060
+ # insignificant.
1061
+ #
1062
+ # Example: `name asc,update_time, create_time desc`
1063
+ #
1064
+ # Supported fields are:
1065
+ #
1066
+ # - `create_time`: corresponds to the time the template was created.
1067
+ # - `update_time`: corresponds to the time the template was last updated.
1068
+ # - `name`: corresponds to the template's name.
1069
+ # - `display_name`: corresponds to the template's display name.
1070
+ # @param location_id [::String]
1071
+ # Deprecated. This field has no effect.
1072
+ # @yield [result, operation] Access the result along with the TransportOperation object
1073
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dlp::V2::InspectTemplate>]
1074
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1075
+ #
1076
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dlp::V2::InspectTemplate>]
1077
+ #
1078
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1079
+ def list_inspect_templates request, options = nil
1080
+ raise ::ArgumentError, "request must be provided" if request.nil?
1081
+
1082
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::ListInspectTemplatesRequest
1083
+
1084
+ # Converts hash and nil to an options object
1085
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1086
+
1087
+ # Customize the options with defaults
1088
+ call_metadata = @config.rpcs.list_inspect_templates.metadata.to_h
1089
+
1090
+ # Set x-goog-api-client and x-goog-user-project headers
1091
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1092
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1093
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
1094
+ transports_version_send: [:rest]
1095
+
1096
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1097
+
1098
+ options.apply_defaults timeout: @config.rpcs.list_inspect_templates.timeout,
1099
+ metadata: call_metadata,
1100
+ retry_policy: @config.rpcs.list_inspect_templates.retry_policy
1101
+
1102
+ options.apply_defaults timeout: @config.timeout,
1103
+ metadata: @config.metadata,
1104
+ retry_policy: @config.retry_policy
1105
+
1106
+ @dlp_service_stub.list_inspect_templates request, options do |result, operation|
1107
+ result = ::Gapic::Rest::PagedEnumerable.new @dlp_service_stub, :list_inspect_templates, "inspect_templates", request, result, options
1108
+ yield result, operation if block_given?
1109
+ return result
1110
+ end
1111
+ rescue ::Gapic::Rest::Error => e
1112
+ raise ::Google::Cloud::Error.from_error(e)
1113
+ end
1114
+
1115
+ ##
1116
+ # Deletes an InspectTemplate.
1117
+ # See https://cloud.google.com/dlp/docs/creating-templates to learn more.
1118
+ #
1119
+ # @overload delete_inspect_template(request, options = nil)
1120
+ # Pass arguments to `delete_inspect_template` via a request object, either of type
1121
+ # {::Google::Cloud::Dlp::V2::DeleteInspectTemplateRequest} or an equivalent Hash.
1122
+ #
1123
+ # @param request [::Google::Cloud::Dlp::V2::DeleteInspectTemplateRequest, ::Hash]
1124
+ # A request object representing the call parameters. Required. To specify no
1125
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1126
+ # @param options [::Gapic::CallOptions, ::Hash]
1127
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1128
+ #
1129
+ # @overload delete_inspect_template(name: nil)
1130
+ # Pass arguments to `delete_inspect_template` via keyword arguments. Note that at
1131
+ # least one keyword argument is required. To specify no parameters, or to keep all
1132
+ # the default parameter values, pass an empty Hash as a request object (see above).
1133
+ #
1134
+ # @param name [::String]
1135
+ # Required. Resource name of the organization and inspectTemplate to be deleted, for
1136
+ # example `organizations/433245324/inspectTemplates/432452342` or
1137
+ # projects/project-id/inspectTemplates/432452342.
1138
+ # @yield [result, operation] Access the result along with the TransportOperation object
1139
+ # @yieldparam result [::Google::Protobuf::Empty]
1140
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1141
+ #
1142
+ # @return [::Google::Protobuf::Empty]
1143
+ #
1144
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1145
+ def delete_inspect_template request, options = nil
1146
+ raise ::ArgumentError, "request must be provided" if request.nil?
1147
+
1148
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::DeleteInspectTemplateRequest
1149
+
1150
+ # Converts hash and nil to an options object
1151
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1152
+
1153
+ # Customize the options with defaults
1154
+ call_metadata = @config.rpcs.delete_inspect_template.metadata.to_h
1155
+
1156
+ # Set x-goog-api-client and x-goog-user-project headers
1157
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1158
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1159
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
1160
+ transports_version_send: [:rest]
1161
+
1162
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1163
+
1164
+ options.apply_defaults timeout: @config.rpcs.delete_inspect_template.timeout,
1165
+ metadata: call_metadata,
1166
+ retry_policy: @config.rpcs.delete_inspect_template.retry_policy
1167
+
1168
+ options.apply_defaults timeout: @config.timeout,
1169
+ metadata: @config.metadata,
1170
+ retry_policy: @config.retry_policy
1171
+
1172
+ @dlp_service_stub.delete_inspect_template request, options do |result, operation|
1173
+ yield result, operation if block_given?
1174
+ return result
1175
+ end
1176
+ rescue ::Gapic::Rest::Error => e
1177
+ raise ::Google::Cloud::Error.from_error(e)
1178
+ end
1179
+
1180
+ ##
1181
+ # Creates a DeidentifyTemplate for reusing frequently used configuration
1182
+ # for de-identifying content, images, and storage.
1183
+ # See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
1184
+ # more.
1185
+ #
1186
+ # @overload create_deidentify_template(request, options = nil)
1187
+ # Pass arguments to `create_deidentify_template` via a request object, either of type
1188
+ # {::Google::Cloud::Dlp::V2::CreateDeidentifyTemplateRequest} or an equivalent Hash.
1189
+ #
1190
+ # @param request [::Google::Cloud::Dlp::V2::CreateDeidentifyTemplateRequest, ::Hash]
1191
+ # A request object representing the call parameters. Required. To specify no
1192
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1193
+ # @param options [::Gapic::CallOptions, ::Hash]
1194
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1195
+ #
1196
+ # @overload create_deidentify_template(parent: nil, deidentify_template: nil, template_id: nil, location_id: nil)
1197
+ # Pass arguments to `create_deidentify_template` via keyword arguments. Note that at
1198
+ # least one keyword argument is required. To specify no parameters, or to keep all
1199
+ # the default parameter values, pass an empty Hash as a request object (see above).
1200
+ #
1201
+ # @param parent [::String]
1202
+ # Required. Parent resource name.
1203
+ #
1204
+ # The format of this value varies depending on the scope of the request
1205
+ # (project or organization) and whether you have [specified a processing
1206
+ # location](https://cloud.google.com/dlp/docs/specifying-location):
1207
+ #
1208
+ # + Projects scope, location specified:<br/>
1209
+ # `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
1210
+ # + Projects scope, no location specified (defaults to global):<br/>
1211
+ # `projects/`<var>PROJECT_ID</var>
1212
+ # + Organizations scope, location specified:<br/>
1213
+ # `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var>
1214
+ # + Organizations scope, no location specified (defaults to global):<br/>
1215
+ # `organizations/`<var>ORG_ID</var>
1216
+ #
1217
+ # The following example `parent` string specifies a parent project with the
1218
+ # identifier `example-project`, and specifies the `europe-west3` location
1219
+ # for processing data:
1220
+ #
1221
+ # parent=projects/example-project/locations/europe-west3
1222
+ # @param deidentify_template [::Google::Cloud::Dlp::V2::DeidentifyTemplate, ::Hash]
1223
+ # Required. The DeidentifyTemplate to create.
1224
+ # @param template_id [::String]
1225
+ # The template id can contain uppercase and lowercase letters,
1226
+ # numbers, and hyphens; that is, it must match the regular
1227
+ # expression: `[a-zA-Z\d-_]+`. The maximum length is 100
1228
+ # characters. Can be empty to allow the system to generate one.
1229
+ # @param location_id [::String]
1230
+ # Deprecated. This field has no effect.
1231
+ # @yield [result, operation] Access the result along with the TransportOperation object
1232
+ # @yieldparam result [::Google::Cloud::Dlp::V2::DeidentifyTemplate]
1233
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1234
+ #
1235
+ # @return [::Google::Cloud::Dlp::V2::DeidentifyTemplate]
1236
+ #
1237
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1238
+ def create_deidentify_template request, options = nil
1239
+ raise ::ArgumentError, "request must be provided" if request.nil?
1240
+
1241
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::CreateDeidentifyTemplateRequest
1242
+
1243
+ # Converts hash and nil to an options object
1244
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1245
+
1246
+ # Customize the options with defaults
1247
+ call_metadata = @config.rpcs.create_deidentify_template.metadata.to_h
1248
+
1249
+ # Set x-goog-api-client and x-goog-user-project headers
1250
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1251
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1252
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
1253
+ transports_version_send: [:rest]
1254
+
1255
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1256
+
1257
+ options.apply_defaults timeout: @config.rpcs.create_deidentify_template.timeout,
1258
+ metadata: call_metadata,
1259
+ retry_policy: @config.rpcs.create_deidentify_template.retry_policy
1260
+
1261
+ options.apply_defaults timeout: @config.timeout,
1262
+ metadata: @config.metadata,
1263
+ retry_policy: @config.retry_policy
1264
+
1265
+ @dlp_service_stub.create_deidentify_template request, options do |result, operation|
1266
+ yield result, operation if block_given?
1267
+ return result
1268
+ end
1269
+ rescue ::Gapic::Rest::Error => e
1270
+ raise ::Google::Cloud::Error.from_error(e)
1271
+ end
1272
+
1273
+ ##
1274
+ # Updates the DeidentifyTemplate.
1275
+ # See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
1276
+ # more.
1277
+ #
1278
+ # @overload update_deidentify_template(request, options = nil)
1279
+ # Pass arguments to `update_deidentify_template` via a request object, either of type
1280
+ # {::Google::Cloud::Dlp::V2::UpdateDeidentifyTemplateRequest} or an equivalent Hash.
1281
+ #
1282
+ # @param request [::Google::Cloud::Dlp::V2::UpdateDeidentifyTemplateRequest, ::Hash]
1283
+ # A request object representing the call parameters. Required. To specify no
1284
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1285
+ # @param options [::Gapic::CallOptions, ::Hash]
1286
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1287
+ #
1288
+ # @overload update_deidentify_template(name: nil, deidentify_template: nil, update_mask: nil)
1289
+ # Pass arguments to `update_deidentify_template` via keyword arguments. Note that at
1290
+ # least one keyword argument is required. To specify no parameters, or to keep all
1291
+ # the default parameter values, pass an empty Hash as a request object (see above).
1292
+ #
1293
+ # @param name [::String]
1294
+ # Required. Resource name of organization and deidentify template to be updated, for
1295
+ # example `organizations/433245324/deidentifyTemplates/432452342` or
1296
+ # projects/project-id/deidentifyTemplates/432452342.
1297
+ # @param deidentify_template [::Google::Cloud::Dlp::V2::DeidentifyTemplate, ::Hash]
1298
+ # New DeidentifyTemplate value.
1299
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1300
+ # Mask to control which fields get updated.
1301
+ # @yield [result, operation] Access the result along with the TransportOperation object
1302
+ # @yieldparam result [::Google::Cloud::Dlp::V2::DeidentifyTemplate]
1303
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1304
+ #
1305
+ # @return [::Google::Cloud::Dlp::V2::DeidentifyTemplate]
1306
+ #
1307
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1308
+ def update_deidentify_template request, options = nil
1309
+ raise ::ArgumentError, "request must be provided" if request.nil?
1310
+
1311
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::UpdateDeidentifyTemplateRequest
1312
+
1313
+ # Converts hash and nil to an options object
1314
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1315
+
1316
+ # Customize the options with defaults
1317
+ call_metadata = @config.rpcs.update_deidentify_template.metadata.to_h
1318
+
1319
+ # Set x-goog-api-client and x-goog-user-project headers
1320
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1321
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1322
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
1323
+ transports_version_send: [:rest]
1324
+
1325
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1326
+
1327
+ options.apply_defaults timeout: @config.rpcs.update_deidentify_template.timeout,
1328
+ metadata: call_metadata,
1329
+ retry_policy: @config.rpcs.update_deidentify_template.retry_policy
1330
+
1331
+ options.apply_defaults timeout: @config.timeout,
1332
+ metadata: @config.metadata,
1333
+ retry_policy: @config.retry_policy
1334
+
1335
+ @dlp_service_stub.update_deidentify_template request, options do |result, operation|
1336
+ yield result, operation if block_given?
1337
+ return result
1338
+ end
1339
+ rescue ::Gapic::Rest::Error => e
1340
+ raise ::Google::Cloud::Error.from_error(e)
1341
+ end
1342
+
1343
+ ##
1344
+ # Gets a DeidentifyTemplate.
1345
+ # See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
1346
+ # more.
1347
+ #
1348
+ # @overload get_deidentify_template(request, options = nil)
1349
+ # Pass arguments to `get_deidentify_template` via a request object, either of type
1350
+ # {::Google::Cloud::Dlp::V2::GetDeidentifyTemplateRequest} or an equivalent Hash.
1351
+ #
1352
+ # @param request [::Google::Cloud::Dlp::V2::GetDeidentifyTemplateRequest, ::Hash]
1353
+ # A request object representing the call parameters. Required. To specify no
1354
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1355
+ # @param options [::Gapic::CallOptions, ::Hash]
1356
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1357
+ #
1358
+ # @overload get_deidentify_template(name: nil)
1359
+ # Pass arguments to `get_deidentify_template` via keyword arguments. Note that at
1360
+ # least one keyword argument is required. To specify no parameters, or to keep all
1361
+ # the default parameter values, pass an empty Hash as a request object (see above).
1362
+ #
1363
+ # @param name [::String]
1364
+ # Required. Resource name of the organization and deidentify template to be read, for
1365
+ # example `organizations/433245324/deidentifyTemplates/432452342` or
1366
+ # projects/project-id/deidentifyTemplates/432452342.
1367
+ # @yield [result, operation] Access the result along with the TransportOperation object
1368
+ # @yieldparam result [::Google::Cloud::Dlp::V2::DeidentifyTemplate]
1369
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1370
+ #
1371
+ # @return [::Google::Cloud::Dlp::V2::DeidentifyTemplate]
1372
+ #
1373
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1374
+ def get_deidentify_template request, options = nil
1375
+ raise ::ArgumentError, "request must be provided" if request.nil?
1376
+
1377
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::GetDeidentifyTemplateRequest
1378
+
1379
+ # Converts hash and nil to an options object
1380
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1381
+
1382
+ # Customize the options with defaults
1383
+ call_metadata = @config.rpcs.get_deidentify_template.metadata.to_h
1384
+
1385
+ # Set x-goog-api-client and x-goog-user-project headers
1386
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1387
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1388
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
1389
+ transports_version_send: [:rest]
1390
+
1391
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1392
+
1393
+ options.apply_defaults timeout: @config.rpcs.get_deidentify_template.timeout,
1394
+ metadata: call_metadata,
1395
+ retry_policy: @config.rpcs.get_deidentify_template.retry_policy
1396
+
1397
+ options.apply_defaults timeout: @config.timeout,
1398
+ metadata: @config.metadata,
1399
+ retry_policy: @config.retry_policy
1400
+
1401
+ @dlp_service_stub.get_deidentify_template request, options do |result, operation|
1402
+ yield result, operation if block_given?
1403
+ return result
1404
+ end
1405
+ rescue ::Gapic::Rest::Error => e
1406
+ raise ::Google::Cloud::Error.from_error(e)
1407
+ end
1408
+
1409
+ ##
1410
+ # Lists DeidentifyTemplates.
1411
+ # See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
1412
+ # more.
1413
+ #
1414
+ # @overload list_deidentify_templates(request, options = nil)
1415
+ # Pass arguments to `list_deidentify_templates` via a request object, either of type
1416
+ # {::Google::Cloud::Dlp::V2::ListDeidentifyTemplatesRequest} or an equivalent Hash.
1417
+ #
1418
+ # @param request [::Google::Cloud::Dlp::V2::ListDeidentifyTemplatesRequest, ::Hash]
1419
+ # A request object representing the call parameters. Required. To specify no
1420
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1421
+ # @param options [::Gapic::CallOptions, ::Hash]
1422
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1423
+ #
1424
+ # @overload list_deidentify_templates(parent: nil, page_token: nil, page_size: nil, order_by: nil, location_id: nil)
1425
+ # Pass arguments to `list_deidentify_templates` via keyword arguments. Note that at
1426
+ # least one keyword argument is required. To specify no parameters, or to keep all
1427
+ # the default parameter values, pass an empty Hash as a request object (see above).
1428
+ #
1429
+ # @param parent [::String]
1430
+ # Required. Parent resource name.
1431
+ #
1432
+ # The format of this value varies depending on the scope of the request
1433
+ # (project or organization) and whether you have [specified a processing
1434
+ # location](https://cloud.google.com/dlp/docs/specifying-location):
1435
+ #
1436
+ # + Projects scope, location specified:<br/>
1437
+ # `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
1438
+ # + Projects scope, no location specified (defaults to global):<br/>
1439
+ # `projects/`<var>PROJECT_ID</var>
1440
+ # + Organizations scope, location specified:<br/>
1441
+ # `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var>
1442
+ # + Organizations scope, no location specified (defaults to global):<br/>
1443
+ # `organizations/`<var>ORG_ID</var>
1444
+ #
1445
+ # The following example `parent` string specifies a parent project with the
1446
+ # identifier `example-project`, and specifies the `europe-west3` location
1447
+ # for processing data:
1448
+ #
1449
+ # parent=projects/example-project/locations/europe-west3
1450
+ # @param page_token [::String]
1451
+ # Page token to continue retrieval. Comes from previous call
1452
+ # to `ListDeidentifyTemplates`.
1453
+ # @param page_size [::Integer]
1454
+ # Size of the page, can be limited by the server. If zero server returns
1455
+ # a page of max size 100.
1456
+ # @param order_by [::String]
1457
+ # Comma separated list of fields to order by,
1458
+ # followed by `asc` or `desc` postfix. This list is case-insensitive,
1459
+ # default sorting order is ascending, redundant space characters are
1460
+ # insignificant.
1461
+ #
1462
+ # Example: `name asc,update_time, create_time desc`
1463
+ #
1464
+ # Supported fields are:
1465
+ #
1466
+ # - `create_time`: corresponds to the time the template was created.
1467
+ # - `update_time`: corresponds to the time the template was last updated.
1468
+ # - `name`: corresponds to the template's name.
1469
+ # - `display_name`: corresponds to the template's display name.
1470
+ # @param location_id [::String]
1471
+ # Deprecated. This field has no effect.
1472
+ # @yield [result, operation] Access the result along with the TransportOperation object
1473
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dlp::V2::DeidentifyTemplate>]
1474
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1475
+ #
1476
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dlp::V2::DeidentifyTemplate>]
1477
+ #
1478
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1479
+ def list_deidentify_templates request, options = nil
1480
+ raise ::ArgumentError, "request must be provided" if request.nil?
1481
+
1482
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::ListDeidentifyTemplatesRequest
1483
+
1484
+ # Converts hash and nil to an options object
1485
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1486
+
1487
+ # Customize the options with defaults
1488
+ call_metadata = @config.rpcs.list_deidentify_templates.metadata.to_h
1489
+
1490
+ # Set x-goog-api-client and x-goog-user-project headers
1491
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1492
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1493
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
1494
+ transports_version_send: [:rest]
1495
+
1496
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1497
+
1498
+ options.apply_defaults timeout: @config.rpcs.list_deidentify_templates.timeout,
1499
+ metadata: call_metadata,
1500
+ retry_policy: @config.rpcs.list_deidentify_templates.retry_policy
1501
+
1502
+ options.apply_defaults timeout: @config.timeout,
1503
+ metadata: @config.metadata,
1504
+ retry_policy: @config.retry_policy
1505
+
1506
+ @dlp_service_stub.list_deidentify_templates request, options do |result, operation|
1507
+ result = ::Gapic::Rest::PagedEnumerable.new @dlp_service_stub, :list_deidentify_templates, "deidentify_templates", request, result, options
1508
+ yield result, operation if block_given?
1509
+ return result
1510
+ end
1511
+ rescue ::Gapic::Rest::Error => e
1512
+ raise ::Google::Cloud::Error.from_error(e)
1513
+ end
1514
+
1515
+ ##
1516
+ # Deletes a DeidentifyTemplate.
1517
+ # See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
1518
+ # more.
1519
+ #
1520
+ # @overload delete_deidentify_template(request, options = nil)
1521
+ # Pass arguments to `delete_deidentify_template` via a request object, either of type
1522
+ # {::Google::Cloud::Dlp::V2::DeleteDeidentifyTemplateRequest} or an equivalent Hash.
1523
+ #
1524
+ # @param request [::Google::Cloud::Dlp::V2::DeleteDeidentifyTemplateRequest, ::Hash]
1525
+ # A request object representing the call parameters. Required. To specify no
1526
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1527
+ # @param options [::Gapic::CallOptions, ::Hash]
1528
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1529
+ #
1530
+ # @overload delete_deidentify_template(name: nil)
1531
+ # Pass arguments to `delete_deidentify_template` via keyword arguments. Note that at
1532
+ # least one keyword argument is required. To specify no parameters, or to keep all
1533
+ # the default parameter values, pass an empty Hash as a request object (see above).
1534
+ #
1535
+ # @param name [::String]
1536
+ # Required. Resource name of the organization and deidentify template to be deleted,
1537
+ # for example `organizations/433245324/deidentifyTemplates/432452342` or
1538
+ # projects/project-id/deidentifyTemplates/432452342.
1539
+ # @yield [result, operation] Access the result along with the TransportOperation object
1540
+ # @yieldparam result [::Google::Protobuf::Empty]
1541
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1542
+ #
1543
+ # @return [::Google::Protobuf::Empty]
1544
+ #
1545
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1546
+ def delete_deidentify_template request, options = nil
1547
+ raise ::ArgumentError, "request must be provided" if request.nil?
1548
+
1549
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::DeleteDeidentifyTemplateRequest
1550
+
1551
+ # Converts hash and nil to an options object
1552
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1553
+
1554
+ # Customize the options with defaults
1555
+ call_metadata = @config.rpcs.delete_deidentify_template.metadata.to_h
1556
+
1557
+ # Set x-goog-api-client and x-goog-user-project headers
1558
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1559
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1560
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
1561
+ transports_version_send: [:rest]
1562
+
1563
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1564
+
1565
+ options.apply_defaults timeout: @config.rpcs.delete_deidentify_template.timeout,
1566
+ metadata: call_metadata,
1567
+ retry_policy: @config.rpcs.delete_deidentify_template.retry_policy
1568
+
1569
+ options.apply_defaults timeout: @config.timeout,
1570
+ metadata: @config.metadata,
1571
+ retry_policy: @config.retry_policy
1572
+
1573
+ @dlp_service_stub.delete_deidentify_template request, options do |result, operation|
1574
+ yield result, operation if block_given?
1575
+ return result
1576
+ end
1577
+ rescue ::Gapic::Rest::Error => e
1578
+ raise ::Google::Cloud::Error.from_error(e)
1579
+ end
1580
+
1581
+ ##
1582
+ # Creates a job trigger to run DLP actions such as scanning storage for
1583
+ # sensitive information on a set schedule.
1584
+ # See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
1585
+ #
1586
+ # @overload create_job_trigger(request, options = nil)
1587
+ # Pass arguments to `create_job_trigger` via a request object, either of type
1588
+ # {::Google::Cloud::Dlp::V2::CreateJobTriggerRequest} or an equivalent Hash.
1589
+ #
1590
+ # @param request [::Google::Cloud::Dlp::V2::CreateJobTriggerRequest, ::Hash]
1591
+ # A request object representing the call parameters. Required. To specify no
1592
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1593
+ # @param options [::Gapic::CallOptions, ::Hash]
1594
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1595
+ #
1596
+ # @overload create_job_trigger(parent: nil, job_trigger: nil, trigger_id: nil, location_id: nil)
1597
+ # Pass arguments to `create_job_trigger` via keyword arguments. Note that at
1598
+ # least one keyword argument is required. To specify no parameters, or to keep all
1599
+ # the default parameter values, pass an empty Hash as a request object (see above).
1600
+ #
1601
+ # @param parent [::String]
1602
+ # Required. Parent resource name.
1603
+ #
1604
+ # The format of this value varies depending on whether you have [specified a
1605
+ # processing
1606
+ # location](https://cloud.google.com/dlp/docs/specifying-location):
1607
+ #
1608
+ # + Projects scope, location specified:<br/>
1609
+ # `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
1610
+ # + Projects scope, no location specified (defaults to global):<br/>
1611
+ # `projects/`<var>PROJECT_ID</var>
1612
+ #
1613
+ # The following example `parent` string specifies a parent project with the
1614
+ # identifier `example-project`, and specifies the `europe-west3` location
1615
+ # for processing data:
1616
+ #
1617
+ # parent=projects/example-project/locations/europe-west3
1618
+ # @param job_trigger [::Google::Cloud::Dlp::V2::JobTrigger, ::Hash]
1619
+ # Required. The JobTrigger to create.
1620
+ # @param trigger_id [::String]
1621
+ # The trigger id can contain uppercase and lowercase letters,
1622
+ # numbers, and hyphens; that is, it must match the regular
1623
+ # expression: `[a-zA-Z\d-_]+`. The maximum length is 100
1624
+ # characters. Can be empty to allow the system to generate one.
1625
+ # @param location_id [::String]
1626
+ # Deprecated. This field has no effect.
1627
+ # @yield [result, operation] Access the result along with the TransportOperation object
1628
+ # @yieldparam result [::Google::Cloud::Dlp::V2::JobTrigger]
1629
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1630
+ #
1631
+ # @return [::Google::Cloud::Dlp::V2::JobTrigger]
1632
+ #
1633
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1634
+ def create_job_trigger request, options = nil
1635
+ raise ::ArgumentError, "request must be provided" if request.nil?
1636
+
1637
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::CreateJobTriggerRequest
1638
+
1639
+ # Converts hash and nil to an options object
1640
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1641
+
1642
+ # Customize the options with defaults
1643
+ call_metadata = @config.rpcs.create_job_trigger.metadata.to_h
1644
+
1645
+ # Set x-goog-api-client and x-goog-user-project headers
1646
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1647
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1648
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
1649
+ transports_version_send: [:rest]
1650
+
1651
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1652
+
1653
+ options.apply_defaults timeout: @config.rpcs.create_job_trigger.timeout,
1654
+ metadata: call_metadata,
1655
+ retry_policy: @config.rpcs.create_job_trigger.retry_policy
1656
+
1657
+ options.apply_defaults timeout: @config.timeout,
1658
+ metadata: @config.metadata,
1659
+ retry_policy: @config.retry_policy
1660
+
1661
+ @dlp_service_stub.create_job_trigger request, options do |result, operation|
1662
+ yield result, operation if block_given?
1663
+ return result
1664
+ end
1665
+ rescue ::Gapic::Rest::Error => e
1666
+ raise ::Google::Cloud::Error.from_error(e)
1667
+ end
1668
+
1669
+ ##
1670
+ # Updates a job trigger.
1671
+ # See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
1672
+ #
1673
+ # @overload update_job_trigger(request, options = nil)
1674
+ # Pass arguments to `update_job_trigger` via a request object, either of type
1675
+ # {::Google::Cloud::Dlp::V2::UpdateJobTriggerRequest} or an equivalent Hash.
1676
+ #
1677
+ # @param request [::Google::Cloud::Dlp::V2::UpdateJobTriggerRequest, ::Hash]
1678
+ # A request object representing the call parameters. Required. To specify no
1679
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1680
+ # @param options [::Gapic::CallOptions, ::Hash]
1681
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1682
+ #
1683
+ # @overload update_job_trigger(name: nil, job_trigger: nil, update_mask: nil)
1684
+ # Pass arguments to `update_job_trigger` via keyword arguments. Note that at
1685
+ # least one keyword argument is required. To specify no parameters, or to keep all
1686
+ # the default parameter values, pass an empty Hash as a request object (see above).
1687
+ #
1688
+ # @param name [::String]
1689
+ # Required. Resource name of the project and the triggeredJob, for example
1690
+ # `projects/dlp-test-project/jobTriggers/53234423`.
1691
+ # @param job_trigger [::Google::Cloud::Dlp::V2::JobTrigger, ::Hash]
1692
+ # New JobTrigger value.
1693
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1694
+ # Mask to control which fields get updated.
1695
+ # @yield [result, operation] Access the result along with the TransportOperation object
1696
+ # @yieldparam result [::Google::Cloud::Dlp::V2::JobTrigger]
1697
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1698
+ #
1699
+ # @return [::Google::Cloud::Dlp::V2::JobTrigger]
1700
+ #
1701
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1702
+ def update_job_trigger request, options = nil
1703
+ raise ::ArgumentError, "request must be provided" if request.nil?
1704
+
1705
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::UpdateJobTriggerRequest
1706
+
1707
+ # Converts hash and nil to an options object
1708
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1709
+
1710
+ # Customize the options with defaults
1711
+ call_metadata = @config.rpcs.update_job_trigger.metadata.to_h
1712
+
1713
+ # Set x-goog-api-client and x-goog-user-project headers
1714
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1715
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1716
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
1717
+ transports_version_send: [:rest]
1718
+
1719
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1720
+
1721
+ options.apply_defaults timeout: @config.rpcs.update_job_trigger.timeout,
1722
+ metadata: call_metadata,
1723
+ retry_policy: @config.rpcs.update_job_trigger.retry_policy
1724
+
1725
+ options.apply_defaults timeout: @config.timeout,
1726
+ metadata: @config.metadata,
1727
+ retry_policy: @config.retry_policy
1728
+
1729
+ @dlp_service_stub.update_job_trigger request, options do |result, operation|
1730
+ yield result, operation if block_given?
1731
+ return result
1732
+ end
1733
+ rescue ::Gapic::Rest::Error => e
1734
+ raise ::Google::Cloud::Error.from_error(e)
1735
+ end
1736
+
1737
+ ##
1738
+ # Inspect hybrid content and store findings to a trigger. The inspection
1739
+ # will be processed asynchronously. To review the findings monitor the
1740
+ # jobs within the trigger.
1741
+ #
1742
+ # @overload hybrid_inspect_job_trigger(request, options = nil)
1743
+ # Pass arguments to `hybrid_inspect_job_trigger` via a request object, either of type
1744
+ # {::Google::Cloud::Dlp::V2::HybridInspectJobTriggerRequest} or an equivalent Hash.
1745
+ #
1746
+ # @param request [::Google::Cloud::Dlp::V2::HybridInspectJobTriggerRequest, ::Hash]
1747
+ # A request object representing the call parameters. Required. To specify no
1748
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1749
+ # @param options [::Gapic::CallOptions, ::Hash]
1750
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1751
+ #
1752
+ # @overload hybrid_inspect_job_trigger(name: nil, hybrid_item: nil)
1753
+ # Pass arguments to `hybrid_inspect_job_trigger` via keyword arguments. Note that at
1754
+ # least one keyword argument is required. To specify no parameters, or to keep all
1755
+ # the default parameter values, pass an empty Hash as a request object (see above).
1756
+ #
1757
+ # @param name [::String]
1758
+ # Required. Resource name of the trigger to execute a hybrid inspect on, for example
1759
+ # `projects/dlp-test-project/jobTriggers/53234423`.
1760
+ # @param hybrid_item [::Google::Cloud::Dlp::V2::HybridContentItem, ::Hash]
1761
+ # The item to inspect.
1762
+ # @yield [result, operation] Access the result along with the TransportOperation object
1763
+ # @yieldparam result [::Google::Cloud::Dlp::V2::HybridInspectResponse]
1764
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1765
+ #
1766
+ # @return [::Google::Cloud::Dlp::V2::HybridInspectResponse]
1767
+ #
1768
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1769
+ def hybrid_inspect_job_trigger request, options = nil
1770
+ raise ::ArgumentError, "request must be provided" if request.nil?
1771
+
1772
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::HybridInspectJobTriggerRequest
1773
+
1774
+ # Converts hash and nil to an options object
1775
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1776
+
1777
+ # Customize the options with defaults
1778
+ call_metadata = @config.rpcs.hybrid_inspect_job_trigger.metadata.to_h
1779
+
1780
+ # Set x-goog-api-client and x-goog-user-project headers
1781
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1782
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1783
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
1784
+ transports_version_send: [:rest]
1785
+
1786
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1787
+
1788
+ options.apply_defaults timeout: @config.rpcs.hybrid_inspect_job_trigger.timeout,
1789
+ metadata: call_metadata,
1790
+ retry_policy: @config.rpcs.hybrid_inspect_job_trigger.retry_policy
1791
+
1792
+ options.apply_defaults timeout: @config.timeout,
1793
+ metadata: @config.metadata,
1794
+ retry_policy: @config.retry_policy
1795
+
1796
+ @dlp_service_stub.hybrid_inspect_job_trigger request, options do |result, operation|
1797
+ yield result, operation if block_given?
1798
+ return result
1799
+ end
1800
+ rescue ::Gapic::Rest::Error => e
1801
+ raise ::Google::Cloud::Error.from_error(e)
1802
+ end
1803
+
1804
+ ##
1805
+ # Gets a job trigger.
1806
+ # See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
1807
+ #
1808
+ # @overload get_job_trigger(request, options = nil)
1809
+ # Pass arguments to `get_job_trigger` via a request object, either of type
1810
+ # {::Google::Cloud::Dlp::V2::GetJobTriggerRequest} or an equivalent Hash.
1811
+ #
1812
+ # @param request [::Google::Cloud::Dlp::V2::GetJobTriggerRequest, ::Hash]
1813
+ # A request object representing the call parameters. Required. To specify no
1814
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1815
+ # @param options [::Gapic::CallOptions, ::Hash]
1816
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1817
+ #
1818
+ # @overload get_job_trigger(name: nil)
1819
+ # Pass arguments to `get_job_trigger` via keyword arguments. Note that at
1820
+ # least one keyword argument is required. To specify no parameters, or to keep all
1821
+ # the default parameter values, pass an empty Hash as a request object (see above).
1822
+ #
1823
+ # @param name [::String]
1824
+ # Required. Resource name of the project and the triggeredJob, for example
1825
+ # `projects/dlp-test-project/jobTriggers/53234423`.
1826
+ # @yield [result, operation] Access the result along with the TransportOperation object
1827
+ # @yieldparam result [::Google::Cloud::Dlp::V2::JobTrigger]
1828
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1829
+ #
1830
+ # @return [::Google::Cloud::Dlp::V2::JobTrigger]
1831
+ #
1832
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1833
+ def get_job_trigger request, options = nil
1834
+ raise ::ArgumentError, "request must be provided" if request.nil?
1835
+
1836
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::GetJobTriggerRequest
1837
+
1838
+ # Converts hash and nil to an options object
1839
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1840
+
1841
+ # Customize the options with defaults
1842
+ call_metadata = @config.rpcs.get_job_trigger.metadata.to_h
1843
+
1844
+ # Set x-goog-api-client and x-goog-user-project headers
1845
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1846
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1847
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
1848
+ transports_version_send: [:rest]
1849
+
1850
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1851
+
1852
+ options.apply_defaults timeout: @config.rpcs.get_job_trigger.timeout,
1853
+ metadata: call_metadata,
1854
+ retry_policy: @config.rpcs.get_job_trigger.retry_policy
1855
+
1856
+ options.apply_defaults timeout: @config.timeout,
1857
+ metadata: @config.metadata,
1858
+ retry_policy: @config.retry_policy
1859
+
1860
+ @dlp_service_stub.get_job_trigger request, options do |result, operation|
1861
+ yield result, operation if block_given?
1862
+ return result
1863
+ end
1864
+ rescue ::Gapic::Rest::Error => e
1865
+ raise ::Google::Cloud::Error.from_error(e)
1866
+ end
1867
+
1868
+ ##
1869
+ # Lists job triggers.
1870
+ # See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
1871
+ #
1872
+ # @overload list_job_triggers(request, options = nil)
1873
+ # Pass arguments to `list_job_triggers` via a request object, either of type
1874
+ # {::Google::Cloud::Dlp::V2::ListJobTriggersRequest} or an equivalent Hash.
1875
+ #
1876
+ # @param request [::Google::Cloud::Dlp::V2::ListJobTriggersRequest, ::Hash]
1877
+ # A request object representing the call parameters. Required. To specify no
1878
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1879
+ # @param options [::Gapic::CallOptions, ::Hash]
1880
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1881
+ #
1882
+ # @overload list_job_triggers(parent: nil, page_token: nil, page_size: nil, order_by: nil, filter: nil, type: nil, location_id: nil)
1883
+ # Pass arguments to `list_job_triggers` via keyword arguments. Note that at
1884
+ # least one keyword argument is required. To specify no parameters, or to keep all
1885
+ # the default parameter values, pass an empty Hash as a request object (see above).
1886
+ #
1887
+ # @param parent [::String]
1888
+ # Required. Parent resource name.
1889
+ #
1890
+ # The format of this value varies depending on whether you have [specified a
1891
+ # processing
1892
+ # location](https://cloud.google.com/dlp/docs/specifying-location):
1893
+ #
1894
+ # + Projects scope, location specified:<br/>
1895
+ # `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
1896
+ # + Projects scope, no location specified (defaults to global):<br/>
1897
+ # `projects/`<var>PROJECT_ID</var>
1898
+ #
1899
+ # The following example `parent` string specifies a parent project with the
1900
+ # identifier `example-project`, and specifies the `europe-west3` location
1901
+ # for processing data:
1902
+ #
1903
+ # parent=projects/example-project/locations/europe-west3
1904
+ # @param page_token [::String]
1905
+ # Page token to continue retrieval. Comes from previous call
1906
+ # to ListJobTriggers. `order_by` field must not
1907
+ # change for subsequent calls.
1908
+ # @param page_size [::Integer]
1909
+ # Size of the page, can be limited by a server.
1910
+ # @param order_by [::String]
1911
+ # Comma separated list of triggeredJob fields to order by,
1912
+ # followed by `asc` or `desc` postfix. This list is case-insensitive,
1913
+ # default sorting order is ascending, redundant space characters are
1914
+ # insignificant.
1915
+ #
1916
+ # Example: `name asc,update_time, create_time desc`
1917
+ #
1918
+ # Supported fields are:
1919
+ #
1920
+ # - `create_time`: corresponds to the time the JobTrigger was created.
1921
+ # - `update_time`: corresponds to the time the JobTrigger was last updated.
1922
+ # - `last_run_time`: corresponds to the last time the JobTrigger ran.
1923
+ # - `name`: corresponds to the JobTrigger's name.
1924
+ # - `display_name`: corresponds to the JobTrigger's display name.
1925
+ # - `status`: corresponds to JobTrigger's status.
1926
+ # @param filter [::String]
1927
+ # Allows filtering.
1928
+ #
1929
+ # Supported syntax:
1930
+ #
1931
+ # * Filter expressions are made up of one or more restrictions.
1932
+ # * Restrictions can be combined by `AND` or `OR` logical operators. A
1933
+ # sequence of restrictions implicitly uses `AND`.
1934
+ # * A restriction has the form of `{field} {operator} {value}`.
1935
+ # * Supported fields/values for inspect triggers:
1936
+ # - `status` - HEALTHY|PAUSED|CANCELLED
1937
+ # - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY
1938
+ # - 'last_run_time` - RFC 3339 formatted timestamp, surrounded by
1939
+ # quotation marks. Nanoseconds are ignored.
1940
+ # - 'error_count' - Number of errors that have occurred while running.
1941
+ # * The operator must be `=` or `!=` for status and inspected_storage.
1942
+ #
1943
+ # Examples:
1944
+ #
1945
+ # * inspected_storage = cloud_storage AND status = HEALTHY
1946
+ # * inspected_storage = cloud_storage OR inspected_storage = bigquery
1947
+ # * inspected_storage = cloud_storage AND (state = PAUSED OR state = HEALTHY)
1948
+ # * last_run_time > \"2017-12-12T00:00:00+00:00\"
1949
+ #
1950
+ # The length of this field should be no more than 500 characters.
1951
+ # @param type [::Google::Cloud::Dlp::V2::DlpJobType]
1952
+ # The type of jobs. Will use `DlpJobType.INSPECT` if not set.
1953
+ # @param location_id [::String]
1954
+ # Deprecated. This field has no effect.
1955
+ # @yield [result, operation] Access the result along with the TransportOperation object
1956
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dlp::V2::JobTrigger>]
1957
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1958
+ #
1959
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dlp::V2::JobTrigger>]
1960
+ #
1961
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1962
+ def list_job_triggers request, options = nil
1963
+ raise ::ArgumentError, "request must be provided" if request.nil?
1964
+
1965
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::ListJobTriggersRequest
1966
+
1967
+ # Converts hash and nil to an options object
1968
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1969
+
1970
+ # Customize the options with defaults
1971
+ call_metadata = @config.rpcs.list_job_triggers.metadata.to_h
1972
+
1973
+ # Set x-goog-api-client and x-goog-user-project headers
1974
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1975
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1976
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
1977
+ transports_version_send: [:rest]
1978
+
1979
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1980
+
1981
+ options.apply_defaults timeout: @config.rpcs.list_job_triggers.timeout,
1982
+ metadata: call_metadata,
1983
+ retry_policy: @config.rpcs.list_job_triggers.retry_policy
1984
+
1985
+ options.apply_defaults timeout: @config.timeout,
1986
+ metadata: @config.metadata,
1987
+ retry_policy: @config.retry_policy
1988
+
1989
+ @dlp_service_stub.list_job_triggers request, options do |result, operation|
1990
+ result = ::Gapic::Rest::PagedEnumerable.new @dlp_service_stub, :list_job_triggers, "job_triggers", request, result, options
1991
+ yield result, operation if block_given?
1992
+ return result
1993
+ end
1994
+ rescue ::Gapic::Rest::Error => e
1995
+ raise ::Google::Cloud::Error.from_error(e)
1996
+ end
1997
+
1998
+ ##
1999
+ # Deletes a job trigger.
2000
+ # See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
2001
+ #
2002
+ # @overload delete_job_trigger(request, options = nil)
2003
+ # Pass arguments to `delete_job_trigger` via a request object, either of type
2004
+ # {::Google::Cloud::Dlp::V2::DeleteJobTriggerRequest} or an equivalent Hash.
2005
+ #
2006
+ # @param request [::Google::Cloud::Dlp::V2::DeleteJobTriggerRequest, ::Hash]
2007
+ # A request object representing the call parameters. Required. To specify no
2008
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2009
+ # @param options [::Gapic::CallOptions, ::Hash]
2010
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2011
+ #
2012
+ # @overload delete_job_trigger(name: nil)
2013
+ # Pass arguments to `delete_job_trigger` via keyword arguments. Note that at
2014
+ # least one keyword argument is required. To specify no parameters, or to keep all
2015
+ # the default parameter values, pass an empty Hash as a request object (see above).
2016
+ #
2017
+ # @param name [::String]
2018
+ # Required. Resource name of the project and the triggeredJob, for example
2019
+ # `projects/dlp-test-project/jobTriggers/53234423`.
2020
+ # @yield [result, operation] Access the result along with the TransportOperation object
2021
+ # @yieldparam result [::Google::Protobuf::Empty]
2022
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2023
+ #
2024
+ # @return [::Google::Protobuf::Empty]
2025
+ #
2026
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2027
+ def delete_job_trigger request, options = nil
2028
+ raise ::ArgumentError, "request must be provided" if request.nil?
2029
+
2030
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::DeleteJobTriggerRequest
2031
+
2032
+ # Converts hash and nil to an options object
2033
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2034
+
2035
+ # Customize the options with defaults
2036
+ call_metadata = @config.rpcs.delete_job_trigger.metadata.to_h
2037
+
2038
+ # Set x-goog-api-client and x-goog-user-project headers
2039
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2040
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2041
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
2042
+ transports_version_send: [:rest]
2043
+
2044
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2045
+
2046
+ options.apply_defaults timeout: @config.rpcs.delete_job_trigger.timeout,
2047
+ metadata: call_metadata,
2048
+ retry_policy: @config.rpcs.delete_job_trigger.retry_policy
2049
+
2050
+ options.apply_defaults timeout: @config.timeout,
2051
+ metadata: @config.metadata,
2052
+ retry_policy: @config.retry_policy
2053
+
2054
+ @dlp_service_stub.delete_job_trigger request, options do |result, operation|
2055
+ yield result, operation if block_given?
2056
+ return result
2057
+ end
2058
+ rescue ::Gapic::Rest::Error => e
2059
+ raise ::Google::Cloud::Error.from_error(e)
2060
+ end
2061
+
2062
+ ##
2063
+ # Activate a job trigger. Causes the immediate execute of a trigger
2064
+ # instead of waiting on the trigger event to occur.
2065
+ #
2066
+ # @overload activate_job_trigger(request, options = nil)
2067
+ # Pass arguments to `activate_job_trigger` via a request object, either of type
2068
+ # {::Google::Cloud::Dlp::V2::ActivateJobTriggerRequest} or an equivalent Hash.
2069
+ #
2070
+ # @param request [::Google::Cloud::Dlp::V2::ActivateJobTriggerRequest, ::Hash]
2071
+ # A request object representing the call parameters. Required. To specify no
2072
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2073
+ # @param options [::Gapic::CallOptions, ::Hash]
2074
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2075
+ #
2076
+ # @overload activate_job_trigger(name: nil)
2077
+ # Pass arguments to `activate_job_trigger` via keyword arguments. Note that at
2078
+ # least one keyword argument is required. To specify no parameters, or to keep all
2079
+ # the default parameter values, pass an empty Hash as a request object (see above).
2080
+ #
2081
+ # @param name [::String]
2082
+ # Required. Resource name of the trigger to activate, for example
2083
+ # `projects/dlp-test-project/jobTriggers/53234423`.
2084
+ # @yield [result, operation] Access the result along with the TransportOperation object
2085
+ # @yieldparam result [::Google::Cloud::Dlp::V2::DlpJob]
2086
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2087
+ #
2088
+ # @return [::Google::Cloud::Dlp::V2::DlpJob]
2089
+ #
2090
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2091
+ def activate_job_trigger request, options = nil
2092
+ raise ::ArgumentError, "request must be provided" if request.nil?
2093
+
2094
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::ActivateJobTriggerRequest
2095
+
2096
+ # Converts hash and nil to an options object
2097
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2098
+
2099
+ # Customize the options with defaults
2100
+ call_metadata = @config.rpcs.activate_job_trigger.metadata.to_h
2101
+
2102
+ # Set x-goog-api-client and x-goog-user-project headers
2103
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2104
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2105
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
2106
+ transports_version_send: [:rest]
2107
+
2108
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2109
+
2110
+ options.apply_defaults timeout: @config.rpcs.activate_job_trigger.timeout,
2111
+ metadata: call_metadata,
2112
+ retry_policy: @config.rpcs.activate_job_trigger.retry_policy
2113
+
2114
+ options.apply_defaults timeout: @config.timeout,
2115
+ metadata: @config.metadata,
2116
+ retry_policy: @config.retry_policy
2117
+
2118
+ @dlp_service_stub.activate_job_trigger request, options do |result, operation|
2119
+ yield result, operation if block_given?
2120
+ return result
2121
+ end
2122
+ rescue ::Gapic::Rest::Error => e
2123
+ raise ::Google::Cloud::Error.from_error(e)
2124
+ end
2125
+
2126
+ ##
2127
+ # Creates a new job to inspect storage or calculate risk metrics.
2128
+ # See https://cloud.google.com/dlp/docs/inspecting-storage and
2129
+ # https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
2130
+ #
2131
+ # When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the
2132
+ # system will automatically choose what detectors to run. By default this may
2133
+ # be all types, but may change over time as detectors are updated.
2134
+ #
2135
+ # @overload create_dlp_job(request, options = nil)
2136
+ # Pass arguments to `create_dlp_job` via a request object, either of type
2137
+ # {::Google::Cloud::Dlp::V2::CreateDlpJobRequest} or an equivalent Hash.
2138
+ #
2139
+ # @param request [::Google::Cloud::Dlp::V2::CreateDlpJobRequest, ::Hash]
2140
+ # A request object representing the call parameters. Required. To specify no
2141
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2142
+ # @param options [::Gapic::CallOptions, ::Hash]
2143
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2144
+ #
2145
+ # @overload create_dlp_job(parent: nil, inspect_job: nil, risk_job: nil, job_id: nil, location_id: nil)
2146
+ # Pass arguments to `create_dlp_job` via keyword arguments. Note that at
2147
+ # least one keyword argument is required. To specify no parameters, or to keep all
2148
+ # the default parameter values, pass an empty Hash as a request object (see above).
2149
+ #
2150
+ # @param parent [::String]
2151
+ # Required. Parent resource name.
2152
+ #
2153
+ # The format of this value varies depending on whether you have [specified a
2154
+ # processing
2155
+ # location](https://cloud.google.com/dlp/docs/specifying-location):
2156
+ #
2157
+ # + Projects scope, location specified:<br/>
2158
+ # `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
2159
+ # + Projects scope, no location specified (defaults to global):<br/>
2160
+ # `projects/`<var>PROJECT_ID</var>
2161
+ #
2162
+ # The following example `parent` string specifies a parent project with the
2163
+ # identifier `example-project`, and specifies the `europe-west3` location
2164
+ # for processing data:
2165
+ #
2166
+ # parent=projects/example-project/locations/europe-west3
2167
+ # @param inspect_job [::Google::Cloud::Dlp::V2::InspectJobConfig, ::Hash]
2168
+ # An inspection job scans a storage repository for InfoTypes.
2169
+ # @param risk_job [::Google::Cloud::Dlp::V2::RiskAnalysisJobConfig, ::Hash]
2170
+ # A risk analysis job calculates re-identification risk metrics for a
2171
+ # BigQuery table.
2172
+ # @param job_id [::String]
2173
+ # The job id can contain uppercase and lowercase letters,
2174
+ # numbers, and hyphens; that is, it must match the regular
2175
+ # expression: `[a-zA-Z\d-_]+`. The maximum length is 100
2176
+ # characters. Can be empty to allow the system to generate one.
2177
+ # @param location_id [::String]
2178
+ # Deprecated. This field has no effect.
2179
+ # @yield [result, operation] Access the result along with the TransportOperation object
2180
+ # @yieldparam result [::Google::Cloud::Dlp::V2::DlpJob]
2181
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2182
+ #
2183
+ # @return [::Google::Cloud::Dlp::V2::DlpJob]
2184
+ #
2185
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2186
+ def create_dlp_job request, options = nil
2187
+ raise ::ArgumentError, "request must be provided" if request.nil?
2188
+
2189
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::CreateDlpJobRequest
2190
+
2191
+ # Converts hash and nil to an options object
2192
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2193
+
2194
+ # Customize the options with defaults
2195
+ call_metadata = @config.rpcs.create_dlp_job.metadata.to_h
2196
+
2197
+ # Set x-goog-api-client and x-goog-user-project headers
2198
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2199
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2200
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
2201
+ transports_version_send: [:rest]
2202
+
2203
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2204
+
2205
+ options.apply_defaults timeout: @config.rpcs.create_dlp_job.timeout,
2206
+ metadata: call_metadata,
2207
+ retry_policy: @config.rpcs.create_dlp_job.retry_policy
2208
+
2209
+ options.apply_defaults timeout: @config.timeout,
2210
+ metadata: @config.metadata,
2211
+ retry_policy: @config.retry_policy
2212
+
2213
+ @dlp_service_stub.create_dlp_job request, options do |result, operation|
2214
+ yield result, operation if block_given?
2215
+ return result
2216
+ end
2217
+ rescue ::Gapic::Rest::Error => e
2218
+ raise ::Google::Cloud::Error.from_error(e)
2219
+ end
2220
+
2221
+ ##
2222
+ # Lists DlpJobs that match the specified filter in the request.
2223
+ # See https://cloud.google.com/dlp/docs/inspecting-storage and
2224
+ # https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
2225
+ #
2226
+ # @overload list_dlp_jobs(request, options = nil)
2227
+ # Pass arguments to `list_dlp_jobs` via a request object, either of type
2228
+ # {::Google::Cloud::Dlp::V2::ListDlpJobsRequest} or an equivalent Hash.
2229
+ #
2230
+ # @param request [::Google::Cloud::Dlp::V2::ListDlpJobsRequest, ::Hash]
2231
+ # A request object representing the call parameters. Required. To specify no
2232
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2233
+ # @param options [::Gapic::CallOptions, ::Hash]
2234
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2235
+ #
2236
+ # @overload list_dlp_jobs(parent: nil, filter: nil, page_size: nil, page_token: nil, type: nil, order_by: nil, location_id: nil)
2237
+ # Pass arguments to `list_dlp_jobs` via keyword arguments. Note that at
2238
+ # least one keyword argument is required. To specify no parameters, or to keep all
2239
+ # the default parameter values, pass an empty Hash as a request object (see above).
2240
+ #
2241
+ # @param parent [::String]
2242
+ # Required. Parent resource name.
2243
+ #
2244
+ # The format of this value varies depending on whether you have [specified a
2245
+ # processing
2246
+ # location](https://cloud.google.com/dlp/docs/specifying-location):
2247
+ #
2248
+ # + Projects scope, location specified:<br/>
2249
+ # `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
2250
+ # + Projects scope, no location specified (defaults to global):<br/>
2251
+ # `projects/`<var>PROJECT_ID</var>
2252
+ #
2253
+ # The following example `parent` string specifies a parent project with the
2254
+ # identifier `example-project`, and specifies the `europe-west3` location
2255
+ # for processing data:
2256
+ #
2257
+ # parent=projects/example-project/locations/europe-west3
2258
+ # @param filter [::String]
2259
+ # Allows filtering.
2260
+ #
2261
+ # Supported syntax:
2262
+ #
2263
+ # * Filter expressions are made up of one or more restrictions.
2264
+ # * Restrictions can be combined by `AND` or `OR` logical operators. A
2265
+ # sequence of restrictions implicitly uses `AND`.
2266
+ # * A restriction has the form of `{field} {operator} {value}`.
2267
+ # * Supported fields/values for inspect jobs:
2268
+ # - `state` - PENDING|RUNNING|CANCELED|FINISHED|FAILED
2269
+ # - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY
2270
+ # - `trigger_name` - The name of the trigger that created the job.
2271
+ # - 'end_time` - Corresponds to the time the job finished.
2272
+ # - 'start_time` - Corresponds to the time the job finished.
2273
+ # * Supported fields for risk analysis jobs:
2274
+ # - `state` - RUNNING|CANCELED|FINISHED|FAILED
2275
+ # - 'end_time` - Corresponds to the time the job finished.
2276
+ # - 'start_time` - Corresponds to the time the job finished.
2277
+ # * The operator must be `=` or `!=`.
2278
+ #
2279
+ # Examples:
2280
+ #
2281
+ # * inspected_storage = cloud_storage AND state = done
2282
+ # * inspected_storage = cloud_storage OR inspected_storage = bigquery
2283
+ # * inspected_storage = cloud_storage AND (state = done OR state = canceled)
2284
+ # * end_time > \"2017-12-12T00:00:00+00:00\"
2285
+ #
2286
+ # The length of this field should be no more than 500 characters.
2287
+ # @param page_size [::Integer]
2288
+ # The standard list page size.
2289
+ # @param page_token [::String]
2290
+ # The standard list page token.
2291
+ # @param type [::Google::Cloud::Dlp::V2::DlpJobType]
2292
+ # The type of job. Defaults to `DlpJobType.INSPECT`
2293
+ # @param order_by [::String]
2294
+ # Comma separated list of fields to order by,
2295
+ # followed by `asc` or `desc` postfix. This list is case-insensitive,
2296
+ # default sorting order is ascending, redundant space characters are
2297
+ # insignificant.
2298
+ #
2299
+ # Example: `name asc, end_time asc, create_time desc`
2300
+ #
2301
+ # Supported fields are:
2302
+ #
2303
+ # - `create_time`: corresponds to the time the job was created.
2304
+ # - `end_time`: corresponds to the time the job ended.
2305
+ # - `name`: corresponds to the job's name.
2306
+ # - `state`: corresponds to `state`
2307
+ # @param location_id [::String]
2308
+ # Deprecated. This field has no effect.
2309
+ # @yield [result, operation] Access the result along with the TransportOperation object
2310
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dlp::V2::DlpJob>]
2311
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2312
+ #
2313
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dlp::V2::DlpJob>]
2314
+ #
2315
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2316
+ def list_dlp_jobs request, options = nil
2317
+ raise ::ArgumentError, "request must be provided" if request.nil?
2318
+
2319
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::ListDlpJobsRequest
2320
+
2321
+ # Converts hash and nil to an options object
2322
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2323
+
2324
+ # Customize the options with defaults
2325
+ call_metadata = @config.rpcs.list_dlp_jobs.metadata.to_h
2326
+
2327
+ # Set x-goog-api-client and x-goog-user-project headers
2328
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2329
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2330
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
2331
+ transports_version_send: [:rest]
2332
+
2333
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2334
+
2335
+ options.apply_defaults timeout: @config.rpcs.list_dlp_jobs.timeout,
2336
+ metadata: call_metadata,
2337
+ retry_policy: @config.rpcs.list_dlp_jobs.retry_policy
2338
+
2339
+ options.apply_defaults timeout: @config.timeout,
2340
+ metadata: @config.metadata,
2341
+ retry_policy: @config.retry_policy
2342
+
2343
+ @dlp_service_stub.list_dlp_jobs request, options do |result, operation|
2344
+ result = ::Gapic::Rest::PagedEnumerable.new @dlp_service_stub, :list_dlp_jobs, "jobs", request, result, options
2345
+ yield result, operation if block_given?
2346
+ return result
2347
+ end
2348
+ rescue ::Gapic::Rest::Error => e
2349
+ raise ::Google::Cloud::Error.from_error(e)
2350
+ end
2351
+
2352
+ ##
2353
+ # Gets the latest state of a long-running DlpJob.
2354
+ # See https://cloud.google.com/dlp/docs/inspecting-storage and
2355
+ # https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
2356
+ #
2357
+ # @overload get_dlp_job(request, options = nil)
2358
+ # Pass arguments to `get_dlp_job` via a request object, either of type
2359
+ # {::Google::Cloud::Dlp::V2::GetDlpJobRequest} or an equivalent Hash.
2360
+ #
2361
+ # @param request [::Google::Cloud::Dlp::V2::GetDlpJobRequest, ::Hash]
2362
+ # A request object representing the call parameters. Required. To specify no
2363
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2364
+ # @param options [::Gapic::CallOptions, ::Hash]
2365
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2366
+ #
2367
+ # @overload get_dlp_job(name: nil)
2368
+ # Pass arguments to `get_dlp_job` via keyword arguments. Note that at
2369
+ # least one keyword argument is required. To specify no parameters, or to keep all
2370
+ # the default parameter values, pass an empty Hash as a request object (see above).
2371
+ #
2372
+ # @param name [::String]
2373
+ # Required. The name of the DlpJob resource.
2374
+ # @yield [result, operation] Access the result along with the TransportOperation object
2375
+ # @yieldparam result [::Google::Cloud::Dlp::V2::DlpJob]
2376
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2377
+ #
2378
+ # @return [::Google::Cloud::Dlp::V2::DlpJob]
2379
+ #
2380
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2381
+ def get_dlp_job request, options = nil
2382
+ raise ::ArgumentError, "request must be provided" if request.nil?
2383
+
2384
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::GetDlpJobRequest
2385
+
2386
+ # Converts hash and nil to an options object
2387
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2388
+
2389
+ # Customize the options with defaults
2390
+ call_metadata = @config.rpcs.get_dlp_job.metadata.to_h
2391
+
2392
+ # Set x-goog-api-client and x-goog-user-project headers
2393
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2394
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2395
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
2396
+ transports_version_send: [:rest]
2397
+
2398
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2399
+
2400
+ options.apply_defaults timeout: @config.rpcs.get_dlp_job.timeout,
2401
+ metadata: call_metadata,
2402
+ retry_policy: @config.rpcs.get_dlp_job.retry_policy
2403
+
2404
+ options.apply_defaults timeout: @config.timeout,
2405
+ metadata: @config.metadata,
2406
+ retry_policy: @config.retry_policy
2407
+
2408
+ @dlp_service_stub.get_dlp_job request, options do |result, operation|
2409
+ yield result, operation if block_given?
2410
+ return result
2411
+ end
2412
+ rescue ::Gapic::Rest::Error => e
2413
+ raise ::Google::Cloud::Error.from_error(e)
2414
+ end
2415
+
2416
+ ##
2417
+ # Deletes a long-running DlpJob. This method indicates that the client is
2418
+ # no longer interested in the DlpJob result. The job will be canceled if
2419
+ # possible.
2420
+ # See https://cloud.google.com/dlp/docs/inspecting-storage and
2421
+ # https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
2422
+ #
2423
+ # @overload delete_dlp_job(request, options = nil)
2424
+ # Pass arguments to `delete_dlp_job` via a request object, either of type
2425
+ # {::Google::Cloud::Dlp::V2::DeleteDlpJobRequest} or an equivalent Hash.
2426
+ #
2427
+ # @param request [::Google::Cloud::Dlp::V2::DeleteDlpJobRequest, ::Hash]
2428
+ # A request object representing the call parameters. Required. To specify no
2429
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2430
+ # @param options [::Gapic::CallOptions, ::Hash]
2431
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2432
+ #
2433
+ # @overload delete_dlp_job(name: nil)
2434
+ # Pass arguments to `delete_dlp_job` via keyword arguments. Note that at
2435
+ # least one keyword argument is required. To specify no parameters, or to keep all
2436
+ # the default parameter values, pass an empty Hash as a request object (see above).
2437
+ #
2438
+ # @param name [::String]
2439
+ # Required. The name of the DlpJob resource to be deleted.
2440
+ # @yield [result, operation] Access the result along with the TransportOperation object
2441
+ # @yieldparam result [::Google::Protobuf::Empty]
2442
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2443
+ #
2444
+ # @return [::Google::Protobuf::Empty]
2445
+ #
2446
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2447
+ def delete_dlp_job request, options = nil
2448
+ raise ::ArgumentError, "request must be provided" if request.nil?
2449
+
2450
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::DeleteDlpJobRequest
2451
+
2452
+ # Converts hash and nil to an options object
2453
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2454
+
2455
+ # Customize the options with defaults
2456
+ call_metadata = @config.rpcs.delete_dlp_job.metadata.to_h
2457
+
2458
+ # Set x-goog-api-client and x-goog-user-project headers
2459
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2460
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2461
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
2462
+ transports_version_send: [:rest]
2463
+
2464
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2465
+
2466
+ options.apply_defaults timeout: @config.rpcs.delete_dlp_job.timeout,
2467
+ metadata: call_metadata,
2468
+ retry_policy: @config.rpcs.delete_dlp_job.retry_policy
2469
+
2470
+ options.apply_defaults timeout: @config.timeout,
2471
+ metadata: @config.metadata,
2472
+ retry_policy: @config.retry_policy
2473
+
2474
+ @dlp_service_stub.delete_dlp_job request, options do |result, operation|
2475
+ yield result, operation if block_given?
2476
+ return result
2477
+ end
2478
+ rescue ::Gapic::Rest::Error => e
2479
+ raise ::Google::Cloud::Error.from_error(e)
2480
+ end
2481
+
2482
+ ##
2483
+ # Starts asynchronous cancellation on a long-running DlpJob. The server
2484
+ # makes a best effort to cancel the DlpJob, but success is not
2485
+ # guaranteed.
2486
+ # See https://cloud.google.com/dlp/docs/inspecting-storage and
2487
+ # https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
2488
+ #
2489
+ # @overload cancel_dlp_job(request, options = nil)
2490
+ # Pass arguments to `cancel_dlp_job` via a request object, either of type
2491
+ # {::Google::Cloud::Dlp::V2::CancelDlpJobRequest} or an equivalent Hash.
2492
+ #
2493
+ # @param request [::Google::Cloud::Dlp::V2::CancelDlpJobRequest, ::Hash]
2494
+ # A request object representing the call parameters. Required. To specify no
2495
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2496
+ # @param options [::Gapic::CallOptions, ::Hash]
2497
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2498
+ #
2499
+ # @overload cancel_dlp_job(name: nil)
2500
+ # Pass arguments to `cancel_dlp_job` via keyword arguments. Note that at
2501
+ # least one keyword argument is required. To specify no parameters, or to keep all
2502
+ # the default parameter values, pass an empty Hash as a request object (see above).
2503
+ #
2504
+ # @param name [::String]
2505
+ # Required. The name of the DlpJob resource to be cancelled.
2506
+ # @yield [result, operation] Access the result along with the TransportOperation object
2507
+ # @yieldparam result [::Google::Protobuf::Empty]
2508
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2509
+ #
2510
+ # @return [::Google::Protobuf::Empty]
2511
+ #
2512
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2513
+ def cancel_dlp_job request, options = nil
2514
+ raise ::ArgumentError, "request must be provided" if request.nil?
2515
+
2516
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::CancelDlpJobRequest
2517
+
2518
+ # Converts hash and nil to an options object
2519
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2520
+
2521
+ # Customize the options with defaults
2522
+ call_metadata = @config.rpcs.cancel_dlp_job.metadata.to_h
2523
+
2524
+ # Set x-goog-api-client and x-goog-user-project headers
2525
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2526
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2527
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
2528
+ transports_version_send: [:rest]
2529
+
2530
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2531
+
2532
+ options.apply_defaults timeout: @config.rpcs.cancel_dlp_job.timeout,
2533
+ metadata: call_metadata,
2534
+ retry_policy: @config.rpcs.cancel_dlp_job.retry_policy
2535
+
2536
+ options.apply_defaults timeout: @config.timeout,
2537
+ metadata: @config.metadata,
2538
+ retry_policy: @config.retry_policy
2539
+
2540
+ @dlp_service_stub.cancel_dlp_job request, options do |result, operation|
2541
+ yield result, operation if block_given?
2542
+ return result
2543
+ end
2544
+ rescue ::Gapic::Rest::Error => e
2545
+ raise ::Google::Cloud::Error.from_error(e)
2546
+ end
2547
+
2548
+ ##
2549
+ # Creates a pre-built stored infoType to be used for inspection.
2550
+ # See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
2551
+ # learn more.
2552
+ #
2553
+ # @overload create_stored_info_type(request, options = nil)
2554
+ # Pass arguments to `create_stored_info_type` via a request object, either of type
2555
+ # {::Google::Cloud::Dlp::V2::CreateStoredInfoTypeRequest} or an equivalent Hash.
2556
+ #
2557
+ # @param request [::Google::Cloud::Dlp::V2::CreateStoredInfoTypeRequest, ::Hash]
2558
+ # A request object representing the call parameters. Required. To specify no
2559
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2560
+ # @param options [::Gapic::CallOptions, ::Hash]
2561
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2562
+ #
2563
+ # @overload create_stored_info_type(parent: nil, config: nil, stored_info_type_id: nil, location_id: nil)
2564
+ # Pass arguments to `create_stored_info_type` via keyword arguments. Note that at
2565
+ # least one keyword argument is required. To specify no parameters, or to keep all
2566
+ # the default parameter values, pass an empty Hash as a request object (see above).
2567
+ #
2568
+ # @param parent [::String]
2569
+ # Required. Parent resource name.
2570
+ #
2571
+ # The format of this value varies depending on the scope of the request
2572
+ # (project or organization) and whether you have [specified a processing
2573
+ # location](https://cloud.google.com/dlp/docs/specifying-location):
2574
+ #
2575
+ # + Projects scope, location specified:<br/>
2576
+ # `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
2577
+ # + Projects scope, no location specified (defaults to global):<br/>
2578
+ # `projects/`<var>PROJECT_ID</var>
2579
+ # + Organizations scope, location specified:<br/>
2580
+ # `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var>
2581
+ # + Organizations scope, no location specified (defaults to global):<br/>
2582
+ # `organizations/`<var>ORG_ID</var>
2583
+ #
2584
+ # The following example `parent` string specifies a parent project with the
2585
+ # identifier `example-project`, and specifies the `europe-west3` location
2586
+ # for processing data:
2587
+ #
2588
+ # parent=projects/example-project/locations/europe-west3
2589
+ # @param config [::Google::Cloud::Dlp::V2::StoredInfoTypeConfig, ::Hash]
2590
+ # Required. Configuration of the storedInfoType to create.
2591
+ # @param stored_info_type_id [::String]
2592
+ # The storedInfoType ID can contain uppercase and lowercase letters,
2593
+ # numbers, and hyphens; that is, it must match the regular
2594
+ # expression: `[a-zA-Z\d-_]+`. The maximum length is 100
2595
+ # characters. Can be empty to allow the system to generate one.
2596
+ # @param location_id [::String]
2597
+ # Deprecated. This field has no effect.
2598
+ # @yield [result, operation] Access the result along with the TransportOperation object
2599
+ # @yieldparam result [::Google::Cloud::Dlp::V2::StoredInfoType]
2600
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2601
+ #
2602
+ # @return [::Google::Cloud::Dlp::V2::StoredInfoType]
2603
+ #
2604
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2605
+ def create_stored_info_type request, options = nil
2606
+ raise ::ArgumentError, "request must be provided" if request.nil?
2607
+
2608
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::CreateStoredInfoTypeRequest
2609
+
2610
+ # Converts hash and nil to an options object
2611
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2612
+
2613
+ # Customize the options with defaults
2614
+ call_metadata = @config.rpcs.create_stored_info_type.metadata.to_h
2615
+
2616
+ # Set x-goog-api-client and x-goog-user-project headers
2617
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2618
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2619
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
2620
+ transports_version_send: [:rest]
2621
+
2622
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2623
+
2624
+ options.apply_defaults timeout: @config.rpcs.create_stored_info_type.timeout,
2625
+ metadata: call_metadata,
2626
+ retry_policy: @config.rpcs.create_stored_info_type.retry_policy
2627
+
2628
+ options.apply_defaults timeout: @config.timeout,
2629
+ metadata: @config.metadata,
2630
+ retry_policy: @config.retry_policy
2631
+
2632
+ @dlp_service_stub.create_stored_info_type request, options do |result, operation|
2633
+ yield result, operation if block_given?
2634
+ return result
2635
+ end
2636
+ rescue ::Gapic::Rest::Error => e
2637
+ raise ::Google::Cloud::Error.from_error(e)
2638
+ end
2639
+
2640
+ ##
2641
+ # Updates the stored infoType by creating a new version. The existing version
2642
+ # will continue to be used until the new version is ready.
2643
+ # See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
2644
+ # learn more.
2645
+ #
2646
+ # @overload update_stored_info_type(request, options = nil)
2647
+ # Pass arguments to `update_stored_info_type` via a request object, either of type
2648
+ # {::Google::Cloud::Dlp::V2::UpdateStoredInfoTypeRequest} or an equivalent Hash.
2649
+ #
2650
+ # @param request [::Google::Cloud::Dlp::V2::UpdateStoredInfoTypeRequest, ::Hash]
2651
+ # A request object representing the call parameters. Required. To specify no
2652
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2653
+ # @param options [::Gapic::CallOptions, ::Hash]
2654
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2655
+ #
2656
+ # @overload update_stored_info_type(name: nil, config: nil, update_mask: nil)
2657
+ # Pass arguments to `update_stored_info_type` via keyword arguments. Note that at
2658
+ # least one keyword argument is required. To specify no parameters, or to keep all
2659
+ # the default parameter values, pass an empty Hash as a request object (see above).
2660
+ #
2661
+ # @param name [::String]
2662
+ # Required. Resource name of organization and storedInfoType to be updated, for
2663
+ # example `organizations/433245324/storedInfoTypes/432452342` or
2664
+ # projects/project-id/storedInfoTypes/432452342.
2665
+ # @param config [::Google::Cloud::Dlp::V2::StoredInfoTypeConfig, ::Hash]
2666
+ # Updated configuration for the storedInfoType. If not provided, a new
2667
+ # version of the storedInfoType will be created with the existing
2668
+ # configuration.
2669
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2670
+ # Mask to control which fields get updated.
2671
+ # @yield [result, operation] Access the result along with the TransportOperation object
2672
+ # @yieldparam result [::Google::Cloud::Dlp::V2::StoredInfoType]
2673
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2674
+ #
2675
+ # @return [::Google::Cloud::Dlp::V2::StoredInfoType]
2676
+ #
2677
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2678
+ def update_stored_info_type request, options = nil
2679
+ raise ::ArgumentError, "request must be provided" if request.nil?
2680
+
2681
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::UpdateStoredInfoTypeRequest
2682
+
2683
+ # Converts hash and nil to an options object
2684
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2685
+
2686
+ # Customize the options with defaults
2687
+ call_metadata = @config.rpcs.update_stored_info_type.metadata.to_h
2688
+
2689
+ # Set x-goog-api-client and x-goog-user-project headers
2690
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2691
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2692
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
2693
+ transports_version_send: [:rest]
2694
+
2695
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2696
+
2697
+ options.apply_defaults timeout: @config.rpcs.update_stored_info_type.timeout,
2698
+ metadata: call_metadata,
2699
+ retry_policy: @config.rpcs.update_stored_info_type.retry_policy
2700
+
2701
+ options.apply_defaults timeout: @config.timeout,
2702
+ metadata: @config.metadata,
2703
+ retry_policy: @config.retry_policy
2704
+
2705
+ @dlp_service_stub.update_stored_info_type request, options do |result, operation|
2706
+ yield result, operation if block_given?
2707
+ return result
2708
+ end
2709
+ rescue ::Gapic::Rest::Error => e
2710
+ raise ::Google::Cloud::Error.from_error(e)
2711
+ end
2712
+
2713
+ ##
2714
+ # Gets a stored infoType.
2715
+ # See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
2716
+ # learn more.
2717
+ #
2718
+ # @overload get_stored_info_type(request, options = nil)
2719
+ # Pass arguments to `get_stored_info_type` via a request object, either of type
2720
+ # {::Google::Cloud::Dlp::V2::GetStoredInfoTypeRequest} or an equivalent Hash.
2721
+ #
2722
+ # @param request [::Google::Cloud::Dlp::V2::GetStoredInfoTypeRequest, ::Hash]
2723
+ # A request object representing the call parameters. Required. To specify no
2724
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2725
+ # @param options [::Gapic::CallOptions, ::Hash]
2726
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2727
+ #
2728
+ # @overload get_stored_info_type(name: nil)
2729
+ # Pass arguments to `get_stored_info_type` via keyword arguments. Note that at
2730
+ # least one keyword argument is required. To specify no parameters, or to keep all
2731
+ # the default parameter values, pass an empty Hash as a request object (see above).
2732
+ #
2733
+ # @param name [::String]
2734
+ # Required. Resource name of the organization and storedInfoType to be read, for
2735
+ # example `organizations/433245324/storedInfoTypes/432452342` or
2736
+ # projects/project-id/storedInfoTypes/432452342.
2737
+ # @yield [result, operation] Access the result along with the TransportOperation object
2738
+ # @yieldparam result [::Google::Cloud::Dlp::V2::StoredInfoType]
2739
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2740
+ #
2741
+ # @return [::Google::Cloud::Dlp::V2::StoredInfoType]
2742
+ #
2743
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2744
+ def get_stored_info_type request, options = nil
2745
+ raise ::ArgumentError, "request must be provided" if request.nil?
2746
+
2747
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::GetStoredInfoTypeRequest
2748
+
2749
+ # Converts hash and nil to an options object
2750
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2751
+
2752
+ # Customize the options with defaults
2753
+ call_metadata = @config.rpcs.get_stored_info_type.metadata.to_h
2754
+
2755
+ # Set x-goog-api-client and x-goog-user-project headers
2756
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2757
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2758
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
2759
+ transports_version_send: [:rest]
2760
+
2761
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2762
+
2763
+ options.apply_defaults timeout: @config.rpcs.get_stored_info_type.timeout,
2764
+ metadata: call_metadata,
2765
+ retry_policy: @config.rpcs.get_stored_info_type.retry_policy
2766
+
2767
+ options.apply_defaults timeout: @config.timeout,
2768
+ metadata: @config.metadata,
2769
+ retry_policy: @config.retry_policy
2770
+
2771
+ @dlp_service_stub.get_stored_info_type request, options do |result, operation|
2772
+ yield result, operation if block_given?
2773
+ return result
2774
+ end
2775
+ rescue ::Gapic::Rest::Error => e
2776
+ raise ::Google::Cloud::Error.from_error(e)
2777
+ end
2778
+
2779
+ ##
2780
+ # Lists stored infoTypes.
2781
+ # See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
2782
+ # learn more.
2783
+ #
2784
+ # @overload list_stored_info_types(request, options = nil)
2785
+ # Pass arguments to `list_stored_info_types` via a request object, either of type
2786
+ # {::Google::Cloud::Dlp::V2::ListStoredInfoTypesRequest} or an equivalent Hash.
2787
+ #
2788
+ # @param request [::Google::Cloud::Dlp::V2::ListStoredInfoTypesRequest, ::Hash]
2789
+ # A request object representing the call parameters. Required. To specify no
2790
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2791
+ # @param options [::Gapic::CallOptions, ::Hash]
2792
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2793
+ #
2794
+ # @overload list_stored_info_types(parent: nil, page_token: nil, page_size: nil, order_by: nil, location_id: nil)
2795
+ # Pass arguments to `list_stored_info_types` via keyword arguments. Note that at
2796
+ # least one keyword argument is required. To specify no parameters, or to keep all
2797
+ # the default parameter values, pass an empty Hash as a request object (see above).
2798
+ #
2799
+ # @param parent [::String]
2800
+ # Required. Parent resource name.
2801
+ #
2802
+ # The format of this value varies depending on the scope of the request
2803
+ # (project or organization) and whether you have [specified a processing
2804
+ # location](https://cloud.google.com/dlp/docs/specifying-location):
2805
+ #
2806
+ # + Projects scope, location specified:<br/>
2807
+ # `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
2808
+ # + Projects scope, no location specified (defaults to global):<br/>
2809
+ # `projects/`<var>PROJECT_ID</var>
2810
+ #
2811
+ # The following example `parent` string specifies a parent project with the
2812
+ # identifier `example-project`, and specifies the `europe-west3` location
2813
+ # for processing data:
2814
+ #
2815
+ # parent=projects/example-project/locations/europe-west3
2816
+ # @param page_token [::String]
2817
+ # Page token to continue retrieval. Comes from previous call
2818
+ # to `ListStoredInfoTypes`.
2819
+ # @param page_size [::Integer]
2820
+ # Size of the page, can be limited by the server. If zero server returns
2821
+ # a page of max size 100.
2822
+ # @param order_by [::String]
2823
+ # Comma separated list of fields to order by,
2824
+ # followed by `asc` or `desc` postfix. This list is case-insensitive,
2825
+ # default sorting order is ascending, redundant space characters are
2826
+ # insignificant.
2827
+ #
2828
+ # Example: `name asc, display_name, create_time desc`
2829
+ #
2830
+ # Supported fields are:
2831
+ #
2832
+ # - `create_time`: corresponds to the time the most recent version of the
2833
+ # resource was created.
2834
+ # - `state`: corresponds to the state of the resource.
2835
+ # - `name`: corresponds to resource name.
2836
+ # - `display_name`: corresponds to info type's display name.
2837
+ # @param location_id [::String]
2838
+ # Deprecated. This field has no effect.
2839
+ # @yield [result, operation] Access the result along with the TransportOperation object
2840
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dlp::V2::StoredInfoType>]
2841
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2842
+ #
2843
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dlp::V2::StoredInfoType>]
2844
+ #
2845
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2846
+ def list_stored_info_types request, options = nil
2847
+ raise ::ArgumentError, "request must be provided" if request.nil?
2848
+
2849
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::ListStoredInfoTypesRequest
2850
+
2851
+ # Converts hash and nil to an options object
2852
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2853
+
2854
+ # Customize the options with defaults
2855
+ call_metadata = @config.rpcs.list_stored_info_types.metadata.to_h
2856
+
2857
+ # Set x-goog-api-client and x-goog-user-project headers
2858
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2859
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2860
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
2861
+ transports_version_send: [:rest]
2862
+
2863
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2864
+
2865
+ options.apply_defaults timeout: @config.rpcs.list_stored_info_types.timeout,
2866
+ metadata: call_metadata,
2867
+ retry_policy: @config.rpcs.list_stored_info_types.retry_policy
2868
+
2869
+ options.apply_defaults timeout: @config.timeout,
2870
+ metadata: @config.metadata,
2871
+ retry_policy: @config.retry_policy
2872
+
2873
+ @dlp_service_stub.list_stored_info_types request, options do |result, operation|
2874
+ result = ::Gapic::Rest::PagedEnumerable.new @dlp_service_stub, :list_stored_info_types, "stored_info_types", request, result, options
2875
+ yield result, operation if block_given?
2876
+ return result
2877
+ end
2878
+ rescue ::Gapic::Rest::Error => e
2879
+ raise ::Google::Cloud::Error.from_error(e)
2880
+ end
2881
+
2882
+ ##
2883
+ # Deletes a stored infoType.
2884
+ # See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
2885
+ # learn more.
2886
+ #
2887
+ # @overload delete_stored_info_type(request, options = nil)
2888
+ # Pass arguments to `delete_stored_info_type` via a request object, either of type
2889
+ # {::Google::Cloud::Dlp::V2::DeleteStoredInfoTypeRequest} or an equivalent Hash.
2890
+ #
2891
+ # @param request [::Google::Cloud::Dlp::V2::DeleteStoredInfoTypeRequest, ::Hash]
2892
+ # A request object representing the call parameters. Required. To specify no
2893
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2894
+ # @param options [::Gapic::CallOptions, ::Hash]
2895
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2896
+ #
2897
+ # @overload delete_stored_info_type(name: nil)
2898
+ # Pass arguments to `delete_stored_info_type` via keyword arguments. Note that at
2899
+ # least one keyword argument is required. To specify no parameters, or to keep all
2900
+ # the default parameter values, pass an empty Hash as a request object (see above).
2901
+ #
2902
+ # @param name [::String]
2903
+ # Required. Resource name of the organization and storedInfoType to be deleted, for
2904
+ # example `organizations/433245324/storedInfoTypes/432452342` or
2905
+ # projects/project-id/storedInfoTypes/432452342.
2906
+ # @yield [result, operation] Access the result along with the TransportOperation object
2907
+ # @yieldparam result [::Google::Protobuf::Empty]
2908
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2909
+ #
2910
+ # @return [::Google::Protobuf::Empty]
2911
+ #
2912
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2913
+ def delete_stored_info_type request, options = nil
2914
+ raise ::ArgumentError, "request must be provided" if request.nil?
2915
+
2916
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::DeleteStoredInfoTypeRequest
2917
+
2918
+ # Converts hash and nil to an options object
2919
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2920
+
2921
+ # Customize the options with defaults
2922
+ call_metadata = @config.rpcs.delete_stored_info_type.metadata.to_h
2923
+
2924
+ # Set x-goog-api-client and x-goog-user-project headers
2925
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2926
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2927
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
2928
+ transports_version_send: [:rest]
2929
+
2930
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2931
+
2932
+ options.apply_defaults timeout: @config.rpcs.delete_stored_info_type.timeout,
2933
+ metadata: call_metadata,
2934
+ retry_policy: @config.rpcs.delete_stored_info_type.retry_policy
2935
+
2936
+ options.apply_defaults timeout: @config.timeout,
2937
+ metadata: @config.metadata,
2938
+ retry_policy: @config.retry_policy
2939
+
2940
+ @dlp_service_stub.delete_stored_info_type request, options do |result, operation|
2941
+ yield result, operation if block_given?
2942
+ return result
2943
+ end
2944
+ rescue ::Gapic::Rest::Error => e
2945
+ raise ::Google::Cloud::Error.from_error(e)
2946
+ end
2947
+
2948
+ ##
2949
+ # Inspect hybrid content and store findings to a job.
2950
+ # To review the findings, inspect the job. Inspection will occur
2951
+ # asynchronously.
2952
+ #
2953
+ # @overload hybrid_inspect_dlp_job(request, options = nil)
2954
+ # Pass arguments to `hybrid_inspect_dlp_job` via a request object, either of type
2955
+ # {::Google::Cloud::Dlp::V2::HybridInspectDlpJobRequest} or an equivalent Hash.
2956
+ #
2957
+ # @param request [::Google::Cloud::Dlp::V2::HybridInspectDlpJobRequest, ::Hash]
2958
+ # A request object representing the call parameters. Required. To specify no
2959
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2960
+ # @param options [::Gapic::CallOptions, ::Hash]
2961
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2962
+ #
2963
+ # @overload hybrid_inspect_dlp_job(name: nil, hybrid_item: nil)
2964
+ # Pass arguments to `hybrid_inspect_dlp_job` via keyword arguments. Note that at
2965
+ # least one keyword argument is required. To specify no parameters, or to keep all
2966
+ # the default parameter values, pass an empty Hash as a request object (see above).
2967
+ #
2968
+ # @param name [::String]
2969
+ # Required. Resource name of the job to execute a hybrid inspect on, for example
2970
+ # `projects/dlp-test-project/dlpJob/53234423`.
2971
+ # @param hybrid_item [::Google::Cloud::Dlp::V2::HybridContentItem, ::Hash]
2972
+ # The item to inspect.
2973
+ # @yield [result, operation] Access the result along with the TransportOperation object
2974
+ # @yieldparam result [::Google::Cloud::Dlp::V2::HybridInspectResponse]
2975
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2976
+ #
2977
+ # @return [::Google::Cloud::Dlp::V2::HybridInspectResponse]
2978
+ #
2979
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2980
+ def hybrid_inspect_dlp_job request, options = nil
2981
+ raise ::ArgumentError, "request must be provided" if request.nil?
2982
+
2983
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::HybridInspectDlpJobRequest
2984
+
2985
+ # Converts hash and nil to an options object
2986
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2987
+
2988
+ # Customize the options with defaults
2989
+ call_metadata = @config.rpcs.hybrid_inspect_dlp_job.metadata.to_h
2990
+
2991
+ # Set x-goog-api-client and x-goog-user-project headers
2992
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2993
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2994
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
2995
+ transports_version_send: [:rest]
2996
+
2997
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2998
+
2999
+ options.apply_defaults timeout: @config.rpcs.hybrid_inspect_dlp_job.timeout,
3000
+ metadata: call_metadata,
3001
+ retry_policy: @config.rpcs.hybrid_inspect_dlp_job.retry_policy
3002
+
3003
+ options.apply_defaults timeout: @config.timeout,
3004
+ metadata: @config.metadata,
3005
+ retry_policy: @config.retry_policy
3006
+
3007
+ @dlp_service_stub.hybrid_inspect_dlp_job request, options do |result, operation|
3008
+ yield result, operation if block_given?
3009
+ return result
3010
+ end
3011
+ rescue ::Gapic::Rest::Error => e
3012
+ raise ::Google::Cloud::Error.from_error(e)
3013
+ end
3014
+
3015
+ ##
3016
+ # Finish a running hybrid DlpJob. Triggers the finalization steps and running
3017
+ # of any enabled actions that have not yet run.
3018
+ #
3019
+ # @overload finish_dlp_job(request, options = nil)
3020
+ # Pass arguments to `finish_dlp_job` via a request object, either of type
3021
+ # {::Google::Cloud::Dlp::V2::FinishDlpJobRequest} or an equivalent Hash.
3022
+ #
3023
+ # @param request [::Google::Cloud::Dlp::V2::FinishDlpJobRequest, ::Hash]
3024
+ # A request object representing the call parameters. Required. To specify no
3025
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3026
+ # @param options [::Gapic::CallOptions, ::Hash]
3027
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3028
+ #
3029
+ # @overload finish_dlp_job(name: nil)
3030
+ # Pass arguments to `finish_dlp_job` via keyword arguments. Note that at
3031
+ # least one keyword argument is required. To specify no parameters, or to keep all
3032
+ # the default parameter values, pass an empty Hash as a request object (see above).
3033
+ #
3034
+ # @param name [::String]
3035
+ # Required. The name of the DlpJob resource to be cancelled.
3036
+ # @yield [result, operation] Access the result along with the TransportOperation object
3037
+ # @yieldparam result [::Google::Protobuf::Empty]
3038
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3039
+ #
3040
+ # @return [::Google::Protobuf::Empty]
3041
+ #
3042
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3043
+ def finish_dlp_job request, options = nil
3044
+ raise ::ArgumentError, "request must be provided" if request.nil?
3045
+
3046
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::FinishDlpJobRequest
3047
+
3048
+ # Converts hash and nil to an options object
3049
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3050
+
3051
+ # Customize the options with defaults
3052
+ call_metadata = @config.rpcs.finish_dlp_job.metadata.to_h
3053
+
3054
+ # Set x-goog-api-client and x-goog-user-project headers
3055
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3056
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3057
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
3058
+ transports_version_send: [:rest]
3059
+
3060
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3061
+
3062
+ options.apply_defaults timeout: @config.rpcs.finish_dlp_job.timeout,
3063
+ metadata: call_metadata,
3064
+ retry_policy: @config.rpcs.finish_dlp_job.retry_policy
3065
+
3066
+ options.apply_defaults timeout: @config.timeout,
3067
+ metadata: @config.metadata,
3068
+ retry_policy: @config.retry_policy
3069
+
3070
+ @dlp_service_stub.finish_dlp_job request, options do |result, operation|
3071
+ yield result, operation if block_given?
3072
+ return result
3073
+ end
3074
+ rescue ::Gapic::Rest::Error => e
3075
+ raise ::Google::Cloud::Error.from_error(e)
3076
+ end
3077
+
3078
+ ##
3079
+ # Configuration class for the DlpService REST API.
3080
+ #
3081
+ # This class represents the configuration for DlpService REST,
3082
+ # providing control over timeouts, retry behavior, logging, transport
3083
+ # parameters, and other low-level controls. Certain parameters can also be
3084
+ # applied individually to specific RPCs. See
3085
+ # {::Google::Cloud::Dlp::V2::DlpService::Rest::Client::Configuration::Rpcs}
3086
+ # for a list of RPCs that can be configured independently.
3087
+ #
3088
+ # Configuration can be applied globally to all clients, or to a single client
3089
+ # on construction.
3090
+ #
3091
+ # @example
3092
+ #
3093
+ # # Modify the global config, setting the timeout for
3094
+ # # inspect_content to 20 seconds,
3095
+ # # and all remaining timeouts to 10 seconds.
3096
+ # ::Google::Cloud::Dlp::V2::DlpService::Rest::Client.configure do |config|
3097
+ # config.timeout = 10.0
3098
+ # config.rpcs.inspect_content.timeout = 20.0
3099
+ # end
3100
+ #
3101
+ # # Apply the above configuration only to a new client.
3102
+ # client = ::Google::Cloud::Dlp::V2::DlpService::Rest::Client.new do |config|
3103
+ # config.timeout = 10.0
3104
+ # config.rpcs.inspect_content.timeout = 20.0
3105
+ # end
3106
+ #
3107
+ # @!attribute [rw] endpoint
3108
+ # The hostname or hostname:port of the service endpoint.
3109
+ # Defaults to `"dlp.googleapis.com"`.
3110
+ # @return [::String]
3111
+ # @!attribute [rw] credentials
3112
+ # Credentials to send with calls. You may provide any of the following types:
3113
+ # * (`String`) The path to a service account key file in JSON format
3114
+ # * (`Hash`) A service account key as a Hash
3115
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
3116
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
3117
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
3118
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
3119
+ # * (`nil`) indicating no credentials
3120
+ # @return [::Object]
3121
+ # @!attribute [rw] scope
3122
+ # The OAuth scopes
3123
+ # @return [::Array<::String>]
3124
+ # @!attribute [rw] lib_name
3125
+ # The library name as recorded in instrumentation and logging
3126
+ # @return [::String]
3127
+ # @!attribute [rw] lib_version
3128
+ # The library version as recorded in instrumentation and logging
3129
+ # @return [::String]
3130
+ # @!attribute [rw] timeout
3131
+ # The call timeout in seconds.
3132
+ # @return [::Numeric]
3133
+ # @!attribute [rw] metadata
3134
+ # Additional headers to be sent with the call.
3135
+ # @return [::Hash{::Symbol=>::String}]
3136
+ # @!attribute [rw] retry_policy
3137
+ # The retry policy. The value is a hash with the following keys:
3138
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
3139
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
3140
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
3141
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
3142
+ # trigger a retry.
3143
+ # @return [::Hash]
3144
+ # @!attribute [rw] quota_project
3145
+ # A separate project against which to charge quota.
3146
+ # @return [::String]
3147
+ #
3148
+ class Configuration
3149
+ extend ::Gapic::Config
3150
+
3151
+ DEFAULT_ENDPOINT = "dlp.googleapis.com"
3152
+
3153
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
3154
+ config_attr :credentials, nil do |value|
3155
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
3156
+ allowed.any? { |klass| klass === value }
3157
+ end
3158
+ config_attr :scope, nil, ::String, ::Array, nil
3159
+ config_attr :lib_name, nil, ::String, nil
3160
+ config_attr :lib_version, nil, ::String, nil
3161
+ config_attr :timeout, nil, ::Numeric, nil
3162
+ config_attr :metadata, nil, ::Hash, nil
3163
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
3164
+ config_attr :quota_project, nil, ::String, nil
3165
+
3166
+ # @private
3167
+ def initialize parent_config = nil
3168
+ @parent_config = parent_config unless parent_config.nil?
3169
+
3170
+ yield self if block_given?
3171
+ end
3172
+
3173
+ ##
3174
+ # Configurations for individual RPCs
3175
+ # @return [Rpcs]
3176
+ #
3177
+ def rpcs
3178
+ @rpcs ||= begin
3179
+ parent_rpcs = nil
3180
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
3181
+ Rpcs.new parent_rpcs
3182
+ end
3183
+ end
3184
+
3185
+ ##
3186
+ # Configuration RPC class for the DlpService API.
3187
+ #
3188
+ # Includes fields providing the configuration for each RPC in this service.
3189
+ # Each configuration object is of type `Gapic::Config::Method` and includes
3190
+ # the following configuration fields:
3191
+ #
3192
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
3193
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
3194
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
3195
+ # include the following keys:
3196
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
3197
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
3198
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
3199
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
3200
+ # trigger a retry.
3201
+ #
3202
+ class Rpcs
3203
+ ##
3204
+ # RPC-specific configuration for `inspect_content`
3205
+ # @return [::Gapic::Config::Method]
3206
+ #
3207
+ attr_reader :inspect_content
3208
+ ##
3209
+ # RPC-specific configuration for `redact_image`
3210
+ # @return [::Gapic::Config::Method]
3211
+ #
3212
+ attr_reader :redact_image
3213
+ ##
3214
+ # RPC-specific configuration for `deidentify_content`
3215
+ # @return [::Gapic::Config::Method]
3216
+ #
3217
+ attr_reader :deidentify_content
3218
+ ##
3219
+ # RPC-specific configuration for `reidentify_content`
3220
+ # @return [::Gapic::Config::Method]
3221
+ #
3222
+ attr_reader :reidentify_content
3223
+ ##
3224
+ # RPC-specific configuration for `list_info_types`
3225
+ # @return [::Gapic::Config::Method]
3226
+ #
3227
+ attr_reader :list_info_types
3228
+ ##
3229
+ # RPC-specific configuration for `create_inspect_template`
3230
+ # @return [::Gapic::Config::Method]
3231
+ #
3232
+ attr_reader :create_inspect_template
3233
+ ##
3234
+ # RPC-specific configuration for `update_inspect_template`
3235
+ # @return [::Gapic::Config::Method]
3236
+ #
3237
+ attr_reader :update_inspect_template
3238
+ ##
3239
+ # RPC-specific configuration for `get_inspect_template`
3240
+ # @return [::Gapic::Config::Method]
3241
+ #
3242
+ attr_reader :get_inspect_template
3243
+ ##
3244
+ # RPC-specific configuration for `list_inspect_templates`
3245
+ # @return [::Gapic::Config::Method]
3246
+ #
3247
+ attr_reader :list_inspect_templates
3248
+ ##
3249
+ # RPC-specific configuration for `delete_inspect_template`
3250
+ # @return [::Gapic::Config::Method]
3251
+ #
3252
+ attr_reader :delete_inspect_template
3253
+ ##
3254
+ # RPC-specific configuration for `create_deidentify_template`
3255
+ # @return [::Gapic::Config::Method]
3256
+ #
3257
+ attr_reader :create_deidentify_template
3258
+ ##
3259
+ # RPC-specific configuration for `update_deidentify_template`
3260
+ # @return [::Gapic::Config::Method]
3261
+ #
3262
+ attr_reader :update_deidentify_template
3263
+ ##
3264
+ # RPC-specific configuration for `get_deidentify_template`
3265
+ # @return [::Gapic::Config::Method]
3266
+ #
3267
+ attr_reader :get_deidentify_template
3268
+ ##
3269
+ # RPC-specific configuration for `list_deidentify_templates`
3270
+ # @return [::Gapic::Config::Method]
3271
+ #
3272
+ attr_reader :list_deidentify_templates
3273
+ ##
3274
+ # RPC-specific configuration for `delete_deidentify_template`
3275
+ # @return [::Gapic::Config::Method]
3276
+ #
3277
+ attr_reader :delete_deidentify_template
3278
+ ##
3279
+ # RPC-specific configuration for `create_job_trigger`
3280
+ # @return [::Gapic::Config::Method]
3281
+ #
3282
+ attr_reader :create_job_trigger
3283
+ ##
3284
+ # RPC-specific configuration for `update_job_trigger`
3285
+ # @return [::Gapic::Config::Method]
3286
+ #
3287
+ attr_reader :update_job_trigger
3288
+ ##
3289
+ # RPC-specific configuration for `hybrid_inspect_job_trigger`
3290
+ # @return [::Gapic::Config::Method]
3291
+ #
3292
+ attr_reader :hybrid_inspect_job_trigger
3293
+ ##
3294
+ # RPC-specific configuration for `get_job_trigger`
3295
+ # @return [::Gapic::Config::Method]
3296
+ #
3297
+ attr_reader :get_job_trigger
3298
+ ##
3299
+ # RPC-specific configuration for `list_job_triggers`
3300
+ # @return [::Gapic::Config::Method]
3301
+ #
3302
+ attr_reader :list_job_triggers
3303
+ ##
3304
+ # RPC-specific configuration for `delete_job_trigger`
3305
+ # @return [::Gapic::Config::Method]
3306
+ #
3307
+ attr_reader :delete_job_trigger
3308
+ ##
3309
+ # RPC-specific configuration for `activate_job_trigger`
3310
+ # @return [::Gapic::Config::Method]
3311
+ #
3312
+ attr_reader :activate_job_trigger
3313
+ ##
3314
+ # RPC-specific configuration for `create_dlp_job`
3315
+ # @return [::Gapic::Config::Method]
3316
+ #
3317
+ attr_reader :create_dlp_job
3318
+ ##
3319
+ # RPC-specific configuration for `list_dlp_jobs`
3320
+ # @return [::Gapic::Config::Method]
3321
+ #
3322
+ attr_reader :list_dlp_jobs
3323
+ ##
3324
+ # RPC-specific configuration for `get_dlp_job`
3325
+ # @return [::Gapic::Config::Method]
3326
+ #
3327
+ attr_reader :get_dlp_job
3328
+ ##
3329
+ # RPC-specific configuration for `delete_dlp_job`
3330
+ # @return [::Gapic::Config::Method]
3331
+ #
3332
+ attr_reader :delete_dlp_job
3333
+ ##
3334
+ # RPC-specific configuration for `cancel_dlp_job`
3335
+ # @return [::Gapic::Config::Method]
3336
+ #
3337
+ attr_reader :cancel_dlp_job
3338
+ ##
3339
+ # RPC-specific configuration for `create_stored_info_type`
3340
+ # @return [::Gapic::Config::Method]
3341
+ #
3342
+ attr_reader :create_stored_info_type
3343
+ ##
3344
+ # RPC-specific configuration for `update_stored_info_type`
3345
+ # @return [::Gapic::Config::Method]
3346
+ #
3347
+ attr_reader :update_stored_info_type
3348
+ ##
3349
+ # RPC-specific configuration for `get_stored_info_type`
3350
+ # @return [::Gapic::Config::Method]
3351
+ #
3352
+ attr_reader :get_stored_info_type
3353
+ ##
3354
+ # RPC-specific configuration for `list_stored_info_types`
3355
+ # @return [::Gapic::Config::Method]
3356
+ #
3357
+ attr_reader :list_stored_info_types
3358
+ ##
3359
+ # RPC-specific configuration for `delete_stored_info_type`
3360
+ # @return [::Gapic::Config::Method]
3361
+ #
3362
+ attr_reader :delete_stored_info_type
3363
+ ##
3364
+ # RPC-specific configuration for `hybrid_inspect_dlp_job`
3365
+ # @return [::Gapic::Config::Method]
3366
+ #
3367
+ attr_reader :hybrid_inspect_dlp_job
3368
+ ##
3369
+ # RPC-specific configuration for `finish_dlp_job`
3370
+ # @return [::Gapic::Config::Method]
3371
+ #
3372
+ attr_reader :finish_dlp_job
3373
+
3374
+ # @private
3375
+ def initialize parent_rpcs = nil
3376
+ inspect_content_config = parent_rpcs.inspect_content if parent_rpcs.respond_to? :inspect_content
3377
+ @inspect_content = ::Gapic::Config::Method.new inspect_content_config
3378
+ redact_image_config = parent_rpcs.redact_image if parent_rpcs.respond_to? :redact_image
3379
+ @redact_image = ::Gapic::Config::Method.new redact_image_config
3380
+ deidentify_content_config = parent_rpcs.deidentify_content if parent_rpcs.respond_to? :deidentify_content
3381
+ @deidentify_content = ::Gapic::Config::Method.new deidentify_content_config
3382
+ reidentify_content_config = parent_rpcs.reidentify_content if parent_rpcs.respond_to? :reidentify_content
3383
+ @reidentify_content = ::Gapic::Config::Method.new reidentify_content_config
3384
+ list_info_types_config = parent_rpcs.list_info_types if parent_rpcs.respond_to? :list_info_types
3385
+ @list_info_types = ::Gapic::Config::Method.new list_info_types_config
3386
+ create_inspect_template_config = parent_rpcs.create_inspect_template if parent_rpcs.respond_to? :create_inspect_template
3387
+ @create_inspect_template = ::Gapic::Config::Method.new create_inspect_template_config
3388
+ update_inspect_template_config = parent_rpcs.update_inspect_template if parent_rpcs.respond_to? :update_inspect_template
3389
+ @update_inspect_template = ::Gapic::Config::Method.new update_inspect_template_config
3390
+ get_inspect_template_config = parent_rpcs.get_inspect_template if parent_rpcs.respond_to? :get_inspect_template
3391
+ @get_inspect_template = ::Gapic::Config::Method.new get_inspect_template_config
3392
+ list_inspect_templates_config = parent_rpcs.list_inspect_templates if parent_rpcs.respond_to? :list_inspect_templates
3393
+ @list_inspect_templates = ::Gapic::Config::Method.new list_inspect_templates_config
3394
+ delete_inspect_template_config = parent_rpcs.delete_inspect_template if parent_rpcs.respond_to? :delete_inspect_template
3395
+ @delete_inspect_template = ::Gapic::Config::Method.new delete_inspect_template_config
3396
+ create_deidentify_template_config = parent_rpcs.create_deidentify_template if parent_rpcs.respond_to? :create_deidentify_template
3397
+ @create_deidentify_template = ::Gapic::Config::Method.new create_deidentify_template_config
3398
+ update_deidentify_template_config = parent_rpcs.update_deidentify_template if parent_rpcs.respond_to? :update_deidentify_template
3399
+ @update_deidentify_template = ::Gapic::Config::Method.new update_deidentify_template_config
3400
+ get_deidentify_template_config = parent_rpcs.get_deidentify_template if parent_rpcs.respond_to? :get_deidentify_template
3401
+ @get_deidentify_template = ::Gapic::Config::Method.new get_deidentify_template_config
3402
+ list_deidentify_templates_config = parent_rpcs.list_deidentify_templates if parent_rpcs.respond_to? :list_deidentify_templates
3403
+ @list_deidentify_templates = ::Gapic::Config::Method.new list_deidentify_templates_config
3404
+ delete_deidentify_template_config = parent_rpcs.delete_deidentify_template if parent_rpcs.respond_to? :delete_deidentify_template
3405
+ @delete_deidentify_template = ::Gapic::Config::Method.new delete_deidentify_template_config
3406
+ create_job_trigger_config = parent_rpcs.create_job_trigger if parent_rpcs.respond_to? :create_job_trigger
3407
+ @create_job_trigger = ::Gapic::Config::Method.new create_job_trigger_config
3408
+ update_job_trigger_config = parent_rpcs.update_job_trigger if parent_rpcs.respond_to? :update_job_trigger
3409
+ @update_job_trigger = ::Gapic::Config::Method.new update_job_trigger_config
3410
+ hybrid_inspect_job_trigger_config = parent_rpcs.hybrid_inspect_job_trigger if parent_rpcs.respond_to? :hybrid_inspect_job_trigger
3411
+ @hybrid_inspect_job_trigger = ::Gapic::Config::Method.new hybrid_inspect_job_trigger_config
3412
+ get_job_trigger_config = parent_rpcs.get_job_trigger if parent_rpcs.respond_to? :get_job_trigger
3413
+ @get_job_trigger = ::Gapic::Config::Method.new get_job_trigger_config
3414
+ list_job_triggers_config = parent_rpcs.list_job_triggers if parent_rpcs.respond_to? :list_job_triggers
3415
+ @list_job_triggers = ::Gapic::Config::Method.new list_job_triggers_config
3416
+ delete_job_trigger_config = parent_rpcs.delete_job_trigger if parent_rpcs.respond_to? :delete_job_trigger
3417
+ @delete_job_trigger = ::Gapic::Config::Method.new delete_job_trigger_config
3418
+ activate_job_trigger_config = parent_rpcs.activate_job_trigger if parent_rpcs.respond_to? :activate_job_trigger
3419
+ @activate_job_trigger = ::Gapic::Config::Method.new activate_job_trigger_config
3420
+ create_dlp_job_config = parent_rpcs.create_dlp_job if parent_rpcs.respond_to? :create_dlp_job
3421
+ @create_dlp_job = ::Gapic::Config::Method.new create_dlp_job_config
3422
+ list_dlp_jobs_config = parent_rpcs.list_dlp_jobs if parent_rpcs.respond_to? :list_dlp_jobs
3423
+ @list_dlp_jobs = ::Gapic::Config::Method.new list_dlp_jobs_config
3424
+ get_dlp_job_config = parent_rpcs.get_dlp_job if parent_rpcs.respond_to? :get_dlp_job
3425
+ @get_dlp_job = ::Gapic::Config::Method.new get_dlp_job_config
3426
+ delete_dlp_job_config = parent_rpcs.delete_dlp_job if parent_rpcs.respond_to? :delete_dlp_job
3427
+ @delete_dlp_job = ::Gapic::Config::Method.new delete_dlp_job_config
3428
+ cancel_dlp_job_config = parent_rpcs.cancel_dlp_job if parent_rpcs.respond_to? :cancel_dlp_job
3429
+ @cancel_dlp_job = ::Gapic::Config::Method.new cancel_dlp_job_config
3430
+ create_stored_info_type_config = parent_rpcs.create_stored_info_type if parent_rpcs.respond_to? :create_stored_info_type
3431
+ @create_stored_info_type = ::Gapic::Config::Method.new create_stored_info_type_config
3432
+ update_stored_info_type_config = parent_rpcs.update_stored_info_type if parent_rpcs.respond_to? :update_stored_info_type
3433
+ @update_stored_info_type = ::Gapic::Config::Method.new update_stored_info_type_config
3434
+ get_stored_info_type_config = parent_rpcs.get_stored_info_type if parent_rpcs.respond_to? :get_stored_info_type
3435
+ @get_stored_info_type = ::Gapic::Config::Method.new get_stored_info_type_config
3436
+ list_stored_info_types_config = parent_rpcs.list_stored_info_types if parent_rpcs.respond_to? :list_stored_info_types
3437
+ @list_stored_info_types = ::Gapic::Config::Method.new list_stored_info_types_config
3438
+ delete_stored_info_type_config = parent_rpcs.delete_stored_info_type if parent_rpcs.respond_to? :delete_stored_info_type
3439
+ @delete_stored_info_type = ::Gapic::Config::Method.new delete_stored_info_type_config
3440
+ hybrid_inspect_dlp_job_config = parent_rpcs.hybrid_inspect_dlp_job if parent_rpcs.respond_to? :hybrid_inspect_dlp_job
3441
+ @hybrid_inspect_dlp_job = ::Gapic::Config::Method.new hybrid_inspect_dlp_job_config
3442
+ finish_dlp_job_config = parent_rpcs.finish_dlp_job if parent_rpcs.respond_to? :finish_dlp_job
3443
+ @finish_dlp_job = ::Gapic::Config::Method.new finish_dlp_job_config
3444
+
3445
+ yield self if block_given?
3446
+ end
3447
+ end
3448
+ end
3449
+ end
3450
+ end
3451
+ end
3452
+ end
3453
+ end
3454
+ end
3455
+ end