google-cloud-dlp-v2 0.7.1 → 0.8.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.
@@ -49,13 +49,12 @@ module Google
49
49
  # See {::Google::Cloud::Dlp::V2::DlpService::Client::Configuration}
50
50
  # for a description of the configuration fields.
51
51
  #
52
- # ## Example
52
+ # @example
53
53
  #
54
- # To modify the configuration for all DlpService clients:
55
- #
56
- # ::Google::Cloud::Dlp::V2::DlpService::Client.configure do |config|
57
- # config.timeout = 10.0
58
- # end
54
+ # # Modify the configuration for all DlpService clients
55
+ # ::Google::Cloud::Dlp::V2::DlpService::Client.configure do |config|
56
+ # config.timeout = 10.0
57
+ # end
59
58
  #
60
59
  # @yield [config] Configure the Client client.
61
60
  # @yieldparam config [Client::Configuration]
@@ -75,42 +74,27 @@ module Google
75
74
 
76
75
  default_config.rpcs.inspect_content.timeout = 300.0
77
76
  default_config.rpcs.inspect_content.retry_policy = {
78
- initial_delay: 0.1,
79
- max_delay: 60.0,
80
- multiplier: 1.3,
81
- retry_codes: [14, 4]
77
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
82
78
  }
83
79
 
84
80
  default_config.rpcs.redact_image.timeout = 300.0
85
81
  default_config.rpcs.redact_image.retry_policy = {
86
- initial_delay: 0.1,
87
- max_delay: 60.0,
88
- multiplier: 1.3,
89
- retry_codes: [14, 4]
82
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
90
83
  }
91
84
 
92
85
  default_config.rpcs.deidentify_content.timeout = 300.0
93
86
  default_config.rpcs.deidentify_content.retry_policy = {
94
- initial_delay: 0.1,
95
- max_delay: 60.0,
96
- multiplier: 1.3,
97
- retry_codes: [14, 4]
87
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
98
88
  }
99
89
 
100
90
  default_config.rpcs.reidentify_content.timeout = 300.0
101
91
  default_config.rpcs.reidentify_content.retry_policy = {
102
- initial_delay: 0.1,
103
- max_delay: 60.0,
104
- multiplier: 1.3,
105
- retry_codes: [14, 4]
92
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
106
93
  }
107
94
 
108
95
  default_config.rpcs.list_info_types.timeout = 300.0
109
96
  default_config.rpcs.list_info_types.retry_policy = {
110
- initial_delay: 0.1,
111
- max_delay: 60.0,
112
- multiplier: 1.3,
113
- retry_codes: [14, 4]
97
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
114
98
  }
115
99
 
116
100
  default_config.rpcs.create_inspect_template.timeout = 300.0
@@ -119,26 +103,17 @@ module Google
119
103
 
120
104
  default_config.rpcs.get_inspect_template.timeout = 300.0
121
105
  default_config.rpcs.get_inspect_template.retry_policy = {
122
- initial_delay: 0.1,
123
- max_delay: 60.0,
124
- multiplier: 1.3,
125
- retry_codes: [14, 4]
106
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
126
107
  }
127
108
 
128
109
  default_config.rpcs.list_inspect_templates.timeout = 300.0
129
110
  default_config.rpcs.list_inspect_templates.retry_policy = {
130
- initial_delay: 0.1,
131
- max_delay: 60.0,
132
- multiplier: 1.3,
133
- retry_codes: [14, 4]
111
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
134
112
  }
135
113
 
136
114
  default_config.rpcs.delete_inspect_template.timeout = 300.0
137
115
  default_config.rpcs.delete_inspect_template.retry_policy = {
138
- initial_delay: 0.1,
139
- max_delay: 60.0,
140
- multiplier: 1.3,
141
- retry_codes: [14, 4]
116
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
142
117
  }
143
118
 
144
119
  default_config.rpcs.create_deidentify_template.timeout = 300.0
@@ -147,26 +122,17 @@ module Google
147
122
 
148
123
  default_config.rpcs.get_deidentify_template.timeout = 300.0
149
124
  default_config.rpcs.get_deidentify_template.retry_policy = {
150
- initial_delay: 0.1,
151
- max_delay: 60.0,
152
- multiplier: 1.3,
153
- retry_codes: [14, 4]
125
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
154
126
  }
155
127
 
156
128
  default_config.rpcs.list_deidentify_templates.timeout = 300.0
157
129
  default_config.rpcs.list_deidentify_templates.retry_policy = {
158
- initial_delay: 0.1,
159
- max_delay: 60.0,
160
- multiplier: 1.3,
161
- retry_codes: [14, 4]
130
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
162
131
  }
163
132
 
164
133
  default_config.rpcs.delete_deidentify_template.timeout = 300.0
165
134
  default_config.rpcs.delete_deidentify_template.retry_policy = {
166
- initial_delay: 0.1,
167
- max_delay: 60.0,
168
- multiplier: 1.3,
169
- retry_codes: [14, 4]
135
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
170
136
  }
171
137
 
172
138
  default_config.rpcs.create_job_trigger.timeout = 300.0
@@ -177,26 +143,17 @@ module Google
177
143
 
178
144
  default_config.rpcs.get_job_trigger.timeout = 300.0
179
145
  default_config.rpcs.get_job_trigger.retry_policy = {
180
- initial_delay: 0.1,
181
- max_delay: 60.0,
182
- multiplier: 1.3,
183
- retry_codes: [14, 4]
146
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
184
147
  }
185
148
 
186
149
  default_config.rpcs.list_job_triggers.timeout = 300.0
187
150
  default_config.rpcs.list_job_triggers.retry_policy = {
188
- initial_delay: 0.1,
189
- max_delay: 60.0,
190
- multiplier: 1.3,
191
- retry_codes: [14, 4]
151
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
192
152
  }
193
153
 
194
154
  default_config.rpcs.delete_job_trigger.timeout = 300.0
195
155
  default_config.rpcs.delete_job_trigger.retry_policy = {
196
- initial_delay: 0.1,
197
- max_delay: 60.0,
198
- multiplier: 1.3,
199
- retry_codes: [14, 4]
156
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
200
157
  }
201
158
 
202
159
  default_config.rpcs.activate_job_trigger.timeout = 300.0
@@ -205,26 +162,17 @@ module Google
205
162
 
206
163
  default_config.rpcs.list_dlp_jobs.timeout = 300.0
207
164
  default_config.rpcs.list_dlp_jobs.retry_policy = {
208
- initial_delay: 0.1,
209
- max_delay: 60.0,
210
- multiplier: 1.3,
211
- retry_codes: [14, 4]
165
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
212
166
  }
213
167
 
214
168
  default_config.rpcs.get_dlp_job.timeout = 300.0
215
169
  default_config.rpcs.get_dlp_job.retry_policy = {
216
- initial_delay: 0.1,
217
- max_delay: 60.0,
218
- multiplier: 1.3,
219
- retry_codes: [14, 4]
170
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
220
171
  }
221
172
 
222
173
  default_config.rpcs.delete_dlp_job.timeout = 300.0
223
174
  default_config.rpcs.delete_dlp_job.retry_policy = {
224
- initial_delay: 0.1,
225
- max_delay: 60.0,
226
- multiplier: 1.3,
227
- retry_codes: [14, 4]
175
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
228
176
  }
229
177
 
230
178
  default_config.rpcs.cancel_dlp_job.timeout = 300.0
@@ -235,26 +183,17 @@ module Google
235
183
 
236
184
  default_config.rpcs.get_stored_info_type.timeout = 300.0
237
185
  default_config.rpcs.get_stored_info_type.retry_policy = {
238
- initial_delay: 0.1,
239
- max_delay: 60.0,
240
- multiplier: 1.3,
241
- retry_codes: [14, 4]
186
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
242
187
  }
243
188
 
244
189
  default_config.rpcs.list_stored_info_types.timeout = 300.0
245
190
  default_config.rpcs.list_stored_info_types.retry_policy = {
246
- initial_delay: 0.1,
247
- max_delay: 60.0,
248
- multiplier: 1.3,
249
- retry_codes: [14, 4]
191
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
250
192
  }
251
193
 
252
194
  default_config.rpcs.delete_stored_info_type.timeout = 300.0
253
195
  default_config.rpcs.delete_stored_info_type.retry_policy = {
254
- initial_delay: 0.1,
255
- max_delay: 60.0,
256
- multiplier: 1.3,
257
- retry_codes: [14, 4]
196
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
258
197
  }
259
198
 
260
199
  default_config.rpcs.hybrid_inspect_dlp_job.timeout = 300.0
@@ -290,19 +229,15 @@ module Google
290
229
  ##
291
230
  # Create a new DlpService client object.
292
231
  #
293
- # ## Examples
294
- #
295
- # To create a new DlpService client with the default
296
- # configuration:
297
- #
298
- # client = ::Google::Cloud::Dlp::V2::DlpService::Client.new
232
+ # @example
299
233
  #
300
- # To create a new DlpService client with a custom
301
- # configuration:
234
+ # # Create a client using the default configuration
235
+ # client = ::Google::Cloud::Dlp::V2::DlpService::Client.new
302
236
  #
303
- # client = ::Google::Cloud::Dlp::V2::DlpService::Client.new do |config|
304
- # config.timeout = 10.0
305
- # end
237
+ # # Create a client using a custom configuration
238
+ # client = ::Google::Cloud::Dlp::V2::DlpService::Client.new do |config|
239
+ # config.timeout = 10.0
240
+ # end
306
241
  #
307
242
  # @yield [config] Configure the DlpService client.
308
243
  # @yieldparam config [Client::Configuration]
@@ -322,14 +257,13 @@ module Google
322
257
 
323
258
  # Create credentials
324
259
  credentials = @config.credentials
325
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
260
+ # Use self-signed JWT if the endpoint is unchanged from default,
326
261
  # but only if the default endpoint does not have a region prefix.
327
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
328
- @config.endpoint == Client.configure.endpoint &&
262
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
329
263
  !@config.endpoint.split(".").first.include?("-")
330
264
  credentials ||= Credentials.default scope: @config.scope,
331
265
  enable_self_signed_jwt: enable_self_signed_jwt
332
- if credentials.is_a?(String) || credentials.is_a?(Hash)
266
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
333
267
  credentials = Credentials.new credentials, scope: @config.scope
