google-cloud-dlp-v2 0.18.0 → 0.20.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -41,6 +41,9 @@ module Google
41
41
  # https://cloud.google.com/dlp/docs/.
42
42
  #
43
43
  class Client
44
+ # @private
45
+ DEFAULT_ENDPOINT_TEMPLATE = "dlp.$UNIVERSE_DOMAIN$"
46
+
44
47
  include Paths
45
48
 
46
49
  # @private
@@ -161,6 +164,25 @@ module Google
161
164
 
162
165
  default_config.rpcs.activate_job_trigger.timeout = 300.0
163
166
 
167
+ default_config.rpcs.create_discovery_config.timeout = 300.0
168
+
169
+ default_config.rpcs.update_discovery_config.timeout = 300.0
170
+
171
+ default_config.rpcs.get_discovery_config.timeout = 300.0
172
+ default_config.rpcs.get_discovery_config.retry_policy = {
173
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
174
+ }
175
+
176
+ default_config.rpcs.list_discovery_configs.timeout = 300.0
177
+ default_config.rpcs.list_discovery_configs.retry_policy = {
178
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
179
+ }
180
+
181
+ default_config.rpcs.delete_discovery_config.timeout = 300.0
182
+ default_config.rpcs.delete_discovery_config.retry_policy = {
183
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
184
+ }
185
+
164
186
  default_config.rpcs.create_dlp_job.timeout = 300.0
165
187
 
166
188
  default_config.rpcs.list_dlp_jobs.timeout = 300.0
@@ -229,6 +251,15 @@ module Google
229
251
  @config
230
252
  end
231
253
 
254
+ ##
255
+ # The effective universe domain
256
+ #
257
+ # @return [String]
258
+ #
259
+ def universe_domain
260
+ @dlp_service_stub.universe_domain
261
+ end
262
+
232
263
  ##
233
264
  # Create a new DlpService REST client object.
234
265
  #
@@ -256,8 +287,9 @@ module Google
256
287
  credentials = @config.credentials
257
288
  # Use self-signed JWT if the endpoint is unchanged from default,
258
289
  # but only if the default endpoint does not have a region prefix.
259
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
260
- !@config.endpoint.split(".").first.include?("-")
290
+ enable_self_signed_jwt = @config.endpoint.nil? ||
291
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
292
+ !@config.endpoint.split(".").first.include?("-"))
261
293
  credentials ||= Credentials.default scope: @config.scope,
262
294
  enable_self_signed_jwt: enable_self_signed_jwt
263
295
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -271,9 +303,15 @@ module Google
271
303
  config.credentials = credentials
272
304
  config.quota_project = @quota_project_id
273
305
  config.endpoint = @config.endpoint
306
+ config.universe_domain = @config.universe_domain
274
307
  end
275
308
 
276
- @dlp_service_stub = ::Google::Cloud::Dlp::V2::DlpService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
309
+ @dlp_service_stub = ::Google::Cloud::Dlp::V2::DlpService::Rest::ServiceStub.new(
310
+ endpoint: @config.endpoint,
311
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
312
+ universe_domain: @config.universe_domain,
313
+ credentials: credentials
314
+ )
277
315
  end
278
316
 
279
317
  ##
@@ -989,8 +1027,8 @@ module Google
989
1027
  # the default parameter values, pass an empty Hash as a request object (see above).
990
1028
  #
991
1029
  # @param name [::String]
992
- # Required. Resource name of organization and inspectTemplate to be updated, for
993
- # example `organizations/433245324/inspectTemplates/432452342` or
1030
+ # Required. Resource name of organization and inspectTemplate to be updated,
1031
+ # for example `organizations/433245324/inspectTemplates/432452342` or
994
1032
  # projects/project-id/inspectTemplates/432452342.
995
1033
  # @param inspect_template [::Google::Cloud::Dlp::V2::InspectTemplate, ::Hash]
996
1034
  # New InspectTemplate value.
@@ -1074,8 +1112,8 @@ module Google
1074
1112
  # the default parameter values, pass an empty Hash as a request object (see above).
1075
1113
  #
1076
1114
  # @param name [::String]
1077
- # Required. Resource name of the organization and inspectTemplate to be read, for
1078
- # example `organizations/433245324/inspectTemplates/432452342` or
1115
+ # Required. Resource name of the organization and inspectTemplate to be read,
1116
+ # for example `organizations/433245324/inspectTemplates/432452342` or
1079
1117
  # projects/project-id/inspectTemplates/432452342.
1080
1118
  # @yield [result, operation] Access the result along with the TransportOperation object
1081
1119
  # @yieldparam result [::Google::Cloud::Dlp::V2::InspectTemplate]
@@ -1176,15 +1214,15 @@ module Google
1176
1214
  #
1177
1215
  # parent=projects/example-project/locations/europe-west3
1178
1216
  # @param page_token [::String]
1179
- # Page token to continue retrieval. Comes from previous call
1217
+ # Page token to continue retrieval. Comes from the previous call
1180
1218
  # to `ListInspectTemplates`.
1181
1219
  # @param page_size [::Integer]
1182
- # Size of the page, can be limited by the server. If zero server returns
1183
- # a page of max size 100.
1220
+ # Size of the page. This value can be limited by the server. If zero server
1221
+ # returns a page of max size 100.
1184
1222
  # @param order_by [::String]
