google-cloud-dlp-v2 0.18.0 → 0.19.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -161,6 +161,25 @@ module Google
161
161
 
162
162
  default_config.rpcs.activate_job_trigger.timeout = 300.0
163
163
 
164
+ default_config.rpcs.create_discovery_config.timeout = 300.0
165
+
166
+ default_config.rpcs.update_discovery_config.timeout = 300.0
167
+
168
+ default_config.rpcs.get_discovery_config.timeout = 300.0
169
+ default_config.rpcs.get_discovery_config.retry_policy = {
170
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
171
+ }
172
+
173
+ default_config.rpcs.list_discovery_configs.timeout = 300.0
174
+ default_config.rpcs.list_discovery_configs.retry_policy = {
175
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
176
+ }
177
+
178
+ default_config.rpcs.delete_discovery_config.timeout = 300.0
179
+ default_config.rpcs.delete_discovery_config.retry_policy = {
180
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
181
+ }
182
+
164
183
  default_config.rpcs.create_dlp_job.timeout = 300.0
165
184
 
166
185
  default_config.rpcs.list_dlp_jobs.timeout = 300.0
@@ -989,8 +1008,8 @@ module Google
989
1008
  # the default parameter values, pass an empty Hash as a request object (see above).
990
1009
  #
991
1010
  # @param name [::String]
992
- # Required. Resource name of organization and inspectTemplate to be updated, for
993
- # example `organizations/433245324/inspectTemplates/432452342` or
1011
+ # Required. Resource name of organization and inspectTemplate to be updated,
1012
+ # for example `organizations/433245324/inspectTemplates/432452342` or
994
1013
  # projects/project-id/inspectTemplates/432452342.
995
1014
  # @param inspect_template [::Google::Cloud::Dlp::V2::InspectTemplate, ::Hash]
996
1015
  # New InspectTemplate value.
@@ -1074,8 +1093,8 @@ module Google
1074
1093
  # the default parameter values, pass an empty Hash as a request object (see above).
1075
1094
  #
1076
1095
  # @param name [::String]
1077
- # Required. Resource name of the organization and inspectTemplate to be read, for
1078
- # example `organizations/433245324/inspectTemplates/432452342` or
1096
+ # Required. Resource name of the organization and inspectTemplate to be read,
1097
+ # for example `organizations/433245324/inspectTemplates/432452342` or
1079
1098
  # projects/project-id/inspectTemplates/432452342.
1080
1099
  # @yield [result, operation] Access the result along with the TransportOperation object
1081
1100
  # @yieldparam result [::Google::Cloud::Dlp::V2::InspectTemplate]
@@ -1176,15 +1195,15 @@ module Google
1176
1195
  #
1177
1196
  # parent=projects/example-project/locations/europe-west3
1178
1197
  # @param page_token [::String]
1179
- # Page token to continue retrieval. Comes from previous call
1198
+ # Page token to continue retrieval. Comes from the previous call
1180
1199
  # to `ListInspectTemplates`.
1181
1200
  # @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.
1201
+ # Size of the page. This value can be limited by the server. If zero server
1202
+ # returns a page of max size 100.
1184
1203
  # @param order_by [::String]
1185
1204
  # 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
1205
+ # followed by `asc` or `desc` postfix. This list is case insensitive. The
1206
+ # default sorting order is ascending. Redundant space characters are
1188
1207
  # insignificant.
1189
1208
  #
1190
1209
  # Example: `name asc,update_time, create_time desc`
@@ -1280,9 +1299,9 @@ module Google
1280
1299
  # the default parameter values, pass an empty Hash as a request object (see above).
1281
1300
  #
1282
1301
  # @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.
1302
+ # Required. Resource name of the organization and inspectTemplate to be
1303
+ # deleted, for example `organizations/433245324/inspectTemplates/432452342`
1304
+ # or projects/project-id/inspectTemplates/432452342.
1286
1305
  # @yield [result, operation] Access the result along with the TransportOperation object
1287
1306
  # @yieldparam result [::Google::Protobuf::Empty]
1288
1307
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -1471,8 +1490,9 @@ module Google
1471
1490
  # the default parameter values, pass an empty Hash as a request object (see above).
1472
1491
  #
1473
1492
  # @param name [::String]
1474
- # Required. Resource name of organization and deidentify template to be updated, for
1475
- # example `organizations/433245324/deidentifyTemplates/432452342` or
1493
+ # Required. Resource name of organization and deidentify template to be
1494
+ # updated, for example
1495
+ # `organizations/433245324/deidentifyTemplates/432452342` or
1476
1496
  # projects/project-id/deidentifyTemplates/432452342.
