google-cloud-dlp 0.4.0 → 0.5.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 644a89d5eac5e54e20c7d6d81cdf261776529518e5f4ce6f17763f7e338f673e
4
- data.tar.gz: 1959d2073e6c41f6dcefa28f243b211fc1786a3d1a7a052483b10ac6659ffd4b
3
+ metadata.gz: 6ab118ba23474f0985aa17a8d40f0c46e1cad6546fdb0a3235c0e4393dddd29a
4
+ data.tar.gz: c3edbdbb0da5699710753b1417067bcf8ed4fffa97e2ccf1bfcecb260518c31a
5
5
  SHA512:
6
- metadata.gz: 62aa3abcc43aa35af82812ebb1c086d822f7edf793eac7345bafa05568ad98c1d0ad09fbc1ddf9a2865e2cea8f39c5f246bed7145827075f01887cfbc5d0770b
7
- data.tar.gz: 4668b1b7581c3cda086faf3aec44752cc36a183c14c238527a21091cd882538168c9800651b172ae6c1d902796d90b0926ea70e1f8637a3415ec69c98a4dcfc8
6
+ metadata.gz: 2054d42975ea736241c46b960e798dd71ca6713a1022c6979d24cd3c9f8fdfa62761358e8b1750d11703ab02fd2a688beda64a380bb7fe2a1033962867c0650b
7
+ data.tar.gz: a88152e7d89201a27c58c26384975102f7de1d1f542dfde3f5aaf26f7662e302021b712bf3bfa905c69c16fd19271921fec0033cd2bb8494ffd930e49e250a20
data/README.md CHANGED
@@ -59,5 +59,38 @@ response = dlp.inspect_content parent,
59
59
  - View this [repository's main README](https://github.com/GoogleCloudPlatform/google-cloud-ruby/blob/master/README.md)
60
60
  to see the full list of Cloud APIs that we cover.
61
61
 
62
+ ## Enabling Logging
63
+
64
+ To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below, or a [`Google::Cloud::Logging::Logger`](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-logging/latest/google/cloud/logging/logger) that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
65
+
66
+ Configuring a Ruby stdlib logger:
67
+
68
+ ```ruby
69
+ require "logger"
70
+
71
+ module MyLogger
72
+ LOGGER = Logger.new $stderr, level: Logger::WARN
73
+ def logger
74
+ LOGGER
75
+ end
76
+ end
77
+
78
+ # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
79
+ module GRPC
80
+ extend MyLogger
81
+ end
82
+ ```
83
+
84
+ ## Supported Ruby Versions
85
+
86
+ This library is supported on Ruby 2.0+.
87
+
88
+ However, Ruby 2.3 or later is strongly recommended, as earlier releases have
89
+ reached or are nearing end-of-life. After June 1, 2018, Google will provide
90
+ official support only for Ruby versions that are considered current and
91
+ supported by Ruby Core (that is, Ruby versions that are either in normal
92
+ maintenance or in security maintenance).
93
+ See https://www.ruby-lang.org/en/downloads/branches/ for further details.
94
+
62
95
  [Client Library Documentation]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-dlp/latest/google/privacy/dlp/v2
63
96
  [Product Documentation]: https://cloud.google.com/dlp
@@ -60,6 +60,34 @@ module Google
60
60
  #
61
61
  # [Product Documentation]: https://cloud.google.com/dlp
62
62
  #
63
+ # ## Enabling Logging
64
+ #
65
+ # To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
66
+ # The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below,
67
+ # or a [`Google::Cloud::Logging::Logger`](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-logging/latest/google/cloud/logging/logger)
68
+ # that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
69
+ # and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
70
+ #
71
+ # Configuring a Ruby stdlib logger:
72
+ #
73
+ # ```ruby
74
+ # require "logger"
75
+ #
76
+ # module MyLogger
77
+ # LOGGER = Logger.new $stderr, level: Logger::WARN
78
+ # def logger
79
+ # LOGGER
80
+ # end
81
+ # end
82
+ #
83
+ # # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
84
+ # module GRPC
85
+ # extend MyLogger
86
+ # end
87
+ # ```
88
+ #
89
+ # [Product Documentation]: https://cloud.google.com/dlp
90
+ #
63
91
  #
64
92
  module Dlp
65
93
  # rubocop:enable LineLength
@@ -80,6 +108,9 @@ module Google
80
108
  # The service also includes methods for sensitive data redaction and
81
109
  # scheduling of data scans on Google Cloud Platform based data sets.
82
110
  #
111
+ # To learn more about concepts and find how-to guides see
112
+ # https://cloud.google.com/dlp/docs/.
113
+ #
83
114
  # @param version [Symbol, String]
84
115
  # The major version of the service to be used. By default :v2
85
116
  # is used.
@@ -108,6 +139,11 @@ module Google
108
139
  # or the specified config is missing data points.
109
140
  # @param timeout [Numeric]
110
141
  # The default timeout, in seconds, for calls made through this client.
142
+ # @param metadata [Hash]
143
+ # Default metadata to be sent with each request. This can be overridden on a per call basis.
144
+ # @param exception_transformer [Proc]
145
+ # An optional proc that intercepts any exceptions raised during an API call to inject
146
+ # custom error handling.
111
147
  def self.new(*args, version: :v2, **kwargs)
112
148
  unless AVAILABLE_VERSIONS.include?(version.to_s.downcase)
113
149
  raise "The version: #{version} is not available. The available versions " \
@@ -44,6 +44,31 @@ module Google
44
44
  #
45
45
  # [Product Documentation]: https://cloud.google.com/dlp
46
46
  #
47
+ # ## Enabling Logging
48
+ #
49
+ # To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
50
+ # The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below,
51
+ # or a [`Google::Cloud::Logging::Logger`](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-logging/latest/google/cloud/logging/logger)
52
+ # that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
53
+ # and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
54
+ #
55
+ # Configuring a Ruby stdlib logger:
56
+ #
57
+ # ```ruby
58
+ # require "logger"
59
+ #
60
+ # module MyLogger
61
+ # LOGGER = Logger.new $stderr, level: Logger::WARN
62
+ # def logger
63
+ # LOGGER
64
+ # end
65
+ # end
66
+ #
67
+ # # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
68
+ # module GRPC
69
+ # extend MyLogger
70
+ # end
71
+ # ```
47
72
  #
48
73
  module Dlp
49
74
  module V2
@@ -57,6 +82,9 @@ module Google
57
82
  # The service also includes methods for sensitive data redaction and
58
83
  # scheduling of data scans on Google Cloud Platform based data sets.
59
84
  #
85
+ # To learn more about concepts and find how-to guides see
86
+ # https://cloud.google.com/dlp/docs/.
87
+ #
60
88
  # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
61
89
  # Provides the means for authenticating requests made by the client. This parameter can
62
90
  # be many types.
@@ -81,11 +109,18 @@ module Google
81
109
  # or the specified config is missing data points.
82
110
  # @param timeout [Numeric]
83
111
  # The default timeout, in seconds, for calls made through this client.
112
+ # @param metadata [Hash]
113
+ # Default metadata to be sent with each request. This can be overridden on a per call basis.
114
+ # @param exception_transformer [Proc]
115
+ # An optional proc that intercepts any exceptions raised during an API call to inject
116
+ # custom error handling.
84
117
  def self.new \
85
118
  credentials: nil,
86
119
  scopes: nil,
87
120
  client_config: nil,
88
121
  timeout: nil,
122
+ metadata: nil,
123
+ exception_transformer: nil,
89
124
  lib_name: nil,
90
125
  lib_version: nil
91
126
  kwargs = {
@@ -93,6 +128,8 @@ module Google
93
128
  scopes: scopes,
94
129
  client_config: client_config,
95
130
  timeout: timeout,
131
+ metadata: metadata,
132
+ exception_transformer: exception_transformer,
96
133
  lib_name: lib_name,
97
134
  lib_version: lib_version
98
135
  }.select { |_, v| v != nil }
@@ -0,0 +1,40 @@
1
+ # Copyright 2018 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require "googleauth"
16
+
17
+ module Google
18
+ module Cloud
19
+ module Dlp
20
+ module V2
21
+ class Credentials < Google::Auth::Credentials
22
+ SCOPE = [
23
+ "https://www.googleapis.com/auth/cloud-platform"
24
+ ].freeze
25
+ PATH_ENV_VARS = %w(DLP_KEYFILE
26
+ DLP_CREDENTIALS
27
+ GOOGLE_CLOUD_CREDENTIALS
28
+ GOOGLE_CLOUD_KEYFILE
29
+ GCLOUD_KEYFILE)
30
+ JSON_ENV_VARS = %w(DLP_KEYFILE_JSON
31
+ DLP_CREDENTIALS_JSON
32
+ GOOGLE_CLOUD_CREDENTIALS_JSON
33
+ GOOGLE_CLOUD_KEYFILE_JSON
34
+ GCLOUD_KEYFILE_JSON)
35
+ DEFAULT_PATHS = ["~/.config/gcloud/application_default_credentials.json"]
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -25,7 +25,7 @@ require "pathname"
25
25
  require "google/gax"
26
26
 
27
27
  require "google/privacy/dlp/v2/dlp_pb"
28
- require "google/cloud/dlp/credentials"
28
+ require "google/cloud/dlp/v2/credentials"
29
29
 
30
30
  module Google
31
31
  module Cloud
@@ -38,6 +38,9 @@ module Google
38
38
  # The service also includes methods for sensitive data redaction and
39
39
  # scheduling of data scans on Google Cloud Platform based data sets.
40
40
  #
41
+ # To learn more about concepts and find how-to guides see
42
+ # https://cloud.google.com/dlp/docs/.
43
+ #
41
44
  # @!attribute [r] dlp_service_stub
42
45
  # @return [Google::Privacy::Dlp::V2::DlpService::Stub]
43
46
  class DlpServiceClient
@@ -49,6 +52,9 @@ module Google
49
52
  # The default port of the service.
50
53
  DEFAULT_SERVICE_PORT = 443
51
54
 
55
+ # The default set of gRPC interceptors.
56
+ GRPC_INTERCEPTORS = []
57
+
52
58
  DEFAULT_TIMEOUT = 30
53
59
 
54
60
  PAGE_DESCRIPTORS = {
@@ -235,11 +241,18 @@ module Google
235
241
  # or the specified config is missing data points.
236
242
  # @param timeout [Numeric]
237
243
  # The default timeout, in seconds, for calls made through this client.
244
+ # @param metadata [Hash]
245
+ # Default metadata to be sent with each request. This can be overridden on a per call basis.
246
+ # @param exception_transformer [Proc]
247
+ # An optional proc that intercepts any exceptions raised during an API call to inject
248
+ # custom error handling.
238
249
  def initialize \
239
250
  credentials: nil,
240
251
  scopes: ALL_SCOPES,
241
252
  client_config: {},
242
253
  timeout: DEFAULT_TIMEOUT,
254
+ metadata: nil,
255
+ exception_transformer: nil,
243
256
  lib_name: nil,
244
257
  lib_version: ""
245
258
  # These require statements are intentionally placed here to initialize
@@ -248,10 +261,10 @@ module Google
248
261
  require "google/gax/grpc"
249
262
  require "google/privacy/dlp/v2/dlp_services_pb"
250
263
 
251
- credentials ||= Google::Cloud::Dlp::Credentials.default
264
+ credentials ||= Google::Cloud::Dlp::V2::Credentials.default
252
265
 
253
266
  if credentials.is_a?(String) || credentials.is_a?(Hash)
254
- updater_proc = Google::Cloud::Dlp::Credentials.new(credentials).updater_proc
267
+ updater_proc = Google::Cloud::Dlp::V2::Credentials.new(credentials).updater_proc
255
268
  end
256
269
  if credentials.is_a?(GRPC::Core::Channel)
257
270
  channel = credentials
@@ -275,6 +288,7 @@ module Google
275
288
  google_api_client.freeze
276
289
 
277
290
  headers = { :"x-goog-api-client" => google_api_client }
291
+ headers.merge!(metadata) unless metadata.nil?
278
292
  client_config_file = Pathname.new(__dir__).join(
279
293
  "dlp_service_client_config.json"
280
294
  )
@@ -287,13 +301,14 @@ module Google
287
301
  timeout,
288
302
  page_descriptors: PAGE_DESCRIPTORS,
289
303
  errors: Google::Gax::Grpc::API_ERRORS,
290
- kwargs: headers
304
+ metadata: headers
291
305
  )
292
306
  end
293
307
 
294
308
  # Allow overriding the service path/port in subclasses.
295
309
  service_path = self.class::SERVICE_ADDRESS
296
310
  port = self.class::DEFAULT_SERVICE_PORT
311
+ interceptors = self.class::GRPC_INTERCEPTORS
297
312
  @dlp_service_stub = Google::Gax::Grpc.create_stub(
298
313
  service_path,
299
314
  port,
@@ -301,108 +316,134 @@ module Google
301
316
  channel: channel,
302
317
  updater_proc: updater_proc,
303
318
  scopes: scopes,
319
+ interceptors: interceptors,
304
320
  &Google::Privacy::Dlp::V2::DlpService::Stub.method(:new)
305
321
  )
306
322
 
307
323
  @inspect_content = Google::Gax.create_api_call(
308
324
  @dlp_service_stub.method(:inspect_content),
309
- defaults["inspect_content"]
325
+ defaults["inspect_content"],
326
+ exception_transformer: exception_transformer
310
327
  )
311
328
  @redact_image = Google::Gax.create_api_call(
312
329
  @dlp_service_stub.method(:redact_image),
313
- defaults["redact_image"]
330
+ defaults["redact_image"],
331
+ exception_transformer: exception_transformer
314
332
  )
315
333
  @deidentify_content = Google::Gax.create_api_call(
316
334
  @dlp_service_stub.method(:deidentify_content),
317
- defaults["deidentify_content"]
335
+ defaults["deidentify_content"],
336
+ exception_transformer: exception_transformer
318
337
  )
319
338
  @reidentify_content = Google::Gax.create_api_call(
320
339
  @dlp_service_stub.method(:reidentify_content),
321
- defaults["reidentify_content"]
340
+ defaults["reidentify_content"],
341
+ exception_transformer: exception_transformer
322
342
  )
323
343
  @list_info_types = Google::Gax.create_api_call(
324
344
  @dlp_service_stub.method(:list_info_types),
325
- defaults["list_info_types"]
345
+ defaults["list_info_types"],
346
+ exception_transformer: exception_transformer
326
347
  )
327
348
  @create_inspect_template = Google::Gax.create_api_call(
328
349
  @dlp_service_stub.method(:create_inspect_template),
329
- defaults["create_inspect_template"]
350
+ defaults["create_inspect_template"],
351
+ exception_transformer: exception_transformer
330
352
  )
331
353
  @update_inspect_template = Google::Gax.create_api_call(
332
354
  @dlp_service_stub.method(:update_inspect_template),
333
- defaults["update_inspect_template"]
355
+ defaults["update_inspect_template"],
356
+ exception_transformer: exception_transformer
334
357
  )
335
358
  @get_inspect_template = Google::Gax.create_api_call(
336
359
  @dlp_service_stub.method(:get_inspect_template),
337
- defaults["get_inspect_template"]
360
+ defaults["get_inspect_template"],
361
+ exception_transformer: exception_transformer
338
362
  )
339
363
  @list_inspect_templates = Google::Gax.create_api_call(
340
364
  @dlp_service_stub.method(:list_inspect_templates),
341
- defaults["list_inspect_templates"]
365
+ defaults["list_inspect_templates"],
366
+ exception_transformer: exception_transformer
342
367
  )
343
368
  @delete_inspect_template = Google::Gax.create_api_call(
344
369
  @dlp_service_stub.method(:delete_inspect_template),
345
- defaults["delete_inspect_template"]
370
+ defaults["delete_inspect_template"],
371
+ exception_transformer: exception_transformer
346
372
  )
347
373
  @create_deidentify_template = Google::Gax.create_api_call(
348
374
  @dlp_service_stub.method(:create_deidentify_template),
349
- defaults["create_deidentify_template"]
375
+ defaults["create_deidentify_template"],
376
+ exception_transformer: exception_transformer
350
377
  )
351
378
  @update_deidentify_template = Google::Gax.create_api_call(
352
379
  @dlp_service_stub.method(:update_deidentify_template),
353
- defaults["update_deidentify_template"]
380
+ defaults["update_deidentify_template"],
381
+ exception_transformer: exception_transformer
354
382
  )
355
383
  @get_deidentify_template = Google::Gax.create_api_call(
356
384
  @dlp_service_stub.method(:get_deidentify_template),
357
- defaults["get_deidentify_template"]
385
+ defaults["get_deidentify_template"],
386
+ exception_transformer: exception_transformer
358
387
  )
359
388
  @list_deidentify_templates = Google::Gax.create_api_call(
360
389
  @dlp_service_stub.method(:list_deidentify_templates),
361
- defaults["list_deidentify_templates"]
390
+ defaults["list_deidentify_templates"],
391
+ exception_transformer: exception_transformer
362
392
  )
363
393
  @delete_deidentify_template = Google::Gax.create_api_call(
364
394
  @dlp_service_stub.method(:delete_deidentify_template),
365
- defaults["delete_deidentify_template"]
395
+ defaults["delete_deidentify_template"],
396
+ exception_transformer: exception_transformer
366
397
  )
367
398
  @create_dlp_job = Google::Gax.create_api_call(
368
399
  @dlp_service_stub.method(:create_dlp_job),
369
- defaults["create_dlp_job"]
400
+ defaults["create_dlp_job"],
401
+ exception_transformer: exception_transformer
370
402
  )
371
403
  @list_dlp_jobs = Google::Gax.create_api_call(
372
404
  @dlp_service_stub.method(:list_dlp_jobs),
373
- defaults["list_dlp_jobs"]
405
+ defaults["list_dlp_jobs"],
406
+ exception_transformer: exception_transformer
374
407
  )
375
408
  @get_dlp_job = Google::Gax.create_api_call(
376
409
  @dlp_service_stub.method(:get_dlp_job),
377
- defaults["get_dlp_job"]
410
+ defaults["get_dlp_job"],
411
+ exception_transformer: exception_transformer
378
412
  )
379
413
  @delete_dlp_job = Google::Gax.create_api_call(
380
414
  @dlp_service_stub.method(:delete_dlp_job),
381
- defaults["delete_dlp_job"]
415
+ defaults["delete_dlp_job"],
416
+ exception_transformer: exception_transformer
382
417
  )
383
418
  @cancel_dlp_job = Google::Gax.create_api_call(
384
419
  @dlp_service_stub.method(:cancel_dlp_job),
385
- defaults["cancel_dlp_job"]
420
+ defaults["cancel_dlp_job"],
421
+ exception_transformer: exception_transformer
386
422
  )
387
423
  @list_job_triggers = Google::Gax.create_api_call(
388
424
  @dlp_service_stub.method(:list_job_triggers),
389
- defaults["list_job_triggers"]
425
+ defaults["list_job_triggers"],
426
+ exception_transformer: exception_transformer
390
427
  )
391
428
  @get_job_trigger = Google::Gax.create_api_call(
392
429
  @dlp_service_stub.method(:get_job_trigger),
393
- defaults["get_job_trigger"]
430
+ defaults["get_job_trigger"],
431
+ exception_transformer: exception_transformer
394
432
  )
395
433
  @delete_job_trigger = Google::Gax.create_api_call(
396
434
  @dlp_service_stub.method(:delete_job_trigger),
397
- defaults["delete_job_trigger"]
435
+ defaults["delete_job_trigger"],
436
+ exception_transformer: exception_transformer
398
437
  )
399
438
  @update_job_trigger = Google::Gax.create_api_call(
400
439
  @dlp_service_stub.method(:update_job_trigger),
401
- defaults["update_job_trigger"]
440
+ defaults["update_job_trigger"],
441
+ exception_transformer: exception_transformer
402
442
  )
403
443
  @create_job_trigger = Google::Gax.create_api_call(
404
444
  @dlp_service_stub.method(:create_job_trigger),
405
- defaults["create_job_trigger"]
445
+ defaults["create_job_trigger"],
446
+ exception_transformer: exception_transformer
406
447
  )
407
448
  end
408
449
 
@@ -410,8 +451,13 @@ module Google
410
451
 
411
452
  # Finds potentially sensitive info in content.
412
453
  # This method has limits on input size, processing time, and output size.
413
- # [How-to guide for text](https://cloud.google.com/dlp/docs/inspecting-text), [How-to guide for
414
- # images](/dlp/docs/inspecting-images)
454
+ #
455
+ # When no InfoTypes or CustomInfoTypes are specified in this request, the
456
+ # system will automatically choose what detectors to run. By default this may
457
+ # be all types, but may change over time as detectors are updated.
458
+ #
459
+ # For how to guides, see https://cloud.google.com/dlp/docs/inspecting-images
460
+ # and https://cloud.google.com/dlp/docs/inspecting-text,
415
461
  #
416
462
  # @param parent [String]
417
463
  # The parent resource name, for example projects/my-project-id.
@@ -433,12 +479,15 @@ module Google
433
479
  # @param options [Google::Gax::CallOptions]
434
480
  # Overrides the default settings for this call, e.g, timeout,
435
481
  # retries, etc.
482
+ # @yield [result, operation] Access the result along with the RPC operation
483
+ # @yieldparam result [Google::Privacy::Dlp::V2::InspectContentResponse]
484
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
436
485
  # @return [Google::Privacy::Dlp::V2::InspectContentResponse]
437
486
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
438
487
  # @example
439
- # require "google/cloud/dlp/v2"
488
+ # require "google/cloud/dlp"
440
489
  #
441
- # dlp_service_client = Google::Cloud::Dlp::V2.new
490
+ # dlp_service_client = Google::Cloud::Dlp.new(version: :V2)
442
491
  # formatted_parent = Google::Cloud::Dlp::V2::DlpServiceClient.project_path("[PROJECT]")
443
492
  # response = dlp_service_client.inspect_content(formatted_parent)
444
493
 
@@ -447,7 +496,8 @@ module Google
447
496
  inspect_config: nil,
448
497
  item: nil,
449
498
  inspect_template_name: nil,
450
- options: nil
499
+ options: nil,
500
+ &block
451
501
  req = {
452
502
  parent: parent,
453
503
  inspect_config: inspect_config,
@@ -455,12 +505,17 @@ module Google
455
505
  inspect_template_name: inspect_template_name
456
506
  }.delete_if { |_, v| v.nil? }
457
507
  req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::InspectContentRequest)