1185
1223
  # Comma separated list of fields to order by,
1186
- # followed by `asc` or `desc` postfix. This list is case-insensitive,
1187
- # default sorting order is ascending, redundant space characters are
1224
+ # followed by `asc` or `desc` postfix. This list is case insensitive. The
1225
+ # default sorting order is ascending. Redundant space characters are
1188
1226
  # insignificant.
1189
1227
  #
1190
1228
  # Example: `name asc,update_time, create_time desc`
@@ -1280,9 +1318,9 @@ module Google
1280
1318
  # the default parameter values, pass an empty Hash as a request object (see above).
1281
1319
  #
1282
1320
  # @param name [::String]
1283
- # Required. Resource name of the organization and inspectTemplate to be deleted, for
1284
- # example `organizations/433245324/inspectTemplates/432452342` or
1285
- # projects/project-id/inspectTemplates/432452342.
1321
+ # Required. Resource name of the organization and inspectTemplate to be
1322
+ # deleted, for example `organizations/433245324/inspectTemplates/432452342`
1323
+ # or projects/project-id/inspectTemplates/432452342.
1286
1324
  # @yield [result, operation] Access the result along with the TransportOperation object
1287
1325
  # @yieldparam result [::Google::Protobuf::Empty]
1288
1326
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -1471,8 +1509,9 @@ module Google
1471
1509
  # the default parameter values, pass an empty Hash as a request object (see above).
1472
1510
  #
1473
1511
  # @param name [::String]
1474
- # Required. Resource name of organization and deidentify template to be updated, for
1475
- # example `organizations/433245324/deidentifyTemplates/432452342` or
1512
+ # Required. Resource name of organization and deidentify template to be
1513
+ # updated, for example
1514
+ # `organizations/433245324/deidentifyTemplates/432452342` or
1476
1515
  # projects/project-id/deidentifyTemplates/432452342.
1477
1516
  # @param deidentify_template [::Google::Cloud::Dlp::V2::DeidentifyTemplate, ::Hash]
1478
1517
  # New DeidentifyTemplate value.
@@ -1557,9 +1596,9 @@ module Google
1557
1596
  # the default parameter values, pass an empty Hash as a request object (see above).
1558
1597
  #
1559
1598
  # @param name [::String]
1560
- # Required. Resource name of the organization and deidentify template to be read, for
1561
- # example `organizations/433245324/deidentifyTemplates/432452342` or
1562
- # projects/project-id/deidentifyTemplates/432452342.
1599
+ # Required. Resource name of the organization and deidentify template to be
1600
+ # read, for example `organizations/433245324/deidentifyTemplates/432452342`
1601
+ # or projects/project-id/deidentifyTemplates/432452342.
1563
1602
  # @yield [result, operation] Access the result along with the TransportOperation object
1564
1603
  # @yieldparam result [::Google::Cloud::Dlp::V2::DeidentifyTemplate]
1565
1604
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -1660,15 +1699,15 @@ module Google
1660
1699
  #
1661
1700
  # parent=projects/example-project/locations/europe-west3
1662
1701
  # @param page_token [::String]
1663
- # Page token to continue retrieval. Comes from previous call
1702
+ # Page token to continue retrieval. Comes from the previous call
1664
1703
  # to `ListDeidentifyTemplates`.
1665
1704
  # @param page_size [::Integer]
1666
- # Size of the page, can be limited by the server. If zero server returns
1667
- # a page of max size 100.
1705
+ # Size of the page. This value can be limited by the server. If zero server
1706
+ # returns a page of max size 100.
1668
1707
  # @param order_by [::String]
1669
1708
  # Comma separated list of fields to order by,
1670
- # followed by `asc` or `desc` postfix. This list is case-insensitive,
1671
- # default sorting order is ascending, redundant space characters are
1709
+ # followed by `asc` or `desc` postfix. This list is case insensitive. The
1710
+ # default sorting order is ascending. Redundant space characters are
1672
1711
  # insignificant.
1673
1712
  #
1674
1713
  # Example: `name asc,update_time, create_time desc`
@@ -1765,8 +1804,9 @@ module Google
1765
1804
  # the default parameter values, pass an empty Hash as a request object (see above).
1766
1805
  #
1767
1806
  # @param name [::String]
1768
- # Required. Resource name of the organization and deidentify template to be deleted,
1769
- # for example `organizations/433245324/deidentifyTemplates/432452342` or
1807
+ # Required. Resource name of the organization and deidentify template to be
1808
+ # deleted, for example
1809
+ # `organizations/433245324/deidentifyTemplates/432452342` or
1770
1810
  # projects/project-id/deidentifyTemplates/432452342.
1771
1811
  # @yield [result, operation] Access the result along with the TransportOperation object
1772
1812
  # @yieldparam result [::Google::Protobuf::Empty]
@@ -2035,8 +2075,8 @@ module Google
2035
2075
  # the default parameter values, pass an empty Hash as a request object (see above).
2036
2076
  #
2037
2077
  # @param name [::String]
2038
- # Required. Resource name of the trigger to execute a hybrid inspect on, for example
2039
- # `projects/dlp-test-project/jobTriggers/53234423`.
2078
+ # Required. Resource name of the trigger to execute a hybrid inspect on, for
2079
+ # example `projects/dlp-test-project/jobTriggers/53234423`.
2040
2080
  # @param hybrid_item [::Google::Cloud::Dlp::V2::HybridContentItem, ::Hash]