334
268
  end
335
269
  @quota_project_id = @config.quota_project
@@ -411,6 +345,21 @@ module Google
411
345
  #
412
346
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
413
347
  #
348
+ # @example Basic example
349
+ # require "google/cloud/dlp/v2"
350
+ #
351
+ # # Create a client object. The client can be reused for multiple calls.
352
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
353
+ #
354
+ # # Create a request. To set request fields, pass in keyword arguments.
355
+ # request = Google::Cloud::Dlp::V2::InspectContentRequest.new
356
+ #
357
+ # # Call the inspect_content method.
358
+ # result = client.inspect_content request
359
+ #
360
+ # # The returned object is of type Google::Cloud::Dlp::V2::InspectContentResponse.
361
+ # p result
362
+ #
414
363
  def inspect_content request, options = nil
415
364
  raise ::ArgumentError, "request must be provided" if request.nil?
416
365
 
@@ -428,16 +377,20 @@ module Google
428
377
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
429
378
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
430
379
 
431
- header_params = {
432
- "parent" => request.parent
433
- }
380
+ header_params = {}
381
+ if request.parent
382
+ header_params["parent"] = request.parent
383
+ end
384
+
434
385
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
435
386
  metadata[:"x-goog-request-params"] ||= request_params_header
436
387
 
437
388
  options.apply_defaults timeout: @config.rpcs.inspect_content.timeout,
438
389
  metadata: metadata,
439
390
  retry_policy: @config.rpcs.inspect_content.retry_policy
440
- options.apply_defaults metadata: @config.metadata,
391
+
392
+ options.apply_defaults timeout: @config.timeout,
393
+ metadata: @config.metadata,
441
394
  retry_policy: @config.retry_policy
442
395
 
443
396
  @dlp_service_stub.call_rpc :inspect_content, request, options: options do |response, operation|
@@ -510,6 +463,21 @@ module Google
510
463
  #
511
464
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
512
465
  #
466
+ # @example Basic example
467
+ # require "google/cloud/dlp/v2"
468
+ #
469
+ # # Create a client object. The client can be reused for multiple calls.
470
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
471
+ #
472
+ # # Create a request. To set request fields, pass in keyword arguments.
473
+ # request = Google::Cloud::Dlp::V2::RedactImageRequest.new
474
+ #
475
+ # # Call the redact_image method.
476
+ # result = client.redact_image request
477
+ #
478
+ # # The returned object is of type Google::Cloud::Dlp::V2::RedactImageResponse.
479
+ # p result
480
+ #
513
481
  def redact_image request, options = nil
514
482
  raise ::ArgumentError, "request must be provided" if request.nil?
515
483
 
@@ -527,16 +495,20 @@ module Google
527
495
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
528
496
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
529
497
 
530
- header_params = {
531
- "parent" => request.parent
532
- }
498
+ header_params = {}
499
+ if request.parent
500
+ header_params["parent"] = request.parent
501
+ end
502
+
533
503
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
534
504
  metadata[:"x-goog-request-params"] ||= request_params_header
535
505
 
536
506
  options.apply_defaults timeout: @config.rpcs.redact_image.timeout,
537
507
  metadata: metadata,
538
508
  retry_policy: @config.rpcs.redact_image.retry_policy
539
- options.apply_defaults metadata: @config.metadata,
509
+
510
+ options.apply_defaults timeout: @config.timeout,
511
+ metadata: @config.metadata,
540
512
  retry_policy: @config.retry_policy
541
513
 
542
514
  @dlp_service_stub.call_rpc :redact_image, request, options: options do |response, operation|
@@ -622,6 +594,21 @@ module Google
622
594
  #
623
595
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
624
596
  #
597
+ # @example Basic example
598
+ # require "google/cloud/dlp/v2"
599
+ #
600
+ # # Create a client object. The client can be reused for multiple calls.
601
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
602
+ #
603
+ # # Create a request. To set request fields, pass in keyword arguments.
604
+ # request = Google::Cloud::Dlp::V2::DeidentifyContentRequest.new
605
+ #
606
+ # # Call the deidentify_content method.
607
+ # result = client.deidentify_content request
608
+ #
609
+ # # The returned object is of type Google::Cloud::Dlp::V2::DeidentifyContentResponse.
610
+ # p result
611
+ #
625
612
  def deidentify_content request, options = nil
626
613
  raise ::ArgumentError, "request must be provided" if request.nil?
627
614
 
@@ -639,16 +626,20 @@ module Google
639
626
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
640
627
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
641
628
 
642
- header_params = {
643
- "parent" => request.parent
644
- }
629
+ header_params = {}
630
+ if request.parent
631
+ header_params["parent"] = request.parent
632
+ end
633
+
645
634
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
646
635
  metadata[:"x-goog-request-params"] ||= request_params_header
647
636
 
648
637
  options.apply_defaults timeout: @config.rpcs.deidentify_content.timeout,
649
638
  metadata: metadata,
650
639
  retry_policy: @config.rpcs.deidentify_content.retry_policy
651
- options.apply_defaults metadata: @config.metadata,
640
+
641
+ options.apply_defaults timeout: @config.timeout,
642
+ metadata: @config.metadata,
652
643
  retry_policy: @config.retry_policy
653
644
 
654
645
  @dlp_service_stub.call_rpc :deidentify_content, request, options: options do |response, operation|
@@ -737,6 +728,21 @@ module Google
737
728
  #
738
729
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
739
730
  #
731
+ # @example Basic example
732
+ # require "google/cloud/dlp/v2"
733
+ #
734
+ # # Create a client object. The client can be reused for multiple calls.
735
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
736
+ #
737
+ # # Create a request. To set request fields, pass in keyword arguments.
738
+ # request = Google::Cloud::Dlp::V2::ReidentifyContentRequest.new
739
+ #
740
+ # # Call the reidentify_content method.
741
+ # result = client.reidentify_content request
742
+ #
743
+ # # The returned object is of type Google::Cloud::Dlp::V2::ReidentifyContentResponse.
744
+ # p result
745
+ #
740
746
  def reidentify_content request, options = nil
741
747
  raise ::ArgumentError, "request must be provided" if request.nil?
742
748
 
@@ -754,16 +760,20 @@ module Google
754
760
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
755
761
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
756
762
 
757
- header_params = {
758
- "parent" => request.parent
759
- }
763
+ header_params = {}
764
+ if request.parent
765
+ header_params["parent"] = request.parent
766
+ end
767
+
760
768
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
761
769
  metadata[:"x-goog-request-params"] ||= request_params_header
762
770
 
763
771
  options.apply_defaults timeout: @config.rpcs.reidentify_content.timeout,
764
772
  metadata: metadata,
765
773
  retry_policy: @config.rpcs.reidentify_content.retry_policy
766
- options.apply_defaults metadata: @config.metadata,
774
+
775
+ options.apply_defaults timeout: @config.timeout,
776
+ metadata: @config.metadata,
767
777
  retry_policy: @config.retry_policy
768
778
 
769
779
  @dlp_service_stub.call_rpc :reidentify_content, request, options: options do |response, operation|
@@ -818,6 +828,21 @@ module Google
818
828
  #
819
829
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
820
830
  #
831
+ # @example Basic example
832
+ # require "google/cloud/dlp/v2"
833
+ #
834
+ # # Create a client object. The client can be reused for multiple calls.
835
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
836
+ #
837
+ # # Create a request. To set request fields, pass in keyword arguments.
838
+ # request = Google::Cloud::Dlp::V2::ListInfoTypesRequest.new
839
+ #
840
+ # # Call the list_info_types method.
841
+ # result = client.list_info_types request
842
+ #
843
+ # # The returned object is of type Google::Cloud::Dlp::V2::ListInfoTypesResponse.
844
+ # p result
845
+ #
821
846
  def list_info_types request, options = nil
822
847
  raise ::ArgumentError, "request must be provided" if request.nil?
823
848
 
@@ -838,7 +863,9 @@ module Google
838
863
  options.apply_defaults timeout: @config.rpcs.list_info_types.timeout,
839
864
  metadata: metadata,
840
865
  retry_policy: @config.rpcs.list_info_types.retry_policy
841
- options.apply_defaults metadata: @config.metadata,
866
+
867
+ options.apply_defaults timeout: @config.timeout,
868
+ metadata: @config.metadata,
842
869
  retry_policy: @config.retry_policy
843
870
 
844
871
  @dlp_service_stub.call_rpc :list_info_types, request, options: options do |response, operation|
@@ -908,6 +935,21 @@ module Google
908
935
  #
909
936
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
910
937
  #
938
+ # @example Basic example
939
+ # require "google/cloud/dlp/v2"
940
+ #
941
+ # # Create a client object. The client can be reused for multiple calls.
942
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
943
+ #
944
+ # # Create a request. To set request fields, pass in keyword arguments.
945
+ # request = Google::Cloud::Dlp::V2::CreateInspectTemplateRequest.new
946
+ #
947
+ # # Call the create_inspect_template method.
948
+ # result = client.create_inspect_template request
949
+ #
950
+ # # The returned object is of type Google::Cloud::Dlp::V2::InspectTemplate.
951
+ # p result
952
+ #
911
953
  def create_inspect_template request, options = nil
912
954
  raise ::ArgumentError, "request must be provided" if request.nil?
913
955
 
@@ -925,16 +967,20 @@ module Google
925
967
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
926
968
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
927
969
 
928
- header_params = {
929
- "parent" => request.parent
930
- }
970
+ header_params = {}
971
+ if request.parent
972
+ header_params["parent"] = request.parent
973
+ end
974
+
931
975
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
932
976
  metadata[:"x-goog-request-params"] ||= request_params_header
933
977
 
934
978
  options.apply_defaults timeout: @config.rpcs.create_inspect_template.timeout,
935
979
  metadata: metadata,
936
980
  retry_policy: @config.rpcs.create_inspect_template.retry_policy
937
- options.apply_defaults metadata: @config.metadata,
981
+
982
+ options.apply_defaults timeout: @config.timeout,
983
+ metadata: @config.metadata,
938
984
  retry_policy: @config.retry_policy
939
985
 
940
986
  @dlp_service_stub.call_rpc :create_inspect_template, request, options: options do |response, operation|
@@ -981,6 +1027,21 @@ module Google
981
1027
  #
