google-cloud-security_center_management-v1 0.a → 0.1.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.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/security_center_management/v1/bindings_override.rb +102 -0
  6. data/lib/google/cloud/security_center_management/v1/rest.rb +38 -0
  7. data/lib/google/cloud/security_center_management/v1/security_center_management/client.rb +2321 -0
  8. data/lib/google/cloud/security_center_management/v1/security_center_management/credentials.rb +47 -0
  9. data/lib/google/cloud/security_center_management/v1/security_center_management/paths.rb +316 -0
  10. data/lib/google/cloud/security_center_management/v1/security_center_management/rest/client.rb +2177 -0
  11. data/lib/google/cloud/security_center_management/v1/security_center_management/rest/service_stub.rb +1401 -0
  12. data/lib/google/cloud/security_center_management/v1/security_center_management/rest.rb +53 -0
  13. data/lib/google/cloud/security_center_management/v1/security_center_management.rb +55 -0
  14. data/lib/google/cloud/security_center_management/v1/version.rb +7 -2
  15. data/lib/google/cloud/security_center_management/v1.rb +45 -0
  16. data/lib/google/cloud/securitycentermanagement/v1/security_center_management_pb.rb +107 -0
  17. data/lib/google/cloud/securitycentermanagement/v1/security_center_management_services_pb.rb +115 -0
  18. data/lib/google-cloud-security_center_management-v1.rb +21 -0
  19. data/proto_docs/README.md +4 -0
  20. data/proto_docs/google/api/client.rb +399 -0
  21. data/proto_docs/google/api/field_behavior.rb +85 -0
  22. data/proto_docs/google/api/launch_stage.rb +71 -0
  23. data/proto_docs/google/api/resource.rb +222 -0
  24. data/proto_docs/google/cloud/securitycentermanagement/v1/security_center_management.rb +1055 -0
  25. data/proto_docs/google/iam/v1/policy.rb +426 -0
  26. data/proto_docs/google/protobuf/any.rb +145 -0
  27. data/proto_docs/google/protobuf/duration.rb +98 -0
  28. data/proto_docs/google/protobuf/empty.rb +34 -0
  29. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  30. data/proto_docs/google/protobuf/struct.rb +96 -0
  31. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  32. data/proto_docs/google/rpc/status.rb +48 -0
  33. data/proto_docs/google/type/expr.rb +75 -0
  34. metadata +112 -11