458
- @inspect_content.call(req, options)
508
+ @inspect_content.call(req, options, &block)
459
509
  end
460
510
 
461
511
  # Redacts potentially sensitive info from an image.
462
512
  # This method has limits on input size, processing time, and output size.
463
- # [How-to guide](https://cloud.google.com/dlp/docs/redacting-sensitive-data-images)
513
+ # See https://cloud.google.com/dlp/docs/redacting-sensitive-data-images to
514
+ # learn more.
515
+ #
516
+ # When no InfoTypes or CustomInfoTypes are specified in this request, the
517
+ # system will automatically choose what detectors to run. By default this may
518
+ # be all types, but may change over time as detectors are updated.
464
519
  #
465
520
  # @param parent [String]
466
521
  # The parent resource name, for example projects/my-project-id.
@@ -472,6 +527,9 @@ module Google
472
527
  # The configuration for specifying what content to redact from images.
473
528
  # A hash of the same form as `Google::Privacy::Dlp::V2::RedactImageRequest::ImageRedactionConfig`
474
529
  # can also be provided.
530
+ # @param include_findings [true, false]
531
+ # Whether the response should include findings along with the redacted
532
+ # image.
475
533
  # @param byte_item [Google::Privacy::Dlp::V2::ByteContentItem | Hash]