982
1028
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
983
1029
  #
1030
+ # @example Basic example
1031
+ # require "google/cloud/dlp/v2"
1032
+ #
1033
+ # # Create a client object. The client can be reused for multiple calls.
1034
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
1035
+ #
1036
+ # # Create a request. To set request fields, pass in keyword arguments.
1037
+ # request = Google::Cloud::Dlp::V2::UpdateInspectTemplateRequest.new
1038
+ #
1039
+ # # Call the update_inspect_template method.
1040
+ # result = client.update_inspect_template request
1041
+ #
1042
+ # # The returned object is of type Google::Cloud::Dlp::V2::InspectTemplate.
1043
+ # p result
1044
+ #
984
1045
  def update_inspect_template request, options = nil
985
1046
  raise ::ArgumentError, "request must be provided" if request.nil?
986
1047
 
@@ -998,16 +1059,20 @@ module Google
998
1059
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
999
1060
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1000
1061
 
1001
- header_params = {
1002
- "name" => request.name
1003
- }
1062
+ header_params = {}
1063
+ if request.name
1064
+ header_params["name"] = request.name
1065
+ end
1066
+
1004
1067
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1005
1068
  metadata[:"x-goog-request-params"] ||= request_params_header
1006
1069
 
1007
1070
  options.apply_defaults timeout: @config.rpcs.update_inspect_template.timeout,
1008
1071
  metadata: metadata,
1009
1072
  retry_policy: @config.rpcs.update_inspect_template.retry_policy
1010
- options.apply_defaults metadata: @config.metadata,
1073
+
1074
+ options.apply_defaults timeout: @config.timeout,
1075
+ metadata: @config.metadata,
1011
1076
  retry_policy: @config.retry_policy
1012
1077
 
1013
1078
  @dlp_service_stub.call_rpc :update_inspect_template, request, options: options do |response, operation|
@@ -1050,6 +1115,21 @@ module Google
1050
1115
  #
1051
1116
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1052
1117
  #
1118
+ # @example Basic example
1119
+ # require "google/cloud/dlp/v2"
1120
+ #
1121
+ # # Create a client object. The client can be reused for multiple calls.
1122
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
1123
+ #
1124
+ # # Create a request. To set request fields, pass in keyword arguments.
1125
+ # request = Google::Cloud::Dlp::V2::GetInspectTemplateRequest.new
1126
+ #
1127
+ # # Call the get_inspect_template method.
1128
+ # result = client.get_inspect_template request
1129
+ #
1130
+ # # The returned object is of type Google::Cloud::Dlp::V2::InspectTemplate.
1131
+ # p result
1132
+ #
1053
1133
  def get_inspect_template request, options = nil
1054
1134
  raise ::ArgumentError, "request must be provided" if request.nil?
1055
1135
 
@@ -1067,16 +1147,20 @@ module Google
1067
1147
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
1068
1148
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1069
1149
 
1070
- header_params = {
1071
- "name" => request.name
1072
- }
1150
+ header_params = {}
1151
+ if request.name
1152
+ header_params["name"] = request.name
1153
+ end
1154
+
1073
1155
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1074
1156
  metadata[:"x-goog-request-params"] ||= request_params_header
1075
1157
 
1076
1158
  options.apply_defaults timeout: @config.rpcs.get_inspect_template.timeout,
1077
1159
  metadata: metadata,
1078
1160
  retry_policy: @config.rpcs.get_inspect_template.retry_policy
1079
- options.apply_defaults metadata: @config.metadata,
1161
+
1162
+ options.apply_defaults timeout: @config.timeout,
1163
+ metadata: @config.metadata,
1080
1164
  retry_policy: @config.retry_policy
1081
1165
 
1082
1166
  @dlp_service_stub.call_rpc :get_inspect_template, request, options: options do |response, operation|
@@ -1158,6 +1242,27 @@ module Google
1158
1242
  #
1159
1243
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1160
1244
  #
1245
+ # @example Basic example
1246
+ # require "google/cloud/dlp/v2"
1247
+ #
1248
+ # # Create a client object. The client can be reused for multiple calls.
1249
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
1250
+ #
1251
+ # # Create a request. To set request fields, pass in keyword arguments.
1252
+ # request = Google::Cloud::Dlp::V2::ListInspectTemplatesRequest.new
1253
+ #
1254
+ # # Call the list_inspect_templates method.
1255
+ # result = client.list_inspect_templates request
1256
+ #
1257
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1258
+ # # iterate over all elements by calling #each, and the enumerable
1259
+ # # will lazily make API calls to fetch subsequent pages. Other
1260
+ # # methods are also available for managing paging directly.
1261
+ # result.each do |response|
1262
+ # # Each element is of type ::Google::Cloud::Dlp::V2::InspectTemplate.
1263
+ # p response
1264
+ # end
1265
+ #
1161
1266
  def list_inspect_templates request, options = nil
1162
1267
  raise ::ArgumentError, "request must be provided" if request.nil?
1163
1268
 
@@ -1175,16 +1280,20 @@ module Google
1175
1280
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
1176
1281
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1177
1282
 
1178
- header_params = {
1179
- "parent" => request.parent
1180
- }
1283
+ header_params = {}
1284
+ if request.parent
1285
+ header_params["parent"] = request.parent
1286
+ end
1287
+
1181
1288
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1182
1289
  metadata[:"x-goog-request-params"] ||= request_params_header
1183
1290
 
1184
1291
  options.apply_defaults timeout: @config.rpcs.list_inspect_templates.timeout,
1185
1292
  metadata: metadata,
1186
1293
  retry_policy: @config.rpcs.list_inspect_templates.retry_policy
1187
- options.apply_defaults metadata: @config.metadata,
1294
+
1295
+ options.apply_defaults timeout: @config.timeout,
1296
+ metadata: @config.metadata,
1188
1297
  retry_policy: @config.retry_policy
1189
1298
 
1190
1299
  @dlp_service_stub.call_rpc :list_inspect_templates, request, options: options do |response, operation|
@@ -1228,6 +1337,21 @@ module Google
1228
1337
  #
1229
1338
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1230
1339
  #
1340
+ # @example Basic example
1341
+ # require "google/cloud/dlp/v2"
1342
+ #
1343
+ # # Create a client object. The client can be reused for multiple calls.
1344
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
1345
+ #
1346
+ # # Create a request. To set request fields, pass in keyword arguments.
1347
+ # request = Google::Cloud::Dlp::V2::DeleteInspectTemplateRequest.new
1348
+ #
1349
+ # # Call the delete_inspect_template method.
1350
+ # result = client.delete_inspect_template request
1351
+ #
1352
+ # # The returned object is of type Google::Protobuf::Empty.
1353
+ # p result
1354
+ #
1231
1355
  def delete_inspect_template request, options = nil
1232
1356
  raise ::ArgumentError, "request must be provided" if request.nil?
1233
1357
 
@@ -1245,16 +1369,20 @@ module Google
1245
1369
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
1246
1370
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1247
1371
 
1248
- header_params = {
1249
- "name" => request.name
1250
- }
1372
+ header_params = {}
1373
+ if request.name
1374
+ header_params["name"] = request.name
1375
+ end
1376
+
1251
1377
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1252
1378
  metadata[:"x-goog-request-params"] ||= request_params_header
1253
1379
 
1254
1380
  options.apply_defaults timeout: @config.rpcs.delete_inspect_template.timeout,
1255
1381
  metadata: metadata,
1256
1382
  retry_policy: @config.rpcs.delete_inspect_template.retry_policy
1257
- options.apply_defaults metadata: @config.metadata,
1383
+
1384
+ options.apply_defaults timeout: @config.timeout,
1385
+ metadata: @config.metadata,
1258
1386
  retry_policy: @config.retry_policy
1259
1387
 
1260
1388
  @dlp_service_stub.call_rpc :delete_inspect_template, request, options: options do |response, operation|
@@ -1325,6 +1453,21 @@ module Google
1325
1453
  #
1326
1454
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1327
1455
  #
1456
+ # @example Basic example
1457
+ # require "google/cloud/dlp/v2"
1458
+ #
1459
+ # # Create a client object. The client can be reused for multiple calls.
1460
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
1461
+ #
1462
+ # # Create a request. To set request fields, pass in keyword arguments.
1463
+ # request = Google::Cloud::Dlp::V2::CreateDeidentifyTemplateRequest.new
1464
+ #
1465
+ # # Call the create_deidentify_template method.
1466
+ # result = client.create_deidentify_template request
1467
+ #
1468
+ # # The returned object is of type Google::Cloud::Dlp::V2::DeidentifyTemplate.
1469
+ # p result
1470
+ #
1328
1471
  def create_deidentify_template request, options = nil
1329
1472
  raise ::ArgumentError, "request must be provided" if request.nil?
1330
1473
 
@@ -1342,16 +1485,20 @@ module Google
1342
1485
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
1343
1486
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1344
1487
 
1345
- header_params = {
1346
- "parent" => request.parent
1347
- }
1488
+ header_params = {}
1489
+ if request.parent
1490
+ header_params["parent"] = request.parent
1491
+ end
1492
+
1348
1493
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1349
1494
  metadata[:"x-goog-request-params"] ||= request_params_header
1350
1495
 
1351
1496
  options.apply_defaults timeout: @config.rpcs.create_deidentify_template.timeout,
1352
1497
  metadata: metadata,
1353
1498
  retry_policy: @config.rpcs.create_deidentify_template.retry_policy
1354
- options.apply_defaults metadata: @config.metadata,
1499
+
1500
+ options.apply_defaults timeout: @config.timeout,
1501
+ metadata: @config.metadata,
1355
1502
  retry_policy: @config.retry_policy
1356
1503
 
1357
1504
  @dlp_service_stub.call_rpc :create_deidentify_template, request, options: options do |response, operation|
@@ -1399,6 +1546,21 @@ module Google
1399
1546
  #
1400
1547
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1401
1548
  #
1549
+ # @example Basic example
1550
+ # require "google/cloud/dlp/v2"
1551
+ #
1552
+ # # Create a client object. The client can be reused for multiple calls.
1553
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
1554
+ #
1555
+ # # Create a request. To set request fields, pass in keyword arguments.
1556
+ # request = Google::Cloud::Dlp::V2::UpdateDeidentifyTemplateRequest.new
1557
+ #
1558
+ # # Call the update_deidentify_template method.
1559
+ # result = client.update_deidentify_template request
1560
+ #
1561
+ # # The returned object is of type Google::Cloud::Dlp::V2::DeidentifyTemplate.
1562
+ # p result
1563
+ #
1402
1564
  def update_deidentify_template request, options = nil
