google-cloud-dlp-v2 0.18.0 → 0.19.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.
@@ -159,6 +159,25 @@ module Google
159
159
 
160
160
  default_config.rpcs.activate_job_trigger.timeout = 300.0
161
161
 
162
+ default_config.rpcs.create_discovery_config.timeout = 300.0
163
+
164
+ default_config.rpcs.update_discovery_config.timeout = 300.0
165
+
166
+ default_config.rpcs.get_discovery_config.timeout = 300.0
167
+ default_config.rpcs.get_discovery_config.retry_policy = {
168
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
169
+ }
170
+
171
+ default_config.rpcs.list_discovery_configs.timeout = 300.0
172
+ default_config.rpcs.list_discovery_configs.retry_policy = {
173
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
174
+ }
175
+
176
+ default_config.rpcs.delete_discovery_config.timeout = 300.0
177
+ default_config.rpcs.delete_discovery_config.retry_policy = {
178
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
179
+ }
180
+
162
181
  default_config.rpcs.create_dlp_job.timeout = 300.0
163
182
 
164
183
  default_config.rpcs.list_dlp_jobs.timeout = 300.0
@@ -1033,8 +1052,8 @@ module Google
1033
1052
  # the default parameter values, pass an empty Hash as a request object (see above).
1034
1053
  #
1035
1054
  # @param name [::String]
1036
- # Required. Resource name of organization and inspectTemplate to be updated, for
1037
- # example `organizations/433245324/inspectTemplates/432452342` or
1055
+ # Required. Resource name of organization and inspectTemplate to be updated,
1056
+ # for example `organizations/433245324/inspectTemplates/432452342` or
1038
1057
  # projects/project-id/inspectTemplates/432452342.
1039
1058
  # @param inspect_template [::Google::Cloud::Dlp::V2::InspectTemplate, ::Hash]
1040
1059
  # New InspectTemplate value.
@@ -1125,8 +1144,8 @@ module Google
1125
1144
  # the default parameter values, pass an empty Hash as a request object (see above).
1126
1145
  #
1127
1146
  # @param name [::String]
1128
- # Required. Resource name of the organization and inspectTemplate to be read, for
1129
- # example `organizations/433245324/inspectTemplates/432452342` or
1147
+ # Required. Resource name of the organization and inspectTemplate to be read,
1148
+ # for example `organizations/433245324/inspectTemplates/432452342` or
1130
1149
  # projects/project-id/inspectTemplates/432452342.
1131
1150
  #
1132
1151
  # @yield [response, operation] Access the result along with the RPC operation
@@ -1234,15 +1253,15 @@ module Google
1234
1253
  #
1235
1254
  # parent=projects/example-project/locations/europe-west3
1236
1255
  # @param page_token [::String]
1237
- # Page token to continue retrieval. Comes from previous call
1256
+ # Page token to continue retrieval. Comes from the previous call
1238
1257
  # to `ListInspectTemplates`.
1239
1258
  # @param page_size [::Integer]
1240
- # Size of the page, can be limited by the server. If zero server returns
1241
- # a page of max size 100.
1259
+ # Size of the page. This value can be limited by the server. If zero server
1260
+ # returns a page of max size 100.
1242
1261
  # @param order_by [::String]
1243
1262
  # Comma separated list of fields to order by,
1244
- # followed by `asc` or `desc` postfix. This list is case-insensitive,
1245
- # default sorting order is ascending, redundant space characters are
1263
+ # followed by `asc` or `desc` postfix. This list is case insensitive. The
1264
+ # default sorting order is ascending. Redundant space characters are
1246
1265
  # insignificant.
1247
1266
  #
1248
1267
  # Example: `name asc,update_time, create_time desc`
@@ -1345,9 +1364,9 @@ module Google
1345
1364
  # the default parameter values, pass an empty Hash as a request object (see above).
1346
1365
  #
1347
1366
  # @param name [::String]
1348
- # Required. Resource name of the organization and inspectTemplate to be deleted, for
1349
- # example `organizations/433245324/inspectTemplates/432452342` or
1350
- # projects/project-id/inspectTemplates/432452342.
1367
+ # Required. Resource name of the organization and inspectTemplate to be
1368
+ # deleted, for example `organizations/433245324/inspectTemplates/432452342`
1369
+ # or projects/project-id/inspectTemplates/432452342.
1351
1370
  #
1352
1371
  # @yield [response, operation] Access the result along with the RPC operation
1353
1372
  # @yieldparam response [::Google::Protobuf::Empty]
@@ -1550,8 +1569,9 @@ module Google
1550
1569
  # the default parameter values, pass an empty Hash as a request object (see above).
1551
1570
  #
1552
1571
  # @param name [::String]
1553
- # Required. Resource name of organization and deidentify template to be updated, for
1554
- # example `organizations/433245324/deidentifyTemplates/432452342` or
1572
+ # Required. Resource name of organization and deidentify template to be
1573
+ # updated, for example
1574
+ # `organizations/433245324/deidentifyTemplates/432452342` or
1555
1575
  # projects/project-id/deidentifyTemplates/432452342.