1477
1497
  # @param deidentify_template [::Google::Cloud::Dlp::V2::DeidentifyTemplate, ::Hash]
1478
1498
  # New DeidentifyTemplate value.
@@ -1557,9 +1577,9 @@ module Google
1557
1577
  # the default parameter values, pass an empty Hash as a request object (see above).
1558
1578
  #
1559
1579
  # @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.
1580
+ # Required. Resource name of the organization and deidentify template to be
1581
+ # read, for example `organizations/433245324/deidentifyTemplates/432452342`
1582
+ # or projects/project-id/deidentifyTemplates/432452342.
1563
1583
  # @yield [result, operation] Access the result along with the TransportOperation object
1564
1584
  # @yieldparam result [::Google::Cloud::Dlp::V2::DeidentifyTemplate]
1565
1585
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -1660,15 +1680,15 @@ module Google
1660
1680
  #
1661
1681
  # parent=projects/example-project/locations/europe-west3
1662
1682
  # @param page_token [::String]
1663
- # Page token to continue retrieval. Comes from previous call
1683
+ # Page token to continue retrieval. Comes from the previous call
1664
1684
  # to `ListDeidentifyTemplates`.
1665
1685
  # @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.
1686
+ # Size of the page. This value can be limited by the server. If zero server
1687
+ # returns a page of max size 100.
1668
1688
  # @param order_by [::String]
1669
1689
  # 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
1690
+ # followed by `asc` or `desc` postfix. This list is case insensitive. The
1691
+ # default sorting order is ascending. Redundant space characters are
1672
1692
  # insignificant.
1673
1693
  #
1674
1694
  # Example: `name asc,update_time, create_time desc`
@@ -1765,8 +1785,9 @@ module Google
1765
1785
  # the default parameter values, pass an empty Hash as a request object (see above).
1766
1786
  #
1767
1787
  # @param name [::String]
1768
- # Required. Resource name of the organization and deidentify template to be deleted,
1769
- # for example `organizations/433245324/deidentifyTemplates/432452342` or
1788
+ # Required. Resource name of the organization and deidentify template to be
1789
+ # deleted, for example
1790
+ # `organizations/433245324/deidentifyTemplates/432452342` or
1770
1791
  # projects/project-id/deidentifyTemplates/432452342.
1771
1792
  # @yield [result, operation] Access the result along with the TransportOperation object
1772
1793
  # @yieldparam result [::Google::Protobuf::Empty]
@@ -2035,8 +2056,8 @@ module Google
2035
2056
  # the default parameter values, pass an empty Hash as a request object (see above).
2036
2057
  #
2037
2058
  # @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`.
2059
+ # Required. Resource name of the trigger to execute a hybrid inspect on, for
2060
+ # example `projects/dlp-test-project/jobTriggers/53234423`.
2040
2061
  # @param hybrid_item [::Google::Cloud::Dlp::V2::HybridContentItem, ::Hash]
2041
2062
  # The item to inspect.
2042
2063
  # @yield [result, operation] Access the result along with the TransportOperation object
@@ -2214,15 +2235,15 @@ module Google
2214
2235
  #
2215
2236
  # parent=projects/example-project/locations/europe-west3
2216
2237
  # @param page_token [::String]
2217
- # Page token to continue retrieval. Comes from previous call
2238
+ # Page token to continue retrieval. Comes from the previous call
2218
2239
  # to ListJobTriggers. `order_by` field must not
2219
2240
  # change for subsequent calls.
2220
2241
  # @param page_size [::Integer]
2221
- # Size of the page, can be limited by a server.
2242
+ # Size of the page. This value can be limited by a server.
2222
2243
  # @param order_by [::String]
2223
2244
  # 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
2245
+ # followed by `asc` or `desc` postfix. This list is case insensitive. The
2246
+ # default sorting order is ascending. Redundant space characters are
2226
2247
  # insignificant.
2227
2248
  #
2228
2249
  # Example: `name asc,update_time, create_time desc`
@@ -2487,6 +2508,452 @@ module Google
2487
2508
  raise ::Google::Cloud::Error.from_error(e)
2488
2509
  end
2489
2510
 