476
534
  # The content must be PNG, JPEG, SVG or BMP.
477
535
  # A hash of the same form as `Google::Privacy::Dlp::V2::ByteContentItem`
@@ -479,12 +537,15 @@ module Google
479
537
  # @param options [Google::Gax::CallOptions]
480
538
  # Overrides the default settings for this call, e.g, timeout,
481
539
  # retries, etc.
540
+ # @yield [result, operation] Access the result along with the RPC operation
541
+ # @yieldparam result [Google::Privacy::Dlp::V2::RedactImageResponse]
542
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
482
543
  # @return [Google::Privacy::Dlp::V2::RedactImageResponse]
483
544
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
484
545
  # @example
485
- # require "google/cloud/dlp/v2"
546
+ # require "google/cloud/dlp"
486
547
  #
487
- # dlp_service_client = Google::Cloud::Dlp::V2.new
548
+ # dlp_service_client = Google::Cloud::Dlp.new(version: :V2)
488
549
  # formatted_parent = Google::Cloud::Dlp::V2::DlpServiceClient.project_path("[PROJECT]")
489
550
  # response = dlp_service_client.redact_image(formatted_parent)
490
551
 
@@ -492,21 +553,29 @@ module Google
492
553
  parent,
493
554
  inspect_config: nil,
494
555
  image_redaction_configs: nil,
556
+ include_findings: nil,
495
557
  byte_item: nil,
496
- options: nil
558
+ options: nil,
559
+ &block
497
560
  req = {
498
561
  parent: parent,
499
562
  inspect_config: inspect_config,
500
563
  image_redaction_configs: image_redaction_configs,
564
+ include_findings: include_findings,
501
565
  byte_item: byte_item
502
566
  }.delete_if { |_, v| v.nil? }
503
567
  req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::RedactImageRequest)
504
- @redact_image.call(req, options)
568
+ @redact_image.call(req, options, &block)
505
569
  end
506
570
 
507
571
  # De-identifies potentially sensitive info from a ContentItem.
508
572
  # This method has limits on input size and output size.
509
- # [How-to guide](https://cloud.google.com/dlp/docs/deidentify-sensitive-data)
573
+ # See https://cloud.google.com/dlp/docs/deidentify-sensitive-data to
574
+ # learn more.
575
+ #
576
+ # When no InfoTypes or CustomInfoTypes are specified in this request, the
577
+ # system will automatically choose what detectors to run. By default this may
578
+ # be all types, but may change over time as detectors are updated.
510
579
  #
511
580
  # @param parent [String]
512
581
  # The parent resource name, for example projects/my-project-id.
@@ -541,12 +610,15 @@ module Google
541
610
  # @param options [Google::Gax::CallOptions]
542
611
  # Overrides the default settings for this call, e.g, timeout,
543
612
  # retries, etc.