1556
1576
  # @param deidentify_template [::Google::Cloud::Dlp::V2::DeidentifyTemplate, ::Hash]
1557
1577
  # New DeidentifyTemplate value.
@@ -1643,9 +1663,9 @@ module Google
1643
1663
  # the default parameter values, pass an empty Hash as a request object (see above).
1644
1664
  #
1645
1665
  # @param name [::String]
1646
- # Required. Resource name of the organization and deidentify template to be read, for
1647
- # example `organizations/433245324/deidentifyTemplates/432452342` or
1648
- # projects/project-id/deidentifyTemplates/432452342.
1666
+ # Required. Resource name of the organization and deidentify template to be
1667
+ # read, for example `organizations/433245324/deidentifyTemplates/432452342`
1668
+ # or projects/project-id/deidentifyTemplates/432452342.
1649
1669
  #
1650
1670
  # @yield [response, operation] Access the result along with the RPC operation
1651
1671
  # @yieldparam response [::Google::Cloud::Dlp::V2::DeidentifyTemplate]
@@ -1753,15 +1773,15 @@ module Google
1753
1773
  #
1754
1774
  # parent=projects/example-project/locations/europe-west3
1755
1775
  # @param page_token [::String]
1756
- # Page token to continue retrieval. Comes from previous call
1776
+ # Page token to continue retrieval. Comes from the previous call
1757
1777
  # to `ListDeidentifyTemplates`.
1758
1778
  # @param page_size [::Integer]
1759
- # Size of the page, can be limited by the server. If zero server returns
1760
- # a page of max size 100.
1779
+ # Size of the page. This value can be limited by the server. If zero server
1780
+ # returns a page of max size 100.
1761
1781
  # @param order_by [::String]
1762
1782
  # Comma separated list of fields to order by,
1763
- # followed by `asc` or `desc` postfix. This list is case-insensitive,
1764
- # default sorting order is ascending, redundant space characters are
1783
+ # followed by `asc` or `desc` postfix. This list is case insensitive. The
1784
+ # default sorting order is ascending. Redundant space characters are
1765
1785
  # insignificant.
1766
1786
  #
1767
1787
  # Example: `name asc,update_time, create_time desc`
@@ -1865,8 +1885,9 @@ module Google
1865
1885
  # the default parameter values, pass an empty Hash as a request object (see above).
1866
1886
  #
1867
1887
  # @param name [::String]
1868
- # Required. Resource name of the organization and deidentify template to be deleted,
1869
- # for example `organizations/433245324/deidentifyTemplates/432452342` or
1888
+ # Required. Resource name of the organization and deidentify template to be
1889
+ # deleted, for example
1890
+ # `organizations/433245324/deidentifyTemplates/432452342` or
1870
1891
  # projects/project-id/deidentifyTemplates/432452342.
1871
1892
  #
1872
1893
  # @yield [response, operation] Access the result along with the RPC operation
@@ -2156,8 +2177,8 @@ module Google
2156
2177
  # the default parameter values, pass an empty Hash as a request object (see above).
2157
2178
  #
2158
2179
  # @param name [::String]
2159
- # Required. Resource name of the trigger to execute a hybrid inspect on, for example
2160
- # `projects/dlp-test-project/jobTriggers/53234423`.
2180
+ # Required. Resource name of the trigger to execute a hybrid inspect on, for
2181
+ # example `projects/dlp-test-project/jobTriggers/53234423`.
2161
2182
  # @param hybrid_item [::Google::Cloud::Dlp::V2::HybridContentItem, ::Hash]
2162
2183
  # The item to inspect.
2163
2184
  #
@@ -2349,15 +2370,15 @@ module Google
2349
2370
  #
2350
2371
  # parent=projects/example-project/locations/europe-west3
2351
2372
  # @param page_token [::String]
2352
- # Page token to continue retrieval. Comes from previous call
2373
+ # Page token to continue retrieval. Comes from the previous call
2353
2374
  # to ListJobTriggers. `order_by` field must not
2354
2375
  # change for subsequent calls.
2355
2376
  # @param page_size [::Integer]
2356
- # Size of the page, can be limited by a server.
2377
+ # Size of the page. This value can be limited by a server.
2357
2378
  # @param order_by [::String]
2358
2379
  # Comma separated list of triggeredJob fields to order by,
2359
- # followed by `asc` or `desc` postfix. This list is case-insensitive,
2360
- # default sorting order is ascending, redundant space characters are
2380
+ # followed by `asc` or `desc` postfix. This list is case insensitive. The
2381
+ # default sorting order is ascending. Redundant space characters are
2361
2382
  # insignificant.
2362
2383
  #
2363
2384
  # Example: `name asc,update_time, create_time desc`