2511
+ ##
2512
+ # Creates a config for discovery to scan and profile storage.
2513
+ #
2514
+ # @overload create_discovery_config(request, options = nil)
2515
+ # Pass arguments to `create_discovery_config` via a request object, either of type
2516
+ # {::Google::Cloud::Dlp::V2::CreateDiscoveryConfigRequest} or an equivalent Hash.
2517
+ #
2518
+ # @param request [::Google::Cloud::Dlp::V2::CreateDiscoveryConfigRequest, ::Hash]
2519
+ # A request object representing the call parameters. Required. To specify no
2520
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2521
+ # @param options [::Gapic::CallOptions, ::Hash]
2522
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2523
+ #
2524
+ # @overload create_discovery_config(parent: nil, discovery_config: nil, config_id: nil)
2525
+ # Pass arguments to `create_discovery_config` via keyword arguments. Note that at
2526
+ # least one keyword argument is required. To specify no parameters, or to keep all
2527
+ # the default parameter values, pass an empty Hash as a request object (see above).
2528
+ #
2529
+ # @param parent [::String]
2530
+ # Required. Parent resource name.
2531
+ #
2532
+ # The format of this value is as follows:
2533
+ # `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
2534
+ #
2535
+ # The following example `parent` string specifies a parent project with the
2536
+ # identifier `example-project`, and specifies the `europe-west3` location
2537
+ # for processing data:
2538
+ #
2539
+ # parent=projects/example-project/locations/europe-west3
2540
+ # @param discovery_config [::Google::Cloud::Dlp::V2::DiscoveryConfig, ::Hash]
2541
+ # Required. The DiscoveryConfig to create.
2542
+ # @param config_id [::String]
2543
+ # The config ID can contain uppercase and lowercase letters,
2544
+ # numbers, and hyphens; that is, it must match the regular
2545
+ # expression: `[a-zA-Z\d-_]+`. The maximum length is 100
2546
+ # characters. Can be empty to allow the system to generate one.
2547
+ # @yield [result, operation] Access the result along with the TransportOperation object
2548
+ # @yieldparam result [::Google::Cloud::Dlp::V2::DiscoveryConfig]
2549
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2550
+ #
2551
+ # @return [::Google::Cloud::Dlp::V2::DiscoveryConfig]
2552
+ #
2553
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2554
+ #
2555
+ # @example Basic example
2556
+ # require "google/cloud/dlp/v2"
2557
+ #
2558
+ # # Create a client object. The client can be reused for multiple calls.
2559
+ # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new
2560
+ #
2561
+ # # Create a request. To set request fields, pass in keyword arguments.
2562
+ # request = Google::Cloud::Dlp::V2::CreateDiscoveryConfigRequest.new
2563
+ #
2564
+ # # Call the create_discovery_config method.
2565
+ # result = client.create_discovery_config request
2566
+ #
2567
+ # # The returned object is of type Google::Cloud::Dlp::V2::DiscoveryConfig.
2568
+ # p result
2569
+ #
2570
+ def create_discovery_config request, options = nil
2571
+ raise ::ArgumentError, "request must be provided" if request.nil?
2572
+
2573
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::CreateDiscoveryConfigRequest
2574
+
2575
+ # Converts hash and nil to an options object
2576
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2577
+
2578
+ # Customize the options with defaults
2579
+ call_metadata = @config.rpcs.create_discovery_config.metadata.to_h
2580
+
2581
+ # Set x-goog-api-client and x-goog-user-project headers
2582
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2583
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2584
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
2585
+ transports_version_send: [:rest]
2586
+
2587
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2588
+
2589
+ options.apply_defaults timeout: @config.rpcs.create_discovery_config.timeout,
2590
+ metadata: call_metadata,
2591
+ retry_policy: @config.rpcs.create_discovery_config.retry_policy
2592
+
2593
+ options.apply_defaults timeout: @config.timeout,
2594
+ metadata: @config.metadata,
2595
+ retry_policy: @config.retry_policy
2596
+
2597
+ @dlp_service_stub.create_discovery_config request, options do |result, operation|
2598
+ yield result, operation if block_given?
2599
+ return result
2600
+ end
2601
+ rescue ::Gapic::Rest::Error => e
2602
+ raise ::Google::Cloud::Error.from_error(e)
2603
+ end
2604
+
2605
+ ##
2606
+ # Updates a discovery configuration.
2607
+ #
2608
+ # @overload update_discovery_config(request, options = nil)
2609
+ # Pass arguments to `update_discovery_config` via a request object, either of type
2610
+ # {::Google::Cloud::Dlp::V2::UpdateDiscoveryConfigRequest} or an equivalent Hash.
2611
+ #
2612
+ # @param request [::Google::Cloud::Dlp::V2::UpdateDiscoveryConfigRequest, ::Hash]
2613
+ # A request object representing the call parameters. Required. To specify no
2614
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2615
+ # @param options [::Gapic::CallOptions, ::Hash]
2616
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2617
+ #
2618
+ # @overload update_discovery_config(name: nil, discovery_config: nil, update_mask: nil)
2619
+ # Pass arguments to `update_discovery_config` via keyword arguments. Note that at
2620
+ # least one keyword argument is required. To specify no parameters, or to keep all
2621
+ # the default parameter values, pass an empty Hash as a request object (see above).
2622
+ #
2623
+ # @param name [::String]
2624
+ # Required. Resource name of the project and the configuration, for example
2625
+ # `projects/dlp-test-project/discoveryConfigs/53234423`.
2626
+ # @param discovery_config [::Google::Cloud::Dlp::V2::DiscoveryConfig, ::Hash]
2627
+ # Required. New DiscoveryConfig value.
2628
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2629
+ # Mask to control which fields get updated.
2630
+ # @yield [result, operation] Access the result along with the TransportOperation object
2631
+ # @yieldparam result [::Google::Cloud::Dlp::V2::DiscoveryConfig]
2632
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2633
+ #
2634
+ # @return [::Google::Cloud::Dlp::V2::DiscoveryConfig]
2635
+ #
2636
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2637
+ #
2638
+ # @example Basic example
2639
+ # require "google/cloud/dlp/v2"
2640
+ #
2641
+ # # Create a client object. The client can be reused for multiple calls.
2642
+ # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new
2643
+ #
2644
+ # # Create a request. To set request fields, pass in keyword arguments.
2645
+ # request = Google::Cloud::Dlp::V2::UpdateDiscoveryConfigRequest.new
2646
+ #
2647
+ # # Call the update_discovery_config method.
2648
+ # result = client.update_discovery_config request
2649
+ #
2650
+ # # The returned object is of type Google::Cloud::Dlp::V2::DiscoveryConfig.
2651
+ # p result
2652
+ #
2653
+ def update_discovery_config request, options = nil
2654
+ raise ::ArgumentError, "request must be provided" if request.nil?
2655
+
2656
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::UpdateDiscoveryConfigRequest
2657
+
2658
+ # Converts hash and nil to an options object
2659
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2660
+
2661
+ # Customize the options with defaults
2662
+ call_metadata = @config.rpcs.update_discovery_config.metadata.to_h
2663
+
2664
+ # Set x-goog-api-client and x-goog-user-project headers
2665
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2666
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2667
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
2668
+ transports_version_send: [:rest]
2669
+
2670
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2671
+
2672
+ options.apply_defaults timeout: @config.rpcs.update_discovery_config.timeout,
2673
+ metadata: call_metadata,
2674
+ retry_policy: @config.rpcs.update_discovery_config.retry_policy
2675
+
2676
+ options.apply_defaults timeout: @config.timeout,
2677
+ metadata: @config.metadata,
2678
+ retry_policy: @config.retry_policy
2679
+
2680
+ @dlp_service_stub.update_discovery_config request, options do |result, operation|
2681
+ yield result, operation if block_given?
2682
+ return result
2683
+ end
2684
+ rescue ::Gapic::Rest::Error => e
2685
+ raise ::Google::Cloud::Error.from_error(e)
2686
+ end
2687
+
2688
+ ##
2689
+ # Gets a discovery configuration.
2690
+ #
2691
+ # @overload get_discovery_config(request, options = nil)
2692
+ # Pass arguments to `get_discovery_config` via a request object, either of type
2693
+ # {::Google::Cloud::Dlp::V2::GetDiscoveryConfigRequest} or an equivalent Hash.
2694
+ #
2695
+ # @param request [::Google::Cloud::Dlp::V2::GetDiscoveryConfigRequest, ::Hash]
2696
+ # A request object representing the call parameters. Required. To specify no
2697
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2698
+ # @param options [::Gapic::CallOptions, ::Hash]
2699
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2700
+ #
2701
+ # @overload get_discovery_config(name: nil)
2702
+ # Pass arguments to `get_discovery_config` via keyword arguments. Note that at
2703
+ # least one keyword argument is required. To specify no parameters, or to keep all
2704
+ # the default parameter values, pass an empty Hash as a request object (see above).
2705
+ #
2706
+ # @param name [::String]
2707
+ # Required. Resource name of the project and the configuration, for example
2708
+ # `projects/dlp-test-project/discoveryConfigs/53234423`.
2709
+ # @yield [result, operation] Access the result along with the TransportOperation object
2710
+ # @yieldparam result [::Google::Cloud::Dlp::V2::DiscoveryConfig]
2711
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2712
+ #
2713
+ # @return [::Google::Cloud::Dlp::V2::DiscoveryConfig]
2714
+ #
2715
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2716
+ #
2717
+ # @example Basic example
2718
+ # require "google/cloud/dlp/v2"
2719
+ #
2720
+ # # Create a client object. The client can be reused for multiple calls.
2721
+ # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new
2722
+ #
2723
+ # # Create a request. To set request fields, pass in keyword arguments.
2724
+ # request = Google::Cloud::Dlp::V2::GetDiscoveryConfigRequest.new
2725
+ #
2726
+ # # Call the get_discovery_config method.
2727
+ # result = client.get_discovery_config request
2728
+ #
2729
+ # # The returned object is of type Google::Cloud::Dlp::V2::DiscoveryConfig.
2730
+ # p result
2731
+ #
2732
+ def get_discovery_config request, options = nil
2733
+ raise ::ArgumentError, "request must be provided" if request.nil?
2734
+
2735
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::GetDiscoveryConfigRequest
2736
+
2737
+ # Converts hash and nil to an options object
2738
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2739
+
2740
+ # Customize the options with defaults
2741
+ call_metadata = @config.rpcs.get_discovery_config.metadata.to_h
2742
+
2743
+ # Set x-goog-api-client and x-goog-user-project headers
2744
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2745
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2746
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
2747
+ transports_version_send: [:rest]
2748
+
2749
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2750
+
2751
+ options.apply_defaults timeout: @config.rpcs.get_discovery_config.timeout,
2752
+ metadata: call_metadata,
2753
+ retry_policy: @config.rpcs.get_discovery_config.retry_policy
2754
+
2755
+ options.apply_defaults timeout: @config.timeout,
2756
+ metadata: @config.metadata,
2757
+ retry_policy: @config.retry_policy
2758
+
2759
+ @dlp_service_stub.get_discovery_config request, options do |result, operation|
2760
+ yield result, operation if block_given?
2761
+ return result
2762
+ end
2763
+ rescue ::Gapic::Rest::Error => e
2764
+ raise ::Google::Cloud::Error.from_error(e)
2765
+ end
2766
+
2767
+ ##
2768
+ # Lists discovery configurations.
2769
+ #
2770
+ # @overload list_discovery_configs(request, options = nil)
2771
+ # Pass arguments to `list_discovery_configs` via a request object, either of type
2772
+ # {::Google::Cloud::Dlp::V2::ListDiscoveryConfigsRequest} or an equivalent Hash.
2773
+ #
2774
+ # @param request [::Google::Cloud::Dlp::V2::ListDiscoveryConfigsRequest, ::Hash]
2775
+ # A request object representing the call parameters. Required. To specify no
2776
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2777
+ # @param options [::Gapic::CallOptions, ::Hash]
2778
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2779
+ #
2780
+ # @overload list_discovery_configs(parent: nil, page_token: nil, page_size: nil, order_by: nil)
2781
+ # Pass arguments to `list_discovery_configs` via keyword arguments. Note that at
2782
+ # least one keyword argument is required. To specify no parameters, or to keep all
2783
+ # the default parameter values, pass an empty Hash as a request object (see above).
2784
+ #
2785
+ # @param parent [::String]
2786
+ # Required. Parent resource name.
2787
+ #
2788
+ # The format of this value is as follows:
2789
+ # `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
2790
+ #
2791
+ # The following example `parent` string specifies a parent project with the
2792
+ # identifier `example-project`, and specifies the `europe-west3` location
2793
+ # for processing data:
2794
+ #
2795
+ # parent=projects/example-project/locations/europe-west3
2796
+ # @param page_token [::String]
2797
+ # Page token to continue retrieval. Comes from the previous call
2798
+ # to ListDiscoveryConfigs. `order_by` field must not
2799
+ # change for subsequent calls.
2800
+ # @param page_size [::Integer]
2801
+ # Size of the page. This value can be limited by a server.
2802
+ # @param order_by [::String]
2803
+ # Comma separated list of config fields to order by,
2804
+ # followed by `asc` or `desc` postfix. This list is case insensitive. The
2805
+ # default sorting order is ascending. Redundant space characters are
2806
+ # insignificant.
2807
+ #
2808
+ # Example: `name asc,update_time, create_time desc`
2809
+ #
2810
+ # Supported fields are:
2811
+ #
2812
+ # - `last_run_time`: corresponds to the last time the DiscoveryConfig ran.
2813
+ # - `name`: corresponds to the DiscoveryConfig's name.
2814
+ # - `status`: corresponds to DiscoveryConfig's status.
2815
+ # @yield [result, operation] Access the result along with the TransportOperation object
2816
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dlp::V2::DiscoveryConfig>]
2817
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2818
+ #
2819
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dlp::V2::DiscoveryConfig>]
2820
+ #
2821
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2822
+ #
2823
+ # @example Basic example
2824
+ # require "google/cloud/dlp/v2"
2825
+ #
2826
+ # # Create a client object. The client can be reused for multiple calls.
2827
+ # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new
2828
+ #
2829
+ # # Create a request. To set request fields, pass in keyword arguments.
2830
+ # request = Google::Cloud::Dlp::V2::ListDiscoveryConfigsRequest.new
2831
+ #
2832
+ # # Call the list_discovery_configs method.
2833
+ # result = client.list_discovery_configs request
2834
+ #
2835
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2836
+ # # over elements, and API calls will be issued to fetch pages as needed.
2837
+ # result.each do |item|
2838
+ # # Each element is of type ::Google::Cloud::Dlp::V2::DiscoveryConfig.
2839
+ # p item
2840
+ # end
2841
+ #
2842
+ def list_discovery_configs request, options = nil
2843
+ raise ::ArgumentError, "request must be provided" if request.nil?
2844
+
2845
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::ListDiscoveryConfigsRequest
2846
+
2847
+ # Converts hash and nil to an options object
2848
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2849
+
2850
+ # Customize the options with defaults
2851
+ call_metadata = @config.rpcs.list_discovery_configs.metadata.to_h
2852
+
2853
+ # Set x-goog-api-client and x-goog-user-project headers
2854
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2855
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2856
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
2857
+ transports_version_send: [:rest]
2858
+
2859
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2860
+
2861
+ options.apply_defaults timeout: @config.rpcs.list_discovery_configs.timeout,
2862
+ metadata: call_metadata,
2863
+ retry_policy: @config.rpcs.list_discovery_configs.retry_policy
2864
+
2865
+ options.apply_defaults timeout: @config.timeout,
2866
+ metadata: @config.metadata,
2867
+ retry_policy: @config.retry_policy
2868
+
2869
+ @dlp_service_stub.list_discovery_configs request, options do |result, operation|
2870
+ result = ::Gapic::Rest::PagedEnumerable.new @dlp_service_stub, :list_discovery_configs, "discovery_configs", request, result, options
2871
+ yield result, operation if block_given?
2872
+ return result
2873
+ end
2874
+ rescue ::Gapic::Rest::Error => e
2875
+ raise ::Google::Cloud::Error.from_error(e)
2876
+ end
2877
+
2878
+ ##
2879
+ # Deletes a discovery configuration.
2880
+ #
2881
+ # @overload delete_discovery_config(request, options = nil)
2882
+ # Pass arguments to `delete_discovery_config` via a request object, either of type
2883
+ # {::Google::Cloud::Dlp::V2::DeleteDiscoveryConfigRequest} or an equivalent Hash.
2884
+ #
2885
+ # @param request [::Google::Cloud::Dlp::V2::DeleteDiscoveryConfigRequest, ::Hash]
2886
+ # A request object representing the call parameters. Required. To specify no
2887
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2888
+ # @param options [::Gapic::CallOptions, ::Hash]
2889
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2890
+ #
2891
+ # @overload delete_discovery_config(name: nil)
2892
+ # Pass arguments to `delete_discovery_config` via keyword arguments. Note that at
2893
+ # least one keyword argument is required. To specify no parameters, or to keep all
2894
+ # the default parameter values, pass an empty Hash as a request object (see above).
2895
+ #
2896
+ # @param name [::String]
2897
+ # Required. Resource name of the project and the config, for example
2898
+ # `projects/dlp-test-project/discoveryConfigs/53234423`.
2899
+ # @yield [result, operation] Access the result along with the TransportOperation object
2900
+ # @yieldparam result [::Google::Protobuf::Empty]
2901
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2902
+ #
2903
+ # @return [::Google::Protobuf::Empty]
2904
+ #
2905
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2906
+ #
2907
+ # @example Basic example
2908
+ # require "google/cloud/dlp/v2"
2909
+ #
2910
+ # # Create a client object. The client can be reused for multiple calls.
2911
+ # client = Google::Cloud::Dlp::V2::DlpService::Rest::Client.new
2912
+ #
2913
+ # # Create a request. To set request fields, pass in keyword arguments.
2914
+ # request = Google::Cloud::Dlp::V2::DeleteDiscoveryConfigRequest.new
2915
+ #
2916
+ # # Call the delete_discovery_config method.
2917
+ # result = client.delete_discovery_config request
2918
+ #
2919
+ # # The returned object is of type Google::Protobuf::Empty.
2920
+ # p result
2921
+ #
2922
+ def delete_discovery_config request, options = nil
2923
+ raise ::ArgumentError, "request must be provided" if request.nil?
2924
+
2925
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::DeleteDiscoveryConfigRequest
2926
+
2927
+ # Converts hash and nil to an options object
2928
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2929
+
2930
+ # Customize the options with defaults
2931
+ call_metadata = @config.rpcs.delete_discovery_config.metadata.to_h
2932
+
2933
+ # Set x-goog-api-client and x-goog-user-project headers
2934
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2935
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2936
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION,
2937
+ transports_version_send: [:rest]
2938
+
2939
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2940
+
2941
+ options.apply_defaults timeout: @config.rpcs.delete_discovery_config.timeout,
2942
+ metadata: call_metadata,
2943
+ retry_policy: @config.rpcs.delete_discovery_config.retry_policy
2944
+
2945
+ options.apply_defaults timeout: @config.timeout,
2946
+ metadata: @config.metadata,
2947
+ retry_policy: @config.retry_policy
2948
+
2949
+ @dlp_service_stub.delete_discovery_config request, options do |result, operation|
2950
+ yield result, operation if block_given?
2951
+ return result
2952
+ end
2953
+ rescue ::Gapic::Rest::Error => e
2954
+ raise ::Google::Cloud::Error.from_error(e)
2955
+ end
2956
+
2490
2957
  ##