613
+ # @yield [result, operation] Access the result along with the RPC operation
614
+ # @yieldparam result [Google::Privacy::Dlp::V2::DeidentifyContentResponse]
615
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
544
616
  # @return [Google::Privacy::Dlp::V2::DeidentifyContentResponse]
545
617
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
546
618
  # @example
547
- # require "google/cloud/dlp/v2"
619
+ # require "google/cloud/dlp"
548
620
  #
549
- # dlp_service_client = Google::Cloud::Dlp::V2.new
621
+ # dlp_service_client = Google::Cloud::Dlp.new(version: :V2)
550
622
  # formatted_parent = Google::Cloud::Dlp::V2::DlpServiceClient.project_path("[PROJECT]")
551
623
  # response = dlp_service_client.deidentify_content(formatted_parent)
552
624
 
@@ -557,7 +629,8 @@ module Google
557
629
  item: nil,
558
630
  inspect_template_name: nil,
559
631
  deidentify_template_name: nil,
560
- options: nil
632
+ options: nil,
633
+ &block
561
634
  req = {
562
635
  parent: parent,
563
636
  deidentify_config: deidentify_config,
@@ -567,10 +640,13 @@ module Google
567
640
  deidentify_template_name: deidentify_template_name
568
641
  }.delete_if { |_, v| v.nil? }
569
642
  req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::DeidentifyContentRequest)
570
- @deidentify_content.call(req, options)
643
+ @deidentify_content.call(req, options, &block)
571
644
  end
572
645
 
573
646
  # Re-identifies content that has been de-identified.
647
+ # See
648
+ # https://cloud.google.com/dlp/docs/pseudonymization#re-identification_in_free_text_code_example
649
+ # to learn more.
574
650
  #
575
651
  # @param parent [String]
576
652
  # The parent resource name.
@@ -610,12 +686,15 @@ module Google
610
686
  # @param options [Google::Gax::CallOptions]
611
687
  # Overrides the default settings for this call, e.g, timeout,
612
688
  # retries, etc.
689
+ # @yield [result, operation] Access the result along with the RPC operation
690
+ # @yieldparam result [Google::Privacy::Dlp::V2::ReidentifyContentResponse]
691
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
613
692
  # @return [Google::Privacy::Dlp::V2::ReidentifyContentResponse]
614
693
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
615
694
  # @example
616
- # require "google/cloud/dlp/v2"
695
+ # require "google/cloud/dlp"
617
696
  #
618
- # dlp_service_client = Google::Cloud::Dlp::V2.new
697
+ # dlp_service_client = Google::Cloud::Dlp.new(version: :V2)
619
698
  # formatted_parent = Google::Cloud::Dlp::V2::DlpServiceClient.project_path("[PROJECT]")
620
699
  # response = dlp_service_client.reidentify_content(formatted_parent)
621
700
 
@@ -626,7 +705,8 @@ module Google
626
705
  item: nil,
627
706
  inspect_template_name: nil,
628
707
  reidentify_template_name: nil,
629
- options: nil
708
+ options: nil,
709
+ &block
630
710
  req = {
631
711
  parent: parent,
632
712
  reidentify_config: reidentify_config,
@@ -636,12 +716,12 @@ module Google
636
716
  reidentify_template_name: reidentify_template_name
637
717
  }.delete_if { |_, v| v.nil? }
638
718
  req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::ReidentifyContentRequest)
639
- @reidentify_content.call(req, options)
719
+ @reidentify_content.call(req, options, &block)
640
720
  end
641
721
 
642
722
  # Returns a list of the sensitive information types that the DLP API
643
- # supports. For more information, see [Listing supported predefined
644
- # infoTypes](/dlp/docs/listing-infotypes).
723
+ # supports. See https://cloud.google.com/dlp/docs/infotypes-reference to
724
+ # learn more.
645
725
  #
646
726
  # @param language_code [String]
647
727
  # Optional BCP-47 language code for localized infoType friendly
@@ -653,28 +733,33 @@ module Google
653
733
  # @param options [Google::Gax::CallOptions]
654
734
  # Overrides the default settings for this call, e.g, timeout,
655
735
  # retries, etc.
736
+ # @yield [result, operation] Access the result along with the RPC operation
737
+ # @yieldparam result [Google::Privacy::Dlp::V2::ListInfoTypesResponse]
738
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
656
739
  # @return [Google::Privacy::Dlp::V2::ListInfoTypesResponse]
657
740
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
658
741
  # @example
659
- # require "google/cloud/dlp/v2"
742
+ # require "google/cloud/dlp"
660
743
  #
661
- # dlp_service_client = Google::Cloud::Dlp::V2.new
744
+ # dlp_service_client = Google::Cloud::Dlp.new(version: :V2)
662
745
  # response = dlp_service_client.list_info_types
663
746
 
664
747
  def list_info_types \
665
748
  language_code: nil,
666
749
  filter: nil,
667
- options: nil
750
+ options: nil,
751
+ &block
668
752
  req = {
669
753
  language_code: language_code,
670
754
  filter: filter
671
755
  }.delete_if { |_, v| v.nil? }
672
756
  req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::ListInfoTypesRequest)
673
- @list_info_types.call(req, options)
757
+ @list_info_types.call(req, options, &block)
674
758
  end
675
759
 
676
760
  # Creates an InspectTemplate for re-using frequently used configuration
677
761
  # for inspecting content, images, and storage.
762
+ # See https://cloud.google.com/dlp/docs/creating-templates to learn more.
678
763
  #
679
764
  # @param parent [String]
680
765
  # The parent resource name, for example projects/my-project-id or
@@ -691,12 +776,15 @@ module Google
691
776
  # @param options [Google::Gax::CallOptions]
692
777
  # Overrides the default settings for this call, e.g, timeout,
693
778
  # retries, etc.
779
+ # @yield [result, operation] Access the result along with the RPC operation
780
+ # @yieldparam result [Google::Privacy::Dlp::V2::InspectTemplate]
781
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
694
782
  # @return [Google::Privacy::Dlp::V2::InspectTemplate]
695
783
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
696
784
  # @example
697
- # require "google/cloud/dlp/v2"
785
+ # require "google/cloud/dlp"
698
786
  #
699
- # dlp_service_client = Google::Cloud::Dlp::V2.new
787
+ # dlp_service_client = Google::Cloud::Dlp.new(version: :V2)
700
788
  # formatted_parent = Google::Cloud::Dlp::V2::DlpServiceClient.organization_path("[ORGANIZATION]")
701
789
  # response = dlp_service_client.create_inspect_template(formatted_parent)
702
790
 
@@ -704,17 +792,19 @@ module Google
704
792
  parent,
705
793
  inspect_template: nil,
706
794
  template_id: nil,
707
- options: nil
795
+ options: nil,
796
+ &block
708
797
  req = {
709
798
  parent: parent,
710
799
  inspect_template: inspect_template,
711
800
  template_id: template_id
712
801
  }.delete_if { |_, v| v.nil? }
713
802
  req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::CreateInspectTemplateRequest)
714
- @create_inspect_template.call(req, options)
803
+ @create_inspect_template.call(req, options, &block)
715
804
  end
716
805
 
717
806
  # Updates the InspectTemplate.
807
+ # See https://cloud.google.com/dlp/docs/creating-templates to learn more.
718
808
  #
719
809
  # @param name [String]
720
810
  # Resource name of organization and inspectTemplate to be updated, for
@@ -731,12 +821,15 @@ module Google
731
821
  # @param options [Google::Gax::CallOptions]
732
822
  # Overrides the default settings for this call, e.g, timeout,
733
823
  # retries, etc.
824
+ # @yield [result, operation] Access the result along with the RPC operation
825
+ # @yieldparam result [Google::Privacy::Dlp::V2::InspectTemplate]
826
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
734
827
  # @return [Google::Privacy::Dlp::V2::InspectTemplate]
735
828
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
736
829
  # @example
737
- # require "google/cloud/dlp/v2"
830
+ # require "google/cloud/dlp"
738
831
  #
739
- # dlp_service_client = Google::Cloud::Dlp::V2.new
832
+ # dlp_service_client = Google::Cloud::Dlp.new(version: :V2)
740
833
  # formatted_name = Google::Cloud::Dlp::V2::DlpServiceClient.organization_inspect_template_path("[ORGANIZATION]", "[INSPECT_TEMPLATE]")
741
834
  # response = dlp_service_client.update_inspect_template(formatted_name)
742
835
 
@@ -744,17 +837,19 @@ module Google
744
837
  name,
745
838
  inspect_template: nil,
746
839
  update_mask: nil,
747
- options: nil
840
+ options: nil,
841
+ &block
748
842
  req = {
749
843
  name: name,
750
844
  inspect_template: inspect_template,
751
845
  update_mask: update_mask
752
846
  }.delete_if { |_, v| v.nil? }
753
847
  req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::UpdateInspectTemplateRequest)
754
- @update_inspect_template.call(req, options)
848
+ @update_inspect_template.call(req, options, &block)
755
849
  end