2041
2081
  # The item to inspect.
2042
2082
  # @yield [result, operation] Access the result along with the TransportOperation object
@@ -2214,15 +2254,15 @@ module Google
2214
2254
  #
2215
2255
  # parent=projects/example-project/locations/europe-west3
2216
2256
  # @param page_token [::String]
2217
- # Page token to continue retrieval. Comes from previous call
2257
+ # Page token to continue retrieval. Comes from the previous call
2218
2258
  # to ListJobTriggers. `order_by` field must not
2219
2259
  # change for subsequent calls.
2220
2260
  # @param page_size [::Integer]
2221
- # Size of the page, can be limited by a server.
2261
+ # Size of the page. This value can be limited by a server.
2222
2262
  # @param order_by [::String]
2223
2263
  # Comma separated list of triggeredJob fields to order by,
2224
- # followed by `asc` or `desc` postfix. This list is case-insensitive,
2225
- # default sorting order is ascending, redundant space characters are
2264
+ # followed by `asc` or `desc` postfix. This list is case insensitive. The
2265
+ # default sorting order is ascending. Redundant space characters are
2226
2266
  # insignificant.
2227
2267
  #
2228
2268
  # Example: `name asc,update_time, create_time desc`
@@ -2487,6 +2527,452 @@ module Google
2487
2527
  raise ::Google::Cloud::Error.from_error(e)
2488
2528
  end
2489
2529
 