2491
2958
  # Creates a new job to inspect storage or calculate risk metrics.
2492
2959
  # See https://cloud.google.com/dlp/docs/inspecting-storage and
@@ -2672,8 +3139,8 @@ module Google
2672
3139
  # The type of job. Defaults to `DlpJobType.INSPECT`
2673
3140
  # @param order_by [::String]
2674
3141
  # 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
3142
+ # followed by `asc` or `desc` postfix. This list is case insensitive. The
3143
+ # default sorting order is ascending. Redundant space characters are
2677
3144
  # insignificant.
2678
3145
  #
2679
3146
  # Example: `name asc, end_time asc, create_time desc`
@@ -3123,8 +3590,8 @@ module Google
3123
3590
  # the default parameter values, pass an empty Hash as a request object (see above).
3124
3591
  #
3125
3592
  # @param name [::String]
3126
- # Required. Resource name of organization and storedInfoType to be updated, for
3127
- # example `organizations/433245324/storedInfoTypes/432452342` or
3593
+ # Required. Resource name of organization and storedInfoType to be updated,
3594
+ # for example `organizations/433245324/storedInfoTypes/432452342` or
3128
3595
  # projects/project-id/storedInfoTypes/432452342.
3129
3596
  # @param config [::Google::Cloud::Dlp::V2::StoredInfoTypeConfig, ::Hash]