756
850
 
757
851
  # Gets an InspectTemplate.
852
+ # See https://cloud.google.com/dlp/docs/creating-templates to learn more.
758
853
  #
759
854
  # @param name [String]
760
855
  # Resource name of the organization and inspectTemplate to be read, for
@@ -763,25 +858,30 @@ module Google
763
858
  # @param options [Google::Gax::CallOptions]
764
859
  # Overrides the default settings for this call, e.g, timeout,
765
860
  # retries, etc.
861
+ # @yield [result, operation] Access the result along with the RPC operation
862
+ # @yieldparam result [Google::Privacy::Dlp::V2::InspectTemplate]
863
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
766
864
  # @return [Google::Privacy::Dlp::V2::InspectTemplate]
767
865
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
768
866
  # @example
769
- # require "google/cloud/dlp/v2"
867
+ # require "google/cloud/dlp"
770
868
  #
771
- # dlp_service_client = Google::Cloud::Dlp::V2.new
869
+ # dlp_service_client = Google::Cloud::Dlp.new(version: :V2)
772
870
  # response = dlp_service_client.get_inspect_template
773
871
 
774
872
  def get_inspect_template \
775
873
  name: nil,
776
- options: nil
874
+ options: nil,
875
+ &block
777
876
  req = {
778
877
  name: name
779
878
  }.delete_if { |_, v| v.nil? }
780
879
  req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::GetInspectTemplateRequest)
781
- @get_inspect_template.call(req, options)
880
+ @get_inspect_template.call(req, options, &block)
782
881
  end
783
882
 
784
883
  # Lists InspectTemplates.
884
+ # See https://cloud.google.com/dlp/docs/creating-templates to learn more.
785
885
  #
786
886
  # @param parent [String]
787
887
  # The parent resource name, for example projects/my-project-id or
@@ -795,6 +895,9 @@ module Google
795
895
  # @param options [Google::Gax::CallOptions]
796
896
  # Overrides the default settings for this call, e.g, timeout,
797
897
  # retries, etc.
898
+ # @yield [result, operation] Access the result along with the RPC operation
899
+ # @yieldparam result [Google::Gax::PagedEnumerable<Google::Privacy::Dlp::V2::InspectTemplate>]
900
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
798
901
  # @return [Google::Gax::PagedEnumerable<Google::Privacy::Dlp::V2::InspectTemplate>]
799
902
  # An enumerable of Google::Privacy::Dlp::V2::InspectTemplate instances.
800
903
  # See Google::Gax::PagedEnumerable documentation for other
@@ -802,9 +905,9 @@ module Google
802
905
  # object.
803
906
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
804
907
  # @example
805
- # require "google/cloud/dlp/v2"
908
+ # require "google/cloud/dlp"
806
909
  #
807
- # dlp_service_client = Google::Cloud::Dlp::V2.new
910
+ # dlp_service_client = Google::Cloud::Dlp.new(version: :V2)
808
911
  # formatted_parent = Google::Cloud::Dlp::V2::DlpServiceClient.organization_path("[ORGANIZATION]")
809
912
  #
810
913
  # # Iterate over all results.
@@ -823,16 +926,18 @@ module Google
823
926
  def list_inspect_templates \
824
927
  parent,
825
928
  page_size: nil,
826
- options: nil
929
+ options: nil,
930
+ &block
827
931
  req = {
828
932
  parent: parent,
829
933
  page_size: page_size
830
934
  }.delete_if { |_, v| v.nil? }
831
935
  req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::ListInspectTemplatesRequest)
832
- @list_inspect_templates.call(req, options)
936
+ @list_inspect_templates.call(req, options, &block)
833
937
  end
834
938
 
835
939
  # Deletes an InspectTemplate.
940
+ # See https://cloud.google.com/dlp/docs/creating-templates to learn more.
836
941
  #
837
942
  # @param name [String]
838
943
  # Resource name of the organization and inspectTemplate to be deleted, for
@@ -841,27 +946,33 @@ module Google
841
946
  # @param options [Google::Gax::CallOptions]
842
947
  # Overrides the default settings for this call, e.g, timeout,
843
948
  # retries, etc.
949
+ # @yield [result, operation] Access the result along with the RPC operation
950
+ # @yieldparam result []
951
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
844
952
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
845
953
  # @example
846
- # require "google/cloud/dlp/v2"
954
+ # require "google/cloud/dlp"
847
955
  #
848
- # dlp_service_client = Google::Cloud::Dlp::V2.new
956
+ # dlp_service_client = Google::Cloud::Dlp.new(version: :V2)
849
957
  # formatted_name = Google::Cloud::Dlp::V2::DlpServiceClient.organization_inspect_template_path("[ORGANIZATION]", "[INSPECT_TEMPLATE]")
850
958
  # dlp_service_client.delete_inspect_template(formatted_name)
851
959
 
852
960
  def delete_inspect_template \
853
961
  name,
854
- options: nil
962
+ options: nil,
963
+ &block
855
964
  req = {
856
965
  name: name
857
966
  }.delete_if { |_, v| v.nil? }
858
967
  req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::DeleteInspectTemplateRequest)
859
- @delete_inspect_template.call(req, options)
968
+ @delete_inspect_template.call(req, options, &block)
860
969
  nil
861
970
  end
862
971
 
863
972
  # Creates a DeidentifyTemplate for re-using frequently used configuration
864
973
  # for de-identifying content, images, and storage.
974
+ # See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
975
+ # more.
865
976
  #
866
977
  # @param parent [String]
867
978
  # The parent resource name, for example projects/my-project-id or
@@ -878,12 +989,15 @@ module Google
878
989
  # @param options [Google::Gax::CallOptions]
879
990
  # Overrides the default settings for this call, e.g, timeout,
880
991
  # retries, etc.
992
+ # @yield [result, operation] Access the result along with the RPC operation
993
+ # @yieldparam result [Google::Privacy::Dlp::V2::DeidentifyTemplate]
994
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
881
995
  # @return [Google::Privacy::Dlp::V2::DeidentifyTemplate]
882
996
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
883
997
  # @example
884
- # require "google/cloud/dlp/v2"
998
+ # require "google/cloud/dlp"
885
999
  #
886
- # dlp_service_client = Google::Cloud::Dlp::V2.new
1000
+ # dlp_service_client = Google::Cloud::Dlp.new(version: :V2)
887
1001
  # formatted_parent = Google::Cloud::Dlp::V2::DlpServiceClient.organization_path("[ORGANIZATION]")
888
1002
  # response = dlp_service_client.create_deidentify_template(formatted_parent)
889
1003
 
@@ -891,17 +1005,20 @@ module Google
891
1005
  parent,
892
1006
  deidentify_template: nil,
893
1007
  template_id: nil,
894
- options: nil
1008
+ options: nil,
1009
+ &block
895
1010
  req = {
896
1011
  parent: parent,
897
1012
  deidentify_template: deidentify_template,
898
1013
  template_id: template_id
899
1014
  }.delete_if { |_, v| v.nil? }
900
1015
  req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::CreateDeidentifyTemplateRequest)
901
- @create_deidentify_template.call(req, options)
1016
+ @create_deidentify_template.call(req, options, &block)
902
1017
  end
903
1018
 
904
1019
  # Updates the DeidentifyTemplate.
1020
+ # See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
1021
+ # more.
905
1022
  #
906
1023
  # @param name [String]
907
1024
  # Resource name of organization and deidentify template to be updated, for
@@ -918,12 +1035,15 @@ module Google
918
1035
  # @param options [Google::Gax::CallOptions]
919
1036
  # Overrides the default settings for this call, e.g, timeout,
920
1037
  # retries, etc.
1038
+ # @yield [result, operation] Access the result along with the RPC operation
1039
+ # @yieldparam result [Google::Privacy::Dlp::V2::DeidentifyTemplate]
1040
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
921
1041
  # @return [Google::Privacy::Dlp::V2::DeidentifyTemplate]
922
1042
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
923
1043
  # @example
924
- # require "google/cloud/dlp/v2"
1044
+ # require "google/cloud/dlp"
925
1045
  #
926
- # dlp_service_client = Google::Cloud::Dlp::V2.new
1046
+ # dlp_service_client = Google::Cloud::Dlp.new(version: :V2)
927
1047
  # formatted_name = Google::Cloud::Dlp::V2::DlpServiceClient.organization_deidentify_template_path("[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]")
928
1048
  # response = dlp_service_client.update_deidentify_template(formatted_name)
929
1049
 
@@ -931,17 +1051,20 @@ module Google
931
1051
  name,
932
1052
  deidentify_template: nil,
933
1053
  update_mask: nil,
934
- options: nil
1054
+ options: nil,
1055
+ &block
935
1056
  req = {
936
1057
  name: name,
937
1058
  deidentify_template: deidentify_template,
938
1059
  update_mask: update_mask
939
1060
  }.delete_if { |_, v| v.nil? }
940
1061
  req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::UpdateDeidentifyTemplateRequest)