@@ -2643,6 +2664,487 @@ module Google
2643
2664
  raise ::Google::Cloud::Error.from_error(e)
2644
2665
  end
2645
2666
 
2667
+ ##
2668
+ # Creates a config for discovery to scan and profile storage.
2669
+ #
2670
+ # @overload create_discovery_config(request, options = nil)
2671
+ # Pass arguments to `create_discovery_config` via a request object, either of type
2672
+ # {::Google::Cloud::Dlp::V2::CreateDiscoveryConfigRequest} or an equivalent Hash.
2673
+ #
2674
+ # @param request [::Google::Cloud::Dlp::V2::CreateDiscoveryConfigRequest, ::Hash]
2675
+ # A request object representing the call parameters. Required. To specify no
2676
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2677
+ # @param options [::Gapic::CallOptions, ::Hash]
2678
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2679
+ #
2680
+ # @overload create_discovery_config(parent: nil, discovery_config: nil, config_id: nil)
2681
+ # Pass arguments to `create_discovery_config` via keyword arguments. Note that at
2682
+ # least one keyword argument is required. To specify no parameters, or to keep all
2683
+ # the default parameter values, pass an empty Hash as a request object (see above).
2684
+ #
2685
+ # @param parent [::String]
2686
+ # Required. Parent resource name.
2687
+ #
2688
+ # The format of this value is as follows:
2689
+ # `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
2690
+ #
2691
+ # The following example `parent` string specifies a parent project with the
2692
+ # identifier `example-project`, and specifies the `europe-west3` location
2693
+ # for processing data:
2694
+ #
2695
+ # parent=projects/example-project/locations/europe-west3
2696
+ # @param discovery_config [::Google::Cloud::Dlp::V2::DiscoveryConfig, ::Hash]
2697
+ # Required. The DiscoveryConfig to create.
2698
+ # @param config_id [::String]
2699
+ # The config ID can contain uppercase and lowercase letters,
2700
+ # numbers, and hyphens; that is, it must match the regular
2701
+ # expression: `[a-zA-Z\d-_]+`. The maximum length is 100
2702
+ # characters. Can be empty to allow the system to generate one.
2703
+ #
2704
+ # @yield [response, operation] Access the result along with the RPC operation
2705
+ # @yieldparam response [::Google::Cloud::Dlp::V2::DiscoveryConfig]
2706
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2707
+ #
2708
+ # @return [::Google::Cloud::Dlp::V2::DiscoveryConfig]
2709
+ #
2710
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2711
+ #
2712
+ # @example Basic example
2713
+ # require "google/cloud/dlp/v2"
2714
+ #
2715
+ # # Create a client object. The client can be reused for multiple calls.
2716
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
2717
+ #
2718
+ # # Create a request. To set request fields, pass in keyword arguments.
2719
+ # request = Google::Cloud::Dlp::V2::CreateDiscoveryConfigRequest.new
2720
+ #
2721
+ # # Call the create_discovery_config method.
2722
+ # result = client.create_discovery_config request
2723
+ #
2724
+ # # The returned object is of type Google::Cloud::Dlp::V2::DiscoveryConfig.
2725
+ # p result
2726
+ #
2727
+ def create_discovery_config request, options = nil
2728
+ raise ::ArgumentError, "request must be provided" if request.nil?
2729
+
2730
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::CreateDiscoveryConfigRequest
2731
+
2732
+ # Converts hash and nil to an options object
2733
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2734
+
2735
+ # Customize the options with defaults
2736
+ metadata = @config.rpcs.create_discovery_config.metadata.to_h
2737
+
2738
+ # Set x-goog-api-client and x-goog-user-project headers
2739
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2740
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2741
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION
2742
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2743
+
2744
+ header_params = {}
2745
+ if request.parent
2746
+ header_params["parent"] = request.parent
2747
+ end
2748
+
2749
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2750
+ metadata[:"x-goog-request-params"] ||= request_params_header
2751
+
2752
+ options.apply_defaults timeout: @config.rpcs.create_discovery_config.timeout,
2753
+ metadata: metadata,
2754
+ retry_policy: @config.rpcs.create_discovery_config.retry_policy
2755
+
2756
+ options.apply_defaults timeout: @config.timeout,
2757
+ metadata: @config.metadata,
2758
+ retry_policy: @config.retry_policy
2759
+
2760
+ @dlp_service_stub.call_rpc :create_discovery_config, request, options: options do |response, operation|
2761
+ yield response, operation if block_given?
2762
+ return response
2763
+ end
2764
+ rescue ::GRPC::BadStatus => e
2765
+ raise ::Google::Cloud::Error.from_error(e)
2766
+ end
2767
+
2768
+ ##
2769
+ # Updates a discovery configuration.
2770
+ #
2771
+ # @overload update_discovery_config(request, options = nil)
2772
+ # Pass arguments to `update_discovery_config` via a request object, either of type
2773
+ # {::Google::Cloud::Dlp::V2::UpdateDiscoveryConfigRequest} or an equivalent Hash.
2774
+ #
2775
+ # @param request [::Google::Cloud::Dlp::V2::UpdateDiscoveryConfigRequest, ::Hash]
2776
+ # A request object representing the call parameters. Required. To specify no
2777
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2778
+ # @param options [::Gapic::CallOptions, ::Hash]
2779
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2780
+ #
2781
+ # @overload update_discovery_config(name: nil, discovery_config: nil, update_mask: nil)
2782
+ # Pass arguments to `update_discovery_config` via keyword arguments. Note that at
2783
+ # least one keyword argument is required. To specify no parameters, or to keep all
2784
+ # the default parameter values, pass an empty Hash as a request object (see above).
2785
+ #
2786
+ # @param name [::String]
2787
+ # Required. Resource name of the project and the configuration, for example
2788
+ # `projects/dlp-test-project/discoveryConfigs/53234423`.
2789
+ # @param discovery_config [::Google::Cloud::Dlp::V2::DiscoveryConfig, ::Hash]
2790
+ # Required. New DiscoveryConfig value.
2791
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2792
+ # Mask to control which fields get updated.
2793
+ #
2794
+ # @yield [response, operation] Access the result along with the RPC operation
2795
+ # @yieldparam response [::Google::Cloud::Dlp::V2::DiscoveryConfig]
2796
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2797
+ #
2798
+ # @return [::Google::Cloud::Dlp::V2::DiscoveryConfig]
2799
+ #
2800
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2801
+ #
2802
+ # @example Basic example
2803
+ # require "google/cloud/dlp/v2"
2804
+ #
2805
+ # # Create a client object. The client can be reused for multiple calls.
2806
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
2807
+ #
2808
+ # # Create a request. To set request fields, pass in keyword arguments.
2809
+ # request = Google::Cloud::Dlp::V2::UpdateDiscoveryConfigRequest.new
2810
+ #
2811
+ # # Call the update_discovery_config method.
2812
+ # result = client.update_discovery_config request
2813
+ #
2814
+ # # The returned object is of type Google::Cloud::Dlp::V2::DiscoveryConfig.
2815
+ # p result
2816
+ #
2817
+ def update_discovery_config request, options = nil
2818
+ raise ::ArgumentError, "request must be provided" if request.nil?
2819
+
2820
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::UpdateDiscoveryConfigRequest
2821
+
2822
+ # Converts hash and nil to an options object
2823
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2824
+
2825
+ # Customize the options with defaults
2826
+ metadata = @config.rpcs.update_discovery_config.metadata.to_h
2827
+
2828
+ # Set x-goog-api-client and x-goog-user-project headers
2829
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2830
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2831
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION
2832
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2833
+
2834
+ header_params = {}
2835
+ if request.name
2836
+ header_params["name"] = request.name
2837
+ end
2838
+
2839
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2840
+ metadata[:"x-goog-request-params"] ||= request_params_header
2841
+
2842
+ options.apply_defaults timeout: @config.rpcs.update_discovery_config.timeout,
2843
+ metadata: metadata,
2844
+ retry_policy: @config.rpcs.update_discovery_config.retry_policy
2845
+
2846
+ options.apply_defaults timeout: @config.timeout,
2847
+ metadata: @config.metadata,
2848
+ retry_policy: @config.retry_policy
2849
+
2850
+ @dlp_service_stub.call_rpc :update_discovery_config, request, options: options do |response, operation|
2851
+ yield response, operation if block_given?
2852
+ return response
2853
+ end
2854
+ rescue ::GRPC::BadStatus => e
2855
+ raise ::Google::Cloud::Error.from_error(e)
2856
+ end
2857
+
2858
+ ##
2859
+ # Gets a discovery configuration.
2860
+ #
2861
+ # @overload get_discovery_config(request, options = nil)
2862
+ # Pass arguments to `get_discovery_config` via a request object, either of type
2863
+ # {::Google::Cloud::Dlp::V2::GetDiscoveryConfigRequest} or an equivalent Hash.
2864
+ #
2865
+ # @param request [::Google::Cloud::Dlp::V2::GetDiscoveryConfigRequest, ::Hash]
2866
+ # A request object representing the call parameters. Required. To specify no
2867
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2868
+ # @param options [::Gapic::CallOptions, ::Hash]
2869
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2870
+ #
2871
+ # @overload get_discovery_config(name: nil)
2872
+ # Pass arguments to `get_discovery_config` via keyword arguments. Note that at
2873
+ # least one keyword argument is required. To specify no parameters, or to keep all
2874
+ # the default parameter values, pass an empty Hash as a request object (see above).
2875
+ #
2876
+ # @param name [::String]
2877
+ # Required. Resource name of the project and the configuration, for example
2878
+ # `projects/dlp-test-project/discoveryConfigs/53234423`.
2879
+ #
2880
+ # @yield [response, operation] Access the result along with the RPC operation
2881
+ # @yieldparam response [::Google::Cloud::Dlp::V2::DiscoveryConfig]
2882
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2883
+ #
2884
+ # @return [::Google::Cloud::Dlp::V2::DiscoveryConfig]
2885
+ #
2886
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2887
+ #
2888
+ # @example Basic example
2889
+ # require "google/cloud/dlp/v2"
2890
+ #
2891
+ # # Create a client object. The client can be reused for multiple calls.
2892
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
2893
+ #
2894
+ # # Create a request. To set request fields, pass in keyword arguments.
2895
+ # request = Google::Cloud::Dlp::V2::GetDiscoveryConfigRequest.new
2896
+ #
2897
+ # # Call the get_discovery_config method.
2898
+ # result = client.get_discovery_config request
2899
+ #
2900
+ # # The returned object is of type Google::Cloud::Dlp::V2::DiscoveryConfig.
2901
+ # p result
2902
+ #
2903
+ def get_discovery_config request, options = nil
2904
+ raise ::ArgumentError, "request must be provided" if request.nil?
2905
+
2906
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::GetDiscoveryConfigRequest
2907
+
2908
+ # Converts hash and nil to an options object
2909
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2910
+
2911
+ # Customize the options with defaults
2912
+ metadata = @config.rpcs.get_discovery_config.metadata.to_h
2913
+
2914
+ # Set x-goog-api-client and x-goog-user-project headers
2915
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2916
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2917
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION
2918
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2919
+
2920
+ header_params = {}
2921
+ if request.name
2922
+ header_params["name"] = request.name
2923
+ end
2924
+
2925
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2926
+ metadata[:"x-goog-request-params"] ||= request_params_header
2927
+
2928
+ options.apply_defaults timeout: @config.rpcs.get_discovery_config.timeout,
2929
+ metadata: metadata,
2930
+ retry_policy: @config.rpcs.get_discovery_config.retry_policy
2931
+
2932
+ options.apply_defaults timeout: @config.timeout,
2933
+ metadata: @config.metadata,
2934
+ retry_policy: @config.retry_policy
2935
+
2936
+ @dlp_service_stub.call_rpc :get_discovery_config, request, options: options do |response, operation|
2937
+ yield response, operation if block_given?
2938
+ return response
2939
+ end
2940
+ rescue ::GRPC::BadStatus => e
2941
+ raise ::Google::Cloud::Error.from_error(e)
2942
+ end
2943
+
2944
+ ##
2945
+ # Lists discovery configurations.
2946
+ #
2947
+ # @overload list_discovery_configs(request, options = nil)
2948
+ # Pass arguments to `list_discovery_configs` via a request object, either of type
2949
+ # {::Google::Cloud::Dlp::V2::ListDiscoveryConfigsRequest} or an equivalent Hash.
2950
+ #
2951
+ # @param request [::Google::Cloud::Dlp::V2::ListDiscoveryConfigsRequest, ::Hash]
2952
+ # A request object representing the call parameters. Required. To specify no
2953
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2954
+ # @param options [::Gapic::CallOptions, ::Hash]
2955
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2956
+ #
2957
+ # @overload list_discovery_configs(parent: nil, page_token: nil, page_size: nil, order_by: nil)
2958
+ # Pass arguments to `list_discovery_configs` via keyword arguments. Note that at
2959
+ # least one keyword argument is required. To specify no parameters, or to keep all
2960
+ # the default parameter values, pass an empty Hash as a request object (see above).
2961
+ #
2962
+ # @param parent [::String]
2963
+ # Required. Parent resource name.
2964
+ #
2965
+ # The format of this value is as follows:
2966
+ # `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
2967
+ #
2968
+ # The following example `parent` string specifies a parent project with the
2969
+ # identifier `example-project`, and specifies the `europe-west3` location
2970
+ # for processing data:
2971
+ #
2972
+ # parent=projects/example-project/locations/europe-west3
2973
+ # @param page_token [::String]
2974
+ # Page token to continue retrieval. Comes from the previous call
2975
+ # to ListDiscoveryConfigs. `order_by` field must not
2976
+ # change for subsequent calls.
2977
+ # @param page_size [::Integer]
2978
+ # Size of the page. This value can be limited by a server.
2979
+ # @param order_by [::String]
2980
+ # Comma separated list of config fields to order by,
2981
+ # followed by `asc` or `desc` postfix. This list is case insensitive. The
2982
+ # default sorting order is ascending. Redundant space characters are
2983
+ # insignificant.
2984
+ #
2985
+ # Example: `name asc,update_time, create_time desc`
2986
+ #
2987
+ # Supported fields are:
2988
+ #
2989
+ # - `last_run_time`: corresponds to the last time the DiscoveryConfig ran.
2990
+ # - `name`: corresponds to the DiscoveryConfig's name.
2991
+ # - `status`: corresponds to DiscoveryConfig's status.
2992
+ #
2993
+ # @yield [response, operation] Access the result along with the RPC operation
2994
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dlp::V2::DiscoveryConfig>]
2995
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2996
+ #
2997
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dlp::V2::DiscoveryConfig>]
2998
+ #
2999
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3000
+ #
3001
+ # @example Basic example
3002
+ # require "google/cloud/dlp/v2"
3003
+ #
3004
+ # # Create a client object. The client can be reused for multiple calls.
3005
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
3006
+ #
3007
+ # # Create a request. To set request fields, pass in keyword arguments.
3008
+ # request = Google::Cloud::Dlp::V2::ListDiscoveryConfigsRequest.new
3009
+ #
3010
+ # # Call the list_discovery_configs method.
3011
+ # result = client.list_discovery_configs request
3012
+ #
3013
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
3014
+ # # over elements, and API calls will be issued to fetch pages as needed.
3015
+ # result.each do |item|
3016
+ # # Each element is of type ::Google::Cloud::Dlp::V2::DiscoveryConfig.
3017
+ # p item
3018
+ # end
3019
+ #
3020
+ def list_discovery_configs request, options = nil
3021
+ raise ::ArgumentError, "request must be provided" if request.nil?
3022
+
3023
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::ListDiscoveryConfigsRequest
3024
+
3025
+ # Converts hash and nil to an options object
3026
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3027
+
3028
+ # Customize the options with defaults
3029
+ metadata = @config.rpcs.list_discovery_configs.metadata.to_h
3030
+
3031
+ # Set x-goog-api-client and x-goog-user-project headers
3032
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3033
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3034
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION
3035
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3036
+
3037
+ header_params = {}
3038
+ if request.parent
3039
+ header_params["parent"] = request.parent
3040
+ end
3041
+
3042
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3043
+ metadata[:"x-goog-request-params"] ||= request_params_header
3044
+
3045
+ options.apply_defaults timeout: @config.rpcs.list_discovery_configs.timeout,
3046
+ metadata: metadata,
3047
+ retry_policy: @config.rpcs.list_discovery_configs.retry_policy
3048
+
3049
+ options.apply_defaults timeout: @config.timeout,
3050
+ metadata: @config.metadata,
3051
+ retry_policy: @config.retry_policy
3052
+
3053
+ @dlp_service_stub.call_rpc :list_discovery_configs, request, options: options do |response, operation|
3054
+ response = ::Gapic::PagedEnumerable.new @dlp_service_stub, :list_discovery_configs, request, response, operation, options
3055
+ yield response, operation if block_given?
3056
+ return response
3057
+ end
3058
+ rescue ::GRPC::BadStatus => e
3059
+ raise ::Google::Cloud::Error.from_error(e)
3060
+ end
3061
+
3062
+ ##
3063
+ # Deletes a discovery configuration.
3064
+ #
3065
+ # @overload delete_discovery_config(request, options = nil)
3066
+ # Pass arguments to `delete_discovery_config` via a request object, either of type
3067
+ # {::Google::Cloud::Dlp::V2::DeleteDiscoveryConfigRequest} or an equivalent Hash.
3068
+ #
3069
+ # @param request [::Google::Cloud::Dlp::V2::DeleteDiscoveryConfigRequest, ::Hash]
3070
+ # A request object representing the call parameters. Required. To specify no
3071
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3072
+ # @param options [::Gapic::CallOptions, ::Hash]
3073
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3074
+ #
3075
+ # @overload delete_discovery_config(name: nil)
3076
+ # Pass arguments to `delete_discovery_config` via keyword arguments. Note that at
3077
+ # least one keyword argument is required. To specify no parameters, or to keep all
3078
+ # the default parameter values, pass an empty Hash as a request object (see above).
3079
+ #
3080
+ # @param name [::String]
3081
+ # Required. Resource name of the project and the config, for example
3082
+ # `projects/dlp-test-project/discoveryConfigs/53234423`.
3083
+ #
3084
+ # @yield [response, operation] Access the result along with the RPC operation
3085
+ # @yieldparam response [::Google::Protobuf::Empty]
3086
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3087
+ #
3088
+ # @return [::Google::Protobuf::Empty]
3089
+ #
3090
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3091
+ #
3092
+ # @example Basic example
3093
+ # require "google/cloud/dlp/v2"
3094
+ #
3095
+ # # Create a client object. The client can be reused for multiple calls.
3096
+ # client = Google::Cloud::Dlp::V2::DlpService::Client.new
3097
+ #
3098
+ # # Create a request. To set request fields, pass in keyword arguments.
3099
+ # request = Google::Cloud::Dlp::V2::DeleteDiscoveryConfigRequest.new
3100
+ #
3101
+ # # Call the delete_discovery_config method.
3102
+ # result = client.delete_discovery_config request
3103
+ #
3104
+ # # The returned object is of type Google::Protobuf::Empty.
3105
+ # p result
3106
+ #
3107
+ def delete_discovery_config request, options = nil
3108
+ raise ::ArgumentError, "request must be provided" if request.nil?
3109
+
3110
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dlp::V2::DeleteDiscoveryConfigRequest
3111
+
3112
+ # Converts hash and nil to an options object
3113
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3114
+
3115
+ # Customize the options with defaults
3116
+ metadata = @config.rpcs.delete_discovery_config.metadata.to_h
3117
+
3118
+ # Set x-goog-api-client and x-goog-user-project headers
3119
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3120
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3121
+ gapic_version: ::Google::Cloud::Dlp::V2::VERSION
3122
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3123
+
3124
+ header_params = {}
3125
+ if request.name
3126
+ header_params["name"] = request.name
3127
+ end
3128
+
3129
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3130
+ metadata[:"x-goog-request-params"] ||= request_params_header
3131
+
3132
+ options.apply_defaults timeout: @config.rpcs.delete_discovery_config.timeout,
3133
+ metadata: metadata,
3134
+ retry_policy: @config.rpcs.delete_discovery_config.retry_policy
3135
+
3136
+ options.apply_defaults timeout: @config.timeout,
3137
+ metadata: @config.metadata,
3138
+ retry_policy: @config.retry_policy
3139
+
3140
+ @dlp_service_stub.call_rpc :delete_discovery_config, request, options: options do |response, operation|
3141
+ yield response, operation if block_given?
3142
+ return response
3143
+ end
3144
+ rescue ::GRPC::BadStatus => e
3145
+ raise ::Google::Cloud::Error.from_error(e)
3146
+ end
3147
+
2646
3148
  ##