3130
3597
  # Updated configuration for the storedInfoType. If not provided, a new
@@ -3211,8 +3678,8 @@ module Google
3211
3678
  # the default parameter values, pass an empty Hash as a request object (see above).
3212
3679
  #
3213
3680
  # @param name [::String]
3214
- # Required. Resource name of the organization and storedInfoType to be read, for
3215
- # example `organizations/433245324/storedInfoTypes/432452342` or
3681
+ # Required. Resource name of the organization and storedInfoType to be read,
3682
+ # for example `organizations/433245324/storedInfoTypes/432452342` or
3216
3683
  # projects/project-id/storedInfoTypes/432452342.
3217
3684
  # @yield [result, operation] Access the result along with the TransportOperation object
3218
3685
  # @yieldparam result [::Google::Cloud::Dlp::V2::StoredInfoType]
@@ -3310,15 +3777,15 @@ module Google
3310
3777
  #
3311
3778
  # parent=projects/example-project/locations/europe-west3
3312
3779
  # @param page_token [::String]
3313
- # Page token to continue retrieval. Comes from previous call
3780
+ # Page token to continue retrieval. Comes from the previous call
3314
3781
  # to `ListStoredInfoTypes`.
3315
3782
  # @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.
3783
+ # Size of the page. This value can be limited by the server. If zero server
3784
+ # returns a page of max size 100.
3318
3785
  # @param order_by [::String]