941
- @update_deidentify_template.call(req, options)
1062
+ @update_deidentify_template.call(req, options, &block)
942
1063
  end
943
1064
 
944
1065
  # Gets a DeidentifyTemplate.
1066
+ # See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
1067
+ # more.
945
1068
  #
946
1069
  # @param name [String]
947
1070
  # Resource name of the organization and deidentify template to be read, for
@@ -950,26 +1073,32 @@ module Google
950
1073
  # @param options [Google::Gax::CallOptions]
951
1074
  # Overrides the default settings for this call, e.g, timeout,
952
1075
  # retries, etc.
1076
+ # @yield [result, operation] Access the result along with the RPC operation
1077
+ # @yieldparam result [Google::Privacy::Dlp::V2::DeidentifyTemplate]
1078
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
953
1079
  # @return [Google::Privacy::Dlp::V2::DeidentifyTemplate]
954
1080
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
955
1081
  # @example
956
- # require "google/cloud/dlp/v2"
1082
+ # require "google/cloud/dlp"
957
1083
  #
958
- # dlp_service_client = Google::Cloud::Dlp::V2.new
1084
+ # dlp_service_client = Google::Cloud::Dlp.new(version: :V2)
959
1085
  # formatted_name = Google::Cloud::Dlp::V2::DlpServiceClient.organization_deidentify_template_path("[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]")
960
1086
  # response = dlp_service_client.get_deidentify_template(formatted_name)
961
1087
 
962
1088
  def get_deidentify_template \
963
1089
  name,
964
- options: nil
1090
+ options: nil,
1091
+ &block
965
1092
  req = {
966
1093
  name: name
967
1094
  }.delete_if { |_, v| v.nil? }
968
1095
  req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::GetDeidentifyTemplateRequest)
969
- @get_deidentify_template.call(req, options)
1096
+ @get_deidentify_template.call(req, options, &block)
970
1097
  end
971
1098
 
972
1099
  # Lists DeidentifyTemplates.
1100
+ # See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
1101
+ # more.
973
1102
  #
974
1103
  # @param parent [String]
975
1104
  # The parent resource name, for example projects/my-project-id or
@@ -983,6 +1112,9 @@ module Google
983
1112
  # @param options [Google::Gax::CallOptions]
984
1113
  # Overrides the default settings for this call, e.g, timeout,
985
1114
  # retries, etc.
1115
+ # @yield [result, operation] Access the result along with the RPC operation
1116
+ # @yieldparam result [Google::Gax::PagedEnumerable<Google::Privacy::Dlp::V2::DeidentifyTemplate>]
1117
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
986
1118
  # @return [Google::Gax::PagedEnumerable<Google::Privacy::Dlp::V2::DeidentifyTemplate>]
987
1119
  # An enumerable of Google::Privacy::Dlp::V2::DeidentifyTemplate instances.
988
1120
  # See Google::Gax::PagedEnumerable documentation for other
@@ -990,9 +1122,9 @@ module Google
990
1122
  # object.
991
1123
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
992
1124
  # @example
993
- # require "google/cloud/dlp/v2"
1125
+ # require "google/cloud/dlp"
994
1126
  #
995
- # dlp_service_client = Google::Cloud::Dlp::V2.new
1127
+ # dlp_service_client = Google::Cloud::Dlp.new(version: :V2)
996
1128
  # formatted_parent = Google::Cloud::Dlp::V2::DlpServiceClient.organization_path("[ORGANIZATION]")
997
1129
  #
998
1130
  # # Iterate over all results.
@@ -1011,16 +1143,19 @@ module Google
1011
1143
  def list_deidentify_templates \
1012
1144
  parent,
1013
1145
  page_size: nil,
1014
- options: nil
1146
+ options: nil,
1147
+ &block
1015
1148
  req = {
1016
1149
  parent: parent,
1017
1150
  page_size: page_size
1018
1151
  }.delete_if { |_, v| v.nil? }
1019
1152
  req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::ListDeidentifyTemplatesRequest)
1020
- @list_deidentify_templates.call(req, options)
1153
+ @list_deidentify_templates.call(req, options, &block)
1021
1154
  end
1022
1155
 
1023
1156
  # Deletes a DeidentifyTemplate.
1157
+ # See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
1158
+ # more.
1024
1159
  #
1025
1160
  # @param name [String]
1026
1161
  # Resource name of the organization and deidentify template to be deleted,
@@ -1029,27 +1164,36 @@ module Google
1029
1164
  # @param options [Google::Gax::CallOptions]
1030
1165
  # Overrides the default settings for this call, e.g, timeout,
1031
1166
  # retries, etc.
1167
+ # @yield [result, operation] Access the result along with the RPC operation
1168
+ # @yieldparam result []
1169
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1032
1170
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
1033
1171
  # @example
1034
- # require "google/cloud/dlp/v2"
1172
+ # require "google/cloud/dlp"
1035
1173
  #
1036
- # dlp_service_client = Google::Cloud::Dlp::V2.new
1174
+ # dlp_service_client = Google::Cloud::Dlp.new(version: :V2)
1037
1175
  # formatted_name = Google::Cloud::Dlp::V2::DlpServiceClient.organization_deidentify_template_path("[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]")
1038
1176
  # dlp_service_client.delete_deidentify_template(formatted_name)
1039
1177
 
1040
1178
  def delete_deidentify_template \
1041
1179
  name,
1042
- options: nil
1180
+ options: nil,
1181
+ &block
1043
1182
  req = {
1044
1183
  name: name
1045
1184
  }.delete_if { |_, v| v.nil? }
1046
1185
  req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::DeleteDeidentifyTemplateRequest)
1047
- @delete_deidentify_template.call(req, options)
1186
+ @delete_deidentify_template.call(req, options, &block)
1048
1187
  nil
1049
1188
  end
1050
1189
 
1051
1190
  # Creates a new job to inspect storage or calculate risk metrics.
1052
- # [How-to guide](https://cloud.google.com/dlp/docs/compute-risk-analysis).
1191
+ # See https://cloud.google.com/dlp/docs/inspecting-storage and
1192
+ # https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
1193
+ #
1194
+ # When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the
1195
+ # system will automatically choose what detectors to run. By default this may
1196
+ # be all types, but may change over time as detectors are updated.
1053
1197
  #
1054
1198
  # @param parent [String]
1055
1199
  # The parent resource name, for example projects/my-project-id.
@@ -1067,12 +1211,15 @@ module Google
1067
1211
  # @param options [Google::Gax::CallOptions]
1068
1212
  # Overrides the default settings for this call, e.g, timeout,
1069
1213
  # retries, etc.
1214
+ # @yield [result, operation] Access the result along with the RPC operation
1215
+ # @yieldparam result [Google::Privacy::Dlp::V2::DlpJob]
1216
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1070
1217
  # @return [Google::Privacy::Dlp::V2::DlpJob]
1071
1218
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
1072
1219
  # @example
1073
- # require "google/cloud/dlp/v2"
1220
+ # require "google/cloud/dlp"
1074
1221
  #
1075
- # dlp_service_client = Google::Cloud::Dlp::V2.new
1222
+ # dlp_service_client = Google::Cloud::Dlp.new(version: :V2)
1076
1223
  # formatted_parent = Google::Cloud::Dlp::V2::DlpServiceClient.project_path("[PROJECT]")
1077
1224
  # response = dlp_service_client.create_dlp_job(formatted_parent)
1078
1225
 
@@ -1081,7 +1228,8 @@ module Google
1081
1228
  inspect_job: nil,
1082
1229
  risk_job: nil,
1083
1230
  job_id: nil,
1084
- options: nil
1231
+ options: nil,
1232
+ &block
1085
1233
  req = {
1086
1234
  parent: parent,
1087
1235
  inspect_job: inspect_job,
@@ -1089,10 +1237,12 @@ module Google
1089
1237
  job_id: job_id
1090
1238
  }.delete_if { |_, v| v.nil? }
1091
1239
  req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::CreateDlpJobRequest)
1092
- @create_dlp_job.call(req, options)
1240
+ @create_dlp_job.call(req, options, &block)
1093
1241
  end
1094
1242
 
1095
1243
  # Lists DlpJobs that match the specified filter in the request.
1244
+ # See https://cloud.google.com/dlp/docs/inspecting-storage and
1245
+ # https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
1096
1246
  #
1097
1247
  # @param parent [String]
1098
1248
  # The parent resource name, for example projects/my-project-id.
@@ -1131,6 +1281,9 @@ module Google
1131
1281
  # @param options [Google::Gax::CallOptions]
1132
1282
  # Overrides the default settings for this call, e.g, timeout,
1133
1283
  # retries, etc.
1284
+ # @yield [result, operation] Access the result along with the RPC operation
1285
+ # @yieldparam result [Google::Gax::PagedEnumerable<Google::Privacy::Dlp::V2::DlpJob>]
1286
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1134
1287
  # @return [Google::Gax::PagedEnumerable<Google::Privacy::Dlp::V2::DlpJob>]