1403
1565
  raise ::ArgumentError, "request must be provided" if request.nil?
1404
1566
 
@@ -1416,16 +1578,20 @@ module Google
1416
1578
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
1417
1579
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1418
1580
 
1419
- header_params = {
1420
- "name" => request.name
1421
- }
1581
+ header_params = {}
1582
+ if request.name
1583
+ header_params["name"] = request.name
1584
+ end
1585
+
1422
1586
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1423
1587
  metadata[:"x-goog-request-params"] ||= request_params_header
1424
1588
 
1425
1589
  options.apply_defaults timeout: @config.rpcs.update_deidentify_template.timeout,
1426
1590
  metadata: metadata,
1427
1591
  retry_policy: @config.rpcs.update_deidentify_template.retry_policy
1428
- options.apply_defaults metadata: @config.metadata,
1592
+
1593
+ options.apply_defaults timeout: @config.timeout,
1594
+ metadata: @config.metadata,
1429
1595
  retry_policy: @config.retry_policy
1430
1596
 
1431
1597
  @dlp_service_stub.call_rpc :update_deidentify_template, request, options: options do |response, operation|
@@ -1469,6 +1635,21 @@ module Google
1469
1635
  #
1470
1636
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1471
1637
  #
1638
+ # @example Basic example
1639
+ # require "google/cloud/dlp/v2"
1640
+ #
1641
+ # # Create a client object. The client can be reused for multiple calls.
1642
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
1643
+ #
1644
+ # # Create a request. To set request fields, pass in keyword arguments.
1645
+ # request = Google::Cloud::Dlp::V2::GetDeidentifyTemplateRequest.new
1646
+ #
1647
+ # # Call the get_deidentify_template method.
1648
+ # result = client.get_deidentify_template request
1649
+ #
1650
+ # # The returned object is of type Google::Cloud::Dlp::V2::DeidentifyTemplate.
1651
+ # p result
1652
+ #
1472
1653
  def get_deidentify_template request, options = nil
1473
1654
  raise ::ArgumentError, "request must be provided" if request.nil?
1474
1655
 
@@ -1486,16 +1667,20 @@ module Google
1486
1667
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
1487
1668
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1488
1669
 
1489
- header_params = {
1490
- "name" => request.name
1491
- }
1670
+ header_params = {}
1671
+ if request.name
1672
+ header_params["name"] = request.name
1673
+ end
1674
+
1492
1675
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1493
1676
  metadata[:"x-goog-request-params"] ||= request_params_header
1494
1677
 
1495
1678
  options.apply_defaults timeout: @config.rpcs.get_deidentify_template.timeout,
1496
1679
  metadata: metadata,
1497
1680
  retry_policy: @config.rpcs.get_deidentify_template.retry_policy
1498
- options.apply_defaults metadata: @config.metadata,
1681
+
1682
+ options.apply_defaults timeout: @config.timeout,
1683
+ metadata: @config.metadata,
1499
1684
  retry_policy: @config.retry_policy
1500
1685
 
1501
1686
  @dlp_service_stub.call_rpc :get_deidentify_template, request, options: options do |response, operation|
@@ -1578,6 +1763,27 @@ module Google
1578
1763
  #
1579
1764
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1580
1765
  #
1766
+ # @example Basic example
1767
+ # require "google/cloud/dlp/v2"
1768
+ #
1769
+ # # Create a client object. The client can be reused for multiple calls.
1770
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
1771
+ #
1772
+ # # Create a request. To set request fields, pass in keyword arguments.
1773
+ # request = Google::Cloud::Dlp::V2::ListDeidentifyTemplatesRequest.new
1774
+ #
1775
+ # # Call the list_deidentify_templates method.
1776
+ # result = client.list_deidentify_templates request
1777
+ #
1778
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1779
+ # # iterate over all elements by calling #each, and the enumerable
1780
+ # # will lazily make API calls to fetch subsequent pages. Other
1781
+ # # methods are also available for managing paging directly.
1782
+ # result.each do |response|
1783
+ # # Each element is of type ::Google::Cloud::Dlp::V2::DeidentifyTemplate.
1784
+ # p response
1785
+ # end
1786
+ #
1581
1787
  def list_deidentify_templates request, options = nil
1582
1788
  raise ::ArgumentError, "request must be provided" if request.nil?
1583
1789
 
@@ -1595,16 +1801,20 @@ module Google
1595
1801
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
1596
1802
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1597
1803
 
1598
- header_params = {
1599
- "parent" => request.parent
1600
- }
1804
+ header_params = {}
1805
+ if request.parent
1806
+ header_params["parent"] = request.parent
1807
+ end
1808
+
1601
1809
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1602
1810
  metadata[:"x-goog-request-params"] ||= request_params_header
1603
1811
 
1604
1812
  options.apply_defaults timeout: @config.rpcs.list_deidentify_templates.timeout,
1605
1813
  metadata: metadata,
1606
1814
  retry_policy: @config.rpcs.list_deidentify_templates.retry_policy
1607
- options.apply_defaults metadata: @config.metadata,
1815
+
1816
+ options.apply_defaults timeout: @config.timeout,
1817
+ metadata: @config.metadata,
1608
1818
  retry_policy: @config.retry_policy
1609
1819
 
1610
1820
  @dlp_service_stub.call_rpc :list_deidentify_templates, request, options: options do |response, operation|
@@ -1649,6 +1859,21 @@ module Google
1649
1859
  #
1650
1860
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1651
1861
  #
1862
+ # @example Basic example
1863
+ # require "google/cloud/dlp/v2"
1864
+ #
1865
+ # # Create a client object. The client can be reused for multiple calls.
1866
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
1867
+ #
1868
+ # # Create a request. To set request fields, pass in keyword arguments.
1869
+ # request = Google::Cloud::Dlp::V2::DeleteDeidentifyTemplateRequest.new
1870
+ #
1871
+ # # Call the delete_deidentify_template method.
1872
+ # result = client.delete_deidentify_template request
1873
+ #
1874
+ # # The returned object is of type Google::Protobuf::Empty.
1875
+ # p result
1876
+ #
1652
1877
  def delete_deidentify_template request, options = nil
1653
1878
  raise ::ArgumentError, "request must be provided" if request.nil?
1654
1879
 
@@ -1666,16 +1891,20 @@ module Google
1666
1891
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
1667
1892
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1668
1893
 
1669
- header_params = {
1670
- "name" => request.name
1671
- }
1894
+ header_params = {}
1895
+ if request.name
1896
+ header_params["name"] = request.name
1897
+ end
1898
+
1672
1899
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1673
1900
  metadata[:"x-goog-request-params"] ||= request_params_header
1674
1901
 
1675
1902
  options.apply_defaults timeout: @config.rpcs.delete_deidentify_template.timeout,
1676
1903
  metadata: metadata,
1677
1904
  retry_policy: @config.rpcs.delete_deidentify_template.retry_policy
1678
- options.apply_defaults metadata: @config.metadata,
1905
+
1906
+ options.apply_defaults timeout: @config.timeout,
1907
+ metadata: @config.metadata,
1679
1908
  retry_policy: @config.retry_policy
1680
1909
 
1681
1910
  @dlp_service_stub.call_rpc :delete_deidentify_template, request, options: options do |response, operation|
@@ -1741,6 +1970,21 @@ module Google
1741
1970
  #
1742
1971
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1743
1972
  #
1973
+ # @example Basic example
1974
+ # require "google/cloud/dlp/v2"
1975
+ #
1976
+ # # Create a client object. The client can be reused for multiple calls.
1977
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
1978
+ #
1979
+ # # Create a request. To set request fields, pass in keyword arguments.
1980
+ # request = Google::Cloud::Dlp::V2::CreateJobTriggerRequest.new
1981
+ #
1982
+ # # Call the create_job_trigger method.
1983
+ # result = client.create_job_trigger request
1984
+ #
1985
+ # # The returned object is of type Google::Cloud::Dlp::V2::JobTrigger.
1986
+ # p result
1987
+ #
1744
1988
  def create_job_trigger request, options = nil
1745
1989
  raise ::ArgumentError, "request must be provided" if request.nil?
1746
1990
 
@@ -1758,16 +2002,20 @@ module Google
1758
2002
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
1759
2003
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1760
2004
 
1761
- header_params = {
1762
- "parent" => request.parent
1763
- }
2005
+ header_params = {}
2006
+ if request.parent
2007
+ header_params["parent"] = request.parent
2008
+ end
2009
+
1764
2010
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1765
2011
  metadata[:"x-goog-request-params"] ||= request_params_header
1766
2012
 
1767
2013
  options.apply_defaults timeout: @config.rpcs.create_job_trigger.timeout,
1768
2014
  metadata: metadata,
1769
2015
  retry_policy: @config.rpcs.create_job_trigger.retry_policy
1770
- options.apply_defaults metadata: @config.metadata,
2016
+
2017
+ options.apply_defaults timeout: @config.timeout,
2018
+ metadata: @config.metadata,
1771
2019
  retry_policy: @config.retry_policy
1772
2020
 
1773
2021
  @dlp_service_stub.call_rpc :create_job_trigger, request, options: options do |response, operation|
@@ -1813,6 +2061,21 @@ module Google
1813
2061
  #
1814
2062
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1815
2063
  #
2064
+ # @example Basic example
2065
+ # require "google/cloud/dlp/v2"
2066
+ #
2067
+ # # Create a client object. The client can be reused for multiple calls.
2068
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
2069
+ #
2070
+ # # Create a request. To set request fields, pass in keyword arguments.
2071
+ # request = Google::Cloud::Dlp::V2::UpdateJobTriggerRequest.new
2072
+ #
2073
+ # # Call the update_job_trigger method.
2074
+ # result = client.update_job_trigger request
2075
+ #
2076
+ # # The returned object is of type Google::Cloud::Dlp::V2::JobTrigger.
2077
+ # p result
2078
+ #
1816
2079
  def update_job_trigger request, options = nil
1817
2080
  raise ::ArgumentError, "request must be provided" if request.nil?