3319
3786
  # 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
3787
+ # followed by `asc` or `desc` postfix. This list is case insensitive. The
3788
+ # default sorting order is ascending. Redundant space characters are
3322
3789
  # insignificant.
3323
3790
  #
3324
3791
  # Example: `name asc, display_name, create_time desc`
@@ -3416,8 +3883,8 @@ module Google
3416
3883
  # the default parameter values, pass an empty Hash as a request object (see above).
3417
3884
  #
3418
3885
  # @param name [::String]
3419
- # Required. Resource name of the organization and storedInfoType to be deleted, for
3420
- # example `organizations/433245324/storedInfoTypes/432452342` or
3886
+ # Required. Resource name of the organization and storedInfoType to be
3887
+ # deleted, for example `organizations/433245324/storedInfoTypes/432452342` or
3421
3888
  # projects/project-id/storedInfoTypes/432452342.
3422
3889
  # @yield [result, operation] Access the result along with the TransportOperation object
3423
3890
  # @yieldparam result [::Google::Protobuf::Empty]
@@ -3498,8 +3965,8 @@ module Google
3498
3965
  # the default parameter values, pass an empty Hash as a request object (see above).
3499
3966
  #
3500
3967
  # @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`.
3968
+ # Required. Resource name of the job to execute a hybrid inspect on, for
3969
+ # example `projects/dlp-test-project/dlpJob/53234423`.
3503
3970
  # @param hybrid_item [::Google::Cloud::Dlp::V2::HybridContentItem, ::Hash]