1135
1288
  # An enumerable of Google::Privacy::Dlp::V2::DlpJob instances.
1136
1289
  # See Google::Gax::PagedEnumerable documentation for other
@@ -1138,9 +1291,9 @@ module Google
1138
1291
  # object.
1139
1292
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
1140
1293
  # @example
1141
- # require "google/cloud/dlp/v2"
1294
+ # require "google/cloud/dlp"
1142
1295
  #
1143
- # dlp_service_client = Google::Cloud::Dlp::V2.new
1296
+ # dlp_service_client = Google::Cloud::Dlp.new(version: :V2)
1144
1297
  # formatted_parent = Google::Cloud::Dlp::V2::DlpServiceClient.project_path("[PROJECT]")
1145
1298
  #
1146
1299
  # # Iterate over all results.
@@ -1161,7 +1314,8 @@ module Google
1161
1314
  filter: nil,
1162
1315
  page_size: nil,
1163
1316
  type: nil,
1164
- options: nil
1317
+ options: nil,
1318
+ &block
1165
1319
  req = {
1166
1320
  parent: parent,
1167
1321
  filter: filter,
@@ -1169,95 +1323,114 @@ module Google
1169
1323
  type: type
1170
1324
  }.delete_if { |_, v| v.nil? }
1171
1325
  req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::ListDlpJobsRequest)
1172
- @list_dlp_jobs.call(req, options)
1326
+ @list_dlp_jobs.call(req, options, &block)
1173
1327
  end
1174
1328
 
1175
1329
  # Gets the latest state of a long-running DlpJob.
1330
+ # See https://cloud.google.com/dlp/docs/inspecting-storage and
1331
+ # https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
1176
1332
  #
1177
1333
  # @param name [String]
1178
1334
  # The name of the DlpJob resource.
1179
1335
  # @param options [Google::Gax::CallOptions]
1180
1336
  # Overrides the default settings for this call, e.g, timeout,
1181
1337
  # retries, etc.
1338
+ # @yield [result, operation] Access the result along with the RPC operation
1339
+ # @yieldparam result [Google::Privacy::Dlp::V2::DlpJob]
1340
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1182
1341
  # @return [Google::Privacy::Dlp::V2::DlpJob]
1183
1342
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
1184
1343
  # @example
1185
- # require "google/cloud/dlp/v2"
1344
+ # require "google/cloud/dlp"
1186
1345
  #
1187
- # dlp_service_client = Google::Cloud::Dlp::V2.new
1346
+ # dlp_service_client = Google::Cloud::Dlp.new(version: :V2)
1188
1347
  # formatted_name = Google::Cloud::Dlp::V2::DlpServiceClient.dlp_job_path("[PROJECT]", "[DLP_JOB]")
1189
1348
  # response = dlp_service_client.get_dlp_job(formatted_name)
1190
1349
 
1191
1350
  def get_dlp_job \
1192
1351
  name,
1193
- options: nil
1352
+ options: nil,
1353
+ &block
1194
1354
  req = {
1195
1355
  name: name
1196
1356
  }.delete_if { |_, v| v.nil? }
1197
1357
  req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::GetDlpJobRequest)
1198
- @get_dlp_job.call(req, options)
1358
+ @get_dlp_job.call(req, options, &block)
1199
1359
  end
1200
1360
 
1201
1361
  # Deletes a long-running DlpJob. This method indicates that the client is
1202
1362
  # no longer interested in the DlpJob result. The job will be cancelled if
1203
1363
  # possible.
1364
+ # See https://cloud.google.com/dlp/docs/inspecting-storage and
1365
+ # https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
1204
1366
  #
1205
1367
  # @param name [String]
1206
1368
  # The name of the DlpJob resource to be deleted.
1207
1369
  # @param options [Google::Gax::CallOptions]
1208
1370
  # Overrides the default settings for this call, e.g, timeout,
1209
1371
  # retries, etc.
1372
+ # @yield [result, operation] Access the result along with the RPC operation
1373
+ # @yieldparam result []
1374
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1210
1375
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
1211
1376
  # @example
1212
- # require "google/cloud/dlp/v2"
1377
+ # require "google/cloud/dlp"
1213
1378
  #
1214
- # dlp_service_client = Google::Cloud::Dlp::V2.new
1379
+ # dlp_service_client = Google::Cloud::Dlp.new(version: :V2)
1215
1380
  # formatted_name = Google::Cloud::Dlp::V2::DlpServiceClient.dlp_job_path("[PROJECT]", "[DLP_JOB]")
1216
1381
  # dlp_service_client.delete_dlp_job(formatted_name)
1217
1382
 
1218
1383
  def delete_dlp_job \
1219
1384
  name,
1220
- options: nil
1385
+ options: nil,
1386
+ &block
1221
1387
  req = {
1222
1388
  name: name
1223
1389
  }.delete_if { |_, v| v.nil? }
1224
1390
  req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::DeleteDlpJobRequest)
1225
- @delete_dlp_job.call(req, options)
1391
+ @delete_dlp_job.call(req, options, &block)
1226
1392
  nil
1227
1393
  end
1228
1394
 
1229
1395
  # Starts asynchronous cancellation on a long-running DlpJob. The server
1230
1396
  # makes a best effort to cancel the DlpJob, but success is not
1231
1397
  # guaranteed.
1398
+ # See https://cloud.google.com/dlp/docs/inspecting-storage and
1399
+ # https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
1232
1400
  #
1233
1401
  # @param name [String]
1234
1402
  # The name of the DlpJob resource to be cancelled.
1235
1403
  # @param options [Google::Gax::CallOptions]
1236
1404
  # Overrides the default settings for this call, e.g, timeout,
1237
1405
  # retries, etc.
1406
+ # @yield [result, operation] Access the result along with the RPC operation
1407
+ # @yieldparam result []
1408
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1238
1409
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
1239
1410
  # @example
1240
- # require "google/cloud/dlp/v2"
1411
+ # require "google/cloud/dlp"
1241
1412
  #
1242
- # dlp_service_client = Google::Cloud::Dlp::V2.new
1413
+ # dlp_service_client = Google::Cloud::Dlp.new(version: :V2)
1243
1414
  # formatted_name = Google::Cloud::Dlp::V2::DlpServiceClient.dlp_job_path("[PROJECT]", "[DLP_JOB]")
1244
1415
  # dlp_service_client.cancel_dlp_job(formatted_name)
1245
1416
 
1246
1417
  def cancel_dlp_job \
1247
1418
  name,
1248
- options: nil
1419
+ options: nil,
1420
+ &block
1249
1421
  req = {
1250
1422
  name: name
1251
1423
  }.delete_if { |_, v| v.nil? }
1252
1424
  req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::CancelDlpJobRequest)
1253
- @cancel_dlp_job.call(req, options)
1425
+ @cancel_dlp_job.call(req, options, &block)
1254
1426
  nil
1255
1427
  end
1256
1428
 
1257
1429
  # Lists job triggers.
1430
+ # See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
1258
1431
  #
1259
1432
  # @param parent [String]
1260
- # The parent resource name, for example projects/my-project-id.
1433
+ # The parent resource name, for example +projects/my-project-id+.
1261
1434
  # @param page_size [Integer]
1262
1435
  # The maximum number of resources contained in the underlying API
1263
1436
  # response. If page streaming is performed per-resource, this
@@ -1266,21 +1439,23 @@ module Google
1266
1439
  # resources in a page.
1267
1440
  # @param order_by [String]
1268
1441
  # Optional comma separated list of triggeredJob fields to order by,
1269
- # followed by 'asc/desc' postfix, i.e.
1270
- # +"create_time asc,name desc,schedule_mode asc"+. This list is
1271
- # case-insensitive.
1442
+ # followed by +asc+ or +desc+ postfix. This list is case-insensitive,
1443
+ # default sorting order is ascending, redundant space characters are
1444
+ # insignificant.
1272
1445
  #
1273
- # Example: +"name asc,schedule_mode desc, status desc"+
1446
+ # Example: +name asc,update_time, create_time desc+
1274
1447
  #
1275
- # Supported filters keys and values are:
1448
+ # Supported fields are:
1276
1449
  #
1277
1450
  # * +create_time+: corresponds to time the triggeredJob was created.
1278
1451
  # * +update_time+: corresponds to time the triggeredJob was last updated.
1279
- # * +name+: corresponds to JobTrigger's display name.
1280
- # * +status+: corresponds to the triggeredJob status.
1452
+ # * +name+: corresponds to JobTrigger's name.
1281
1453
  # @param options [Google::Gax::CallOptions]
1282
1454
  # Overrides the default settings for this call, e.g, timeout,
1283
1455
  # retries, etc.
1456
+ # @yield [result, operation] Access the result along with the RPC operation
1457
+ # @yieldparam result [Google::Gax::PagedEnumerable<Google::Privacy::Dlp::V2::JobTrigger>]
1458
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1284
1459
  # @return [Google::Gax::PagedEnumerable<Google::Privacy::Dlp::V2::JobTrigger>]