2647
3149
  # Creates a new job to inspect storage or calculate risk metrics.
2648
3150
  # See https://cloud.google.com/dlp/docs/inspecting-storage and
@@ -2835,8 +3337,8 @@ module Google
2835
3337
  # The type of job. Defaults to `DlpJobType.INSPECT`
2836
3338
  # @param order_by [::String]
2837
3339
  # Comma separated list of fields to order by,
2838
- # followed by `asc` or `desc` postfix. This list is case-insensitive,
2839
- # default sorting order is ascending, redundant space characters are
3340
+ # followed by `asc` or `desc` postfix. This list is case insensitive. The
3341
+ # default sorting order is ascending. Redundant space characters are
2840
3342
  # insignificant.
2841
3343
  #
2842
3344
  # Example: `name asc, end_time asc, create_time desc`
@@ -3321,8 +3823,8 @@ module Google
3321
3823
  # the default parameter values, pass an empty Hash as a request object (see above).
3322
3824
  #
3323
3825
  # @param name [::String]
3324
- # Required. Resource name of organization and storedInfoType to be updated, for
3325
- # example `organizations/433245324/storedInfoTypes/432452342` or
3826
+ # Required. Resource name of organization and storedInfoType to be updated,
3827
+ # for example `organizations/433245324/storedInfoTypes/432452342` or
3326
3828
  # projects/project-id/storedInfoTypes/432452342.