1818
2081
 
@@ -1830,16 +2093,20 @@ module Google
1830
2093
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
1831
2094
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1832
2095
 
1833
- header_params = {
1834
- "name" => request.name
1835
- }
2096
+ header_params = {}
2097
+ if request.name
2098
+ header_params["name"] = request.name
2099
+ end
2100
+
1836
2101
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1837
2102
  metadata[:"x-goog-request-params"] ||= request_params_header
1838
2103
 
1839
2104
  options.apply_defaults timeout: @config.rpcs.update_job_trigger.timeout,
1840
2105
  metadata: metadata,
1841
2106
  retry_policy: @config.rpcs.update_job_trigger.retry_policy
1842
- options.apply_defaults metadata: @config.metadata,
2107
+
2108
+ options.apply_defaults timeout: @config.timeout,
2109
+ metadata: @config.metadata,
1843
2110
  retry_policy: @config.retry_policy
1844
2111
 
1845
2112
  @dlp_service_stub.call_rpc :update_job_trigger, request, options: options do |response, operation|
@@ -1854,9 +2121,6 @@ module Google
1854
2121
  # Inspect hybrid content and store findings to a trigger. The inspection
1855
2122
  # will be processed asynchronously. To review the findings monitor the
1856
2123
  # jobs within the trigger.
1857
- # Early access feature is in a pre-release state and might change or have
1858
- # limited support. For more information, see
1859
- # https://cloud.google.com/products#product-launch-stages.
1860
2124
  #
1861
2125
  # @overload hybrid_inspect_job_trigger(request, options = nil)
1862
2126
  # Pass arguments to `hybrid_inspect_job_trigger` via a request object, either of type
@@ -1887,6 +2151,21 @@ module Google
1887
2151
  #
1888
2152
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1889
2153
  #
2154
+ # @example Basic example
2155
+ # require "google/cloud/dlp/v2"
2156
+ #
2157
+ # # Create a client object. The client can be reused for multiple calls.
2158
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
2159
+ #
2160
+ # # Create a request. To set request fields, pass in keyword arguments.
2161
+ # request = Google::Cloud::Dlp::V2::HybridInspectJobTriggerRequest.new
2162
+ #
2163
+ # # Call the hybrid_inspect_job_trigger method.
2164
+ # result = client.hybrid_inspect_job_trigger request
2165
+ #
2166
+ # # The returned object is of type Google::Cloud::Dlp::V2::HybridInspectResponse.
2167
+ # p result
2168
+ #
1890
2169
  def hybrid_inspect_job_trigger request, options = nil
1891
2170
  raise ::ArgumentError, "request must be provided" if request.nil?
1892
2171
 
@@ -1904,16 +2183,20 @@ module Google
1904
2183
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
1905
2184
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1906
2185
 
1907
- header_params = {
1908
- "name" => request.name
1909
- }
2186
+ header_params = {}
2187
+ if request.name
2188
+ header_params["name"] = request.name
2189
+ end
2190
+
1910
2191
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1911
2192
  metadata[:"x-goog-request-params"] ||= request_params_header
1912
2193
 
1913
2194
  options.apply_defaults timeout: @config.rpcs.hybrid_inspect_job_trigger.timeout,
1914
2195
  metadata: metadata,
1915
2196
  retry_policy: @config.rpcs.hybrid_inspect_job_trigger.retry_policy
1916
- options.apply_defaults metadata: @config.metadata,
2197
+
2198
+ options.apply_defaults timeout: @config.timeout,
2199
+ metadata: @config.metadata,
1917
2200
  retry_policy: @config.retry_policy
1918
2201
 
1919
2202
  @dlp_service_stub.call_rpc :hybrid_inspect_job_trigger, request, options: options do |response, operation|
@@ -1955,6 +2238,21 @@ module Google
1955
2238
  #
1956
2239
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1957
2240
  #
2241
+ # @example Basic example
2242
+ # require "google/cloud/dlp/v2"
2243
+ #
2244
+ # # Create a client object. The client can be reused for multiple calls.
2245
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
2246
+ #
2247
+ # # Create a request. To set request fields, pass in keyword arguments.
2248
+ # request = Google::Cloud::Dlp::V2::GetJobTriggerRequest.new
2249
+ #
2250
+ # # Call the get_job_trigger method.
2251
+ # result = client.get_job_trigger request
2252
+ #
2253
+ # # The returned object is of type Google::Cloud::Dlp::V2::JobTrigger.
2254
+ # p result
2255
+ #
1958
2256
  def get_job_trigger request, options = nil
1959
2257
  raise ::ArgumentError, "request must be provided" if request.nil?
1960
2258
 
@@ -1972,16 +2270,20 @@ module Google
1972
2270
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
1973
2271
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1974
2272
 
1975
- header_params = {
1976
- "name" => request.name
1977
- }
2273
+ header_params = {}
2274
+ if request.name
2275
+ header_params["name"] = request.name
2276
+ end
2277
+
1978
2278
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1979
2279
  metadata[:"x-goog-request-params"] ||= request_params_header
1980
2280
 
1981
2281
  options.apply_defaults timeout: @config.rpcs.get_job_trigger.timeout,
1982
2282
  metadata: metadata,
1983
2283
  retry_policy: @config.rpcs.get_job_trigger.retry_policy
1984
- options.apply_defaults metadata: @config.metadata,
2284
+
2285
+ options.apply_defaults timeout: @config.timeout,
2286
+ metadata: @config.metadata,
1985
2287
  retry_policy: @config.retry_policy
1986
2288
 
1987
2289
  @dlp_service_stub.call_rpc :get_job_trigger, request, options: options do |response, operation|
@@ -2006,7 +2308,7 @@ module Google
2006
2308
  # @param options [::Gapic::CallOptions, ::Hash]
2007
2309
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2008
2310
  #
2009
- # @overload list_job_triggers(parent: nil, page_token: nil, page_size: nil, order_by: nil, filter: nil, location_id: nil)
2311
+ # @overload list_job_triggers(parent: nil, page_token: nil, page_size: nil, order_by: nil, filter: nil, type: nil, location_id: nil)
2010
2312
  # Pass arguments to `list_job_triggers` via keyword arguments. Note that at
2011
2313
  # least one keyword argument is required. To specify no parameters, or to keep all
2012
2314
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -2059,7 +2361,7 @@ module Google
2059
2361
  # * Restrictions can be combined by `AND` or `OR` logical operators. A
2060
2362
  # sequence of restrictions implicitly uses `AND`.
2061
2363
  # * A restriction has the form of `{field} {operator} {value}`.
2062
- # * Supported fields/values for inspect jobs:
2364
+ # * Supported fields/values for inspect triggers:
2063
2365
  # - `status` - HEALTHY|PAUSED|CANCELLED
2064
2366
  # - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY
2065
2367
  # - 'last_run_time` - RFC 3339 formatted timestamp, surrounded by
@@ -2075,6 +2377,8 @@ module Google
2075
2377
  # * last_run_time > \"2017-12-12T00:00:00+00:00\"
2076
2378
  #
2077
2379
  # The length of this field should be no more than 500 characters.
2380
+ # @param type [::Google::Cloud::Dlp::V2::DlpJobType]
2381
+ # The type of jobs. Will use `DlpJobType.INSPECT` if not set.
2078
2382
  # @param location_id [::String]
2079
2383
  # Deprecated. This field has no effect.
2080
2384
  #
@@ -2086,6 +2390,27 @@ module Google
2086
2390
  #
2087
2391
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2088
2392
  #
2393
+ # @example Basic example
2394
+ # require "google/cloud/dlp/v2"
2395
+ #
2396
+ # # Create a client object. The client can be reused for multiple calls.
2397
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
2398
+ #
2399
+ # # Create a request. To set request fields, pass in keyword arguments.
2400
+ # request = Google::Cloud::Dlp::V2::ListJobTriggersRequest.new
2401
+ #
2402
+ # # Call the list_job_triggers method.
2403
+ # result = client.list_job_triggers request
2404
+ #
2405
+ # # The returned object is of type Gapic::PagedEnumerable. You can
2406
+ # # iterate over all elements by calling #each, and the enumerable
2407
+ # # will lazily make API calls to fetch subsequent pages. Other
2408
+ # # methods are also available for managing paging directly.
2409
+ # result.each do |response|
2410
+ # # Each element is of type ::Google::Cloud::Dlp::V2::JobTrigger.
2411
+ # p response
2412
+ # end
2413
+ #
2089
2414
  def list_job_triggers request, options = nil
2090
2415
  raise ::ArgumentError, "request must be provided" if request.nil?
2091
2416
 
@@ -2103,16 +2428,20 @@ module Google
2103
2428
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
2104
2429
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2105
2430
 
2106
- header_params = {
2107
- "parent" => request.parent
2108
- }
2431
+ header_params = {}
2432
+ if request.parent
2433
+ header_params["parent"] = request.parent
2434
+ end
2435
+
2109
2436
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2110
2437
  metadata[:"x-goog-request-params"] ||= request_params_header
2111
2438
 
2112
2439
  options.apply_defaults timeout: @config.rpcs.list_job_triggers.timeout,
2113
2440
  metadata: metadata,
2114
2441
  retry_policy: @config.rpcs.list_job_triggers.retry_policy
2115
- options.apply_defaults metadata: @config.metadata,
2442
+
2443
+ options.apply_defaults timeout: @config.timeout,
2444
+ metadata: @config.metadata,
2116
2445
  retry_policy: @config.retry_policy
2117
2446
 
2118
2447
  @dlp_service_stub.call_rpc :list_job_triggers, request, options: options do |response, operation|
@@ -2155,6 +2484,21 @@ module Google
2155
2484
  #
2156
2485
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2157
2486
  #
2487
+ # @example Basic example
2488
+ # require "google/cloud/dlp/v2"
2489
+ #
2490
+ # # Create a client object. The client can be reused for multiple calls.
2491
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
2492
+ #
2493
+ # # Create a request. To set request fields, pass in keyword arguments.
2494
+ # request = Google::Cloud::Dlp::V2::DeleteJobTriggerRequest.new
2495
+ #
2496
+ # # Call the delete_job_trigger method.
2497
+ # result = client.delete_job_trigger request
2498
+ #
2499
+ # # The returned object is of type Google::Protobuf::Empty.
2500
+ # p result
2501
+ #
2158
2502
  def delete_job_trigger request, options = nil