1285
1460
  # An enumerable of Google::Privacy::Dlp::V2::JobTrigger instances.
1286
1461
  # See Google::Gax::PagedEnumerable documentation for other
@@ -1288,9 +1463,9 @@ module Google
1288
1463
  # object.
1289
1464
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
1290
1465
  # @example
1291
- # require "google/cloud/dlp/v2"
1466
+ # require "google/cloud/dlp"
1292
1467
  #
1293
- # dlp_service_client = Google::Cloud::Dlp::V2.new
1468
+ # dlp_service_client = Google::Cloud::Dlp.new(version: :V2)
1294
1469
  # formatted_parent = Google::Cloud::Dlp::V2::DlpServiceClient.project_path("[PROJECT]")
1295
1470
  #
1296
1471
  # # Iterate over all results.
@@ -1310,17 +1485,19 @@ module Google
1310
1485
  parent,
1311
1486
  page_size: nil,
1312
1487
  order_by: nil,
1313
- options: nil
1488
+ options: nil,
1489
+ &block
1314
1490
  req = {
1315
1491
  parent: parent,
1316
1492
  page_size: page_size,
1317
1493
  order_by: order_by
1318
1494
  }.delete_if { |_, v| v.nil? }
1319
1495
  req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::ListJobTriggersRequest)
1320
- @list_job_triggers.call(req, options)
1496
+ @list_job_triggers.call(req, options, &block)
1321
1497
  end
1322
1498
 
1323
1499
  # Gets a job trigger.
1500
+ # See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
1324
1501
  #
1325
1502
  # @param name [String]
1326
1503
  # Resource name of the project and the triggeredJob, for example
@@ -1328,26 +1505,31 @@ module Google
1328
1505
  # @param options [Google::Gax::CallOptions]
1329
1506
  # Overrides the default settings for this call, e.g, timeout,
1330
1507
  # retries, etc.
1508
+ # @yield [result, operation] Access the result along with the RPC operation
1509
+ # @yieldparam result [Google::Privacy::Dlp::V2::JobTrigger]
1510
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1331
1511
  # @return [Google::Privacy::Dlp::V2::JobTrigger]
1332
1512
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
1333
1513
  # @example
1334
- # require "google/cloud/dlp/v2"
1514
+ # require "google/cloud/dlp"
1335
1515
  #
1336
- # dlp_service_client = Google::Cloud::Dlp::V2.new
1516
+ # dlp_service_client = Google::Cloud::Dlp.new(version: :V2)
1337
1517
  # formatted_name = Google::Cloud::Dlp::V2::DlpServiceClient.project_job_trigger_path("[PROJECT]", "[JOB_TRIGGER]")
1338
1518
  # response = dlp_service_client.get_job_trigger(formatted_name)
1339
1519
 
1340
1520
  def get_job_trigger \
1341
1521
  name,
1342
- options: nil
1522
+ options: nil,
1523
+ &block
1343
1524
  req = {
1344
1525
  name: name
1345
1526
  }.delete_if { |_, v| v.nil? }
1346
1527
  req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::GetJobTriggerRequest)
1347
- @get_job_trigger.call(req, options)
1528
+ @get_job_trigger.call(req, options, &block)
1348
1529
  end
1349
1530
 
1350
1531
  # Deletes a job trigger.
1532
+ # See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
1351
1533
  #
1352
1534
  # @param name [String]
1353
1535
  # Resource name of the project and the triggeredJob, for example
@@ -1355,11 +1537,14 @@ module Google
1355
1537
  # @param options [Google::Gax::CallOptions]
1356
1538
  # Overrides the default settings for this call, e.g, timeout,
1357
1539
  # retries, etc.
1540
+ # @yield [result, operation] Access the result along with the RPC operation
1541
+ # @yieldparam result []
1542
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1358
1543
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
1359
1544
  # @example
1360
- # require "google/cloud/dlp/v2"
1545
+ # require "google/cloud/dlp"
1361
1546
  #
1362
- # dlp_service_client = Google::Cloud::Dlp::V2.new
1547
+ # dlp_service_client = Google::Cloud::Dlp.new(version: :V2)
1363
1548
  #
1364
1549
  # # TODO: Initialize +name+:
1365
1550
  # name = ''
@@ -1367,16 +1552,18 @@ module Google
1367
1552
 
1368
1553
  def delete_job_trigger \
1369
1554
  name,
1370
- options: nil
1555
+ options: nil,
1556
+ &block
1371
1557
  req = {
1372
1558
  name: name
1373
1559
  }.delete_if { |_, v| v.nil? }
1374
1560
  req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::DeleteJobTriggerRequest)
1375
- @delete_job_trigger.call(req, options)
1561
+ @delete_job_trigger.call(req, options, &block)
1376
1562
  nil
1377
1563
  end
1378
1564
 
1379
1565
  # Updates a job trigger.
1566
+ # See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
1380
1567
  #
1381
1568
  # @param name [String]
1382
1569
  # Resource name of the project and the triggeredJob, for example
@@ -1392,12 +1579,15 @@ module Google
1392
1579
  # @param options [Google::Gax::CallOptions]
1393
1580
  # Overrides the default settings for this call, e.g, timeout,
1394
1581
  # retries, etc.
1582
+ # @yield [result, operation] Access the result along with the RPC operation
1583
+ # @yieldparam result [Google::Privacy::Dlp::V2::JobTrigger]
1584
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1395
1585
  # @return [Google::Privacy::Dlp::V2::JobTrigger]
1396
1586
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
1397
1587
  # @example
1398
- # require "google/cloud/dlp/v2"
1588
+ # require "google/cloud/dlp"
1399
1589
  #
1400
- # dlp_service_client = Google::Cloud::Dlp::V2.new
1590
+ # dlp_service_client = Google::Cloud::Dlp.new(version: :V2)
1401
1591
  # formatted_name = Google::Cloud::Dlp::V2::DlpServiceClient.project_job_trigger_path("[PROJECT]", "[JOB_TRIGGER]")
1402
1592
  # response = dlp_service_client.update_job_trigger(formatted_name)
1403
1593
 
@@ -1405,18 +1595,20 @@ module Google
1405
1595
  name,
1406
1596
  job_trigger: nil,
1407
1597
  update_mask: nil,
1408
- options: nil
1598
+ options: nil,
1599
+ &block
1409
1600
  req = {
1410
1601
  name: name,
1411
1602
  job_trigger: job_trigger,
1412
1603
  update_mask: update_mask
1413
1604
  }.delete_if { |_, v| v.nil? }
1414
1605
  req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::UpdateJobTriggerRequest)
1415
- @update_job_trigger.call(req, options)
1606
+ @update_job_trigger.call(req, options, &block)
1416
1607
  end
1417
1608
 
1418
1609
  # Creates a job trigger to run DLP actions such as scanning storage for
1419
1610
  # sensitive information on a set schedule.
1611
+ # See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
1420
1612
  #
1421
1613
  # @param parent [String]
1422
1614
  # The parent resource name, for example projects/my-project-id.
@@ -1432,12 +1624,15 @@ module Google
1432
1624
  # @param options [Google::Gax::CallOptions]
1433
1625
  # Overrides the default settings for this call, e.g, timeout,
1434
1626
  # retries, etc.
1627
+ # @yield [result, operation] Access the result along with the RPC operation
1628
+ # @yieldparam result [Google::Privacy::Dlp::V2::JobTrigger]
1629
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
1435
1630
  # @return [Google::Privacy::Dlp::V2::JobTrigger]
1436
1631
  # @raise [Google::Gax::GaxError] if the RPC is aborted.
1437
1632
  # @example
1438
- # require "google/cloud/dlp/v2"
1633
+ # require "google/cloud/dlp"
1439
1634
  #
1440
- # dlp_service_client = Google::Cloud::Dlp::V2.new
1635
+ # dlp_service_client = Google::Cloud::Dlp.new(version: :V2)
1441
1636
  # formatted_parent = Google::Cloud::Dlp::V2::DlpServiceClient.project_path("[PROJECT]")
1442
1637
  # response = dlp_service_client.create_job_trigger(formatted_parent)
1443
1638
 
@@ -1445,14 +1640,15 @@ module Google
1445
1640
  parent,
1446
1641
  job_trigger: nil,
1447
1642
  trigger_id: nil,
1448
- options: nil
1643
+ options: nil,
1644
+ &block
1449
1645
  req = {
1450
1646
  parent: parent,
1451
1647
  job_trigger: job_trigger,
1452
1648
  trigger_id: trigger_id
1453
1649
  }.delete_if { |_, v| v.nil? }
1454
1650
  req = Google::Gax::to_proto(req, Google::Privacy::Dlp::V2::CreateJobTriggerRequest)
1455
- @create_job_trigger.call(req, options)
1651
+ @create_job_trigger.call(req, options, &block)
1456
1652
  end
1457
1653
  end
1458
1654
  end