3327
3829
  # @param config [::Google::Cloud::Dlp::V2::StoredInfoTypeConfig, ::Hash]
3328
3830
  # Updated configuration for the storedInfoType. If not provided, a new
@@ -3416,8 +3918,8 @@ module Google
3416
3918
  # the default parameter values, pass an empty Hash as a request object (see above).
3417
3919
  #
3418
3920
  # @param name [::String]
3419
- # Required. Resource name of the organization and storedInfoType to be read, for
3420
- # example `organizations/433245324/storedInfoTypes/432452342` or
3921
+ # Required. Resource name of the organization and storedInfoType to be read,
3922
+ # for example `organizations/433245324/storedInfoTypes/432452342` or
3421
3923
  # projects/project-id/storedInfoTypes/432452342.
3422
3924
  #
3423
3925
  # @yield [response, operation] Access the result along with the RPC operation
@@ -3522,15 +4024,15 @@ module Google
3522
4024
  #
3523
4025
  # parent=projects/example-project/locations/europe-west3
3524
4026
  # @param page_token [::String]
3525
- # Page token to continue retrieval. Comes from previous call
4027
+ # Page token to continue retrieval. Comes from the previous call
3526
4028
  # to `ListStoredInfoTypes`.
3527
4029
  # @param page_size [::Integer]