2530
+ ##
2531
+ # Creates a config for discovery to scan and profile storage.
2532
+ #
2533
+ # @overload create_discovery_config(request, options = nil)
2534
+ # Pass arguments to `create_discovery_config` via a request object, either of type
2535
+ # {::Google::Cloud::Dlp::V2::CreateDiscoveryConfigRequest} or an equivalent Hash.
2536
+ #
2537
+ # @param request [::Google::Cloud::Dlp::V2::CreateDiscoveryConfigRequest, ::Hash]
2538
+ # A request object representing the call parameters. Required. To specify no
2539
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2540
+ # @param options [::Gapic::CallOptions, ::Hash]
2541
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2542
+ #
2543
+ # @overload create_discovery_config(parent: nil, discovery_config: nil, config_id: nil)
2544
+ # Pass arguments to `create_discovery_config` via keyword arguments. Note that at
2545
+ # least one keyword argument is required. To specify no parameters, or to keep all
2546
+ # the default parameter values, pass an empty Hash as a request object (see above).
2547
+ #
2548
+ # @param parent [::String]
2549
+ # Required. Parent resource name.
2550
+ #
2551
+ # The format of this value is as follows:
2552
+ # `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
2553
+ #
2554
+ # The following example `parent` string specifies a parent project with the
2555
+ # identifier `example-project`, and specifies the `europe-west3` location
2556
+ # for processing data:
2557
+ #
2558
+ # parent=projects/example-project/locations/europe-west3
2559
+ # @param discovery_config [::Google::Cloud::Dlp::V2::DiscoveryConfig, ::Hash]
2560
+ # Required. The DiscoveryConfig to create.
2561
+ # @param config_id [::String]
2562
+ # The config ID can contain uppercase and lowercase letters,
2563
+ # numbers, and hyphens; that is, it must match the regular
2564
+ # expression: `[a-zA-Z\d-_]+`. The maximum length is 100
2565
+ # characters. Can be empty to allow the system to generate one.
2566
+ # @yield [result, operation] Access the result along with the TransportOperation object
2567
+ # @yieldparam result [::Google::Cloud::Dlp::V2::DiscoveryConfig]
2568
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2569
+ #
2570
+ # @return [::Google::Cloud::Dlp::V2::DiscoveryConfig]
2571
+ #
2572
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
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::Rest::Client.new
2579
+ #
2580
+ # # Create a request. To set request fields, pass in keyword arguments.
2581
+ # request = Google::Cloud::Dlp::V2::CreateDiscoveryConfigRequest.new
2582
+ #
2583
+ # # Call the create_discovery_config method.
2584
+ # result = client.create_discovery_config request
2585
+ #
2586
+ # # The returned object is of type Google::Cloud::Dlp::V2::DiscoveryConfig.
2587
+ # p result
2588
+ #
2589
+ def create_discovery_config request, options = nil
2590
+ raise ::ArgumentError, "request must be provided" if request.nil?
2591
+
2592
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::CreateDiscoveryConfigRequest
2593
+
2594
+ # Converts hash and nil to an options object
2595
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2596
+
2597
+ # Customize the options with defaults
2598
+ call_metadata = @config.rpcs.create_discovery_config.metadata.to_h
2599
+
2600
+ # Set x-goog-api-client and x-goog-user-project headers
2601
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2602
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2603
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
2604
+ transports_version_send: [:rest]
2605
+
2606
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2607
+
2608
+ options.apply_defaults timeout: @config.rpcs.create_discovery_config.timeout,
2609
+ metadata: call_metadata,
2610
+ retry_policy: @config.rpcs.create_discovery_config.retry_policy
2611
+
2612
+ options.apply_defaults timeout: @config.timeout,
2613
+ metadata: @config.metadata,
2614
+ retry_policy: @config.retry_policy
2615
+
2616
+ @dlp_service_stub.create_discovery_config request, options do |result, operation|
2617
+ yield result, operation if block_given?
2618
+ return result
2619
+ end
2620
+ rescue ::Gapic::Rest::Error => e
2621
+ raise ::Google::Cloud::Error.from_error(e)
2622
+ end
2623
+
2624
+ ##
2625
+ # Updates a discovery configuration.
2626
+ #
2627
+ # @overload update_discovery_config(request, options = nil)
2628
+ # Pass arguments to `update_discovery_config` via a request object, either of type
2629
+ # {::Google::Cloud::Dlp::V2::UpdateDiscoveryConfigRequest} or an equivalent Hash.
2630
+ #
2631
+ # @param request [::Google::Cloud::Dlp::V2::UpdateDiscoveryConfigRequest, ::Hash]
2632
+ # A request object representing the call parameters. Required. To specify no
2633
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2634
+ # @param options [::Gapic::CallOptions, ::Hash]
2635
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2636
+ #
2637
+ # @overload update_discovery_config(name: nil, discovery_config: nil, update_mask: nil)
2638
+ # Pass arguments to `update_discovery_config` via keyword arguments. Note that at
2639
+ # least one keyword argument is required. To specify no parameters, or to keep all
2640
+ # the default parameter values, pass an empty Hash as a request object (see above).
2641
+ #
2642
+ # @param name [::String]
2643
+ # Required. Resource name of the project and the configuration, for example
2644
+ # `projects/dlp-test-project/discoveryConfigs/53234423`.
2645
+ # @param discovery_config [::Google::Cloud::Dlp::V2::DiscoveryConfig, ::Hash]
2646
+ # Required. New DiscoveryConfig value.
2647
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2648
+ # Mask to control which fields get updated.
2649
+ # @yield [result, operation] Access the result along with the TransportOperation object
2650
+ # @yieldparam result [::Google::Cloud::Dlp::V2::DiscoveryConfig]
2651
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2652
+ #
2653
+ # @return [::Google::Cloud::Dlp::V2::DiscoveryConfig]
2654
+ #
2655
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2656
+ #
2657
+ # @example Basic example
2658
+ # require "google/cloud/dlp/v2"
2659
+ #
2660
+ # # Create a client object. The client can be reused for multiple calls.
2661
+ # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new
2662
+ #
2663
+ # # Create a request. To set request fields, pass in keyword arguments.
2664
+ # request = Google::Cloud::Dlp::V2::UpdateDiscoveryConfigRequest.new
2665
+ #
2666
+ # # Call the update_discovery_config method.
2667
+ # result = client.update_discovery_config request
2668
+ #
2669
+ # # The returned object is of type Google::Cloud::Dlp::V2::DiscoveryConfig.
2670
+ # p result
2671
+ #
2672
+ def update_discovery_config request, options = nil
2673
+ raise ::ArgumentError, "request must be provided" if request.nil?
2674
+
2675
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::UpdateDiscoveryConfigRequest
2676
+
2677
+ # Converts hash and nil to an options object
2678
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2679
+
2680
+ # Customize the options with defaults
2681
+ call_metadata = @config.rpcs.update_discovery_config.metadata.to_h
2682
+
2683
+ # Set x-goog-api-client and x-goog-user-project headers
2684
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2685
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2686
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
2687
+ transports_version_send: [:rest]
2688
+
2689
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2690
+
2691
+ options.apply_defaults timeout: @config.rpcs.update_discovery_config.timeout,
2692
+ metadata: call_metadata,
2693
+ retry_policy: @config.rpcs.update_discovery_config.retry_policy
2694
+
2695
+ options.apply_defaults timeout: @config.timeout,
2696
+ metadata: @config.metadata,
2697
+ retry_policy: @config.retry_policy
2698
+
2699
+ @dlp_service_stub.update_discovery_config request, options do |result, operation|
2700
+ yield result, operation if block_given?
2701
+ return result
2702
+ end
2703
+ rescue ::Gapic::Rest::Error => e
2704
+ raise ::Google::Cloud::Error.from_error(e)
2705
+ end
2706
+
2707
+ ##
2708
+ # Gets a discovery configuration.
2709
+ #
2710
+ # @overload get_discovery_config(request, options = nil)
2711
+ # Pass arguments to `get_discovery_config` via a request object, either of type
2712
+ # {::Google::Cloud::Dlp::V2::GetDiscoveryConfigRequest} or an equivalent Hash.
2713
+ #
2714
+ # @param request [::Google::Cloud::Dlp::V2::GetDiscoveryConfigRequest, ::Hash]
2715
+ # A request object representing the call parameters. Required. To specify no
2716
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2717
+ # @param options [::Gapic::CallOptions, ::Hash]
2718
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2719
+ #
2720
+ # @overload get_discovery_config(name: nil)
2721
+ # Pass arguments to `get_discovery_config` via keyword arguments. Note that at
2722
+ # least one keyword argument is required. To specify no parameters, or to keep all
2723
+ # the default parameter values, pass an empty Hash as a request object (see above).
2724
+ #
2725
+ # @param name [::String]
2726
+ # Required. Resource name of the project and the configuration, for example
2727
+ # `projects/dlp-test-project/discoveryConfigs/53234423`.
2728
+ # @yield [result, operation] Access the result along with the TransportOperation object
2729
+ # @yieldparam result [::Google::Cloud::Dlp::V2::DiscoveryConfig]
2730
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2731
+ #
2732
+ # @return [::Google::Cloud::Dlp::V2::DiscoveryConfig]
2733
+ #
2734
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2735
+ #
2736
+ # @example Basic example
2737
+ # require "google/cloud/dlp/v2"
2738
+ #
2739
+ # # Create a client object. The client can be reused for multiple calls.
2740
+ # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new
2741
+ #
2742
+ # # Create a request. To set request fields, pass in keyword arguments.
2743
+ # request = Google::Cloud::Dlp::V2::GetDiscoveryConfigRequest.new
2744
+ #
2745
+ # # Call the get_discovery_config method.
2746
+ # result = client.get_discovery_config request
2747
+ #
2748
+ # # The returned object is of type Google::Cloud::Dlp::V2::DiscoveryConfig.
2749
+ # p result
2750
+ #
2751
+ def get_discovery_config request, options = nil
2752
+ raise ::ArgumentError, "request must be provided" if request.nil?
2753
+
2754
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::GetDiscoveryConfigRequest
2755
+
2756
+ # Converts hash and nil to an options object
2757
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2758
+
2759
+ # Customize the options with defaults
2760
+ call_metadata = @config.rpcs.get_discovery_config.metadata.to_h
2761
+
2762
+ # Set x-goog-api-client and x-goog-user-project headers
2763
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2764
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2765
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
2766
+ transports_version_send: [:rest]
2767
+
2768
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2769
+
2770
+ options.apply_defaults timeout: @config.rpcs.get_discovery_config.timeout,
2771
+ metadata: call_metadata,
2772
+ retry_policy: @config.rpcs.get_discovery_config.retry_policy
2773
+
2774
+ options.apply_defaults timeout: @config.timeout,
2775
+ metadata: @config.metadata,
2776
+ retry_policy: @config.retry_policy
2777
+
2778
+ @dlp_service_stub.get_discovery_config request, options do |result, operation|
2779
+ yield result, operation if block_given?
2780
+ return result
2781
+ end
2782
+ rescue ::Gapic::Rest::Error => e
2783
+ raise ::Google::Cloud::Error.from_error(e)
2784
+ end
2785
+
2786
+ ##
2787
+ # Lists discovery configurations.
2788
+ #
2789
+ # @overload list_discovery_configs(request, options = nil)
2790
+ # Pass arguments to `list_discovery_configs` via a request object, either of type
2791
+ # {::Google::Cloud::Dlp::V2::ListDiscoveryConfigsRequest} or an equivalent Hash.
2792
+ #
2793
+ # @param request [::Google::Cloud::Dlp::V2::ListDiscoveryConfigsRequest, ::Hash]
2794
+ # A request object representing the call parameters. Required. To specify no
2795
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2796
+ # @param options [::Gapic::CallOptions, ::Hash]
2797
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2798
+ #
2799
+ # @overload list_discovery_configs(parent: nil, page_token: nil, page_size: nil, order_by: nil)
2800
+ # Pass arguments to `list_discovery_configs` via keyword arguments. Note that at
2801
+ # least one keyword argument is required. To specify no parameters, or to keep all
2802
+ # the default parameter values, pass an empty Hash as a request object (see above).
2803
+ #
2804
+ # @param parent [::String]
2805
+ # Required. Parent resource name.
2806
+ #
2807
+ # The format of this value is as follows:
2808
+ # `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
2809
+ #
2810
+ # The following example `parent` string specifies a parent project with the
2811
+ # identifier `example-project`, and specifies the `europe-west3` location
2812
+ # for processing data:
2813
+ #
2814
+ # parent=projects/example-project/locations/europe-west3
2815
+ # @param page_token [::String]
2816
+ # Page token to continue retrieval. Comes from the previous call
2817
+ # to ListDiscoveryConfigs. `order_by` field must not
2818
+ # change for subsequent calls.
2819
+ # @param page_size [::Integer]
2820
+ # Size of the page. This value can be limited by a server.
2821
+ # @param order_by [::String]
2822
+ # Comma separated list of config fields to order by,
2823
+ # followed by `asc` or `desc` postfix. This list is case insensitive. The
2824
+ # default sorting order is ascending. Redundant space characters are
2825
+ # insignificant.
2826
+ #
2827
+ # Example: `name asc,update_time, create_time desc`
2828
+ #
2829
+ # Supported fields are:
2830
+ #
2831
+ # - `last_run_time`: corresponds to the last time the DiscoveryConfig ran.
2832
+ # - `name`: corresponds to the DiscoveryConfig's name.
2833
+ # - `status`: corresponds to DiscoveryConfig's status.
2834
+ # @yield [result, operation] Access the result along with the TransportOperation object
2835
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dlp::V2::DiscoveryConfig>]
2836
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2837
+ #
2838
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dlp::V2::DiscoveryConfig>]
2839
+ #
2840
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2841
+ #
2842
+ # @example Basic example
2843
+ # require "google/cloud/dlp/v2"
2844
+ #
2845
+ # # Create a client object. The client can be reused for multiple calls.
2846
+ # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new
2847
+ #
2848
+ # # Create a request. To set request fields, pass in keyword arguments.
2849
+ # request = Google::Cloud::Dlp::V2::ListDiscoveryConfigsRequest.new
2850
+ #
2851
+ # # Call the list_discovery_configs method.
2852
+ # result = client.list_discovery_configs request
2853
+ #
2854
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2855
+ # # over elements, and API calls will be issued to fetch pages as needed.
2856
+ # result.each do |item|
2857
+ # # Each element is of type ::Google::Cloud::Dlp::V2::DiscoveryConfig.
2858
+ # p item
2859
+ # end
2860
+ #
2861
+ def list_discovery_configs request, options = nil
2862
+ raise ::ArgumentError, "request must be provided" if request.nil?
2863
+
2864
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::ListDiscoveryConfigsRequest
2865
+
2866
+ # Converts hash and nil to an options object
2867
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2868
+
2869
+ # Customize the options with defaults
2870
+ call_metadata = @config.rpcs.list_discovery_configs.metadata.to_h
2871
+
2872
+ # Set x-goog-api-client and x-goog-user-project headers
2873
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2874
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2875
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
2876
+ transports_version_send: [:rest]
2877
+
2878
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2879
+
2880
+ options.apply_defaults timeout: @config.rpcs.list_discovery_configs.timeout,
2881
+ metadata: call_metadata,
2882
+ retry_policy: @config.rpcs.list_discovery_configs.retry_policy
2883
+
2884
+ options.apply_defaults timeout: @config.timeout,
2885
+ metadata: @config.metadata,
2886
+ retry_policy: @config.retry_policy
2887
+
2888
+ @dlp_service_stub.list_discovery_configs request, options do |result, operation|
2889
+ result = ::Gapic::Rest::PagedEnumerable.new @dlp_service_stub, :list_discovery_configs, "discovery_configs", request, result, options
2890
+ yield result, operation if block_given?
2891
+ return result
2892
+ end
2893
+ rescue ::Gapic::Rest::Error => e
2894
+ raise ::Google::Cloud::Error.from_error(e)
2895
+ end
2896
+
2897
+ ##
2898
+ # Deletes a discovery configuration.
2899
+ #
2900
+ # @overload delete_discovery_config(request, options = nil)
2901
+ # Pass arguments to `delete_discovery_config` via a request object, either of type
2902
+ # {::Google::Cloud::Dlp::V2::DeleteDiscoveryConfigRequest} or an equivalent Hash.
2903
+ #
2904
+ # @param request [::Google::Cloud::Dlp::V2::DeleteDiscoveryConfigRequest, ::Hash]
2905
+ # A request object representing the call parameters. Required. To specify no
2906
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2907
+ # @param options [::Gapic::CallOptions, ::Hash]
2908
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2909
+ #
2910
+ # @overload delete_discovery_config(name: nil)
2911
+ # Pass arguments to `delete_discovery_config` via keyword arguments. Note that at
2912
+ # least one keyword argument is required. To specify no parameters, or to keep all
2913
+ # the default parameter values, pass an empty Hash as a request object (see above).
2914
+ #
2915
+ # @param name [::String]
2916
+ # Required. Resource name of the project and the config, for example
2917
+ # `projects/dlp-test-project/discoveryConfigs/53234423`.
2918
+ # @yield [result, operation] Access the result along with the TransportOperation object
2919
+ # @yieldparam result [::Google::Protobuf::Empty]
2920
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2921
+ #
2922
+ # @return [::Google::Protobuf::Empty]
2923
+ #
2924
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2925
+ #
2926
+ # @example Basic example
2927
+ # require "google/cloud/dlp/v2"
2928
+ #
2929
+ # # Create a client object. The client can be reused for multiple calls.
2930
+ # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new
2931
+ #
2932
+ # # Create a request. To set request fields, pass in keyword arguments.
2933
+ # request = Google::Cloud::Dlp::V2::DeleteDiscoveryConfigRequest.new
2934
+ #
2935
+ # # Call the delete_discovery_config method.
2936
+ # result = client.delete_discovery_config request
2937
+ #
2938
+ # # The returned object is of type Google::Protobuf::Empty.
2939
+ # p result
2940
+ #
2941
+ def delete_discovery_config request, options = nil
2942
+ raise ::ArgumentError, "request must be provided" if request.nil?
2943
+
2944
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::DeleteDiscoveryConfigRequest
2945
+
2946
+ # Converts hash and nil to an options object
2947
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2948
+
2949
+ # Customize the options with defaults
2950
+ call_metadata = @config.rpcs.delete_discovery_config.metadata.to_h
2951
+
2952
+ # Set x-goog-api-client and x-goog-user-project headers
2953
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2954
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2955
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
2956
+ transports_version_send: [:rest]
2957
+
2958
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2959
+
2960
+ options.apply_defaults timeout: @config.rpcs.delete_discovery_config.timeout,
2961
+ metadata: call_metadata,
2962
+ retry_policy: @config.rpcs.delete_discovery_config.retry_policy
2963
+
2964
+ options.apply_defaults timeout: @config.timeout,
2965
+ metadata: @config.metadata,
2966
+ retry_policy: @config.retry_policy
2967
+
2968
+ @dlp_service_stub.delete_discovery_config request, options do |result, operation|
2969
+ yield result, operation if block_given?
2970
+ return result
2971
+ end
2972
+ rescue ::Gapic::Rest::Error => e
2973
+ raise ::Google::Cloud::Error.from_error(e)
2974
+ end
2975
+
2490
2976
  ##