2159
2503
  raise ::ArgumentError, "request must be provided" if request.nil?
2160
2504
 
@@ -2172,16 +2516,20 @@ module Google
2172
2516
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
2173
2517
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2174
2518
 
2175
- header_params = {
2176
- "name" => request.name
2177
- }
2519
+ header_params = {}
2520
+ if request.name
2521
+ header_params["name"] = request.name
2522
+ end
2523
+
2178
2524
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2179
2525
  metadata[:"x-goog-request-params"] ||= request_params_header
2180
2526
 
2181
2527
  options.apply_defaults timeout: @config.rpcs.delete_job_trigger.timeout,
2182
2528
  metadata: metadata,
2183
2529
  retry_policy: @config.rpcs.delete_job_trigger.retry_policy
2184
- options.apply_defaults metadata: @config.metadata,
2530
+
2531
+ options.apply_defaults timeout: @config.timeout,
2532
+ metadata: @config.metadata,
2185
2533
  retry_policy: @config.retry_policy
2186
2534
 
2187
2535
  @dlp_service_stub.call_rpc :delete_job_trigger, request, options: options do |response, operation|
@@ -2223,6 +2571,21 @@ module Google
2223
2571
  #
2224
2572
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2225
2573
  #
2574
+ # @example Basic example
2575
+ # require "google/cloud/dlp/v2"
2576
+ #
2577
+ # # Create a client object. The client can be reused for multiple calls.
2578
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
2579
+ #
2580
+ # # Create a request. To set request fields, pass in keyword arguments.
2581
+ # request = Google::Cloud::Dlp::V2::ActivateJobTriggerRequest.new
2582
+ #
2583
+ # # Call the activate_job_trigger method.
2584
+ # result = client.activate_job_trigger request
2585
+ #
2586
+ # # The returned object is of type Google::Cloud::Dlp::V2::DlpJob.
2587
+ # p result
2588
+ #
2226
2589
  def activate_job_trigger request, options = nil
2227
2590
  raise ::ArgumentError, "request must be provided" if request.nil?
2228
2591
 
@@ -2240,16 +2603,20 @@ module Google
2240
2603
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
2241
2604
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2242
2605
 
2243
- header_params = {
2244
- "name" => request.name
2245
- }
2606
+ header_params = {}
2607
+ if request.name
2608
+ header_params["name"] = request.name
2609
+ end
2610
+
2246
2611
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2247
2612
  metadata[:"x-goog-request-params"] ||= request_params_header
2248
2613
 
2249
2614
  options.apply_defaults timeout: @config.rpcs.activate_job_trigger.timeout,
2250
2615
  metadata: metadata,
2251
2616
  retry_policy: @config.rpcs.activate_job_trigger.retry_policy
2252
- options.apply_defaults metadata: @config.metadata,
2617
+
2618
+ options.apply_defaults timeout: @config.timeout,
2619
+ metadata: @config.metadata,
2253
2620
  retry_policy: @config.retry_policy
2254
2621
 
2255
2622
  @dlp_service_stub.call_rpc :activate_job_trigger, request, options: options do |response, operation|
@@ -2302,9 +2669,10 @@ module Google
2302
2669
  #
2303
2670
  # parent=projects/example-project/locations/europe-west3
2304
2671
  # @param inspect_job [::Google::Cloud::Dlp::V2::InspectJobConfig, ::Hash]
2305
- # Set to control what and how to inspect.
2672
+ # An inspection job scans a storage repository for InfoTypes.
2306
2673
  # @param risk_job [::Google::Cloud::Dlp::V2::RiskAnalysisJobConfig, ::Hash]
2307
- # Set to choose what metric to calculate.
2674
+ # A risk analysis job calculates re-identification risk metrics for a
2675
+ # BigQuery table.
2308
2676
  # @param job_id [::String]
2309
2677
  # The job id can contain uppercase and lowercase letters,
2310
2678
  # numbers, and hyphens; that is, it must match the regular
@@ -2321,6 +2689,21 @@ module Google
2321
2689
  #
2322
2690
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2323
2691
  #
2692
+ # @example Basic example
2693
+ # require "google/cloud/dlp/v2"
2694
+ #
2695
+ # # Create a client object. The client can be reused for multiple calls.
2696
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
2697
+ #
2698
+ # # Create a request. To set request fields, pass in keyword arguments.
2699
+ # request = Google::Cloud::Dlp::V2::CreateDlpJobRequest.new
2700
+ #
2701
+ # # Call the create_dlp_job method.
2702
+ # result = client.create_dlp_job request
2703
+ #
2704
+ # # The returned object is of type Google::Cloud::Dlp::V2::DlpJob.
2705
+ # p result
2706
+ #
2324
2707
  def create_dlp_job request, options = nil
2325
2708
  raise ::ArgumentError, "request must be provided" if request.nil?
2326
2709
 
@@ -2338,16 +2721,20 @@ module Google
2338
2721
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
2339
2722
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2340
2723
 
2341
- header_params = {
2342
- "parent" => request.parent
2343
- }
2724
+ header_params = {}
2725
+ if request.parent
2726
+ header_params["parent"] = request.parent
2727
+ end
2728
+
2344
2729
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2345
2730
  metadata[:"x-goog-request-params"] ||= request_params_header
2346
2731
 
2347
2732
  options.apply_defaults timeout: @config.rpcs.create_dlp_job.timeout,
2348
2733
  metadata: metadata,
2349
2734
  retry_policy: @config.rpcs.create_dlp_job.retry_policy
2350
- options.apply_defaults metadata: @config.metadata,
2735
+
2736
+ options.apply_defaults timeout: @config.timeout,
2737
+ metadata: @config.metadata,
2351
2738
  retry_policy: @config.retry_policy
2352
2739
 
2353
2740
  @dlp_service_stub.call_rpc :create_dlp_job, request, options: options do |response, operation|
@@ -2455,6 +2842,27 @@ module Google
2455
2842
  #
2456
2843
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2457
2844
  #
2845
+ # @example Basic example
2846
+ # require "google/cloud/dlp/v2"
2847
+ #
2848
+ # # Create a client object. The client can be reused for multiple calls.
2849
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
2850
+ #
2851
+ # # Create a request. To set request fields, pass in keyword arguments.
2852
+ # request = Google::Cloud::Dlp::V2::ListDlpJobsRequest.new
2853
+ #
2854
+ # # Call the list_dlp_jobs method.
2855
+ # result = client.list_dlp_jobs request
2856
+ #
2857
+ # # The returned object is of type Gapic::PagedEnumerable. You can
2858
+ # # iterate over all elements by calling #each, and the enumerable
2859
+ # # will lazily make API calls to fetch subsequent pages. Other
2860
+ # # methods are also available for managing paging directly.
2861
+ # result.each do |response|
2862
+ # # Each element is of type ::Google::Cloud::Dlp::V2::DlpJob.
2863
+ # p response
2864
+ # end
2865
+ #
2458
2866
  def list_dlp_jobs request, options = nil
2459
2867
  raise ::ArgumentError, "request must be provided" if request.nil?
2460
2868
 
@@ -2472,16 +2880,20 @@ module Google
2472
2880
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
2473
2881
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2474
2882
 
2475
- header_params = {
2476
- "parent" => request.parent
2477
- }
2883
+ header_params = {}
2884
+ if request.parent
2885
+ header_params["parent"] = request.parent
2886
+ end
2887
+
2478
2888
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2479
2889
  metadata[:"x-goog-request-params"] ||= request_params_header
2480
2890
 
2481
2891
  options.apply_defaults timeout: @config.rpcs.list_dlp_jobs.timeout,
2482
2892
  metadata: metadata,
2483
2893
  retry_policy: @config.rpcs.list_dlp_jobs.retry_policy
2484
- options.apply_defaults metadata: @config.metadata,
2894
+
2895
+ options.apply_defaults timeout: @config.timeout,
2896
+ metadata: @config.metadata,
2485
2897
  retry_policy: @config.retry_policy
2486
2898
 
2487
2899
  @dlp_service_stub.call_rpc :list_dlp_jobs, request, options: options do |response, operation|
@@ -2524,6 +2936,21 @@ module Google
2524
2936
  #
2525
2937
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2526
2938
  #
2939
+ # @example Basic example
2940
+ # require "google/cloud/dlp/v2"
2941
+ #
2942
+ # # Create a client object. The client can be reused for multiple calls.
2943
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
2944
+ #
2945
+ # # Create a request. To set request fields, pass in keyword arguments.
2946
+ # request = Google::Cloud::Dlp::V2::GetDlpJobRequest.new
2947
+ #
2948
+ # # Call the get_dlp_job method.
2949
+ # result = client.get_dlp_job request
2950
+ #
2951
+ # # The returned object is of type Google::Cloud::Dlp::V2::DlpJob.
2952
+ # p result
2953
+ #
2527
2954
  def get_dlp_job request, options = nil
2528
2955
  raise ::ArgumentError, "request must be provided" if request.nil?
2529
2956
 
@@ -2541,16 +2968,20 @@ module Google
2541
2968
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
2542
2969
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2543
2970
 
2544
- header_params = {
2545
- "name" => request.name
2546
- }
2971
+ header_params = {}
2972
+ if request.name
2973
+ header_params["name"] = request.name
2974
+ end
2975
+
2547
2976
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2548
2977
  metadata[:"x-goog-request-params"] ||= request_params_header
2549
2978
 
2550
2979
  options.apply_defaults timeout: @config.rpcs.get_dlp_job.timeout,
2551
2980
  metadata: metadata,
2552
2981
  retry_policy: @config.rpcs.get_dlp_job.retry_policy
2553
- options.apply_defaults metadata: @config.metadata,
2982
+
2983
+ options.apply_defaults timeout: @config.timeout,
2984
+ metadata: @config.metadata,
2554
2985
  retry_policy: @config.retry_policy
2555
2986
 
2556
2987
  @dlp_service_stub.call_rpc :get_dlp_job, request, options: options do |response, operation|
@@ -2594,6 +3025,21 @@ module Google
2594
3025
  #
2595
3026
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2596
3027
  #