3528
- # Size of the page, can be limited by the server. If zero server returns
3529
- # a page of max size 100.
4030
+ # Size of the page. This value can be limited by the server. If zero server
4031
+ # returns a page of max size 100.
3530
4032
  # @param order_by [::String]
3531
4033
  # Comma separated list of fields to order by,
3532
- # followed by `asc` or `desc` postfix. This list is case-insensitive,
3533
- # default sorting order is ascending, redundant space characters are
4034
+ # followed by `asc` or `desc` postfix. This list is case insensitive. The
4035
+ # default sorting order is ascending. Redundant space characters are
3534
4036
  # insignificant.
3535
4037
  #
3536
4038
  # Example: `name asc, display_name, create_time desc`
@@ -3635,8 +4137,8 @@ module Google
3635
4137
  # the default parameter values, pass an empty Hash as a request object (see above).
3636
4138
  #
3637
4139
  # @param name [::String]
3638
- # Required. Resource name of the organization and storedInfoType to be deleted, for
3639
- # example `organizations/433245324/storedInfoTypes/432452342` or
4140
+ # Required. Resource name of the organization and storedInfoType to be
4141
+ # deleted, for example `organizations/433245324/storedInfoTypes/432452342` or
3640
4142
  # projects/project-id/storedInfoTypes/432452342.