3504
3971
  # The item to inspect.
3505
3972
  # @yield [result, operation] Access the result along with the TransportOperation object
@@ -3875,6 +4342,31 @@ module Google
3875
4342
  #
3876
4343
  attr_reader :activate_job_trigger
3877
4344
  ##
4345
+ # RPC-specific configuration for `create_discovery_config`
4346
+ # @return [::Gapic::Config::Method]
4347
+ #
4348
+ attr_reader :create_discovery_config
4349
+ ##
4350
+ # RPC-specific configuration for `update_discovery_config`
4351
+ # @return [::Gapic::Config::Method]
4352
+ #
4353
+ attr_reader :update_discovery_config
4354
+ ##
4355
+ # RPC-specific configuration for `get_discovery_config`
4356
+ # @return [::Gapic::Config::Method]
4357
+ #
4358
+ attr_reader :get_discovery_config
4359
+ ##
4360
+ # RPC-specific configuration for `list_discovery_configs`
4361
+ # @return [::Gapic::Config::Method]
4362
+ #
4363
+ attr_reader :list_discovery_configs
4364
+ ##
4365
+ # RPC-specific configuration for `delete_discovery_config`
4366
+ # @return [::Gapic::Config::Method]
4367
+ #
4368
+ attr_reader :delete_discovery_config
4369
+ ##
3878
4370
  # RPC-specific configuration for `create_dlp_job`