2491
2977
  # Creates a new job to inspect storage or calculate risk metrics.
2492
2978
  # See https://cloud.google.com/dlp/docs/inspecting-storage and
@@ -2672,8 +3158,8 @@ module Google
2672
3158
  # The type of job. Defaults to `DlpJobType.INSPECT`
2673
3159
  # @param order_by [::String]
2674
3160
  # Comma separated list of fields to order by,
2675
- # followed by `asc` or `desc` postfix. This list is case-insensitive,
2676
- # default sorting order is ascending, redundant space characters are
3161
+ # followed by `asc` or `desc` postfix. This list is case insensitive. The
3162
+ # default sorting order is ascending. Redundant space characters are
2677
3163
  # insignificant.
2678
3164
  #
2679
3165
  # Example: `name asc, end_time asc, create_time desc`
@@ -3123,8 +3609,8 @@ module Google
3123
3609
  # the default parameter values, pass an empty Hash as a request object (see above).
3124
3610
  #
3125
3611
  # @param name [::String]
3126
- # Required. Resource name of organization and storedInfoType to be updated, for
3127
- # example `organizations/433245324/storedInfoTypes/432452342` or
3612
+ # Required. Resource name of organization and storedInfoType to be updated,
3613
+ # for example `organizations/433245324/storedInfoTypes/432452342` or
3128
3614
  # projects/project-id/storedInfoTypes/432452342.