3641
4143
  #
3642
4144
  # @yield [response, operation] Access the result along with the RPC operation
@@ -3724,8 +4226,8 @@ module Google
3724
4226
  # the default parameter values, pass an empty Hash as a request object (see above).
3725
4227
  #
3726
4228
  # @param name [::String]
3727
- # Required. Resource name of the job to execute a hybrid inspect on, for example
3728
- # `projects/dlp-test-project/dlpJob/53234423`.
4229
+ # Required. Resource name of the job to execute a hybrid inspect on, for
4230
+ # example `projects/dlp-test-project/dlpJob/53234423`.
3729
4231
  # @param hybrid_item [::Google::Cloud::Dlp::V2::HybridContentItem, ::Hash]
3730
4232
  # The item to inspect.
3731
4233
  #
@@ -4135,6 +4637,31 @@ module Google
4135
4637
  #
4136
4638
  attr_reader :activate_job_trigger
4137
4639
  ##
4640
+ # RPC-specific configuration for `create_discovery_config`
4641
+ # @return [::Gapic::Config::Method]
4642
+ #
4643
+ attr_reader :create_discovery_config
4644
+ ##
4645
+ # RPC-specific configuration for `update_discovery_config`
4646
+ # @return [::Gapic::Config::Method]
4647
+ #
4648
+ attr_reader :update_discovery_config
4649
+ ##
4650
+ # RPC-specific configuration for `get_discovery_config`
4651
+ # @return [::Gapic::Config::Method]
4652
+ #
4653
+ attr_reader :get_discovery_config
4654
+ ##
4655
+ # RPC-specific configuration for `list_discovery_configs`
4656
+ # @return [::Gapic::Config::Method]
4657
+ #
4658
+ attr_reader :list_discovery_configs
4659
+ ##
4660
+ # RPC-specific configuration for `delete_discovery_config`
4661
+ # @return [::Gapic::Config::Method]
4662
+ #
4663
+ attr_reader :delete_discovery_config
4664
+ ##
4138
4665
  # RPC-specific configuration for `create_dlp_job`