3879
4371
  # @return [::Gapic::Config::Method]
3880
4372
  #
@@ -3981,6 +4473,16 @@ module Google
3981
4473
  @delete_job_trigger = ::Gapic::Config::Method.new delete_job_trigger_config
3982
4474
  activate_job_trigger_config = parent_rpcs.activate_job_trigger if parent_rpcs.respond_to? :activate_job_trigger
3983
4475
  @activate_job_trigger = ::Gapic::Config::Method.new activate_job_trigger_config
4476
+ create_discovery_config_config = parent_rpcs.create_discovery_config if parent_rpcs.respond_to? :create_discovery_config
4477
+ @create_discovery_config = ::Gapic::Config::Method.new create_discovery_config_config
4478
+ update_discovery_config_config = parent_rpcs.update_discovery_config if parent_rpcs.respond_to? :update_discovery_config
4479
+ @update_discovery_config = ::Gapic::Config::Method.new update_discovery_config_config
4480
+ get_discovery_config_config = parent_rpcs.get_discovery_config if parent_rpcs.respond_to? :get_discovery_config
4481
+ @get_discovery_config = ::Gapic::Config::Method.new get_discovery_config_config
4482
+ list_discovery_configs_config = parent_rpcs.list_discovery_configs if parent_rpcs.respond_to? :list_discovery_configs
4483
+ @list_discovery_configs = ::Gapic::Config::Method.new list_discovery_configs_config
4484
+ delete_discovery_config_config = parent_rpcs.delete_discovery_config if parent_rpcs.respond_to? :delete_discovery_config
4485
+ @delete_discovery_config = ::Gapic::Config::Method.new delete_discovery_config_config
3984
4486
  create_dlp_job_config = parent_rpcs.create_dlp_job if parent_rpcs.respond_to? :create_dlp_job
3985
4487
  @create_dlp_job = ::Gapic::Config::Method.new create_dlp_job_config
3986
4488
  list_dlp_jobs_config = parent_rpcs.list_dlp_jobs if parent_rpcs.respond_to? :list_dlp_jobs