3129
3615
  # @param config [::Google::Cloud::Dlp::V2::StoredInfoTypeConfig, ::Hash]
3130
3616
  # Updated configuration for the storedInfoType. If not provided, a new
@@ -3211,8 +3697,8 @@ module Google
3211
3697
  # the default parameter values, pass an empty Hash as a request object (see above).
3212
3698
  #
3213
3699
  # @param name [::String]
3214
- # Required. Resource name of the organization and storedInfoType to be read, for
3215
- # example `organizations/433245324/storedInfoTypes/432452342` or
3700
+ # Required. Resource name of the organization and storedInfoType to be read,
3701
+ # for example `organizations/433245324/storedInfoTypes/432452342` or
3216
3702
  # projects/project-id/storedInfoTypes/432452342.
3217
3703
  # @yield [result, operation] Access the result along with the TransportOperation object
3218
3704
  # @yieldparam result [::Google::Cloud::Dlp::V2::StoredInfoType]
@@ -3310,15 +3796,15 @@ module Google
3310
3796
  #
3311
3797
  # parent=projects/example-project/locations/europe-west3
3312
3798
  # @param page_token [::String]
3313
- # Page token to continue retrieval. Comes from previous call
3799
+ # Page token to continue retrieval. Comes from the previous call
3314
3800
  # to `ListStoredInfoTypes`.