4139
4666
  # @return [::Gapic::Config::Method]
4140
4667
  #
@@ -4241,6 +4768,16 @@ module Google
4241
4768
  @delete_job_trigger = ::Gapic::Config::Method.new delete_job_trigger_config
4242
4769
  activate_job_trigger_config = parent_rpcs.activate_job_trigger if parent_rpcs.respond_to? :activate_job_trigger
4243
4770
  @activate_job_trigger = ::Gapic::Config::Method.new activate_job_trigger_config
4771
+ create_discovery_config_config = parent_rpcs.create_discovery_config if parent_rpcs.respond_to? :create_discovery_config
4772
+ @create_discovery_config = ::Gapic::Config::Method.new create_discovery_config_config
4773
+ update_discovery_config_config = parent_rpcs.update_discovery_config if parent_rpcs.respond_to? :update_discovery_config
4774
+ @update_discovery_config = ::Gapic::Config::Method.new update_discovery_config_config
4775
+ get_discovery_config_config = parent_rpcs.get_discovery_config if parent_rpcs.respond_to? :get_discovery_config
4776
+ @get_discovery_config = ::Gapic::Config::Method.new get_discovery_config_config
4777
+ list_discovery_configs_config = parent_rpcs.list_discovery_configs if parent_rpcs.respond_to? :list_discovery_configs
4778
+ @list_discovery_configs = ::Gapic::Config::Method.new list_discovery_configs_config
4779
+ delete_discovery_config_config = parent_rpcs.delete_discovery_config if parent_rpcs.respond_to? :delete_discovery_config
4780
+ @delete_discovery_config = ::Gapic::Config::Method.new delete_discovery_config_config
4244
4781
  create_dlp_job_config = parent_rpcs.create_dlp_job if parent_rpcs.respond_to? :create_dlp_job
4245
4782
  @create_dlp_job = ::Gapic::Config::Method.new create_dlp_job_config
4246
4783
  list_dlp_jobs_config = parent_rpcs.list_dlp_jobs if parent_rpcs.respond_to? :list_dlp_jobs