@@ -0,0 +1,2321 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/securitycentermanagement/v1/security_center_management_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module SecurityCenterManagement
26
+ module V1
27
+ module SecurityCenterManagement
28
+ ##
29
+ # Client for the SecurityCenterManagement service.
30
+ #
31
+ # Service describing handlers for resources
32
+ #
33
+ class Client
34
+ # @private
35
+ DEFAULT_ENDPOINT_TEMPLATE = "securitycentermanagement.$UNIVERSE_DOMAIN$"
36
+
37
+ include Paths
38
+
39
+ # @private
40
+ attr_reader :security_center_management_stub
41
+
42
+ ##
43
+ # Configure the SecurityCenterManagement Client class.
44
+ #
45
+ # See {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client::Configuration}
46
+ # for a description of the configuration fields.
47
+ #
48
+ # @example
49
+ #
50
+ # # Modify the configuration for all SecurityCenterManagement clients
51
+ # ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.configure do |config|
52
+ # config.timeout = 10.0
53
+ # end
54
+ #
55
+ # @yield [config] Configure the Client client.
56
+ # @yieldparam config [Client::Configuration]
57
+ #
58
+ # @return [Client::Configuration]
59
+ #
60
+ def self.configure
61
+ @configure ||= begin
62
+ namespace = ["Google", "Cloud", "SecurityCenterManagement", "V1"]
63
+ parent_config = while namespace.any?
64
+ parent_name = namespace.join "::"
65
+ parent_const = const_get parent_name
66
+ break parent_const.configure if parent_const.respond_to? :configure
67
+ namespace.pop
68
+ end
69
+ default_config = Client::Configuration.new parent_config
70
+
71
+ default_config.rpcs.list_effective_security_health_analytics_custom_modules.timeout = 60.0
72
+ default_config.rpcs.list_effective_security_health_analytics_custom_modules.retry_policy = {
73
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
74
+ }
75
+
76
+ default_config.rpcs.get_effective_security_health_analytics_custom_module.timeout = 60.0
77
+ default_config.rpcs.get_effective_security_health_analytics_custom_module.retry_policy = {
78
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
79
+ }
80
+
81
+ default_config.rpcs.list_security_health_analytics_custom_modules.timeout = 60.0
82
+ default_config.rpcs.list_security_health_analytics_custom_modules.retry_policy = {
83
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
84
+ }
85
+
86
+ default_config.rpcs.list_descendant_security_health_analytics_custom_modules.timeout = 60.0
87
+ default_config.rpcs.list_descendant_security_health_analytics_custom_modules.retry_policy = {
88
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
89
+ }
90
+
91
+ default_config.rpcs.get_security_health_analytics_custom_module.timeout = 60.0
92
+ default_config.rpcs.get_security_health_analytics_custom_module.retry_policy = {
93
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
94
+ }
95
+
96
+ default_config.rpcs.create_security_health_analytics_custom_module.timeout = 60.0
97
+
98
+ default_config.rpcs.update_security_health_analytics_custom_module.timeout = 60.0
99
+
100
+ default_config.rpcs.delete_security_health_analytics_custom_module.timeout = 60.0
101
+
102
+ default_config.rpcs.simulate_security_health_analytics_custom_module.timeout = 60.0
103
+ default_config.rpcs.simulate_security_health_analytics_custom_module.retry_policy = {
104
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
105
+ }
106
+
107
+ default_config.rpcs.list_effective_event_threat_detection_custom_modules.timeout = 60.0
108
+ default_config.rpcs.list_effective_event_threat_detection_custom_modules.retry_policy = {
109
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
110
+ }
111
+
112
+ default_config.rpcs.get_effective_event_threat_detection_custom_module.timeout = 60.0
113
+ default_config.rpcs.get_effective_event_threat_detection_custom_module.retry_policy = {
114
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
115
+ }
116
+
117
+ default_config.rpcs.list_event_threat_detection_custom_modules.timeout = 60.0
118
+ default_config.rpcs.list_event_threat_detection_custom_modules.retry_policy = {
119
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
120
+ }
121
+
122
+ default_config.rpcs.list_descendant_event_threat_detection_custom_modules.timeout = 60.0
123
+ default_config.rpcs.list_descendant_event_threat_detection_custom_modules.retry_policy = {
124
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
125
+ }
126
+
127
+ default_config.rpcs.get_event_threat_detection_custom_module.timeout = 60.0
128
+ default_config.rpcs.get_event_threat_detection_custom_module.retry_policy = {
129
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
130
+ }
131
+
132
+ default_config.rpcs.create_event_threat_detection_custom_module.timeout = 60.0
133
+
134
+ default_config.rpcs.update_event_threat_detection_custom_module.timeout = 60.0
135
+
136
+ default_config.rpcs.delete_event_threat_detection_custom_module.timeout = 60.0
137
+
138
+ default_config.rpcs.validate_event_threat_detection_custom_module.timeout = 60.0
139
+ default_config.rpcs.validate_event_threat_detection_custom_module.retry_policy = {
140
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
141
+ }
142
+
143
+ default_config
144
+ end
145
+ yield @configure if block_given?
146
+ @configure
147
+ end
148
+
149
+ ##
150
+ # Configure the SecurityCenterManagement Client instance.
151
+ #
152
+ # The configuration is set to the derived mode, meaning that values can be changed,
153
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
154
+ # should be made on {Client.configure}.
155
+ #
156
+ # See {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client::Configuration}
157
+ # for a description of the configuration fields.
158
+ #
159
+ # @yield [config] Configure the Client client.
160
+ # @yieldparam config [Client::Configuration]
161
+ #
162
+ # @return [Client::Configuration]
163
+ #
164
+ def configure
165
+ yield @config if block_given?
166
+ @config
167
+ end
168
+
169
+ ##
170
+ # The effective universe domain
171
+ #
172
+ # @return [String]
173
+ #
174
+ def universe_domain
175
+ @security_center_management_stub.universe_domain
176
+ end
177
+
178
+ ##
179
+ # Create a new SecurityCenterManagement client object.
180
+ #
181
+ # @example
182
+ #
183
+ # # Create a client using the default configuration
184
+ # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new
185
+ #
186
+ # # Create a client using a custom configuration
187
+ # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config|
188
+ # config.timeout = 10.0
189
+ # end
190
+ #
191
+ # @yield [config] Configure the SecurityCenterManagement client.
192
+ # @yieldparam config [Client::Configuration]
193
+ #
194
+ def initialize
195
+ # These require statements are intentionally placed here to initialize
196
+ # the gRPC module only when it's required.
197
+ # See https://github.com/googleapis/toolkit/issues/446
198
+ require "gapic/grpc"
199
+ require "google/cloud/securitycentermanagement/v1/security_center_management_services_pb"
200
+
201
+ # Create the configuration object
202
+ @config = Configuration.new Client.configure
203
+
204
+ # Yield the configuration if needed
205
+ yield @config if block_given?
206
+
207
+ # Create credentials
208
+ credentials = @config.credentials
209
+ # Use self-signed JWT if the endpoint is unchanged from default,
210
+ # but only if the default endpoint does not have a region prefix.
211
+ enable_self_signed_jwt = @config.endpoint.nil? ||
212
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
213
+ !@config.endpoint.split(".").first.include?("-"))
214
+ credentials ||= Credentials.default scope: @config.scope,
215
+ enable_self_signed_jwt: enable_self_signed_jwt
216
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
217
+ credentials = Credentials.new credentials, scope: @config.scope
218
+ end
219
+ @quota_project_id = @config.quota_project
220
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
221
+
222
+ @security_center_management_stub = ::Gapic::ServiceStub.new(
223
+ ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Stub,
224
+ credentials: credentials,
225
+ endpoint: @config.endpoint,
226
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
227
+ universe_domain: @config.universe_domain,
228
+ channel_args: @config.channel_args,
229
+ interceptors: @config.interceptors,
230
+ channel_pool_config: @config.channel_pool
231
+ )
232
+
233
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
234
+ config.credentials = credentials
235
+ config.quota_project = @quota_project_id
236
+ config.endpoint = @security_center_management_stub.endpoint
237
+ config.universe_domain = @security_center_management_stub.universe_domain
238
+ end
239
+ end
240
+
241
+ ##
242
+ # Get the associated client for mix-in of the Locations.
243
+ #
244
+ # @return [Google::Cloud::Location::Locations::Client]
245
+ #
246
+ attr_reader :location_client
247
+
248
+ # Service calls
249
+
250
+ ##
251
+ # Returns a list of all EffectiveSecurityHealthAnalyticsCustomModules for the
252
+ # given parent. This includes resident modules defined at the scope of the
253
+ # parent, and inherited modules, inherited from CRM ancestors (no
254
+ # descendants).
255
+ #
256
+ # @overload list_effective_security_health_analytics_custom_modules(request, options = nil)
257
+ # Pass arguments to `list_effective_security_health_analytics_custom_modules` via a request object, either of type
258
+ # {::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest} or an equivalent Hash.
259
+ #
260
+ # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest, ::Hash]
261
+ # A request object representing the call parameters. Required. To specify no
262
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
263
+ # @param options [::Gapic::CallOptions, ::Hash]
264
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
265
+ #
266
+ # @overload list_effective_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil)
267
+ # Pass arguments to `list_effective_security_health_analytics_custom_modules` via keyword arguments. Note that at
268
+ # least one keyword argument is required. To specify no parameters, or to keep all
269
+ # the default parameter values, pass an empty Hash as a request object (see above).
270
+ #
271
+ # @param parent [::String]
272
+ # Required. Name of parent to list effective custom modules. Its format is
273
+ # "organizations/\\{organization}/locations/\\{location}",
274
+ # "folders/\\{folder}/locations/\\{location}",
275
+ # or
276
+ # "projects/\\{project}/locations/\\{location}"
277
+ # @param page_size [::Integer]
278
+ # Optional. The maximum number of results to return in a single response.
279
+ # Default is 10, minimum is 1, maximum is 1000.
280
+ # @param page_token [::String]
281
+ # Optional. The value returned by the last call indicating a continuation.
282
+ #
283
+ # @yield [response, operation] Access the result along with the RPC operation
284
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule>]
285
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
286
+ #
287
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule>]
288
+ #
289
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
290
+ #
291
+ # @example Basic example
292
+ # require "google/cloud/security_center_management/v1"
293
+ #
294
+ # # Create a client object. The client can be reused for multiple calls.
295
+ # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new
296
+ #
297
+ # # Create a request. To set request fields, pass in keyword arguments.
298
+ # request = Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.new
299
+ #
300
+ # # Call the list_effective_security_health_analytics_custom_modules method.
301
+ # result = client.list_effective_security_health_analytics_custom_modules request
302
+ #
303
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
304
+ # # over elements, and API calls will be issued to fetch pages as needed.
305
+ # result.each do |item|
306
+ # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule.
307
+ # p item
308
+ # end
309
+ #
310
+ def list_effective_security_health_analytics_custom_modules request, options = nil
311
+ raise ::ArgumentError, "request must be provided" if request.nil?
312
+
313
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveSecurityHealthAnalyticsCustomModulesRequest
314
+
315
+ # Converts hash and nil to an options object
316
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
317
+
318
+ # Customize the options with defaults
319
+ metadata = @config.rpcs.list_effective_security_health_analytics_custom_modules.metadata.to_h
320
+
321
+ # Set x-goog-api-client and x-goog-user-project headers
322
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
323
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
324
+ gapic_version: ::Google::Cloud::SecurityCenterManagement::V1::VERSION
325
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
326
+
327
+ header_params = {}
328
+ if request.parent
329
+ header_params["parent"] = request.parent
330
+ end
331
+
332
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
333
+ metadata[:"x-goog-request-params"] ||= request_params_header
334
+
335
+ options.apply_defaults timeout: @config.rpcs.list_effective_security_health_analytics_custom_modules.timeout,
336
+ metadata: metadata,
337
+ retry_policy: @config.rpcs.list_effective_security_health_analytics_custom_modules.retry_policy
338
+
339
+ options.apply_defaults timeout: @config.timeout,
340
+ metadata: @config.metadata,
341
+ retry_policy: @config.retry_policy
342
+
343
+ @security_center_management_stub.call_rpc :list_effective_security_health_analytics_custom_modules, request, options: options do |response, operation|
344
+ response = ::Gapic::PagedEnumerable.new @security_center_management_stub, :list_effective_security_health_analytics_custom_modules, request, response, operation, options
345
+ yield response, operation if block_given?
346
+ return response
347
+ end
348
+ rescue ::GRPC::BadStatus => e
349
+ raise ::Google::Cloud::Error.from_error(e)
350
+ end
351
+
352
+ ##
353
+ # Gets details of a single EffectiveSecurityHealthAnalyticsCustomModule.
354
+ #
355
+ # @overload get_effective_security_health_analytics_custom_module(request, options = nil)
356
+ # Pass arguments to `get_effective_security_health_analytics_custom_module` via a request object, either of type
357
+ # {::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash.
358
+ #
359
+ # @param request [::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest, ::Hash]
360
+ # A request object representing the call parameters. Required. To specify no
361
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
362
+ # @param options [::Gapic::CallOptions, ::Hash]
363
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
364
+ #
365
+ # @overload get_effective_security_health_analytics_custom_module(name: nil)
366
+ # Pass arguments to `get_effective_security_health_analytics_custom_module` via keyword arguments. Note that at
367
+ # least one keyword argument is required. To specify no parameters, or to keep all
368
+ # the default parameter values, pass an empty Hash as a request object (see above).
369
+ #
370
+ # @param name [::String]
371
+ # Required. The resource name of the SHA custom module.
372
+ #
373
+ # Its format is:
374
+ #
375
+ # * "organizations/\\{organization}/locations/\\{location}/effectiveSecurityHealthAnalyticsCustomModules/\\{module_id}".
376
+ # * "folders/\\{folder}/locations/\\{location}/effectiveSecurityHealthAnalyticsCustomModules/\\{module_id}".
377
+ # * "projects/\\{project}/locations/\\{location}/effectiveSecurityHealthAnalyticsCustomModules/\\{module_id}".
378
+ #
379
+ # @yield [response, operation] Access the result along with the RPC operation
380
+ # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule]
381
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
382
+ #
383
+ # @return [::Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule]
384
+ #
385
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
386
+ #
387
+ # @example Basic example
388
+ # require "google/cloud/security_center_management/v1"
389
+ #
390
+ # # Create a client object. The client can be reused for multiple calls.
391
+ # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new
392
+ #
393
+ # # Create a request. To set request fields, pass in keyword arguments.
394
+ # request = Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.new
395
+ #
396
+ # # Call the get_effective_security_health_analytics_custom_module method.
397
+ # result = client.get_effective_security_health_analytics_custom_module request
398
+ #
399
+ # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EffectiveSecurityHealthAnalyticsCustomModule.
400
+ # p result
401
+ #
402
+ def get_effective_security_health_analytics_custom_module request, options = nil
403
+ raise ::ArgumentError, "request must be provided" if request.nil?
404
+
405
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveSecurityHealthAnalyticsCustomModuleRequest
406
+
407
+ # Converts hash and nil to an options object
408
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
409
+
410
+ # Customize the options with defaults
411
+ metadata = @config.rpcs.get_effective_security_health_analytics_custom_module.metadata.to_h
412
+
413
+ # Set x-goog-api-client and x-goog-user-project headers
414
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
415
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
416
+ gapic_version: ::Google::Cloud::SecurityCenterManagement::V1::VERSION
417
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
418
+
419
+ header_params = {}
420
+ if request.name
421
+ header_params["name"] = request.name
422
+ end
423
+
424
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
425
+ metadata[:"x-goog-request-params"] ||= request_params_header
426
+
427
+ options.apply_defaults timeout: @config.rpcs.get_effective_security_health_analytics_custom_module.timeout,
428
+ metadata: metadata,
429
+ retry_policy: @config.rpcs.get_effective_security_health_analytics_custom_module.retry_policy
430
+
431
+ options.apply_defaults timeout: @config.timeout,
432
+ metadata: @config.metadata,
433
+ retry_policy: @config.retry_policy
434
+
435
+ @security_center_management_stub.call_rpc :get_effective_security_health_analytics_custom_module, request, options: options do |response, operation|
436
+ yield response, operation if block_given?
437
+ return response
438
+ end
439
+ rescue ::GRPC::BadStatus => e
440
+ raise ::Google::Cloud::Error.from_error(e)
441
+ end
442
+
443
+ ##
444
+ # Returns a list of all SecurityHealthAnalyticsCustomModules for the given
445
+ # parent. This includes resident modules defined at the scope of the parent,
446
+ # and inherited modules, inherited from CRM ancestors (no descendants).
447
+ #
448
+ # @overload list_security_health_analytics_custom_modules(request, options = nil)
449
+ # Pass arguments to `list_security_health_analytics_custom_modules` via a request object, either of type
450
+ # {::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest} or an equivalent Hash.
451
+ #
452
+ # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest, ::Hash]
453
+ # A request object representing the call parameters. Required. To specify no
454
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
455
+ # @param options [::Gapic::CallOptions, ::Hash]
456
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
457
+ #
458
+ # @overload list_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil)
459
+ # Pass arguments to `list_security_health_analytics_custom_modules` via keyword arguments. Note that at
460
+ # least one keyword argument is required. To specify no parameters, or to keep all
461
+ # the default parameter values, pass an empty Hash as a request object (see above).
462
+ #
463
+ # @param parent [::String]
464
+ # Required. Name of parent to list custom modules. Its format is
465
+ # "organizations/\\{organization}/locations/\\{location}",
466
+ # "folders/\\{folder}/locations/\\{location}",
467
+ # or
468
+ # "projects/\\{project}/locations/\\{location}"
469
+ # @param page_size [::Integer]
470
+ # Optional. The maximum number of results to return in a single response.
471
+ # Default is 10, minimum is 1, maximum is 1000.
472
+ # @param page_token [::String]
473
+ # Optional. A token identifying a page of results the server should return.
474
+ #
475
+ # @yield [response, operation] Access the result along with the RPC operation
476
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule>]
477
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
478
+ #
479
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule>]
480
+ #
481
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
482
+ #
483
+ # @example Basic example
484
+ # require "google/cloud/security_center_management/v1"
485
+ #
486
+ # # Create a client object. The client can be reused for multiple calls.
487
+ # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new
488
+ #
489
+ # # Create a request. To set request fields, pass in keyword arguments.
490
+ # request = Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest.new
491
+ #
492
+ # # Call the list_security_health_analytics_custom_modules method.
493
+ # result = client.list_security_health_analytics_custom_modules request
494
+ #
495
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
496
+ # # over elements, and API calls will be issued to fetch pages as needed.
497
+ # result.each do |item|
498
+ # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule.
499
+ # p item
500
+ # end
501
+ #
502
+ def list_security_health_analytics_custom_modules request, options = nil
503
+ raise ::ArgumentError, "request must be provided" if request.nil?
504
+
505
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListSecurityHealthAnalyticsCustomModulesRequest
506
+
507
+ # Converts hash and nil to an options object
508
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
509
+
510
+ # Customize the options with defaults
511
+ metadata = @config.rpcs.list_security_health_analytics_custom_modules.metadata.to_h
512
+
513
+ # Set x-goog-api-client and x-goog-user-project headers
514
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
515
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
516
+ gapic_version: ::Google::Cloud::SecurityCenterManagement::V1::VERSION
517
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
518
+
519
+ header_params = {}
520
+ if request.parent
521
+ header_params["parent"] = request.parent
522
+ end
523
+
524
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
525
+ metadata[:"x-goog-request-params"] ||= request_params_header
526
+
527
+ options.apply_defaults timeout: @config.rpcs.list_security_health_analytics_custom_modules.timeout,
528
+ metadata: metadata,
529
+ retry_policy: @config.rpcs.list_security_health_analytics_custom_modules.retry_policy
530
+
531
+ options.apply_defaults timeout: @config.timeout,
532
+ metadata: @config.metadata,
533
+ retry_policy: @config.retry_policy
534
+
535
+ @security_center_management_stub.call_rpc :list_security_health_analytics_custom_modules, request, options: options do |response, operation|
536
+ response = ::Gapic::PagedEnumerable.new @security_center_management_stub, :list_security_health_analytics_custom_modules, request, response, operation, options
537
+ yield response, operation if block_given?
538
+ return response
539
+ end
540
+ rescue ::GRPC::BadStatus => e
541
+ raise ::Google::Cloud::Error.from_error(e)
542
+ end
543
+
544
+ ##
545
+ # Returns a list of all resident SecurityHealthAnalyticsCustomModules under
546
+ # the given CRM parent and all of the parent's CRM descendants.
547
+ #
548
+ # @overload list_descendant_security_health_analytics_custom_modules(request, options = nil)
549
+ # Pass arguments to `list_descendant_security_health_analytics_custom_modules` via a request object, either of type
550
+ # {::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest} or an equivalent Hash.
551
+ #
552
+ # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest, ::Hash]
553
+ # A request object representing the call parameters. Required. To specify no
554
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
555
+ # @param options [::Gapic::CallOptions, ::Hash]
556
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
557
+ #
558
+ # @overload list_descendant_security_health_analytics_custom_modules(parent: nil, page_size: nil, page_token: nil)
559
+ # Pass arguments to `list_descendant_security_health_analytics_custom_modules` via keyword arguments. Note that at
560
+ # least one keyword argument is required. To specify no parameters, or to keep all
561
+ # the default parameter values, pass an empty Hash as a request object (see above).
562
+ #
563
+ # @param parent [::String]
564
+ # Required. Name of parent to list custom modules. Its format is
565
+ # "organizations/\\{organization}/locations/\\{location}",
566
+ # "folders/\\{folder}/locations/\\{location}",
567
+ # or
568
+ # "projects/\\{project}/locations/\\{location}"
569
+ # @param page_size [::Integer]
570
+ # Optional. The maximum number of results to return in a single response.
571
+ # Default is 10, minimum is 1, maximum is 1000.
572
+ # @param page_token [::String]
573
+ # Optional. A token identifying a page of results the server should return.
574
+ #
575
+ # @yield [response, operation] Access the result along with the RPC operation
576
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule>]
577
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
578
+ #
579
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule>]
580
+ #
581
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
582
+ #
583
+ # @example Basic example
584
+ # require "google/cloud/security_center_management/v1"
585
+ #
586
+ # # Create a client object. The client can be reused for multiple calls.
587
+ # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new
588
+ #
589
+ # # Create a request. To set request fields, pass in keyword arguments.
590
+ # request = Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest.new
591
+ #
592
+ # # Call the list_descendant_security_health_analytics_custom_modules method.
593
+ # result = client.list_descendant_security_health_analytics_custom_modules request
594
+ #
595
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
596
+ # # over elements, and API calls will be issued to fetch pages as needed.
597
+ # result.each do |item|
598
+ # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule.
599
+ # p item
600
+ # end
601
+ #
602
+ def list_descendant_security_health_analytics_custom_modules request, options = nil
603
+ raise ::ArgumentError, "request must be provided" if request.nil?
604
+
605
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantSecurityHealthAnalyticsCustomModulesRequest
606
+
607
+ # Converts hash and nil to an options object
608
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
609
+
610
+ # Customize the options with defaults
611
+ metadata = @config.rpcs.list_descendant_security_health_analytics_custom_modules.metadata.to_h
612
+
613
+ # Set x-goog-api-client and x-goog-user-project headers
614
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
615
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
616
+ gapic_version: ::Google::Cloud::SecurityCenterManagement::V1::VERSION
617
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
618
+
619
+ header_params = {}
620
+ if request.parent
621
+ header_params["parent"] = request.parent
622
+ end
623
+
624
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
625
+ metadata[:"x-goog-request-params"] ||= request_params_header
626
+
627
+ options.apply_defaults timeout: @config.rpcs.list_descendant_security_health_analytics_custom_modules.timeout,
628
+ metadata: metadata,
629
+ retry_policy: @config.rpcs.list_descendant_security_health_analytics_custom_modules.retry_policy
630
+
631
+ options.apply_defaults timeout: @config.timeout,
632
+ metadata: @config.metadata,
633
+ retry_policy: @config.retry_policy
634
+
635
+ @security_center_management_stub.call_rpc :list_descendant_security_health_analytics_custom_modules, request, options: options do |response, operation|
636
+ response = ::Gapic::PagedEnumerable.new @security_center_management_stub, :list_descendant_security_health_analytics_custom_modules, request, response, operation, options
637
+ yield response, operation if block_given?
638
+ return response
639
+ end
640
+ rescue ::GRPC::BadStatus => e
641
+ raise ::Google::Cloud::Error.from_error(e)
642
+ end
643
+
644
+ ##
645
+ # Retrieves a SecurityHealthAnalyticsCustomModule.
646
+ #
647
+ # @overload get_security_health_analytics_custom_module(request, options = nil)
648
+ # Pass arguments to `get_security_health_analytics_custom_module` via a request object, either of type
649
+ # {::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash.
650
+ #
651
+ # @param request [::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest, ::Hash]
652
+ # A request object representing the call parameters. Required. To specify no
653
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
654
+ # @param options [::Gapic::CallOptions, ::Hash]
655
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
656
+ #
657
+ # @overload get_security_health_analytics_custom_module(name: nil)
658
+ # Pass arguments to `get_security_health_analytics_custom_module` via keyword arguments. Note that at
659
+ # least one keyword argument is required. To specify no parameters, or to keep all
660
+ # the default parameter values, pass an empty Hash as a request object (see above).
661
+ #
662
+ # @param name [::String]
663
+ # Required. Name of the resource
664
+ #
665
+ # @yield [response, operation] Access the result along with the RPC operation
666
+ # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule]
667
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
668
+ #
669
+ # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule]
670
+ #
671
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
672
+ #
673
+ # @example Basic example
674
+ # require "google/cloud/security_center_management/v1"
675
+ #
676
+ # # Create a client object. The client can be reused for multiple calls.
677
+ # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new
678
+ #
679
+ # # Create a request. To set request fields, pass in keyword arguments.
680
+ # request = Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest.new
681
+ #
682
+ # # Call the get_security_health_analytics_custom_module method.
683
+ # result = client.get_security_health_analytics_custom_module request
684
+ #
685
+ # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule.
686
+ # p result
687
+ #
688
+ def get_security_health_analytics_custom_module request, options = nil
689
+ raise ::ArgumentError, "request must be provided" if request.nil?
690
+
691
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::GetSecurityHealthAnalyticsCustomModuleRequest
692
+
693
+ # Converts hash and nil to an options object
694
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
695
+
696
+ # Customize the options with defaults
697
+ metadata = @config.rpcs.get_security_health_analytics_custom_module.metadata.to_h
698
+
699
+ # Set x-goog-api-client and x-goog-user-project headers
700
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
701
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
702
+ gapic_version: ::Google::Cloud::SecurityCenterManagement::V1::VERSION
703
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
704
+
705
+ header_params = {}
706
+ if request.name
707
+ header_params["name"] = request.name
708
+ end
709
+
710
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
711
+ metadata[:"x-goog-request-params"] ||= request_params_header
712
+
713
+ options.apply_defaults timeout: @config.rpcs.get_security_health_analytics_custom_module.timeout,
714
+ metadata: metadata,
715
+ retry_policy: @config.rpcs.get_security_health_analytics_custom_module.retry_policy
716
+
717
+ options.apply_defaults timeout: @config.timeout,
718
+ metadata: @config.metadata,
719
+ retry_policy: @config.retry_policy
720
+
721
+ @security_center_management_stub.call_rpc :get_security_health_analytics_custom_module, request, options: options do |response, operation|
722
+ yield response, operation if block_given?
723
+ return response
724
+ end
725
+ rescue ::GRPC::BadStatus => e
726
+ raise ::Google::Cloud::Error.from_error(e)
727
+ end
728
+
729
+ ##
730
+ # Creates a resident SecurityHealthAnalyticsCustomModule at the scope of the
731
+ # given CRM parent, and also creates inherited
732
+ # SecurityHealthAnalyticsCustomModules for all CRM descendants of the given
733
+ # parent. These modules are enabled by default.
734
+ #
735
+ # @overload create_security_health_analytics_custom_module(request, options = nil)
736
+ # Pass arguments to `create_security_health_analytics_custom_module` via a request object, either of type
737
+ # {::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash.
738
+ #
739
+ # @param request [::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest, ::Hash]
740
+ # A request object representing the call parameters. Required. To specify no
741
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
742
+ # @param options [::Gapic::CallOptions, ::Hash]
743
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
744
+ #
745
+ # @overload create_security_health_analytics_custom_module(parent: nil, security_health_analytics_custom_module: nil, validate_only: nil)
746
+ # Pass arguments to `create_security_health_analytics_custom_module` via keyword arguments. Note that at
747
+ # least one keyword argument is required. To specify no parameters, or to keep all
748
+ # the default parameter values, pass an empty Hash as a request object (see above).
749
+ #
750
+ # @param parent [::String]
751
+ # Required. Name of the parent for the module. Its format is
752
+ # "organizations/\\{organization}/locations/\\{location}",
753
+ # "folders/\\{folder}/locations/\\{location}",
754
+ # or
755
+ # "projects/\\{project}/locations/\\{location}"
756
+ # @param security_health_analytics_custom_module [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule, ::Hash]
757
+ # Required. The resource being created
758
+ # @param validate_only [::Boolean]
759
+ # Optional. When set to true, only validations (including IAM checks) will
760
+ # done for the request (no module will be created). An OK response indicates
761
+ # the request is valid while an error response indicates the request is
762
+ # invalid. Note that a subsequent request to actually create the module could
763
+ # still fail because:
764
+ # 1. the state could have changed (e.g. IAM permission lost) or
765
+ # 2. A failure occurred during creation of the module.
766
+ # Defaults to false.
767
+ #
768
+ # @yield [response, operation] Access the result along with the RPC operation
769
+ # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule]
770
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
771
+ #
772
+ # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule]
773
+ #
774
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
775
+ #
776
+ # @example Basic example
777
+ # require "google/cloud/security_center_management/v1"
778
+ #
779
+ # # Create a client object. The client can be reused for multiple calls.
780
+ # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new
781
+ #
782
+ # # Create a request. To set request fields, pass in keyword arguments.
783
+ # request = Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest.new
784
+ #
785
+ # # Call the create_security_health_analytics_custom_module method.
786
+ # result = client.create_security_health_analytics_custom_module request
787
+ #
788
+ # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule.
789
+ # p result
790
+ #
791
+ def create_security_health_analytics_custom_module request, options = nil
792
+ raise ::ArgumentError, "request must be provided" if request.nil?
793
+
794
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::CreateSecurityHealthAnalyticsCustomModuleRequest
795
+
796
+ # Converts hash and nil to an options object
797
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
798
+
799
+ # Customize the options with defaults
800
+ metadata = @config.rpcs.create_security_health_analytics_custom_module.metadata.to_h
801
+
802
+ # Set x-goog-api-client and x-goog-user-project headers
803
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
804
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
805
+ gapic_version: ::Google::Cloud::SecurityCenterManagement::V1::VERSION
806
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
807
+
808
+ header_params = {}
809
+ if request.parent
810
+ header_params["parent"] = request.parent
811
+ end
812
+
813
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
814
+ metadata[:"x-goog-request-params"] ||= request_params_header
815
+
816
+ options.apply_defaults timeout: @config.rpcs.create_security_health_analytics_custom_module.timeout,
817
+ metadata: metadata,
818
+ retry_policy: @config.rpcs.create_security_health_analytics_custom_module.retry_policy
819
+
820
+ options.apply_defaults timeout: @config.timeout,
821
+ metadata: @config.metadata,
822
+ retry_policy: @config.retry_policy
823
+
824
+ @security_center_management_stub.call_rpc :create_security_health_analytics_custom_module, request, options: options do |response, operation|
825
+ yield response, operation if block_given?
826
+ return response
827
+ end
828
+ rescue ::GRPC::BadStatus => e
829
+ raise ::Google::Cloud::Error.from_error(e)
830
+ end
831
+
832
+ ##
833
+ # Updates the SecurityHealthAnalyticsCustomModule under the given name based
834
+ # on the given update mask. Updating the enablement state is supported on
835
+ # both resident and inherited modules (though resident modules cannot have an
836
+ # enablement state of "inherited"). Updating the display name and custom
837
+ # config of a module is supported on resident modules only.
838
+ #
839
+ # @overload update_security_health_analytics_custom_module(request, options = nil)
840
+ # Pass arguments to `update_security_health_analytics_custom_module` via a request object, either of type
841
+ # {::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash.
842
+ #
843
+ # @param request [::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest, ::Hash]
844
+ # A request object representing the call parameters. Required. To specify no
845
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
846
+ # @param options [::Gapic::CallOptions, ::Hash]
847
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
848
+ #
849
+ # @overload update_security_health_analytics_custom_module(update_mask: nil, security_health_analytics_custom_module: nil, validate_only: nil)
850
+ # Pass arguments to `update_security_health_analytics_custom_module` via keyword arguments. Note that at
851
+ # least one keyword argument is required. To specify no parameters, or to keep all
852
+ # the default parameter values, pass an empty Hash as a request object (see above).
853
+ #
854
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
855
+ # Required. The list of fields to be updated. The only fields that can be
856
+ # updated are `enablement_state` and `custom_config`. If empty or set to the
857
+ # wildcard value `*`, both `enablement_state` and `custom_config` are
858
+ # updated.
859
+ # @param security_health_analytics_custom_module [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule, ::Hash]
860
+ # Required. The resource being updated
861
+ # @param validate_only [::Boolean]
862
+ # Optional. When set to true, only validations (including IAM checks) will
863
+ # done for the request (module will not be updated). An OK response indicates
864
+ # the request is valid while an error response indicates the request is
865
+ # invalid. Note that a subsequent request to actually update the module could
866
+ # still fail because 1. the state could have changed (e.g. IAM permission
867
+ # lost) or
868
+ # 2. A failure occurred while trying to update the module.
869
+ #
870
+ # @yield [response, operation] Access the result along with the RPC operation
871
+ # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule]
872
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
873
+ #
874
+ # @return [::Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule]
875
+ #
876
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
877
+ #
878
+ # @example Basic example
879
+ # require "google/cloud/security_center_management/v1"
880
+ #
881
+ # # Create a client object. The client can be reused for multiple calls.
882
+ # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new
883
+ #
884
+ # # Create a request. To set request fields, pass in keyword arguments.
885
+ # request = Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest.new
886
+ #
887
+ # # Call the update_security_health_analytics_custom_module method.
888
+ # result = client.update_security_health_analytics_custom_module request
889
+ #
890
+ # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SecurityHealthAnalyticsCustomModule.
891
+ # p result
892
+ #
893
+ def update_security_health_analytics_custom_module request, options = nil
894
+ raise ::ArgumentError, "request must be provided" if request.nil?
895
+
896
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::UpdateSecurityHealthAnalyticsCustomModuleRequest
897
+
898
+ # Converts hash and nil to an options object
899
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
900
+
901
+ # Customize the options with defaults
902
+ metadata = @config.rpcs.update_security_health_analytics_custom_module.metadata.to_h
903
+
904
+ # Set x-goog-api-client and x-goog-user-project headers
905
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
906
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
907
+ gapic_version: ::Google::Cloud::SecurityCenterManagement::V1::VERSION
908
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
909
+
910
+ header_params = {}
911
+ if request.security_health_analytics_custom_module&.name
912
+ header_params["security_health_analytics_custom_module.name"] = request.security_health_analytics_custom_module.name
913
+ end
914
+
915
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
916
+ metadata[:"x-goog-request-params"] ||= request_params_header
917
+
918
+ options.apply_defaults timeout: @config.rpcs.update_security_health_analytics_custom_module.timeout,
919
+ metadata: metadata,
920
+ retry_policy: @config.rpcs.update_security_health_analytics_custom_module.retry_policy
921
+
922
+ options.apply_defaults timeout: @config.timeout,
923
+ metadata: @config.metadata,
924
+ retry_policy: @config.retry_policy
925
+
926
+ @security_center_management_stub.call_rpc :update_security_health_analytics_custom_module, request, options: options do |response, operation|
927
+ yield response, operation if block_given?
928
+ return response
929
+ end
930
+ rescue ::GRPC::BadStatus => e
931
+ raise ::Google::Cloud::Error.from_error(e)
932
+ end
933
+
934
+ ##
935
+ # Deletes the specified SecurityHealthAnalyticsCustomModule and all of its
936
+ # descendants in the CRM hierarchy. This method is only supported for
937
+ # resident custom modules.
938
+ #
939
+ # @overload delete_security_health_analytics_custom_module(request, options = nil)
940
+ # Pass arguments to `delete_security_health_analytics_custom_module` via a request object, either of type
941
+ # {::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash.
942
+ #
943
+ # @param request [::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest, ::Hash]
944
+ # A request object representing the call parameters. Required. To specify no
945
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
946
+ # @param options [::Gapic::CallOptions, ::Hash]
947
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
948
+ #
949
+ # @overload delete_security_health_analytics_custom_module(name: nil, validate_only: nil)
950
+ # Pass arguments to `delete_security_health_analytics_custom_module` via keyword arguments. Note that at
951
+ # least one keyword argument is required. To specify no parameters, or to keep all
952
+ # the default parameter values, pass an empty Hash as a request object (see above).
953
+ #
954
+ # @param name [::String]
955
+ # Required. The resource name of the SHA custom module.
956
+ #
957
+ # Its format is:
958
+ #
959
+ # * "organizations/\\{organization}/locations/\\{location}/securityHealthAnalyticsCustomModules/\\{security_health_analytics_custom_module}".
960
+ # * "folders/\\{folder}/locations/\\{location}/securityHealthAnalyticsCustomModules/\\{security_health_analytics_custom_module}".
961
+ # * "projects/\\{project}/locations/\\{location}/securityHealthAnalyticsCustomModules/\\{security_health_analytics_custom_module}".
962
+ # @param validate_only [::Boolean]
963
+ # Optional. When set to true, only validations (including IAM checks) will
964
+ # done for the request (module will not be deleted). An OK response indicates
965
+ # the request is valid while an error response indicates the request is
966
+ # invalid. Note that a subsequent request to actually delete the module could
967
+ # still fail because 1. the state could have changed (e.g. IAM permission
968
+ # lost) or
969
+ # 2. A failure occurred while trying to delete the module.
970
+ #
971
+ # @yield [response, operation] Access the result along with the RPC operation
972
+ # @yieldparam response [::Google::Protobuf::Empty]
973
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
974
+ #
975
+ # @return [::Google::Protobuf::Empty]
976
+ #
977
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
978
+ #
979
+ # @example Basic example
980
+ # require "google/cloud/security_center_management/v1"
981
+ #
982
+ # # Create a client object. The client can be reused for multiple calls.
983
+ # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new
984
+ #
985
+ # # Create a request. To set request fields, pass in keyword arguments.
986
+ # request = Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest.new
987
+ #
988
+ # # Call the delete_security_health_analytics_custom_module method.
989
+ # result = client.delete_security_health_analytics_custom_module request
990
+ #
991
+ # # The returned object is of type Google::Protobuf::Empty.
992
+ # p result
993
+ #
994
+ def delete_security_health_analytics_custom_module request, options = nil
995
+ raise ::ArgumentError, "request must be provided" if request.nil?
996
+
997
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::DeleteSecurityHealthAnalyticsCustomModuleRequest
998
+
999
+ # Converts hash and nil to an options object
1000
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1001
+
1002
+ # Customize the options with defaults
1003
+ metadata = @config.rpcs.delete_security_health_analytics_custom_module.metadata.to_h
1004
+
1005
+ # Set x-goog-api-client and x-goog-user-project headers
1006
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1007
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1008
+ gapic_version: ::Google::Cloud::SecurityCenterManagement::V1::VERSION
1009
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1010
+
1011
+ header_params = {}
1012
+ if request.name
1013
+ header_params["name"] = request.name
1014
+ end
1015
+
1016
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1017
+ metadata[:"x-goog-request-params"] ||= request_params_header
1018
+
1019
+ options.apply_defaults timeout: @config.rpcs.delete_security_health_analytics_custom_module.timeout,
1020
+ metadata: metadata,
1021
+ retry_policy: @config.rpcs.delete_security_health_analytics_custom_module.retry_policy
1022
+
1023
+ options.apply_defaults timeout: @config.timeout,
1024
+ metadata: @config.metadata,
1025
+ retry_policy: @config.retry_policy
1026
+
1027
+ @security_center_management_stub.call_rpc :delete_security_health_analytics_custom_module, request, options: options do |response, operation|
1028
+ yield response, operation if block_given?
1029
+ return response
1030
+ end
1031
+ rescue ::GRPC::BadStatus => e
1032
+ raise ::Google::Cloud::Error.from_error(e)
1033
+ end
1034
+
1035
+ ##
1036
+ # Simulates a given SecurityHealthAnalyticsCustomModule and Resource.
1037
+ #
1038
+ # @overload simulate_security_health_analytics_custom_module(request, options = nil)
1039
+ # Pass arguments to `simulate_security_health_analytics_custom_module` via a request object, either of type
1040
+ # {::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest} or an equivalent Hash.
1041
+ #
1042
+ # @param request [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest, ::Hash]
1043
+ # A request object representing the call parameters. Required. To specify no
1044
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1045
+ # @param options [::Gapic::CallOptions, ::Hash]
1046
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1047
+ #
1048
+ # @overload simulate_security_health_analytics_custom_module(parent: nil, custom_config: nil, resource: nil)
1049
+ # Pass arguments to `simulate_security_health_analytics_custom_module` via keyword arguments. Note that at
1050
+ # least one keyword argument is required. To specify no parameters, or to keep all
1051
+ # the default parameter values, pass an empty Hash as a request object (see above).
1052
+ #
1053
+ # @param parent [::String]
1054
+ # Required. The relative resource name of the organization, project, or
1055
+ # folder. For more information about relative resource names, see [Relative
1056
+ # Resource
1057
+ # Name](https://cloud.google.com/apis/design/resource_names#relative_resource_name)
1058
+ # Example: `organizations/{organization_id}`.
1059
+ # @param custom_config [::Google::Cloud::SecurityCenterManagement::V1::CustomConfig, ::Hash]
1060
+ # Required. The custom configuration that you need to test.
1061
+ # @param resource [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest::SimulatedResource, ::Hash]
1062
+ # Required. Resource data to simulate custom module against.
1063
+ #
1064
+ # @yield [response, operation] Access the result along with the RPC operation
1065
+ # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse]
1066
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1067
+ #
1068
+ # @return [::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse]
1069
+ #
1070
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1071
+ #
1072
+ # @example Basic example
1073
+ # require "google/cloud/security_center_management/v1"
1074
+ #
1075
+ # # Create a client object. The client can be reused for multiple calls.
1076
+ # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new
1077
+ #
1078
+ # # Create a request. To set request fields, pass in keyword arguments.
1079
+ # request = Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest.new
1080
+ #
1081
+ # # Call the simulate_security_health_analytics_custom_module method.
1082
+ # result = client.simulate_security_health_analytics_custom_module request
1083
+ #
1084
+ # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleResponse.
1085
+ # p result
1086
+ #
1087
+ def simulate_security_health_analytics_custom_module request, options = nil
1088
+ raise ::ArgumentError, "request must be provided" if request.nil?
1089
+
1090
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::SimulateSecurityHealthAnalyticsCustomModuleRequest
1091
+
1092
+ # Converts hash and nil to an options object
1093
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1094
+
1095
+ # Customize the options with defaults
1096
+ metadata = @config.rpcs.simulate_security_health_analytics_custom_module.metadata.to_h
1097
+
1098
+ # Set x-goog-api-client and x-goog-user-project headers
1099
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1100
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1101
+ gapic_version: ::Google::Cloud::SecurityCenterManagement::V1::VERSION
1102
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1103
+
1104
+ header_params = {}
1105
+ if request.parent
1106
+ header_params["parent"] = request.parent
1107
+ end
1108
+
1109
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1110
+ metadata[:"x-goog-request-params"] ||= request_params_header
1111
+
1112
+ options.apply_defaults timeout: @config.rpcs.simulate_security_health_analytics_custom_module.timeout,
1113
+ metadata: metadata,
1114
+ retry_policy: @config.rpcs.simulate_security_health_analytics_custom_module.retry_policy
1115
+
1116
+ options.apply_defaults timeout: @config.timeout,
1117
+ metadata: @config.metadata,
1118
+ retry_policy: @config.retry_policy
1119
+
1120
+ @security_center_management_stub.call_rpc :simulate_security_health_analytics_custom_module, request, options: options do |response, operation|
1121
+ yield response, operation if block_given?
1122
+ return response
1123
+ end
1124
+ rescue ::GRPC::BadStatus => e
1125
+ raise ::Google::Cloud::Error.from_error(e)
1126
+ end
1127
+
1128
+ ##
1129
+ # Lists all effective Event Threat Detection custom modules for the
1130
+ # given parent. This includes resident modules defined at the scope of the
1131
+ # parent along with modules inherited from its ancestors.
1132
+ #
1133
+ # @overload list_effective_event_threat_detection_custom_modules(request, options = nil)
1134
+ # Pass arguments to `list_effective_event_threat_detection_custom_modules` via a request object, either of type
1135
+ # {::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest} or an equivalent Hash.
1136
+ #
1137
+ # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest, ::Hash]
1138
+ # A request object representing the call parameters. Required. To specify no
1139
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1140
+ # @param options [::Gapic::CallOptions, ::Hash]
1141
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1142
+ #
1143
+ # @overload list_effective_event_threat_detection_custom_modules(parent: nil, page_size: nil, page_token: nil)
1144
+ # Pass arguments to `list_effective_event_threat_detection_custom_modules` via keyword arguments. Note that at
1145
+ # least one keyword argument is required. To specify no parameters, or to keep all
1146
+ # the default parameter values, pass an empty Hash as a request object (see above).
1147
+ #
1148
+ # @param parent [::String]
1149
+ # Required. Name of parent to list effective custom modules. Its format is
1150
+ # "organizations/\\{organization}/locations/\\{location}",
1151
+ # "folders/\\{folder}/locations/\\{location}",
1152
+ # or
1153
+ # "projects/\\{project}/locations/\\{location}"
1154
+ # @param page_size [::Integer]
1155
+ # Optional. The maximum number of results to return in a single response.
1156
+ # Default is 10, minimum is 1, maximum is 1000.
1157
+ # @param page_token [::String]
1158
+ # Optional. The value returned by the last call indicating a continuation
1159
+ #
1160
+ # @yield [response, operation] Access the result along with the RPC operation
1161
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule>]
1162
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1163
+ #
1164
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule>]
1165
+ #
1166
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1167
+ #
1168
+ # @example Basic example
1169
+ # require "google/cloud/security_center_management/v1"
1170
+ #
1171
+ # # Create a client object. The client can be reused for multiple calls.
1172
+ # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new
1173
+ #
1174
+ # # Create a request. To set request fields, pass in keyword arguments.
1175
+ # request = Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest.new
1176
+ #
1177
+ # # Call the list_effective_event_threat_detection_custom_modules method.
1178
+ # result = client.list_effective_event_threat_detection_custom_modules request
1179
+ #
1180
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1181
+ # # over elements, and API calls will be issued to fetch pages as needed.
1182
+ # result.each do |item|
1183
+ # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule.
1184
+ # p item
1185
+ # end
1186
+ #
1187
+ def list_effective_event_threat_detection_custom_modules request, options = nil
1188
+ raise ::ArgumentError, "request must be provided" if request.nil?
1189
+
1190
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListEffectiveEventThreatDetectionCustomModulesRequest
1191
+
1192
+ # Converts hash and nil to an options object
1193
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1194
+
1195
+ # Customize the options with defaults
1196
+ metadata = @config.rpcs.list_effective_event_threat_detection_custom_modules.metadata.to_h
1197
+
1198
+ # Set x-goog-api-client and x-goog-user-project headers
1199
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1200
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1201
+ gapic_version: ::Google::Cloud::SecurityCenterManagement::V1::VERSION
1202
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1203
+
1204
+ header_params = {}
1205
+ if request.parent
1206
+ header_params["parent"] = request.parent
1207
+ end
1208
+
1209
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1210
+ metadata[:"x-goog-request-params"] ||= request_params_header
1211
+
1212
+ options.apply_defaults timeout: @config.rpcs.list_effective_event_threat_detection_custom_modules.timeout,
1213
+ metadata: metadata,
1214
+ retry_policy: @config.rpcs.list_effective_event_threat_detection_custom_modules.retry_policy
1215
+
1216
+ options.apply_defaults timeout: @config.timeout,
1217
+ metadata: @config.metadata,
1218
+ retry_policy: @config.retry_policy
1219
+
1220
+ @security_center_management_stub.call_rpc :list_effective_event_threat_detection_custom_modules, request, options: options do |response, operation|
1221
+ response = ::Gapic::PagedEnumerable.new @security_center_management_stub, :list_effective_event_threat_detection_custom_modules, request, response, operation, options
1222
+ yield response, operation if block_given?
1223
+ return response
1224
+ end
1225
+ rescue ::GRPC::BadStatus => e
1226
+ raise ::Google::Cloud::Error.from_error(e)
1227
+ end
1228
+
1229
+ ##
1230
+ # Gets an effective ETD custom module. Retrieves the effective module at the
1231
+ # given level. The difference between an EffectiveCustomModule and a
1232
+ # CustomModule is that the fields for an EffectiveCustomModule are computed
1233
+ # from ancestors if needed. For example, the enablement_state for a
1234
+ # CustomModule can be either ENABLED, DISABLED, or INHERITED. Where as the
1235
+ # enablement_state for an EffectiveCustomModule is always computed to ENABLED
1236
+ # or DISABLED (the effective enablement_state).
1237
+ #
1238
+ # @overload get_effective_event_threat_detection_custom_module(request, options = nil)
1239
+ # Pass arguments to `get_effective_event_threat_detection_custom_module` via a request object, either of type
1240
+ # {::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest} or an equivalent Hash.
1241
+ #
1242
+ # @param request [::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest, ::Hash]
1243
+ # A request object representing the call parameters. Required. To specify no
1244
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1245
+ # @param options [::Gapic::CallOptions, ::Hash]
1246
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1247
+ #
1248
+ # @overload get_effective_event_threat_detection_custom_module(name: nil)
1249
+ # Pass arguments to `get_effective_event_threat_detection_custom_module` via keyword arguments. Note that at
1250
+ # least one keyword argument is required. To specify no parameters, or to keep all
1251
+ # the default parameter values, pass an empty Hash as a request object (see above).
1252
+ #
1253
+ # @param name [::String]
1254
+ # Required. The resource name of the ETD custom module.
1255
+ #
1256
+ # Its format is:
1257
+ #
1258
+ # * "organizations/\\{organization}/locations/\\{location}/effectiveEventThreatDetectionCustomModules/\\{effective_event_threat_detection_custom_module}".
1259
+ # * "folders/\\{folder}/locations/\\{location}/effectiveEventThreatDetectionCustomModules/\\{effective_event_threat_detection_custom_module}".
1260
+ # * "projects/\\{project}/locations/\\{location}/effectiveEventThreatDetectionCustomModules/\\{effective_event_threat_detection_custom_module}".
1261
+ #
1262
+ # @yield [response, operation] Access the result along with the RPC operation
1263
+ # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule]
1264
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1265
+ #
1266
+ # @return [::Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule]
1267
+ #
1268
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1269
+ #
1270
+ # @example Basic example
1271
+ # require "google/cloud/security_center_management/v1"
1272
+ #
1273
+ # # Create a client object. The client can be reused for multiple calls.
1274
+ # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new
1275
+ #
1276
+ # # Create a request. To set request fields, pass in keyword arguments.
1277
+ # request = Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest.new
1278
+ #
1279
+ # # Call the get_effective_event_threat_detection_custom_module method.
1280
+ # result = client.get_effective_event_threat_detection_custom_module request
1281
+ #
1282
+ # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EffectiveEventThreatDetectionCustomModule.
1283
+ # p result
1284
+ #
1285
+ def get_effective_event_threat_detection_custom_module request, options = nil
1286
+ raise ::ArgumentError, "request must be provided" if request.nil?
1287
+
1288
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::GetEffectiveEventThreatDetectionCustomModuleRequest
1289
+
1290
+ # Converts hash and nil to an options object
1291
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1292
+
1293
+ # Customize the options with defaults
1294
+ metadata = @config.rpcs.get_effective_event_threat_detection_custom_module.metadata.to_h
1295
+
1296
+ # Set x-goog-api-client and x-goog-user-project headers
1297
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1298
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1299
+ gapic_version: ::Google::Cloud::SecurityCenterManagement::V1::VERSION
1300
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1301
+
1302
+ header_params = {}
1303
+ if request.name
1304
+ header_params["name"] = request.name
1305
+ end
1306
+
1307
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1308
+ metadata[:"x-goog-request-params"] ||= request_params_header
1309
+
1310
+ options.apply_defaults timeout: @config.rpcs.get_effective_event_threat_detection_custom_module.timeout,
1311
+ metadata: metadata,
1312
+ retry_policy: @config.rpcs.get_effective_event_threat_detection_custom_module.retry_policy
1313
+
1314
+ options.apply_defaults timeout: @config.timeout,
1315
+ metadata: @config.metadata,
1316
+ retry_policy: @config.retry_policy
1317
+
1318
+ @security_center_management_stub.call_rpc :get_effective_event_threat_detection_custom_module, request, options: options do |response, operation|
1319
+ yield response, operation if block_given?
1320
+ return response
1321
+ end
1322
+ rescue ::GRPC::BadStatus => e
1323
+ raise ::Google::Cloud::Error.from_error(e)
1324
+ end
1325
+
1326
+ ##
1327
+ # Lists all Event Threat Detection custom modules for the given
1328
+ # Resource Manager parent. This includes resident modules defined at the
1329
+ # scope of the parent along with modules inherited from ancestors.
1330
+ #
1331
+ # @overload list_event_threat_detection_custom_modules(request, options = nil)
1332
+ # Pass arguments to `list_event_threat_detection_custom_modules` via a request object, either of type
1333
+ # {::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest} or an equivalent Hash.
1334
+ #
1335
+ # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest, ::Hash]
1336
+ # A request object representing the call parameters. Required. To specify no
1337
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1338
+ # @param options [::Gapic::CallOptions, ::Hash]
1339
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1340
+ #
1341
+ # @overload list_event_threat_detection_custom_modules(parent: nil, page_size: nil, page_token: nil)
1342
+ # Pass arguments to `list_event_threat_detection_custom_modules` via keyword arguments. Note that at
1343
+ # least one keyword argument is required. To specify no parameters, or to keep all
1344
+ # the default parameter values, pass an empty Hash as a request object (see above).
1345
+ #
1346
+ # @param parent [::String]
1347
+ # Required. Name of parent to list custom modules. Its format is
1348
+ # "organizations/\\{organization}/locations/\\{location}",
1349
+ # "folders/\\{folder}/locations/\\{location}",
1350
+ # or
1351
+ # "projects/\\{project}/locations/\\{location}"
1352
+ # @param page_size [::Integer]
1353
+ # Optional. The maximum number of modules to return. The service may return
1354
+ # fewer than this value. If unspecified, at most 10 configs will be returned.
1355
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
1356
+ # @param page_token [::String]
1357
+ # Optional. A page token, received from a previous
1358
+ # `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the
1359
+ # subsequent page.
1360
+ #
1361
+ # When paginating, all other parameters provided to
1362
+ # `ListEventThreatDetectionCustomModules` must match the call that provided
1363
+ # the page token.
1364
+ #
1365
+ # @yield [response, operation] Access the result along with the RPC operation
1366
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule>]
1367
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1368
+ #
1369
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule>]
1370
+ #
1371
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1372
+ #
1373
+ # @example Basic example
1374
+ # require "google/cloud/security_center_management/v1"
1375
+ #
1376
+ # # Create a client object. The client can be reused for multiple calls.
1377
+ # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new
1378
+ #
1379
+ # # Create a request. To set request fields, pass in keyword arguments.
1380
+ # request = Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest.new
1381
+ #
1382
+ # # Call the list_event_threat_detection_custom_modules method.
1383
+ # result = client.list_event_threat_detection_custom_modules request
1384
+ #
1385
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1386
+ # # over elements, and API calls will be issued to fetch pages as needed.
1387
+ # result.each do |item|
1388
+ # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule.
1389
+ # p item
1390
+ # end
1391
+ #
1392
+ def list_event_threat_detection_custom_modules request, options = nil
1393
+ raise ::ArgumentError, "request must be provided" if request.nil?
1394
+
1395
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListEventThreatDetectionCustomModulesRequest
1396
+
1397
+ # Converts hash and nil to an options object
1398
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1399
+
1400
+ # Customize the options with defaults
1401
+ metadata = @config.rpcs.list_event_threat_detection_custom_modules.metadata.to_h
1402
+
1403
+ # Set x-goog-api-client and x-goog-user-project headers
1404
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1405
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1406
+ gapic_version: ::Google::Cloud::SecurityCenterManagement::V1::VERSION
1407
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1408
+
1409
+ header_params = {}
1410
+ if request.parent
1411
+ header_params["parent"] = request.parent
1412
+ end
1413
+
1414
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1415
+ metadata[:"x-goog-request-params"] ||= request_params_header
1416
+
1417
+ options.apply_defaults timeout: @config.rpcs.list_event_threat_detection_custom_modules.timeout,
1418
+ metadata: metadata,
1419
+ retry_policy: @config.rpcs.list_event_threat_detection_custom_modules.retry_policy
1420
+
1421
+ options.apply_defaults timeout: @config.timeout,
1422
+ metadata: @config.metadata,
1423
+ retry_policy: @config.retry_policy
1424
+
1425
+ @security_center_management_stub.call_rpc :list_event_threat_detection_custom_modules, request, options: options do |response, operation|
1426
+ response = ::Gapic::PagedEnumerable.new @security_center_management_stub, :list_event_threat_detection_custom_modules, request, response, operation, options
1427
+ yield response, operation if block_given?
1428
+ return response
1429
+ end
1430
+ rescue ::GRPC::BadStatus => e
1431
+ raise ::Google::Cloud::Error.from_error(e)
1432
+ end
1433
+
1434
+ ##
1435
+ # Lists all resident Event Threat Detection custom modules under the
1436
+ # given Resource Manager parent and its descendants.
1437
+ #
1438
+ # @overload list_descendant_event_threat_detection_custom_modules(request, options = nil)
1439
+ # Pass arguments to `list_descendant_event_threat_detection_custom_modules` via a request object, either of type
1440
+ # {::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest} or an equivalent Hash.
1441
+ #
1442
+ # @param request [::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest, ::Hash]
1443
+ # A request object representing the call parameters. Required. To specify no
1444
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1445
+ # @param options [::Gapic::CallOptions, ::Hash]
1446
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1447
+ #
1448
+ # @overload list_descendant_event_threat_detection_custom_modules(parent: nil, page_size: nil, page_token: nil)
1449
+ # Pass arguments to `list_descendant_event_threat_detection_custom_modules` via keyword arguments. Note that at
1450
+ # least one keyword argument is required. To specify no parameters, or to keep all
1451
+ # the default parameter values, pass an empty Hash as a request object (see above).
1452
+ #
1453
+ # @param parent [::String]
1454
+ # Required. Name of parent to list custom modules. Its format is
1455
+ # "organizations/\\{organization}/locations/\\{location}",
1456
+ # "folders/\\{folder}/locations/\\{location}",
1457
+ # or
1458
+ # "projects/\\{project}/locations/\\{location}"
1459
+ # @param page_size [::Integer]
1460
+ # Optional. The maximum number of modules to return. The service may return
1461
+ # fewer than this value. If unspecified, at most 10 configs will be returned.
1462
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
1463
+ # @param page_token [::String]
1464
+ # Optional. A token identifying a page of results the server should return.
1465
+ #
1466
+ # @yield [response, operation] Access the result along with the RPC operation
1467
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule>]
1468
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1469
+ #
1470
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule>]
1471
+ #
1472
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1473
+ #
1474
+ # @example Basic example
1475
+ # require "google/cloud/security_center_management/v1"
1476
+ #
1477
+ # # Create a client object. The client can be reused for multiple calls.
1478
+ # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new
1479
+ #
1480
+ # # Create a request. To set request fields, pass in keyword arguments.
1481
+ # request = Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest.new
1482
+ #
1483
+ # # Call the list_descendant_event_threat_detection_custom_modules method.
1484
+ # result = client.list_descendant_event_threat_detection_custom_modules request
1485
+ #
1486
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1487
+ # # over elements, and API calls will be issued to fetch pages as needed.
1488
+ # result.each do |item|
1489
+ # # Each element is of type ::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule.
1490
+ # p item
1491
+ # end
1492
+ #
1493
+ def list_descendant_event_threat_detection_custom_modules request, options = nil
1494
+ raise ::ArgumentError, "request must be provided" if request.nil?
1495
+
1496
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ListDescendantEventThreatDetectionCustomModulesRequest
1497
+
1498
+ # Converts hash and nil to an options object
1499
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1500
+
1501
+ # Customize the options with defaults
1502
+ metadata = @config.rpcs.list_descendant_event_threat_detection_custom_modules.metadata.to_h
1503
+
1504
+ # Set x-goog-api-client and x-goog-user-project headers
1505
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1506
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1507
+ gapic_version: ::Google::Cloud::SecurityCenterManagement::V1::VERSION
1508
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1509
+
1510
+ header_params = {}
1511
+ if request.parent
1512
+ header_params["parent"] = request.parent
1513
+ end
1514
+
1515
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1516
+ metadata[:"x-goog-request-params"] ||= request_params_header
1517
+
1518
+ options.apply_defaults timeout: @config.rpcs.list_descendant_event_threat_detection_custom_modules.timeout,
1519
+ metadata: metadata,
1520
+ retry_policy: @config.rpcs.list_descendant_event_threat_detection_custom_modules.retry_policy
1521
+
1522
+ options.apply_defaults timeout: @config.timeout,
1523
+ metadata: @config.metadata,
1524
+ retry_policy: @config.retry_policy
1525
+
1526
+ @security_center_management_stub.call_rpc :list_descendant_event_threat_detection_custom_modules, request, options: options do |response, operation|
1527
+ response = ::Gapic::PagedEnumerable.new @security_center_management_stub, :list_descendant_event_threat_detection_custom_modules, request, response, operation, options
1528
+ yield response, operation if block_given?
1529
+ return response
1530
+ end
1531
+ rescue ::GRPC::BadStatus => e
1532
+ raise ::Google::Cloud::Error.from_error(e)
1533
+ end
1534
+
1535
+ ##
1536
+ # Gets an Event Threat Detection custom module.
1537
+ #
1538
+ # @overload get_event_threat_detection_custom_module(request, options = nil)
1539
+ # Pass arguments to `get_event_threat_detection_custom_module` via a request object, either of type
1540
+ # {::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest} or an equivalent Hash.
1541
+ #
1542
+ # @param request [::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest, ::Hash]
1543
+ # A request object representing the call parameters. Required. To specify no
1544
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1545
+ # @param options [::Gapic::CallOptions, ::Hash]
1546
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1547
+ #
1548
+ # @overload get_event_threat_detection_custom_module(name: nil)
1549
+ # Pass arguments to `get_event_threat_detection_custom_module` via keyword arguments. Note that at
1550
+ # least one keyword argument is required. To specify no parameters, or to keep all
1551
+ # the default parameter values, pass an empty Hash as a request object (see above).
1552
+ #
1553
+ # @param name [::String]
1554
+ # Required. The resource name of the ETD custom module.
1555
+ #
1556
+ # Its format is:
1557
+ #
1558
+ # * "organizations/\\{organization}/locations/\\{location}/eventThreatDetectionCustomModules/\\{event_threat_detection_custom_module}".
1559
+ # * "folders/\\{folder}/locations/\\{location}/eventThreatDetectionCustomModules/\\{event_threat_detection_custom_module}".
1560
+ # * "projects/\\{project}/locations/\\{location}/eventThreatDetectionCustomModules/\\{event_threat_detection_custom_module}".
1561
+ #
1562
+ # @yield [response, operation] Access the result along with the RPC operation
1563
+ # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule]
1564
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1565
+ #
1566
+ # @return [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule]
1567
+ #
1568
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1569
+ #
1570
+ # @example Basic example
1571
+ # require "google/cloud/security_center_management/v1"
1572
+ #
1573
+ # # Create a client object. The client can be reused for multiple calls.
1574
+ # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new
1575
+ #
1576
+ # # Create a request. To set request fields, pass in keyword arguments.
1577
+ # request = Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest.new
1578
+ #
1579
+ # # Call the get_event_threat_detection_custom_module method.
1580
+ # result = client.get_event_threat_detection_custom_module request
1581
+ #
1582
+ # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule.
1583
+ # p result
1584
+ #
1585
+ def get_event_threat_detection_custom_module request, options = nil
1586
+ raise ::ArgumentError, "request must be provided" if request.nil?
1587
+
1588
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::GetEventThreatDetectionCustomModuleRequest
1589
+
1590
+ # Converts hash and nil to an options object
1591
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1592
+
1593
+ # Customize the options with defaults
1594
+ metadata = @config.rpcs.get_event_threat_detection_custom_module.metadata.to_h
1595
+
1596
+ # Set x-goog-api-client and x-goog-user-project headers
1597
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1598
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1599
+ gapic_version: ::Google::Cloud::SecurityCenterManagement::V1::VERSION
1600
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1601
+
1602
+ header_params = {}
1603
+ if request.name
1604
+ header_params["name"] = request.name
1605
+ end
1606
+
1607
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1608
+ metadata[:"x-goog-request-params"] ||= request_params_header
1609
+
1610
+ options.apply_defaults timeout: @config.rpcs.get_event_threat_detection_custom_module.timeout,
1611
+ metadata: metadata,
1612
+ retry_policy: @config.rpcs.get_event_threat_detection_custom_module.retry_policy
1613
+
1614
+ options.apply_defaults timeout: @config.timeout,
1615
+ metadata: @config.metadata,
1616
+ retry_policy: @config.retry_policy
1617
+
1618
+ @security_center_management_stub.call_rpc :get_event_threat_detection_custom_module, request, options: options do |response, operation|
1619
+ yield response, operation if block_given?
1620
+ return response
1621
+ end
1622
+ rescue ::GRPC::BadStatus => e
1623
+ raise ::Google::Cloud::Error.from_error(e)
1624
+ end
1625
+
1626
+ ##
1627
+ # Creates a resident Event Threat Detection custom module at the scope of the
1628
+ # given Resource Manager parent, and also creates inherited custom modules
1629
+ # for all descendants of the given parent. These modules are enabled by
1630
+ # default.
1631
+ #
1632
+ # @overload create_event_threat_detection_custom_module(request, options = nil)
1633
+ # Pass arguments to `create_event_threat_detection_custom_module` via a request object, either of type
1634
+ # {::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest} or an equivalent Hash.
1635
+ #
1636
+ # @param request [::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest, ::Hash]
1637
+ # A request object representing the call parameters. Required. To specify no
1638
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1639
+ # @param options [::Gapic::CallOptions, ::Hash]
1640
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1641
+ #
1642
+ # @overload create_event_threat_detection_custom_module(parent: nil, event_threat_detection_custom_module: nil, validate_only: nil)
1643
+ # Pass arguments to `create_event_threat_detection_custom_module` via keyword arguments. Note that at
1644
+ # least one keyword argument is required. To specify no parameters, or to keep all
1645
+ # the default parameter values, pass an empty Hash as a request object (see above).
1646
+ #
1647
+ # @param parent [::String]
1648
+ # Required. Name of parent for the module. Its format is
1649
+ # "organizations/\\{organization}/locations/\\{location}",
1650
+ # "folders/\\{folder}/locations/\\{location}",
1651
+ # or
1652
+ # "projects/\\{project}/locations/\\{location}"
1653
+ # @param event_threat_detection_custom_module [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule, ::Hash]
1654
+ # Required. The module to create. The
1655
+ # event_threat_detection_custom_module.name will be ignored and server
1656
+ # generated.
1657
+ # @param validate_only [::Boolean]
1658
+ # Optional. When set to true, only validations (including IAM checks) will
1659
+ # done for the request (no module will be created). An OK response indicates
1660
+ # the request is valid while an error response indicates the request is
1661
+ # invalid. Note that a subsequent request to actually create the module could
1662
+ # still fail because 1. the state could have changed (e.g. IAM permission
1663
+ # lost) or
1664
+ # 2. A failure occurred during creation of the module.
1665
+ #
1666
+ # @yield [response, operation] Access the result along with the RPC operation
1667
+ # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule]
1668
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1669
+ #
1670
+ # @return [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule]
1671
+ #
1672
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1673
+ #
1674
+ # @example Basic example
1675
+ # require "google/cloud/security_center_management/v1"
1676
+ #
1677
+ # # Create a client object. The client can be reused for multiple calls.
1678
+ # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new
1679
+ #
1680
+ # # Create a request. To set request fields, pass in keyword arguments.
1681
+ # request = Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest.new
1682
+ #
1683
+ # # Call the create_event_threat_detection_custom_module method.
1684
+ # result = client.create_event_threat_detection_custom_module request
1685
+ #
1686
+ # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule.
1687
+ # p result
1688
+ #
1689
+ def create_event_threat_detection_custom_module request, options = nil
1690
+ raise ::ArgumentError, "request must be provided" if request.nil?
1691
+
1692
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::CreateEventThreatDetectionCustomModuleRequest
1693
+
1694
+ # Converts hash and nil to an options object
1695
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1696
+
1697
+ # Customize the options with defaults
1698
+ metadata = @config.rpcs.create_event_threat_detection_custom_module.metadata.to_h
1699
+
1700
+ # Set x-goog-api-client and x-goog-user-project headers
1701
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1702
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1703
+ gapic_version: ::Google::Cloud::SecurityCenterManagement::V1::VERSION
1704
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1705
+
1706
+ header_params = {}
1707
+ if request.parent
1708
+ header_params["parent"] = request.parent
1709
+ end
1710
+
1711
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1712
+ metadata[:"x-goog-request-params"] ||= request_params_header
1713
+
1714
+ options.apply_defaults timeout: @config.rpcs.create_event_threat_detection_custom_module.timeout,
1715
+ metadata: metadata,
1716
+ retry_policy: @config.rpcs.create_event_threat_detection_custom_module.retry_policy
1717
+
1718
+ options.apply_defaults timeout: @config.timeout,
1719
+ metadata: @config.metadata,
1720
+ retry_policy: @config.retry_policy
1721
+
1722
+ @security_center_management_stub.call_rpc :create_event_threat_detection_custom_module, request, options: options do |response, operation|
1723
+ yield response, operation if block_given?
1724
+ return response
1725
+ end
1726
+ rescue ::GRPC::BadStatus => e
1727
+ raise ::Google::Cloud::Error.from_error(e)
1728
+ end
1729
+
1730
+ ##
1731
+ # Updates the Event Threat Detection custom module with the given name based
1732
+ # on the given update mask. Updating the enablement state is supported for
1733
+ # both resident and inherited modules (though resident modules cannot have an
1734
+ # enablement state of "inherited"). Updating the display name or
1735
+ # configuration of a module is supported for resident modules only. The type
1736
+ # of a module cannot be changed.
1737
+ #
1738
+ # @overload update_event_threat_detection_custom_module(request, options = nil)
1739
+ # Pass arguments to `update_event_threat_detection_custom_module` via a request object, either of type
1740
+ # {::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest} or an equivalent Hash.
1741
+ #
1742
+ # @param request [::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest, ::Hash]
1743
+ # A request object representing the call parameters. Required. To specify no
1744
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1745
+ # @param options [::Gapic::CallOptions, ::Hash]
1746
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1747
+ #
1748
+ # @overload update_event_threat_detection_custom_module(update_mask: nil, event_threat_detection_custom_module: nil, validate_only: nil)
1749
+ # Pass arguments to `update_event_threat_detection_custom_module` via keyword arguments. Note that at
1750
+ # least one keyword argument is required. To specify no parameters, or to keep all
1751
+ # the default parameter values, pass an empty Hash as a request object (see above).
1752
+ #
1753
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1754
+ # Required. Field mask is used to specify the fields to be overwritten in the
1755
+ # EventThreatDetectionCustomModule resource by the update.
1756
+ # The fields specified in the update_mask are relative to the resource, not
1757
+ # the full request. A field will be overwritten if it is in the mask. If the
1758
+ # user does not provide a mask then all fields will be overwritten.
1759
+ # @param event_threat_detection_custom_module [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule, ::Hash]
1760
+ # Required. The module being updated
1761
+ # @param validate_only [::Boolean]
1762
+ # Optional. When set to true, only validations (including IAM checks) will
1763
+ # done for the request (module will not be updated). An OK response indicates
1764
+ # the request is valid while an error response indicates the request is
1765
+ # invalid. Note that a subsequent request to actually update the module could
1766
+ # still fail because 1. the state could have changed (e.g. IAM permission
1767
+ # lost) or
1768
+ # 2. A failure occurred while trying to update the module.
1769
+ #
1770
+ # @yield [response, operation] Access the result along with the RPC operation
1771
+ # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule]
1772
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1773
+ #
1774
+ # @return [::Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule]
1775
+ #
1776
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1777
+ #
1778
+ # @example Basic example
1779
+ # require "google/cloud/security_center_management/v1"
1780
+ #
1781
+ # # Create a client object. The client can be reused for multiple calls.
1782
+ # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new
1783
+ #
1784
+ # # Create a request. To set request fields, pass in keyword arguments.
1785
+ # request = Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest.new
1786
+ #
1787
+ # # Call the update_event_threat_detection_custom_module method.
1788
+ # result = client.update_event_threat_detection_custom_module request
1789
+ #
1790
+ # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::EventThreatDetectionCustomModule.
1791
+ # p result
1792
+ #
1793
+ def update_event_threat_detection_custom_module request, options = nil
1794
+ raise ::ArgumentError, "request must be provided" if request.nil?
1795
+
1796
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::UpdateEventThreatDetectionCustomModuleRequest
1797
+
1798
+ # Converts hash and nil to an options object
1799
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1800
+
1801
+ # Customize the options with defaults
1802
+ metadata = @config.rpcs.update_event_threat_detection_custom_module.metadata.to_h
1803
+
1804
+ # Set x-goog-api-client and x-goog-user-project headers
1805
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1806
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1807
+ gapic_version: ::Google::Cloud::SecurityCenterManagement::V1::VERSION
1808
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1809
+
1810
+ header_params = {}
1811
+ if request.event_threat_detection_custom_module&.name
1812
+ header_params["event_threat_detection_custom_module.name"] = request.event_threat_detection_custom_module.name
1813
+ end
1814
+
1815
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1816
+ metadata[:"x-goog-request-params"] ||= request_params_header
1817
+
1818
+ options.apply_defaults timeout: @config.rpcs.update_event_threat_detection_custom_module.timeout,
1819
+ metadata: metadata,
1820
+ retry_policy: @config.rpcs.update_event_threat_detection_custom_module.retry_policy
1821
+
1822
+ options.apply_defaults timeout: @config.timeout,
1823
+ metadata: @config.metadata,
1824
+ retry_policy: @config.retry_policy
1825
+
1826
+ @security_center_management_stub.call_rpc :update_event_threat_detection_custom_module, request, options: options do |response, operation|
1827
+ yield response, operation if block_given?
1828
+ return response
1829
+ end
1830
+ rescue ::GRPC::BadStatus => e
1831
+ raise ::Google::Cloud::Error.from_error(e)
1832
+ end
1833
+
1834
+ ##
1835
+ # Deletes the specified Event Threat Detection custom module and all of its
1836
+ # descendants in the Resource Manager hierarchy. This method is only
1837
+ # supported for resident custom modules.
1838
+ #
1839
+ # @overload delete_event_threat_detection_custom_module(request, options = nil)
1840
+ # Pass arguments to `delete_event_threat_detection_custom_module` via a request object, either of type
1841
+ # {::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest} or an equivalent Hash.
1842
+ #
1843
+ # @param request [::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest, ::Hash]
1844
+ # A request object representing the call parameters. Required. To specify no
1845
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1846
+ # @param options [::Gapic::CallOptions, ::Hash]
1847
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1848
+ #
1849
+ # @overload delete_event_threat_detection_custom_module(name: nil, validate_only: nil)
1850
+ # Pass arguments to `delete_event_threat_detection_custom_module` via keyword arguments. Note that at
1851
+ # least one keyword argument is required. To specify no parameters, or to keep all
1852
+ # the default parameter values, pass an empty Hash as a request object (see above).
1853
+ #
1854
+ # @param name [::String]
1855
+ # Required. The resource name of the ETD custom module.
1856
+ #
1857
+ # Its format is:
1858
+ #
1859
+ # * "organizations/\\{organization}/locations/\\{location}/eventThreatDetectionCustomModules/\\{event_threat_detection_custom_module}".
1860
+ # * "folders/\\{folder}/locations/\\{location}/eventThreatDetectionCustomModules/\\{event_threat_detection_custom_module}".
1861
+ # * "projects/\\{project}/locations/\\{location}/eventThreatDetectionCustomModules/\\{event_threat_detection_custom_module}".
1862
+ # @param validate_only [::Boolean]
1863
+ # Optional. When set to true, only validations (including IAM checks) will
1864
+ # done for the request (module will not be deleted). An OK response indicates
1865
+ # the request is valid while an error response indicates the request is
1866
+ # invalid. Note that a subsequent request to actually delete the module could
1867
+ # still fail because 1. the state could have changed (e.g. IAM permission
1868
+ # lost) or
1869
+ # 2. A failure occurred while trying to delete the module.
1870
+ #
1871
+ # @yield [response, operation] Access the result along with the RPC operation
1872
+ # @yieldparam response [::Google::Protobuf::Empty]
1873
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1874
+ #
1875
+ # @return [::Google::Protobuf::Empty]
1876
+ #
1877
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1878
+ #
1879
+ # @example Basic example
1880
+ # require "google/cloud/security_center_management/v1"
1881
+ #
1882
+ # # Create a client object. The client can be reused for multiple calls.
1883
+ # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new
1884
+ #
1885
+ # # Create a request. To set request fields, pass in keyword arguments.
1886
+ # request = Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest.new
1887
+ #
1888
+ # # Call the delete_event_threat_detection_custom_module method.
1889
+ # result = client.delete_event_threat_detection_custom_module request
1890
+ #
1891
+ # # The returned object is of type Google::Protobuf::Empty.
1892
+ # p result
1893
+ #
1894
+ def delete_event_threat_detection_custom_module request, options = nil
1895
+ raise ::ArgumentError, "request must be provided" if request.nil?
1896
+
1897
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::DeleteEventThreatDetectionCustomModuleRequest
1898
+
1899
+ # Converts hash and nil to an options object
1900
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1901
+
1902
+ # Customize the options with defaults
1903
+ metadata = @config.rpcs.delete_event_threat_detection_custom_module.metadata.to_h
1904
+
1905
+ # Set x-goog-api-client and x-goog-user-project headers
1906
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1907
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1908
+ gapic_version: ::Google::Cloud::SecurityCenterManagement::V1::VERSION
1909
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1910
+
1911
+ header_params = {}
1912
+ if request.name
1913
+ header_params["name"] = request.name
1914
+ end
1915
+
1916
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1917
+ metadata[:"x-goog-request-params"] ||= request_params_header
1918
+
1919
+ options.apply_defaults timeout: @config.rpcs.delete_event_threat_detection_custom_module.timeout,
1920
+ metadata: metadata,
1921
+ retry_policy: @config.rpcs.delete_event_threat_detection_custom_module.retry_policy
1922
+
1923
+ options.apply_defaults timeout: @config.timeout,
1924
+ metadata: @config.metadata,
1925
+ retry_policy: @config.retry_policy
1926
+
1927
+ @security_center_management_stub.call_rpc :delete_event_threat_detection_custom_module, request, options: options do |response, operation|
1928
+ yield response, operation if block_given?
1929
+ return response
1930
+ end
1931
+ rescue ::GRPC::BadStatus => e
1932
+ raise ::Google::Cloud::Error.from_error(e)
1933
+ end
1934
+
1935
+ ##
1936
+ # Validates the given Event Threat Detection custom module.
1937
+ #
1938
+ # @overload validate_event_threat_detection_custom_module(request, options = nil)
1939
+ # Pass arguments to `validate_event_threat_detection_custom_module` via a request object, either of type
1940
+ # {::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest} or an equivalent Hash.
1941
+ #
1942
+ # @param request [::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest, ::Hash]
1943
+ # A request object representing the call parameters. Required. To specify no
1944
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1945
+ # @param options [::Gapic::CallOptions, ::Hash]
1946
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1947
+ #
1948
+ # @overload validate_event_threat_detection_custom_module(parent: nil, raw_text: nil, type: nil)
1949
+ # Pass arguments to `validate_event_threat_detection_custom_module` via keyword arguments. Note that at
1950
+ # least one keyword argument is required. To specify no parameters, or to keep all
1951
+ # the default parameter values, pass an empty Hash as a request object (see above).
1952
+ #
1953
+ # @param parent [::String]
1954
+ # Required. Resource name of the parent to validate the Custom Module under.
1955
+ #
1956
+ # Its format is:
1957
+ #
1958
+ # * "organizations/\\{organization}/locations/\\{location}".
1959
+ # @param raw_text [::String]
1960
+ # Required. The raw text of the module's contents. Used to generate error
1961
+ # messages.
1962
+ # @param type [::String]
1963
+ # Required. The type of the module (e.g. CONFIGURABLE_BAD_IP).
1964
+ #
1965
+ # @yield [response, operation] Access the result along with the RPC operation
1966
+ # @yieldparam response [::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse]
1967
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1968
+ #
1969
+ # @return [::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse]
1970
+ #
1971
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1972
+ #
1973
+ # @example Basic example
1974
+ # require "google/cloud/security_center_management/v1"
1975
+ #
1976
+ # # Create a client object. The client can be reused for multiple calls.
1977
+ # client = Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new
1978
+ #
1979
+ # # Create a request. To set request fields, pass in keyword arguments.
1980
+ # request = Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest.new
1981
+ #
1982
+ # # Call the validate_event_threat_detection_custom_module method.
1983
+ # result = client.validate_event_threat_detection_custom_module request
1984
+ #
1985
+ # # The returned object is of type Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleResponse.
1986
+ # p result
1987
+ #
1988
+ def validate_event_threat_detection_custom_module request, options = nil
1989
+ raise ::ArgumentError, "request must be provided" if request.nil?
1990
+
1991
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenterManagement::V1::ValidateEventThreatDetectionCustomModuleRequest
1992
+
1993
+ # Converts hash and nil to an options object
1994
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1995
+
1996
+ # Customize the options with defaults
1997
+ metadata = @config.rpcs.validate_event_threat_detection_custom_module.metadata.to_h
1998
+
1999
+ # Set x-goog-api-client and x-goog-user-project headers
2000
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2001
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2002
+ gapic_version: ::Google::Cloud::SecurityCenterManagement::V1::VERSION
2003
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2004
+
2005
+ header_params = {}
2006
+ if request.parent
2007
+ header_params["parent"] = request.parent
2008
+ end
2009
+
2010
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2011
+ metadata[:"x-goog-request-params"] ||= request_params_header
2012
+
2013
+ options.apply_defaults timeout: @config.rpcs.validate_event_threat_detection_custom_module.timeout,
2014
+ metadata: metadata,
2015
+ retry_policy: @config.rpcs.validate_event_threat_detection_custom_module.retry_policy
2016
+
2017
+ options.apply_defaults timeout: @config.timeout,
2018
+ metadata: @config.metadata,
2019
+ retry_policy: @config.retry_policy
2020
+
2021
+ @security_center_management_stub.call_rpc :validate_event_threat_detection_custom_module, request, options: options do |response, operation|
2022
+ yield response, operation if block_given?
2023
+ return response
2024
+ end
2025
+ rescue ::GRPC::BadStatus => e
2026
+ raise ::Google::Cloud::Error.from_error(e)
2027
+ end
2028
+
2029
+ ##
2030
+ # Configuration class for the SecurityCenterManagement API.
2031
+ #
2032
+ # This class represents the configuration for SecurityCenterManagement,
2033
+ # providing control over timeouts, retry behavior, logging, transport
2034
+ # parameters, and other low-level controls. Certain parameters can also be
2035
+ # applied individually to specific RPCs. See
2036
+ # {::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client::Configuration::Rpcs}
2037
+ # for a list of RPCs that can be configured independently.
2038
+ #
2039
+ # Configuration can be applied globally to all clients, or to a single client
2040
+ # on construction.
2041
+ #
2042
+ # @example
2043
+ #
2044
+ # # Modify the global config, setting the timeout for
2045
+ # # list_effective_security_health_analytics_custom_modules to 20 seconds,
2046
+ # # and all remaining timeouts to 10 seconds.
2047
+ # ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.configure do |config|
2048
+ # config.timeout = 10.0
2049
+ # config.rpcs.list_effective_security_health_analytics_custom_modules.timeout = 20.0
2050
+ # end
2051
+ #
2052
+ # # Apply the above configuration only to a new client.
2053
+ # client = ::Google::Cloud::SecurityCenterManagement::V1::SecurityCenterManagement::Client.new do |config|
2054
+ # config.timeout = 10.0
2055
+ # config.rpcs.list_effective_security_health_analytics_custom_modules.timeout = 20.0
2056
+ # end
2057
+ #
2058
+ # @!attribute [rw] endpoint
2059
+ # A custom service endpoint, as a hostname or hostname:port. The default is
2060
+ # nil, indicating to use the default endpoint in the current universe domain.
2061
+ # @return [::String,nil]
2062
+ # @!attribute [rw] credentials
2063
+ # Credentials to send with calls. You may provide any of the following types:
2064
+ # * (`String`) The path to a service account key file in JSON format
2065
+ # * (`Hash`) A service account key as a Hash
2066
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
2067
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
2068
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
2069
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
2070
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
2071
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
2072
+ # * (`nil`) indicating no credentials
2073
+ # @return [::Object]
2074
+ # @!attribute [rw] scope
2075
+ # The OAuth scopes
2076
+ # @return [::Array<::String>]
2077
+ # @!attribute [rw] lib_name
2078
+ # The library name as recorded in instrumentation and logging
2079
+ # @return [::String]
2080
+ # @!attribute [rw] lib_version
2081
+ # The library version as recorded in instrumentation and logging
2082
+ # @return [::String]
2083
+ # @!attribute [rw] channel_args
2084
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
2085
+ # `GRPC::Core::Channel` object is provided as the credential.
2086
+ # @return [::Hash]
2087
+ # @!attribute [rw] interceptors
2088
+ # An array of interceptors that are run before calls are executed.
2089
+ # @return [::Array<::GRPC::ClientInterceptor>]
2090
+ # @!attribute [rw] timeout
2091
+ # The call timeout in seconds.
2092
+ # @return [::Numeric]
2093
+ # @!attribute [rw] metadata
2094
+ # Additional gRPC headers to be sent with the call.
2095
+ # @return [::Hash{::Symbol=>::String}]
2096
+ # @!attribute [rw] retry_policy
2097
+ # The retry policy. The value is a hash with the following keys:
2098
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2099
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2100
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2101
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2102
+ # trigger a retry.
2103
+ # @return [::Hash]
2104
+ # @!attribute [rw] quota_project
2105
+ # A separate project against which to charge quota.
2106
+ # @return [::String]
2107
+ # @!attribute [rw] universe_domain
2108
+ # The universe domain within which to make requests. This determines the
2109
+ # default endpoint URL. The default value of nil uses the environment
2110
+ # universe (usually the default "googleapis.com" universe).
2111
+ # @return [::String,nil]
2112
+ #
2113
+ class Configuration
2114
+ extend ::Gapic::Config
2115
+
2116
+ # @private
2117
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
2118
+ DEFAULT_ENDPOINT = "securitycentermanagement.googleapis.com"
2119
+
2120
+ config_attr :endpoint, nil, ::String, nil
2121
+ config_attr :credentials, nil do |value|
2122
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
2123
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
2124
+ allowed.any? { |klass| klass === value }
2125
+ end
2126
+ config_attr :scope, nil, ::String, ::Array, nil
2127
+ config_attr :lib_name, nil, ::String, nil
2128
+ config_attr :lib_version, nil, ::String, nil
2129
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
2130
+ config_attr :interceptors, nil, ::Array, nil
2131
+ config_attr :timeout, nil, ::Numeric, nil
2132
+ config_attr :metadata, nil, ::Hash, nil
2133
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2134
+ config_attr :quota_project, nil, ::String, nil
2135
+ config_attr :universe_domain, nil, ::String, nil
2136
+
2137
+ # @private
2138
+ def initialize parent_config = nil
2139
+ @parent_config = parent_config unless parent_config.nil?
2140
+
2141
+ yield self if block_given?
2142
+ end
2143
+
2144
+ ##
2145
+ # Configurations for individual RPCs
2146
+ # @return [Rpcs]
2147
+ #
2148
+ def rpcs
2149
+ @rpcs ||= begin
2150
+ parent_rpcs = nil
2151
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
2152
+ Rpcs.new parent_rpcs
2153
+ end
2154
+ end
2155
+
2156
+ ##
2157
+ # Configuration for the channel pool
2158
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
2159
+ #
2160
+ def channel_pool
2161
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
2162
+ end
2163
+
2164
+ ##
2165
+ # Configuration RPC class for the SecurityCenterManagement API.
2166
+ #
2167
+ # Includes fields providing the configuration for each RPC in this service.
2168
+ # Each configuration object is of type `Gapic::Config::Method` and includes
2169
+ # the following configuration fields:
2170
+ #
2171
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
2172
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
2173
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
2174
+ # include the following keys:
2175
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2176
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2177
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2178
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2179
+ # trigger a retry.
2180
+ #
2181
+ class Rpcs
2182
+ ##
2183
+ # RPC-specific configuration for `list_effective_security_health_analytics_custom_modules`
2184
+ # @return [::Gapic::Config::Method]
2185
+ #
2186
+ attr_reader :list_effective_security_health_analytics_custom_modules
2187
+ ##
2188
+ # RPC-specific configuration for `get_effective_security_health_analytics_custom_module`
2189
+ # @return [::Gapic::Config::Method]
2190
+ #
2191
+ attr_reader :get_effective_security_health_analytics_custom_module
2192
+ ##
2193
+ # RPC-specific configuration for `list_security_health_analytics_custom_modules`
2194
+ # @return [::Gapic::Config::Method]
2195
+ #
2196
+ attr_reader :list_security_health_analytics_custom_modules
2197
+ ##
2198
+ # RPC-specific configuration for `list_descendant_security_health_analytics_custom_modules`
2199
+ # @return [::Gapic::Config::Method]
2200
+ #
2201
+ attr_reader :list_descendant_security_health_analytics_custom_modules
2202
+ ##
2203
+ # RPC-specific configuration for `get_security_health_analytics_custom_module`
2204
+ # @return [::Gapic::Config::Method]
2205
+ #
2206
+ attr_reader :get_security_health_analytics_custom_module
2207
+ ##
2208
+ # RPC-specific configuration for `create_security_health_analytics_custom_module`
2209
+ # @return [::Gapic::Config::Method]
2210
+ #
2211
+ attr_reader :create_security_health_analytics_custom_module
2212
+ ##
2213
+ # RPC-specific configuration for `update_security_health_analytics_custom_module`
2214
+ # @return [::Gapic::Config::Method]
2215
+ #
2216
+ attr_reader :update_security_health_analytics_custom_module
2217
+ ##
2218
+ # RPC-specific configuration for `delete_security_health_analytics_custom_module`
2219
+ # @return [::Gapic::Config::Method]
2220
+ #
2221
+ attr_reader :delete_security_health_analytics_custom_module
2222
+ ##
2223
+ # RPC-specific configuration for `simulate_security_health_analytics_custom_module`
2224
+ # @return [::Gapic::Config::Method]
2225
+ #
2226
+ attr_reader :simulate_security_health_analytics_custom_module
2227
+ ##
2228
+ # RPC-specific configuration for `list_effective_event_threat_detection_custom_modules`
2229
+ # @return [::Gapic::Config::Method]
2230
+ #
2231
+ attr_reader :list_effective_event_threat_detection_custom_modules
2232
+ ##
2233
+ # RPC-specific configuration for `get_effective_event_threat_detection_custom_module`
2234
+ # @return [::Gapic::Config::Method]
2235
+ #
2236
+ attr_reader :get_effective_event_threat_detection_custom_module
2237
+ ##
2238
+ # RPC-specific configuration for `list_event_threat_detection_custom_modules`
2239
+ # @return [::Gapic::Config::Method]
2240
+ #
2241
+ attr_reader :list_event_threat_detection_custom_modules
2242
+ ##
2243
+ # RPC-specific configuration for `list_descendant_event_threat_detection_custom_modules`
2244
+ # @return [::Gapic::Config::Method]
2245
+ #
2246
+ attr_reader :list_descendant_event_threat_detection_custom_modules
2247
+ ##
2248
+ # RPC-specific configuration for `get_event_threat_detection_custom_module`
2249
+ # @return [::Gapic::Config::Method]
2250
+ #
2251
+ attr_reader :get_event_threat_detection_custom_module
2252
+ ##
2253
+ # RPC-specific configuration for `create_event_threat_detection_custom_module`
2254
+ # @return [::Gapic::Config::Method]
2255
+ #
2256
+ attr_reader :create_event_threat_detection_custom_module
2257
+ ##
2258
+ # RPC-specific configuration for `update_event_threat_detection_custom_module`
2259
+ # @return [::Gapic::Config::Method]
2260
+ #
2261
+ attr_reader :update_event_threat_detection_custom_module
2262
+ ##
2263
+ # RPC-specific configuration for `delete_event_threat_detection_custom_module`
2264
+ # @return [::Gapic::Config::Method]
2265
+ #
2266
+ attr_reader :delete_event_threat_detection_custom_module
2267
+ ##
2268
+ # RPC-specific configuration for `validate_event_threat_detection_custom_module`
2269
+ # @return [::Gapic::Config::Method]
2270
+ #
2271
+ attr_reader :validate_event_threat_detection_custom_module
2272
+
2273
+ # @private
2274
+ def initialize parent_rpcs = nil
2275
+ list_effective_security_health_analytics_custom_modules_config = parent_rpcs.list_effective_security_health_analytics_custom_modules if parent_rpcs.respond_to? :list_effective_security_health_analytics_custom_modules
2276
+ @list_effective_security_health_analytics_custom_modules = ::Gapic::Config::Method.new list_effective_security_health_analytics_custom_modules_config
2277
+ get_effective_security_health_analytics_custom_module_config = parent_rpcs.get_effective_security_health_analytics_custom_module if parent_rpcs.respond_to? :get_effective_security_health_analytics_custom_module
2278
+ @get_effective_security_health_analytics_custom_module = ::Gapic::Config::Method.new get_effective_security_health_analytics_custom_module_config
2279
+ list_security_health_analytics_custom_modules_config = parent_rpcs.list_security_health_analytics_custom_modules if parent_rpcs.respond_to? :list_security_health_analytics_custom_modules
2280
+ @list_security_health_analytics_custom_modules = ::Gapic::Config::Method.new list_security_health_analytics_custom_modules_config
2281
+ list_descendant_security_health_analytics_custom_modules_config = parent_rpcs.list_descendant_security_health_analytics_custom_modules if parent_rpcs.respond_to? :list_descendant_security_health_analytics_custom_modules
2282
+ @list_descendant_security_health_analytics_custom_modules = ::Gapic::Config::Method.new list_descendant_security_health_analytics_custom_modules_config
2283
+ get_security_health_analytics_custom_module_config = parent_rpcs.get_security_health_analytics_custom_module if parent_rpcs.respond_to? :get_security_health_analytics_custom_module
2284
+ @get_security_health_analytics_custom_module = ::Gapic::Config::Method.new get_security_health_analytics_custom_module_config
2285
+ create_security_health_analytics_custom_module_config = parent_rpcs.create_security_health_analytics_custom_module if parent_rpcs.respond_to? :create_security_health_analytics_custom_module
2286
+ @create_security_health_analytics_custom_module = ::Gapic::Config::Method.new create_security_health_analytics_custom_module_config
2287
+ update_security_health_analytics_custom_module_config = parent_rpcs.update_security_health_analytics_custom_module if parent_rpcs.respond_to? :update_security_health_analytics_custom_module
2288
+ @update_security_health_analytics_custom_module = ::Gapic::Config::Method.new update_security_health_analytics_custom_module_config
2289
+ delete_security_health_analytics_custom_module_config = parent_rpcs.delete_security_health_analytics_custom_module if parent_rpcs.respond_to? :delete_security_health_analytics_custom_module
2290
+ @delete_security_health_analytics_custom_module = ::Gapic::Config::Method.new delete_security_health_analytics_custom_module_config
2291
+ simulate_security_health_analytics_custom_module_config = parent_rpcs.simulate_security_health_analytics_custom_module if parent_rpcs.respond_to? :simulate_security_health_analytics_custom_module
2292
+ @simulate_security_health_analytics_custom_module = ::Gapic::Config::Method.new simulate_security_health_analytics_custom_module_config
2293
+ list_effective_event_threat_detection_custom_modules_config = parent_rpcs.list_effective_event_threat_detection_custom_modules if parent_rpcs.respond_to? :list_effective_event_threat_detection_custom_modules
2294
+ @list_effective_event_threat_detection_custom_modules = ::Gapic::Config::Method.new list_effective_event_threat_detection_custom_modules_config
2295
+ get_effective_event_threat_detection_custom_module_config = parent_rpcs.get_effective_event_threat_detection_custom_module if parent_rpcs.respond_to? :get_effective_event_threat_detection_custom_module
2296
+ @get_effective_event_threat_detection_custom_module = ::Gapic::Config::Method.new get_effective_event_threat_detection_custom_module_config
2297
+ list_event_threat_detection_custom_modules_config = parent_rpcs.list_event_threat_detection_custom_modules if parent_rpcs.respond_to? :list_event_threat_detection_custom_modules
2298
+ @list_event_threat_detection_custom_modules = ::Gapic::Config::Method.new list_event_threat_detection_custom_modules_config
2299
+ list_descendant_event_threat_detection_custom_modules_config = parent_rpcs.list_descendant_event_threat_detection_custom_modules if parent_rpcs.respond_to? :list_descendant_event_threat_detection_custom_modules
2300
+ @list_descendant_event_threat_detection_custom_modules = ::Gapic::Config::Method.new list_descendant_event_threat_detection_custom_modules_config
2301
+ get_event_threat_detection_custom_module_config = parent_rpcs.get_event_threat_detection_custom_module if parent_rpcs.respond_to? :get_event_threat_detection_custom_module
2302
+ @get_event_threat_detection_custom_module = ::Gapic::Config::Method.new get_event_threat_detection_custom_module_config
2303
+ create_event_threat_detection_custom_module_config = parent_rpcs.create_event_threat_detection_custom_module if parent_rpcs.respond_to? :create_event_threat_detection_custom_module
2304
+ @create_event_threat_detection_custom_module = ::Gapic::Config::Method.new create_event_threat_detection_custom_module_config
2305
+ update_event_threat_detection_custom_module_config = parent_rpcs.update_event_threat_detection_custom_module if parent_rpcs.respond_to? :update_event_threat_detection_custom_module
2306
+ @update_event_threat_detection_custom_module = ::Gapic::Config::Method.new update_event_threat_detection_custom_module_config
2307
+ delete_event_threat_detection_custom_module_config = parent_rpcs.delete_event_threat_detection_custom_module if parent_rpcs.respond_to? :delete_event_threat_detection_custom_module
2308
+ @delete_event_threat_detection_custom_module = ::Gapic::Config::Method.new delete_event_threat_detection_custom_module_config
2309
+ validate_event_threat_detection_custom_module_config = parent_rpcs.validate_event_threat_detection_custom_module if parent_rpcs.respond_to? :validate_event_threat_detection_custom_module
2310
+ @validate_event_threat_detection_custom_module = ::Gapic::Config::Method.new validate_event_threat_detection_custom_module_config
2311
+
2312
+ yield self if block_given?
2313
+ end
2314
+ end
2315
+ end
2316
+ end
2317
+ end
2318
+ end
2319
+ end
2320
+ end
2321
+ end