3315
3801
  # @param page_size [::Integer]
3316
- # Size of the page, can be limited by the server. If zero server returns
3317
- # a page of max size 100.
3802
+ # Size of the page. This value can be limited by the server. If zero server
3803
+ # returns a page of max size 100.
3318
3804
  # @param order_by [::String]
3319
3805
  # Comma separated list of fields to order by,
3320
- # followed by `asc` or `desc` postfix. This list is case-insensitive,
3321
- # default sorting order is ascending, redundant space characters are
3806
+ # followed by `asc` or `desc` postfix. This list is case insensitive. The
3807
+ # default sorting order is ascending. Redundant space characters are
3322
3808
  # insignificant.
3323
3809
  #
3324
3810
  # Example: `name asc, display_name, create_time desc`
@@ -3416,8 +3902,8 @@ module Google
3416
3902
  # the default parameter values, pass an empty Hash as a request object (see above).
3417
3903
  #
3418
3904
  # @param name [::String]
3419
- # Required. Resource name of the organization and storedInfoType to be deleted, for
3420
- # example `organizations/433245324/storedInfoTypes/432452342` or
3905
+ # Required. Resource name of the organization and storedInfoType to be
3906
+ # deleted, for example `organizations/433245324/storedInfoTypes/432452342` or
3421
3907
  # projects/project-id/storedInfoTypes/432452342.
3422
3908
  # @yield [result, operation] Access the result along with the TransportOperation object
3423
3909
  # @yieldparam result [::Google::Protobuf::Empty]
@@ -3498,8 +3984,8 @@ module Google
3498
3984
  # the default parameter values, pass an empty Hash as a request object (see above).
3499
3985
  #
3500
3986
  # @param name [::String]
3501
- # Required. Resource name of the job to execute a hybrid inspect on, for example
3502
- # `projects/dlp-test-project/dlpJob/53234423`.
3987
+ # Required. Resource name of the job to execute a hybrid inspect on, for
3988
+ # example `projects/dlp-test-project/dlpJob/53234423`.
3503
3989
  # @param hybrid_item [::Google::Cloud::Dlp::V2::HybridContentItem, ::Hash]
3504
3990
  # The item to inspect.
3505
3991
  # @yield [result, operation] Access the result along with the TransportOperation object
@@ -3669,9 +4155,9 @@ module Google
3669
4155
  # end