3028
+ # @example Basic example
3029
+ # require "google/cloud/dlp/v2"
3030
+ #
3031
+ # # Create a client object. The client can be reused for multiple calls.
3032
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
3033
+ #
3034
+ # # Create a request. To set request fields, pass in keyword arguments.
3035
+ # request = Google::Cloud::Dlp::V2::DeleteDlpJobRequest.new
3036
+ #
3037
+ # # Call the delete_dlp_job method.
3038
+ # result = client.delete_dlp_job request
3039
+ #
3040
+ # # The returned object is of type Google::Protobuf::Empty.
3041
+ # p result
3042
+ #
2597
3043
  def delete_dlp_job request, options = nil
2598
3044
  raise ::ArgumentError, "request must be provided" if request.nil?
2599
3045
 
@@ -2611,16 +3057,20 @@ module Google
2611
3057
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
2612
3058
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2613
3059
 
2614
- header_params = {
2615
- "name" => request.name
2616
- }
3060
+ header_params = {}
3061
+ if request.name
3062
+ header_params["name"] = request.name
3063
+ end
3064
+
2617
3065
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2618
3066
  metadata[:"x-goog-request-params"] ||= request_params_header
2619
3067
 
2620
3068
  options.apply_defaults timeout: @config.rpcs.delete_dlp_job.timeout,
2621
3069
  metadata: metadata,
2622
3070
  retry_policy: @config.rpcs.delete_dlp_job.retry_policy
2623
- options.apply_defaults metadata: @config.metadata,
3071
+
3072
+ options.apply_defaults timeout: @config.timeout,
3073
+ metadata: @config.metadata,
2624
3074
  retry_policy: @config.retry_policy
2625
3075
 
2626
3076
  @dlp_service_stub.call_rpc :delete_dlp_job, request, options: options do |response, operation|
@@ -2664,6 +3114,21 @@ module Google
2664
3114
  #
2665
3115
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2666
3116
  #
3117
+ # @example Basic example
3118
+ # require "google/cloud/dlp/v2"
3119
+ #
3120
+ # # Create a client object. The client can be reused for multiple calls.
3121
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
3122
+ #
3123
+ # # Create a request. To set request fields, pass in keyword arguments.
3124
+ # request = Google::Cloud::Dlp::V2::CancelDlpJobRequest.new
3125
+ #
3126
+ # # Call the cancel_dlp_job method.
3127
+ # result = client.cancel_dlp_job request
3128
+ #
3129
+ # # The returned object is of type Google::Protobuf::Empty.
3130
+ # p result
3131
+ #
2667
3132
  def cancel_dlp_job request, options = nil
2668
3133
  raise ::ArgumentError, "request must be provided" if request.nil?
2669
3134
 
@@ -2681,16 +3146,20 @@ module Google
2681
3146
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
2682
3147
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2683
3148
 
2684
- header_params = {
2685
- "name" => request.name
2686
- }
3149
+ header_params = {}
3150
+ if request.name
3151
+ header_params["name"] = request.name
3152
+ end
3153
+
2687
3154
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2688
3155
  metadata[:"x-goog-request-params"] ||= request_params_header
2689
3156
 
2690
3157
  options.apply_defaults timeout: @config.rpcs.cancel_dlp_job.timeout,
2691
3158
  metadata: metadata,
2692
3159
  retry_policy: @config.rpcs.cancel_dlp_job.retry_policy
2693
- options.apply_defaults metadata: @config.metadata,
3160
+
3161
+ options.apply_defaults timeout: @config.timeout,
3162
+ metadata: @config.metadata,
2694
3163
  retry_policy: @config.retry_policy
2695
3164
 
2696
3165
  @dlp_service_stub.call_rpc :cancel_dlp_job, request, options: options do |response, operation|
@@ -2760,6 +3229,21 @@ module Google
2760
3229
  #
2761
3230
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2762
3231
  #
3232
+ # @example Basic example
3233
+ # require "google/cloud/dlp/v2"
3234
+ #
3235
+ # # Create a client object. The client can be reused for multiple calls.
3236
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
3237
+ #
3238
+ # # Create a request. To set request fields, pass in keyword arguments.
3239
+ # request = Google::Cloud::Dlp::V2::CreateStoredInfoTypeRequest.new
3240
+ #
3241
+ # # Call the create_stored_info_type method.
3242
+ # result = client.create_stored_info_type request
3243
+ #
3244
+ # # The returned object is of type Google::Cloud::Dlp::V2::StoredInfoType.
3245
+ # p result
3246
+ #
2763
3247
  def create_stored_info_type request, options = nil
2764
3248
  raise ::ArgumentError, "request must be provided" if request.nil?
2765
3249
 
@@ -2777,16 +3261,20 @@ module Google
2777
3261
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
2778
3262
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2779
3263
 
2780
- header_params = {
2781
- "parent" => request.parent
2782
- }
3264
+ header_params = {}
3265
+ if request.parent
3266
+ header_params["parent"] = request.parent
3267
+ end
3268
+
2783
3269
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2784
3270
  metadata[:"x-goog-request-params"] ||= request_params_header
2785
3271
 
2786
3272
  options.apply_defaults timeout: @config.rpcs.create_stored_info_type.timeout,
2787
3273
  metadata: metadata,
2788
3274
  retry_policy: @config.rpcs.create_stored_info_type.retry_policy
2789
- options.apply_defaults metadata: @config.metadata,
3275
+
3276
+ options.apply_defaults timeout: @config.timeout,
3277
+ metadata: @config.metadata,
2790
3278
  retry_policy: @config.retry_policy
2791
3279
 
2792
3280
  @dlp_service_stub.call_rpc :create_stored_info_type, request, options: options do |response, operation|
@@ -2837,6 +3325,21 @@ module Google
2837
3325
  #
2838
3326
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2839
3327
  #
3328
+ # @example Basic example
3329
+ # require "google/cloud/dlp/v2"
3330
+ #
3331
+ # # Create a client object. The client can be reused for multiple calls.
3332
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
3333
+ #
3334
+ # # Create a request. To set request fields, pass in keyword arguments.
3335
+ # request = Google::Cloud::Dlp::V2::UpdateStoredInfoTypeRequest.new
3336
+ #
3337
+ # # Call the update_stored_info_type method.
3338
+ # result = client.update_stored_info_type request
3339
+ #
3340
+ # # The returned object is of type Google::Cloud::Dlp::V2::StoredInfoType.
3341
+ # p result
3342
+ #
2840
3343
  def update_stored_info_type request, options = nil
2841
3344
  raise ::ArgumentError, "request must be provided" if request.nil?
2842
3345
 
@@ -2854,16 +3357,20 @@ module Google
2854
3357
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
2855
3358
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2856
3359
 
2857
- header_params = {
2858
- "name" => request.name
2859
- }
3360
+ header_params = {}
3361
+ if request.name
3362
+ header_params["name"] = request.name
3363
+ end
3364
+
2860
3365
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2861
3366
  metadata[:"x-goog-request-params"] ||= request_params_header
2862
3367
 
2863
3368
  options.apply_defaults timeout: @config.rpcs.update_stored_info_type.timeout,
2864
3369
  metadata: metadata,
2865
3370
  retry_policy: @config.rpcs.update_stored_info_type.retry_policy
2866
- options.apply_defaults metadata: @config.metadata,
3371
+
3372
+ options.apply_defaults timeout: @config.timeout,
3373
+ metadata: @config.metadata,
2867
3374
  retry_policy: @config.retry_policy
2868
3375
 
2869
3376
  @dlp_service_stub.call_rpc :update_stored_info_type, request, options: options do |response, operation|
@@ -2907,6 +3414,21 @@ module Google
2907
3414
  #
2908
3415
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2909
3416
  #
3417
+ # @example Basic example
3418
+ # require "google/cloud/dlp/v2"
3419
+ #
3420
+ # # Create a client object. The client can be reused for multiple calls.
3421
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
3422
+ #
3423
+ # # Create a request. To set request fields, pass in keyword arguments.
3424
+ # request = Google::Cloud::Dlp::V2::GetStoredInfoTypeRequest.new
3425
+ #
3426
+ # # Call the get_stored_info_type method.
3427
+ # result = client.get_stored_info_type request
3428
+ #
3429
+ # # The returned object is of type Google::Cloud::Dlp::V2::StoredInfoType.
3430
+ # p result
3431
+ #
2910
3432
  def get_stored_info_type request, options = nil
2911
3433
  raise ::ArgumentError, "request must be provided" if request.nil?
2912
3434
 
@@ -2924,16 +3446,20 @@ module Google
2924
3446
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
2925
3447
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2926
3448
 
2927
- header_params = {
2928
- "name" => request.name
2929
- }
3449
+ header_params = {}
3450
+ if request.name
3451
+ header_params["name"] = request.name
3452
+ end
3453
+
2930
3454
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2931
3455
  metadata[:"x-goog-request-params"] ||= request_params_header
2932
3456
 
2933
3457
  options.apply_defaults timeout: @config.rpcs.get_stored_info_type.timeout,
2934
3458
  metadata: metadata,
2935
3459
  retry_policy: @config.rpcs.get_stored_info_type.retry_policy
2936
- options.apply_defaults metadata: @config.metadata,
3460
+
3461
+ options.apply_defaults timeout: @config.timeout,
3462
+ metadata: @config.metadata,
2937
3463
  retry_policy: @config.retry_policy
2938
3464
 
2939
3465
  @dlp_service_stub.call_rpc :get_stored_info_type, request, options: options do |response, operation|
@@ -3017,6 +3543,27 @@ module Google
3017
3543
  #
3018
3544
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
3019
3545
  #
3546
+ # @example Basic example
3547
+ # require "google/cloud/dlp/v2"
3548
+ #
3549
+ # # Create a client object. The client can be reused for multiple calls.
3550
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
3551
+ #
3552
+ # # Create a request. To set request fields, pass in keyword arguments.
3553
+ # request = Google::Cloud::Dlp::V2::ListStoredInfoTypesRequest.new
3554
+ #
3555
+ # # Call the list_stored_info_types method.
3556
+ # result = client.list_stored_info_types request
3557
+ #
3558
+ # # The returned object is of type Gapic::PagedEnumerable. You can
3559
+ # # iterate over all elements by calling #each, and the enumerable
3560
+ # # will lazily make API calls to fetch subsequent pages. Other
3561
+ # # methods are also available for managing paging directly.
3562
+ # result.each do |response|
3563
+ # # Each element is of type ::Google::Cloud::Dlp::V2::StoredInfoType.
3564
+ # p response
3565
+ # end
3566
+ #
3020
3567
  def list_stored_info_types request, options = nil