3670
4156
  #
3671
4157
  # @!attribute [rw] endpoint
3672
- # The hostname or hostname:port of the service endpoint.
3673
- # Defaults to `"dlp.googleapis.com"`.
3674
- # @return [::String]
4158
+ # A custom service endpoint, as a hostname or hostname:port. The default is
4159
+ # nil, indicating to use the default endpoint in the current universe domain.
4160
+ # @return [::String,nil]
3675
4161
  # @!attribute [rw] credentials
3676
4162
  # Credentials to send with calls. You may provide any of the following types:
3677
4163
  # * (`String`) The path to a service account key file in JSON format
@@ -3708,13 +4194,20 @@ module Google
3708
4194
  # @!attribute [rw] quota_project
3709
4195
  # A separate project against which to charge quota.
3710
4196
  # @return [::String]
4197
+ # @!attribute [rw] universe_domain
4198
+ # The universe domain within which to make requests. This determines the
4199
+ # default endpoint URL. The default value of nil uses the environment
4200
+ # universe (usually the default "googleapis.com" universe).
4201
+ # @return [::String,nil]
3711
4202
  #
3712
4203
  class Configuration
3713
4204
  extend ::Gapic::Config
3714
4205
 
4206
+ # @private
4207
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
3715
4208
  DEFAULT_ENDPOINT = "dlp.googleapis.com"
3716
4209
 
3717
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
4210
+ config_attr :endpoint, nil, ::String, nil
3718
4211
  config_attr :credentials, nil do |value|
3719
4212
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
3720
4213
  allowed.any? { |klass| klass === value }
@@ -3726,6 +4219,7 @@ module Google
3726
4219
  config_attr :metadata, nil, ::Hash, nil
3727
4220
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
3728
4221
  config_attr :quota_project, nil, ::String, nil
4222
+ config_attr :universe_domain, nil, ::String, nil
3729
4223
 
3730
4224
  # @private
3731
4225
  def initialize parent_config = nil
@@ -3875,6 +4369,31 @@ module Google
3875
4369
  #
3876
4370
  attr_reader :activate_job_trigger
3877
4371
  ##
4372
+ # RPC-specific configuration for `create_discovery_config`
4373
+ # @return [::Gapic::Config::Method]
4374
+ #
4375
+ attr_reader :create_discovery_config
4376
+ ##
4377
+ # RPC-specific configuration for `update_discovery_config`
4378
+ # @return [::Gapic::Config::Method]
4379
+ #
4380
+ attr_reader :update_discovery_config
4381
+ ##
4382
+ # RPC-specific configuration for `get_discovery_config`
4383
+ # @return [::Gapic::Config::Method]
4384
+ #
4385
+ attr_reader :get_discovery_config
4386
+ ##
4387
+ # RPC-specific configuration for `list_discovery_configs`
4388
+ # @return [::Gapic::Config::Method]
4389
+ #
4390
+ attr_reader :list_discovery_configs
4391
+ ##
4392
+ # RPC-specific configuration for `delete_discovery_config`
4393
+ # @return [::Gapic::Config::Method]
4394
+ #
4395
+ attr_reader :delete_discovery_config
4396
+ ##
3878
4397
  # RPC-specific configuration for `create_dlp_job`
3879
4398
  # @return [::Gapic::Config::Method]
3880
4399
  #
@@ -3981,6 +4500,16 @@ module Google
3981
4500
  @delete_job_trigger = ::Gapic::Config::Method.new delete_job_trigger_config
3982
4501
  activate_job_trigger_config = parent_rpcs.activate_job_trigger if parent_rpcs.respond_to? :activate_job_trigger
3983
4502
  @activate_job_trigger = ::Gapic::Config::Method.new activate_job_trigger_config
4503
+ create_discovery_config_config = parent_rpcs.create_discovery_config if parent_rpcs.respond_to? :create_discovery_config
4504
+ @create_discovery_config = ::Gapic::Config::Method.new create_discovery_config_config
4505
+ update_discovery_config_config = parent_rpcs.update_discovery_config if parent_rpcs.respond_to? :update_discovery_config
4506
+ @update_discovery_config = ::Gapic::Config::Method.new update_discovery_config_config
4507
+ get_discovery_config_config = parent_rpcs.get_discovery_config if parent_rpcs.respond_to? :get_discovery_config
4508
+ @get_discovery_config = ::Gapic::Config::Method.new get_discovery_config_config
4509
+ list_discovery_configs_config = parent_rpcs.list_discovery_configs if parent_rpcs.respond_to? :list_discovery_configs
4510
+ @list_discovery_configs = ::Gapic::Config::Method.new list_discovery_configs_config
4511
+ delete_discovery_config_config = parent_rpcs.delete_discovery_config if parent_rpcs.respond_to? :delete_discovery_config
4512
+ @delete_discovery_config = ::Gapic::Config::Method.new delete_discovery_config_config
3984
4513
  create_dlp_job_config = parent_rpcs.create_dlp_job if parent_rpcs.respond_to? :create_dlp_job
3985
4514
  @create_dlp_job = ::Gapic::Config::Method.new create_dlp_job_config
3986
4515
  list_dlp_jobs_config = parent_rpcs.list_dlp_jobs if parent_rpcs.respond_to? :list_dlp_jobs