3021
3568
  raise ::ArgumentError, "request must be provided" if request.nil?
3022
3569
 
@@ -3034,16 +3581,20 @@ module Google
3034
3581
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
3035
3582
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3036
3583
 
3037
- header_params = {
3038
- "parent" => request.parent
3039
- }
3584
+ header_params = {}
3585
+ if request.parent
3586
+ header_params["parent"] = request.parent
3587
+ end
3588
+
3040
3589
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3041
3590
  metadata[:"x-goog-request-params"] ||= request_params_header
3042
3591
 
3043
3592
  options.apply_defaults timeout: @config.rpcs.list_stored_info_types.timeout,
3044
3593
  metadata: metadata,
3045
3594
  retry_policy: @config.rpcs.list_stored_info_types.retry_policy
3046
- options.apply_defaults metadata: @config.metadata,
3595
+
3596
+ options.apply_defaults timeout: @config.timeout,
3597
+ metadata: @config.metadata,
3047
3598
  retry_policy: @config.retry_policy
3048
3599
 
3049
3600
  @dlp_service_stub.call_rpc :list_stored_info_types, request, options: options do |response, operation|
@@ -3088,6 +3639,21 @@ module Google
3088
3639
  #
3089
3640
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
3090
3641
  #
3642
+ # @example Basic example
3643
+ # require "google/cloud/dlp/v2"
3644
+ #
3645
+ # # Create a client object. The client can be reused for multiple calls.
3646
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
3647
+ #
3648
+ # # Create a request. To set request fields, pass in keyword arguments.
3649
+ # request = Google::Cloud::Dlp::V2::DeleteStoredInfoTypeRequest.new
3650
+ #
3651
+ # # Call the delete_stored_info_type method.
3652
+ # result = client.delete_stored_info_type request
3653
+ #
3654
+ # # The returned object is of type Google::Protobuf::Empty.
3655
+ # p result
3656
+ #
3091
3657
  def delete_stored_info_type request, options = nil
3092
3658
  raise ::ArgumentError, "request must be provided" if request.nil?
3093
3659
 
@@ -3105,16 +3671,20 @@ module Google
3105
3671
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
3106
3672
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3107
3673
 
3108
- header_params = {
3109
- "name" => request.name
3110
- }
3674
+ header_params = {}
3675
+ if request.name
3676
+ header_params["name"] = request.name
3677
+ end
3678
+
3111
3679
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3112
3680
  metadata[:"x-goog-request-params"] ||= request_params_header
3113
3681
 
3114
3682
  options.apply_defaults timeout: @config.rpcs.delete_stored_info_type.timeout,
3115
3683
  metadata: metadata,
3116
3684
  retry_policy: @config.rpcs.delete_stored_info_type.retry_policy
3117
- options.apply_defaults metadata: @config.metadata,
3685
+
3686
+ options.apply_defaults timeout: @config.timeout,
3687
+ metadata: @config.metadata,
3118
3688
  retry_policy: @config.retry_policy
3119
3689
 
3120
3690
  @dlp_service_stub.call_rpc :delete_stored_info_type, request, options: options do |response, operation|
@@ -3127,11 +3697,8 @@ module Google
3127
3697
 
3128
3698
  ##
3129
3699
  # Inspect hybrid content and store findings to a job.
3130
- # To review the findings inspect the job. Inspection will occur
3700
+ # To review the findings, inspect the job. Inspection will occur
3131
3701
  # asynchronously.
3132
- # Early access feature is in a pre-release state and might change or have
3133
- # limited support. For more information, see
3134
- # https://cloud.google.com/products#product-launch-stages.
3135
3702
  #
3136
3703
  # @overload hybrid_inspect_dlp_job(request, options = nil)
3137
3704
  # Pass arguments to `hybrid_inspect_dlp_job` via a request object, either of type
@@ -3162,6 +3729,21 @@ module Google
3162
3729
  #
3163
3730
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
3164
3731
  #
3732
+ # @example Basic example
3733
+ # require "google/cloud/dlp/v2"
3734
+ #
3735
+ # # Create a client object. The client can be reused for multiple calls.
3736
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
3737
+ #
3738
+ # # Create a request. To set request fields, pass in keyword arguments.
3739
+ # request = Google::Cloud::Dlp::V2::HybridInspectDlpJobRequest.new
3740
+ #
3741
+ # # Call the hybrid_inspect_dlp_job method.
3742
+ # result = client.hybrid_inspect_dlp_job request
3743
+ #
3744
+ # # The returned object is of type Google::Cloud::Dlp::V2::HybridInspectResponse.
3745
+ # p result
3746
+ #
3165
3747
  def hybrid_inspect_dlp_job request, options = nil
3166
3748
  raise ::ArgumentError, "request must be provided" if request.nil?
3167
3749
 
@@ -3179,16 +3761,20 @@ module Google
3179
3761
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
3180
3762
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3181
3763
 
3182
- header_params = {
3183
- "name" => request.name
3184
- }
3764
+ header_params = {}
3765
+ if request.name
3766
+ header_params["name"] = request.name
3767
+ end
3768
+
3185
3769
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3186
3770
  metadata[:"x-goog-request-params"] ||= request_params_header
3187
3771
 
3188
3772
  options.apply_defaults timeout: @config.rpcs.hybrid_inspect_dlp_job.timeout,
3189
3773
  metadata: metadata,
3190
3774
  retry_policy: @config.rpcs.hybrid_inspect_dlp_job.retry_policy
3191
- options.apply_defaults metadata: @config.metadata,
3775
+
3776
+ options.apply_defaults timeout: @config.timeout,
3777
+ metadata: @config.metadata,
3192
3778
  retry_policy: @config.retry_policy
3193
3779
 
3194
3780
  @dlp_service_stub.call_rpc :hybrid_inspect_dlp_job, request, options: options do |response, operation|
@@ -3202,9 +3788,6 @@ module Google
3202
3788
  ##
3203
3789
  # Finish a running hybrid DlpJob. Triggers the finalization steps and running
3204
3790
  # of any enabled actions that have not yet run.
3205
- # Early access feature is in a pre-release state and might change or have
3206
- # limited support. For more information, see
3207
- # https://cloud.google.com/products#product-launch-stages.
3208
3791
  #
3209
3792
  # @overload finish_dlp_job(request, options = nil)
3210
3793
  # Pass arguments to `finish_dlp_job` via a request object, either of type
@@ -3232,6 +3815,21 @@ module Google
3232
3815
  #
3233
3816
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
3234
3817
  #
3818
+ # @example Basic example
3819
+ # require "google/cloud/dlp/v2"
3820
+ #
3821
+ # # Create a client object. The client can be reused for multiple calls.
3822
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
3823
+ #
3824
+ # # Create a request. To set request fields, pass in keyword arguments.
3825
+ # request = Google::Cloud::Dlp::V2::FinishDlpJobRequest.new
3826
+ #
3827
+ # # Call the finish_dlp_job method.
3828
+ # result = client.finish_dlp_job request
3829
+ #
3830
+ # # The returned object is of type Google::Protobuf::Empty.
3831
+ # p result
3832
+ #
3235
3833
  def finish_dlp_job request, options = nil
3236
3834
  raise ::ArgumentError, "request must be provided" if request.nil?
3237
3835
 
@@ -3249,16 +3847,20 @@ module Google
3249
3847
  gapic_version: ::Google::Cloud::Dlp::V2::VERSION
3250
3848
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3251
3849
 
3252
- header_params = {
3253
- "name" => request.name
3254
- }
3850
+ header_params = {}
3851
+ if request.name
3852
+ header_params["name"] = request.name
3853
+ end
3854
+
3255
3855
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3256
3856
  metadata[:"x-goog-request-params"] ||= request_params_header
3257
3857
 
3258
3858
  options.apply_defaults timeout: @config.rpcs.finish_dlp_job.timeout,
3259
3859
  metadata: metadata,
3260
3860
  retry_policy: @config.rpcs.finish_dlp_job.retry_policy
3261
- options.apply_defaults metadata: @config.metadata,
3861
+
3862
+ options.apply_defaults timeout: @config.timeout,
3863
+ metadata: @config.metadata,
3262
3864
  retry_policy: @config.retry_policy
3263
3865
 
3264
3866
  @dlp_service_stub.call_rpc :finish_dlp_job, request, options: options do |response, operation|
@@ -3282,22 +3884,21 @@ module Google
3282
3884
  # Configuration can be applied globally to all clients, or to a single client
3283
3885
  # on construction.
3284
3886
  #
3285
- # # Examples
3286
- #
3287
- # To modify the global config, setting the timeout for inspect_content
3288
- # to 20 seconds, and all remaining timeouts to 10 seconds:
3289
- #
3290
- # ::Google::Cloud::Dlp::V2::DlpService::Client.configure do |config|
3291
- # config.timeout = 10.0
3292
- # config.rpcs.inspect_content.timeout = 20.0
3293
- # end
3294
- #
3295
- # To apply the above configuration only to a new client:
3296
- #
3297
- # client = ::Google::Cloud::Dlp::V2::DlpService::Client.new do |config|
3298
- # config.timeout = 10.0
3299
- # config.rpcs.inspect_content.timeout = 20.0
3300
- # end
3887
+ # @example
3888
+ #
3889
+ # # Modify the global config, setting the timeout for
3890
+ # # inspect_content to 20 seconds,
3891
+ # # and all remaining timeouts to 10 seconds.
3892
+ # ::Google::Cloud::Dlp::V2::DlpService::Client.configure do |config|
3893
+ # config.timeout = 10.0
3894
+ # config.rpcs.inspect_content.timeout = 20.0
3895
+ # end
3896
+ #
3897
+ # # Apply the above configuration only to a new client.
3898
+ # client = ::Google::Cloud::Dlp::V2::DlpService::Client.new do |config|
3899
+ # config.timeout = 10.0
3900
+ # config.rpcs.inspect_content.timeout = 20.0
3901
+ # end
3301
3902
  #
3302
3903
  # @!attribute [rw] endpoint
3303
3904
  # The hostname or hostname:port of the service endpoint.