google-cloud-security_center-v1 0.8.1 → 0.11.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.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/google/cloud/security_center/v1/security_center/client.rb +1361 -105
- data/lib/google/cloud/security_center/v1/security_center/operations.rb +115 -12
- data/lib/google/cloud/security_center/v1/security_center/paths.rb +116 -0
- data/lib/google/cloud/security_center/v1/version.rb +1 -1
- data/lib/google/cloud/securitycenter/v1/asset_pb.rb +2 -2
- data/lib/google/cloud/securitycenter/v1/external_system_pb.rb +29 -0
- data/lib/google/cloud/securitycenter/v1/finding_pb.rb +16 -2
- data/lib/google/cloud/securitycenter/v1/folder_pb.rb +1 -1
- data/lib/google/cloud/securitycenter/v1/indicator_pb.rb +1 -1
- data/lib/google/cloud/securitycenter/v1/mute_config_pb.rb +32 -0
- data/lib/google/cloud/securitycenter/v1/notification_config_pb.rb +2 -2
- data/lib/google/cloud/securitycenter/v1/notification_message_pb.rb +2 -2
- data/lib/google/cloud/securitycenter/v1/organization_settings_pb.rb +2 -2
- data/lib/google/cloud/securitycenter/v1/resource_pb.rb +4 -2
- data/lib/google/cloud/securitycenter/v1/run_asset_discovery_response_pb.rb +2 -2
- data/lib/google/cloud/securitycenter/v1/security_marks_pb.rb +2 -2
- data/lib/google/cloud/securitycenter/v1/securitycenter_service_pb.rb +55 -2
- data/lib/google/cloud/securitycenter/v1/securitycenter_service_services_pb.rb +19 -1
- data/lib/google/cloud/securitycenter/v1/source_pb.rb +2 -2
- data/lib/google/cloud/securitycenter/v1/vulnerability_pb.rb +86 -0
- data/proto_docs/google/cloud/securitycenter/v1/external_system.rb +52 -0
- data/proto_docs/google/cloud/securitycenter/v1/finding.rb +45 -0
- data/proto_docs/google/cloud/securitycenter/v1/mute_config.rb +82 -0
- data/proto_docs/google/cloud/securitycenter/v1/resource.rb +6 -0
- data/proto_docs/google/cloud/securitycenter/v1/securitycenter_service.rb +181 -0
- data/proto_docs/google/cloud/securitycenter/v1/vulnerability.rb +226 -0
- metadata +8 -2
@@ -235,6 +235,127 @@ module Google
|
|
235
235
|
|
236
236
|
# Service calls
|
237
237
|
|
238
|
+
##
|
239
|
+
# Kicks off an LRO to bulk mute findings for a parent based on a filter. The
|
240
|
+
# parent can be either an organization, folder or project. The findings
|
241
|
+
# matched by the filter will be muted after the LRO is done.
|
242
|
+
#
|
243
|
+
# @overload bulk_mute_findings(request, options = nil)
|
244
|
+
# Pass arguments to `bulk_mute_findings` via a request object, either of type
|
245
|
+
# {::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest} or an equivalent Hash.
|
246
|
+
#
|
247
|
+
# @param request [::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest, ::Hash]
|
248
|
+
# A request object representing the call parameters. Required. To specify no
|
249
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
250
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
251
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
252
|
+
#
|
253
|
+
# @overload bulk_mute_findings(parent: nil, filter: nil, mute_annotation: nil)
|
254
|
+
# Pass arguments to `bulk_mute_findings` via keyword arguments. Note that at
|
255
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
256
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
257
|
+
#
|
258
|
+
# @param parent [::String]
|
259
|
+
# Required. The parent, at which bulk action needs to be applied. Its format is
|
260
|
+
# "organizations/[organization_id]", "folders/[folder_id]",
|
261
|
+
# "projects/[project_id]".
|
262
|
+
# @param filter [::String]
|
263
|
+
# Expression that identifies findings that should be updated.
|
264
|
+
# The expression is a list of zero or more restrictions combined
|
265
|
+
# via logical operators `AND` and `OR`. Parentheses are supported, and `OR`
|
266
|
+
# has higher precedence than `AND`.
|
267
|
+
#
|
268
|
+
# Restrictions have the form `<field> <operator> <value>` and may have a
|
269
|
+
# `-` character in front of them to indicate negation. The fields map to
|
270
|
+
# those defined in the corresponding resource.
|
271
|
+
#
|
272
|
+
# The supported operators are:
|
273
|
+
#
|
274
|
+
# * `=` for all value types.
|
275
|
+
# * `>`, `<`, `>=`, `<=` for integer values.
|
276
|
+
# * `:`, meaning substring matching, for strings.
|
277
|
+
#
|
278
|
+
# The supported value types are:
|
279
|
+
#
|
280
|
+
# * string literals in quotes.
|
281
|
+
# * integer literals without quotes.
|
282
|
+
# * boolean literals `true` and `false` without quotes.
|
283
|
+
# @param mute_annotation [::String]
|
284
|
+
# This can be a mute configuration name or any identifier for mute/unmute
|
285
|
+
# of findings based on the filter.
|
286
|
+
#
|
287
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
288
|
+
# @yieldparam response [::Gapic::Operation]
|
289
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
290
|
+
#
|
291
|
+
# @return [::Gapic::Operation]
|
292
|
+
#
|
293
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
294
|
+
#
|
295
|
+
# @example Basic example
|
296
|
+
# require "google/cloud/security_center/v1"
|
297
|
+
#
|
298
|
+
# # Create a client object. The client can be reused for multiple calls.
|
299
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
300
|
+
#
|
301
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
302
|
+
# request = Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest.new
|
303
|
+
#
|
304
|
+
# # Call the bulk_mute_findings method.
|
305
|
+
# result = client.bulk_mute_findings request
|
306
|
+
#
|
307
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
308
|
+
# # object to check the status of an operation, cancel it, or wait
|
309
|
+
# # for results. Here is how to block until completion:
|
310
|
+
# result.wait_until_done! timeout: 60
|
311
|
+
# if result.response?
|
312
|
+
# p result.response
|
313
|
+
# else
|
314
|
+
# puts "Error!"
|
315
|
+
# end
|
316
|
+
#
|
317
|
+
def bulk_mute_findings request, options = nil
|
318
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
319
|
+
|
320
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest
|
321
|
+
|
322
|
+
# Converts hash and nil to an options object
|
323
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
324
|
+
|
325
|
+
# Customize the options with defaults
|
326
|
+
metadata = @config.rpcs.bulk_mute_findings.metadata.to_h
|
327
|
+
|
328
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
329
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
330
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
331
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
332
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
333
|
+
|
334
|
+
header_params = {}
|
335
|
+
if request.parent
|
336
|
+
header_params["parent"] = request.parent
|
337
|
+
end
|
338
|
+
|
339
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
340
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
341
|
+
|
342
|
+
options.apply_defaults timeout: @config.rpcs.bulk_mute_findings.timeout,
|
343
|
+
metadata: metadata,
|
344
|
+
retry_policy: @config.rpcs.bulk_mute_findings.retry_policy
|
345
|
+
|
346
|
+
options.apply_defaults timeout: @config.timeout,
|
347
|
+
metadata: @config.metadata,
|
348
|
+
retry_policy: @config.retry_policy
|
349
|
+
|
350
|
+
@security_center_stub.call_rpc :bulk_mute_findings, request, options: options do |response, operation|
|
351
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
352
|
+
yield response, operation if block_given?
|
353
|
+
return response
|
354
|
+
end
|
355
|
+
rescue ::GRPC::BadStatus => e
|
356
|
+
raise ::Google::Cloud::Error.from_error(e)
|
357
|
+
end
|
358
|
+
|
238
359
|
##
|
239
360
|
# Creates a source.
|
240
361
|
#
|
@@ -268,6 +389,21 @@ module Google
|
|
268
389
|
#
|
269
390
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
270
391
|
#
|
392
|
+
# @example Basic example
|
393
|
+
# require "google/cloud/security_center/v1"
|
394
|
+
#
|
395
|
+
# # Create a client object. The client can be reused for multiple calls.
|
396
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
397
|
+
#
|
398
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
399
|
+
# request = Google::Cloud::SecurityCenter::V1::CreateSourceRequest.new
|
400
|
+
#
|
401
|
+
# # Call the create_source method.
|
402
|
+
# result = client.create_source request
|
403
|
+
#
|
404
|
+
# # The returned object is of type Google::Cloud::SecurityCenter::V1::Source.
|
405
|
+
# p result
|
406
|
+
#
|
271
407
|
def create_source request, options = nil
|
272
408
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
273
409
|
|
@@ -285,9 +421,11 @@ module Google
|
|
285
421
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
286
422
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
287
423
|
|
288
|
-
header_params = {
|
289
|
-
|
290
|
-
|
424
|
+
header_params = {}
|
425
|
+
if request.parent
|
426
|
+
header_params["parent"] = request.parent
|
427
|
+
end
|
428
|
+
|
291
429
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
292
430
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
293
431
|
|
@@ -345,6 +483,21 @@ module Google
|
|
345
483
|
#
|
346
484
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
347
485
|
#
|
486
|
+
# @example Basic example
|
487
|
+
# require "google/cloud/security_center/v1"
|
488
|
+
#
|
489
|
+
# # Create a client object. The client can be reused for multiple calls.
|
490
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
491
|
+
#
|
492
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
493
|
+
# request = Google::Cloud::SecurityCenter::V1::CreateFindingRequest.new
|
494
|
+
#
|
495
|
+
# # Call the create_finding method.
|
496
|
+
# result = client.create_finding request
|
497
|
+
#
|
498
|
+
# # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding.
|
499
|
+
# p result
|
500
|
+
#
|
348
501
|
def create_finding request, options = nil
|
349
502
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
350
503
|
|
@@ -362,9 +515,11 @@ module Google
|
|
362
515
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
363
516
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
364
517
|
|
365
|
-
header_params = {
|
366
|
-
|
367
|
-
|
518
|
+
header_params = {}
|
519
|
+
if request.parent
|
520
|
+
header_params["parent"] = request.parent
|
521
|
+
end
|
522
|
+
|
368
523
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
369
524
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
370
525
|
|
@@ -384,6 +539,100 @@ module Google
|
|
384
539
|
raise ::Google::Cloud::Error.from_error(e)
|
385
540
|
end
|
386
541
|
|
542
|
+
##
|
543
|
+
# Creates a mute config.
|
544
|
+
#
|
545
|
+
# @overload create_mute_config(request, options = nil)
|
546
|
+
# Pass arguments to `create_mute_config` via a request object, either of type
|
547
|
+
# {::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest} or an equivalent Hash.
|
548
|
+
#
|
549
|
+
# @param request [::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest, ::Hash]
|
550
|
+
# A request object representing the call parameters. Required. To specify no
|
551
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
552
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
553
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
554
|
+
#
|
555
|
+
# @overload create_mute_config(parent: nil, mute_config: nil, mute_config_id: nil)
|
556
|
+
# Pass arguments to `create_mute_config` via keyword arguments. Note that at
|
557
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
558
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
559
|
+
#
|
560
|
+
# @param parent [::String]
|
561
|
+
# Required. Resource name of the new mute configs's parent. Its format is
|
562
|
+
# "organizations/[organization_id]", "folders/[folder_id]", or
|
563
|
+
# "projects/[project_id]".
|
564
|
+
# @param mute_config [::Google::Cloud::SecurityCenter::V1::MuteConfig, ::Hash]
|
565
|
+
# Required. The mute config being created.
|
566
|
+
# @param mute_config_id [::String]
|
567
|
+
# Required. Unique identifier provided by the client within the parent scope.
|
568
|
+
# It must consist of lower case letters, numbers, and hyphen, with the first
|
569
|
+
# character a letter, the last a letter or a number, and a 63 character
|
570
|
+
# maximum.
|
571
|
+
#
|
572
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
573
|
+
# @yieldparam response [::Google::Cloud::SecurityCenter::V1::MuteConfig]
|
574
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
575
|
+
#
|
576
|
+
# @return [::Google::Cloud::SecurityCenter::V1::MuteConfig]
|
577
|
+
#
|
578
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
579
|
+
#
|
580
|
+
# @example Basic example
|
581
|
+
# require "google/cloud/security_center/v1"
|
582
|
+
#
|
583
|
+
# # Create a client object. The client can be reused for multiple calls.
|
584
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
585
|
+
#
|
586
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
587
|
+
# request = Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest.new
|
588
|
+
#
|
589
|
+
# # Call the create_mute_config method.
|
590
|
+
# result = client.create_mute_config request
|
591
|
+
#
|
592
|
+
# # The returned object is of type Google::Cloud::SecurityCenter::V1::MuteConfig.
|
593
|
+
# p result
|
594
|
+
#
|
595
|
+
def create_mute_config request, options = nil
|
596
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
597
|
+
|
598
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest
|
599
|
+
|
600
|
+
# Converts hash and nil to an options object
|
601
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
602
|
+
|
603
|
+
# Customize the options with defaults
|
604
|
+
metadata = @config.rpcs.create_mute_config.metadata.to_h
|
605
|
+
|
606
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
607
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
608
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
609
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
610
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
611
|
+
|
612
|
+
header_params = {}
|
613
|
+
if request.parent
|
614
|
+
header_params["parent"] = request.parent
|
615
|
+
end
|
616
|
+
|
617
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
618
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
619
|
+
|
620
|
+
options.apply_defaults timeout: @config.rpcs.create_mute_config.timeout,
|
621
|
+
metadata: metadata,
|
622
|
+
retry_policy: @config.rpcs.create_mute_config.retry_policy
|
623
|
+
|
624
|
+
options.apply_defaults timeout: @config.timeout,
|
625
|
+
metadata: @config.metadata,
|
626
|
+
retry_policy: @config.retry_policy
|
627
|
+
|
628
|
+
@security_center_stub.call_rpc :create_mute_config, request, options: options do |response, operation|
|
629
|
+
yield response, operation if block_given?
|
630
|
+
return response
|
631
|
+
end
|
632
|
+
rescue ::GRPC::BadStatus => e
|
633
|
+
raise ::Google::Cloud::Error.from_error(e)
|
634
|
+
end
|
635
|
+
|
387
636
|
##
|
388
637
|
# Creates a notification config.
|
389
638
|
#
|
@@ -422,6 +671,21 @@ module Google
|
|
422
671
|
#
|
423
672
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
424
673
|
#
|
674
|
+
# @example Basic example
|
675
|
+
# require "google/cloud/security_center/v1"
|
676
|
+
#
|
677
|
+
# # Create a client object. The client can be reused for multiple calls.
|
678
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
679
|
+
#
|
680
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
681
|
+
# request = Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest.new
|
682
|
+
#
|
683
|
+
# # Call the create_notification_config method.
|
684
|
+
# result = client.create_notification_config request
|
685
|
+
#
|
686
|
+
# # The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig.
|
687
|
+
# p result
|
688
|
+
#
|
425
689
|
def create_notification_config request, options = nil
|
426
690
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
427
691
|
|
@@ -439,9 +703,11 @@ module Google
|
|
439
703
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
440
704
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
441
705
|
|
442
|
-
header_params = {
|
443
|
-
|
444
|
-
|
706
|
+
header_params = {}
|
707
|
+
if request.parent
|
708
|
+
header_params["parent"] = request.parent
|
709
|
+
end
|
710
|
+
|
445
711
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
446
712
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
447
713
|
|
@@ -461,6 +727,94 @@ module Google
|
|
461
727
|
raise ::Google::Cloud::Error.from_error(e)
|
462
728
|
end
|
463
729
|
|
730
|
+
##
|
731
|
+
# Deletes an existing mute config.
|
732
|
+
#
|
733
|
+
# @overload delete_mute_config(request, options = nil)
|
734
|
+
# Pass arguments to `delete_mute_config` via a request object, either of type
|
735
|
+
# {::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest} or an equivalent Hash.
|
736
|
+
#
|
737
|
+
# @param request [::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest, ::Hash]
|
738
|
+
# A request object representing the call parameters. Required. To specify no
|
739
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
740
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
741
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
742
|
+
#
|
743
|
+
# @overload delete_mute_config(name: nil)
|
744
|
+
# Pass arguments to `delete_mute_config` via keyword arguments. Note that at
|
745
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
746
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
747
|
+
#
|
748
|
+
# @param name [::String]
|
749
|
+
# Required. Name of the mute config to delete. Its format is
|
750
|
+
# organizations/\\{organization}/muteConfigs/\\{config_id},
|
751
|
+
# folders/\\{folder}/muteConfigs/\\{config_id}, or
|
752
|
+
# projects/\\{project}/muteConfigs/\\{config_id}
|
753
|
+
#
|
754
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
755
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
756
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
757
|
+
#
|
758
|
+
# @return [::Google::Protobuf::Empty]
|
759
|
+
#
|
760
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
761
|
+
#
|
762
|
+
# @example Basic example
|
763
|
+
# require "google/cloud/security_center/v1"
|
764
|
+
#
|
765
|
+
# # Create a client object. The client can be reused for multiple calls.
|
766
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
767
|
+
#
|
768
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
769
|
+
# request = Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest.new
|
770
|
+
#
|
771
|
+
# # Call the delete_mute_config method.
|
772
|
+
# result = client.delete_mute_config request
|
773
|
+
#
|
774
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
775
|
+
# p result
|
776
|
+
#
|
777
|
+
def delete_mute_config request, options = nil
|
778
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
779
|
+
|
780
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest
|
781
|
+
|
782
|
+
# Converts hash and nil to an options object
|
783
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
784
|
+
|
785
|
+
# Customize the options with defaults
|
786
|
+
metadata = @config.rpcs.delete_mute_config.metadata.to_h
|
787
|
+
|
788
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
789
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
790
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
791
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
792
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
793
|
+
|
794
|
+
header_params = {}
|
795
|
+
if request.name
|
796
|
+
header_params["name"] = request.name
|
797
|
+
end
|
798
|
+
|
799
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
800
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
801
|
+
|
802
|
+
options.apply_defaults timeout: @config.rpcs.delete_mute_config.timeout,
|
803
|
+
metadata: metadata,
|
804
|
+
retry_policy: @config.rpcs.delete_mute_config.retry_policy
|
805
|
+
|
806
|
+
options.apply_defaults timeout: @config.timeout,
|
807
|
+
metadata: @config.metadata,
|
808
|
+
retry_policy: @config.retry_policy
|
809
|
+
|
810
|
+
@security_center_stub.call_rpc :delete_mute_config, request, options: options do |response, operation|
|
811
|
+
yield response, operation if block_given?
|
812
|
+
return response
|
813
|
+
end
|
814
|
+
rescue ::GRPC::BadStatus => e
|
815
|
+
raise ::Google::Cloud::Error.from_error(e)
|
816
|
+
end
|
817
|
+
|
464
818
|
##
|
465
819
|
# Deletes a notification config.
|
466
820
|
#
|
@@ -491,6 +845,21 @@ module Google
|
|
491
845
|
#
|
492
846
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
493
847
|
#
|
848
|
+
# @example Basic example
|
849
|
+
# require "google/cloud/security_center/v1"
|
850
|
+
#
|
851
|
+
# # Create a client object. The client can be reused for multiple calls.
|
852
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
853
|
+
#
|
854
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
855
|
+
# request = Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest.new
|
856
|
+
#
|
857
|
+
# # Call the delete_notification_config method.
|
858
|
+
# result = client.delete_notification_config request
|
859
|
+
#
|
860
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
861
|
+
# p result
|
862
|
+
#
|
494
863
|
def delete_notification_config request, options = nil
|
495
864
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
496
865
|
|
@@ -508,9 +877,11 @@ module Google
|
|
508
877
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
509
878
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
510
879
|
|
511
|
-
header_params = {
|
512
|
-
|
513
|
-
|
880
|
+
header_params = {}
|
881
|
+
if request.name
|
882
|
+
header_params["name"] = request.name
|
883
|
+
end
|
884
|
+
|
514
885
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
515
886
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
516
887
|
|
@@ -563,6 +934,21 @@ module Google
|
|
563
934
|
#
|
564
935
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
565
936
|
#
|
937
|
+
# @example Basic example
|
938
|
+
# require "google/cloud/security_center/v1"
|
939
|
+
#
|
940
|
+
# # Create a client object. The client can be reused for multiple calls.
|
941
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
942
|
+
#
|
943
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
944
|
+
# request = Google::Iam::V1::GetIamPolicyRequest.new
|
945
|
+
#
|
946
|
+
# # Call the get_iam_policy method.
|
947
|
+
# result = client.get_iam_policy request
|
948
|
+
#
|
949
|
+
# # The returned object is of type Google::Iam::V1::Policy.
|
950
|
+
# p result
|
951
|
+
#
|
566
952
|
def get_iam_policy request, options = nil
|
567
953
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
568
954
|
|
@@ -580,9 +966,11 @@ module Google
|
|
580
966
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
581
967
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
582
968
|
|
583
|
-
header_params = {
|
584
|
-
|
585
|
-
|
969
|
+
header_params = {}
|
970
|
+
if request.resource
|
971
|
+
header_params["resource"] = request.resource
|
972
|
+
end
|
973
|
+
|
586
974
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
587
975
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
588
976
|
|
@@ -602,6 +990,94 @@ module Google
|
|
602
990
|
raise ::Google::Cloud::Error.from_error(e)
|
603
991
|
end
|
604
992
|
|
993
|
+
##
|
994
|
+
# Gets a mute config.
|
995
|
+
#
|
996
|
+
# @overload get_mute_config(request, options = nil)
|
997
|
+
# Pass arguments to `get_mute_config` via a request object, either of type
|
998
|
+
# {::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest} or an equivalent Hash.
|
999
|
+
#
|
1000
|
+
# @param request [::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest, ::Hash]
|
1001
|
+
# A request object representing the call parameters. Required. To specify no
|
1002
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1003
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1004
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1005
|
+
#
|
1006
|
+
# @overload get_mute_config(name: nil)
|
1007
|
+
# Pass arguments to `get_mute_config` via keyword arguments. Note that at
|
1008
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1009
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1010
|
+
#
|
1011
|
+
# @param name [::String]
|
1012
|
+
# Required. Name of the mute config to retrieve. Its format is
|
1013
|
+
# organizations/\\{organization}/muteConfigs/\\{config_id},
|
1014
|
+
# folders/\\{folder}/muteConfigs/\\{config_id}, or
|
1015
|
+
# projects/\\{project}/muteConfigs/\\{config_id}
|
1016
|
+
#
|
1017
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1018
|
+
# @yieldparam response [::Google::Cloud::SecurityCenter::V1::MuteConfig]
|
1019
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1020
|
+
#
|
1021
|
+
# @return [::Google::Cloud::SecurityCenter::V1::MuteConfig]
|
1022
|
+
#
|
1023
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1024
|
+
#
|
1025
|
+
# @example Basic example
|
1026
|
+
# require "google/cloud/security_center/v1"
|
1027
|
+
#
|
1028
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1029
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
1030
|
+
#
|
1031
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1032
|
+
# request = Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest.new
|
1033
|
+
#
|
1034
|
+
# # Call the get_mute_config method.
|
1035
|
+
# result = client.get_mute_config request
|
1036
|
+
#
|
1037
|
+
# # The returned object is of type Google::Cloud::SecurityCenter::V1::MuteConfig.
|
1038
|
+
# p result
|
1039
|
+
#
|
1040
|
+
def get_mute_config request, options = nil
|
1041
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1042
|
+
|
1043
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest
|
1044
|
+
|
1045
|
+
# Converts hash and nil to an options object
|
1046
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1047
|
+
|
1048
|
+
# Customize the options with defaults
|
1049
|
+
metadata = @config.rpcs.get_mute_config.metadata.to_h
|
1050
|
+
|
1051
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1052
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1053
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1054
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
1055
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1056
|
+
|
1057
|
+
header_params = {}
|
1058
|
+
if request.name
|
1059
|
+
header_params["name"] = request.name
|
1060
|
+
end
|
1061
|
+
|
1062
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1063
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1064
|
+
|
1065
|
+
options.apply_defaults timeout: @config.rpcs.get_mute_config.timeout,
|
1066
|
+
metadata: metadata,
|
1067
|
+
retry_policy: @config.rpcs.get_mute_config.retry_policy
|
1068
|
+
|
1069
|
+
options.apply_defaults timeout: @config.timeout,
|
1070
|
+
metadata: @config.metadata,
|
1071
|
+
retry_policy: @config.retry_policy
|
1072
|
+
|
1073
|
+
@security_center_stub.call_rpc :get_mute_config, request, options: options do |response, operation|
|
1074
|
+
yield response, operation if block_given?
|
1075
|
+
return response
|
1076
|
+
end
|
1077
|
+
rescue ::GRPC::BadStatus => e
|
1078
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1079
|
+
end
|
1080
|
+
|
605
1081
|
##
|
606
1082
|
# Gets a notification config.
|
607
1083
|
#
|
@@ -632,6 +1108,21 @@ module Google
|
|
632
1108
|
#
|
633
1109
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
634
1110
|
#
|
1111
|
+
# @example Basic example
|
1112
|
+
# require "google/cloud/security_center/v1"
|
1113
|
+
#
|
1114
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1115
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
1116
|
+
#
|
1117
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1118
|
+
# request = Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest.new
|
1119
|
+
#
|
1120
|
+
# # Call the get_notification_config method.
|
1121
|
+
# result = client.get_notification_config request
|
1122
|
+
#
|
1123
|
+
# # The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig.
|
1124
|
+
# p result
|
1125
|
+
#
|
635
1126
|
def get_notification_config request, options = nil
|
636
1127
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
637
1128
|
|
@@ -649,9 +1140,11 @@ module Google
|
|
649
1140
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
650
1141
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
651
1142
|
|
652
|
-
header_params = {
|
653
|
-
|
654
|
-
|
1143
|
+
header_params = {}
|
1144
|
+
if request.name
|
1145
|
+
header_params["name"] = request.name
|
1146
|
+
end
|
1147
|
+
|
655
1148
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
656
1149
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
657
1150
|
|
@@ -701,6 +1194,21 @@ module Google
|
|
701
1194
|
#
|
702
1195
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
703
1196
|
#
|
1197
|
+
# @example Basic example
|
1198
|
+
# require "google/cloud/security_center/v1"
|
1199
|
+
#
|
1200
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1201
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
1202
|
+
#
|
1203
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1204
|
+
# request = Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest.new
|
1205
|
+
#
|
1206
|
+
# # Call the get_organization_settings method.
|
1207
|
+
# result = client.get_organization_settings request
|
1208
|
+
#
|
1209
|
+
# # The returned object is of type Google::Cloud::SecurityCenter::V1::OrganizationSettings.
|
1210
|
+
# p result
|
1211
|
+
#
|
704
1212
|
def get_organization_settings request, options = nil
|
705
1213
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
706
1214
|
|
@@ -718,9 +1226,11 @@ module Google
|
|
718
1226
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
719
1227
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
720
1228
|
|
721
|
-
header_params = {
|
722
|
-
|
723
|
-
|
1229
|
+
header_params = {}
|
1230
|
+
if request.name
|
1231
|
+
header_params["name"] = request.name
|
1232
|
+
end
|
1233
|
+
|
724
1234
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
725
1235
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
726
1236
|
|
@@ -770,6 +1280,21 @@ module Google
|
|
770
1280
|
#
|
771
1281
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
772
1282
|
#
|
1283
|
+
# @example Basic example
|
1284
|
+
# require "google/cloud/security_center/v1"
|
1285
|
+
#
|
1286
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1287
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
1288
|
+
#
|
1289
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1290
|
+
# request = Google::Cloud::SecurityCenter::V1::GetSourceRequest.new
|
1291
|
+
#
|
1292
|
+
# # Call the get_source method.
|
1293
|
+
# result = client.get_source request
|
1294
|
+
#
|
1295
|
+
# # The returned object is of type Google::Cloud::SecurityCenter::V1::Source.
|
1296
|
+
# p result
|
1297
|
+
#
|
773
1298
|
def get_source request, options = nil
|
774
1299
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
775
1300
|
|
@@ -787,9 +1312,11 @@ module Google
|
|
787
1312
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
788
1313
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
789
1314
|
|
790
|
-
header_params = {
|
791
|
-
|
792
|
-
|
1315
|
+
header_params = {}
|
1316
|
+
if request.name
|
1317
|
+
header_params["name"] = request.name
|
1318
|
+
end
|
1319
|
+
|
793
1320
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
794
1321
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
795
1322
|
|
@@ -963,6 +1490,27 @@ module Google
|
|
963
1490
|
#
|
964
1491
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
965
1492
|
#
|
1493
|
+
# @example Basic example
|
1494
|
+
# require "google/cloud/security_center/v1"
|
1495
|
+
#
|
1496
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1497
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
1498
|
+
#
|
1499
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1500
|
+
# request = Google::Cloud::SecurityCenter::V1::GroupAssetsRequest.new
|
1501
|
+
#
|
1502
|
+
# # Call the group_assets method.
|
1503
|
+
# result = client.group_assets request
|
1504
|
+
#
|
1505
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
1506
|
+
# # iterate over all elements by calling #each, and the enumerable
|
1507
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
1508
|
+
# # methods are also available for managing paging directly.
|
1509
|
+
# result.each do |response|
|
1510
|
+
# # Each element is of type ::Google::Cloud::SecurityCenter::V1::GroupResult.
|
1511
|
+
# p response
|
1512
|
+
# end
|
1513
|
+
#
|
966
1514
|
def group_assets request, options = nil
|
967
1515
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
968
1516
|
|
@@ -980,9 +1528,11 @@ module Google
|
|
980
1528
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
981
1529
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
982
1530
|
|
983
|
-
header_params = {
|
984
|
-
|
985
|
-
|
1531
|
+
header_params = {}
|
1532
|
+
if request.parent
|
1533
|
+
header_params["parent"] = request.parent
|
1534
|
+
end
|
1535
|
+
|
986
1536
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
987
1537
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
988
1538
|
|
@@ -1165,6 +1715,27 @@ module Google
|
|
1165
1715
|
#
|
1166
1716
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1167
1717
|
#
|
1718
|
+
# @example Basic example
|
1719
|
+
# require "google/cloud/security_center/v1"
|
1720
|
+
#
|
1721
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1722
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
1723
|
+
#
|
1724
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1725
|
+
# request = Google::Cloud::SecurityCenter::V1::GroupFindingsRequest.new
|
1726
|
+
#
|
1727
|
+
# # Call the group_findings method.
|
1728
|
+
# result = client.group_findings request
|
1729
|
+
#
|
1730
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
1731
|
+
# # iterate over all elements by calling #each, and the enumerable
|
1732
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
1733
|
+
# # methods are also available for managing paging directly.
|
1734
|
+
# result.each do |response|
|
1735
|
+
# # Each element is of type ::Google::Cloud::SecurityCenter::V1::GroupResult.
|
1736
|
+
# p response
|
1737
|
+
# end
|
1738
|
+
#
|
1168
1739
|
def group_findings request, options = nil
|
1169
1740
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1170
1741
|
|
@@ -1182,9 +1753,11 @@ module Google
|
|
1182
1753
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
1183
1754
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1184
1755
|
|
1185
|
-
header_params = {
|
1186
|
-
|
1187
|
-
|
1756
|
+
header_params = {}
|
1757
|
+
if request.parent
|
1758
|
+
header_params["parent"] = request.parent
|
1759
|
+
end
|
1760
|
+
|
1188
1761
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1189
1762
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1190
1763
|
|
@@ -1362,6 +1935,27 @@ module Google
|
|
1362
1935
|
#
|
1363
1936
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1364
1937
|
#
|
1938
|
+
# @example Basic example
|
1939
|
+
# require "google/cloud/security_center/v1"
|
1940
|
+
#
|
1941
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1942
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
1943
|
+
#
|
1944
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1945
|
+
# request = Google::Cloud::SecurityCenter::V1::ListAssetsRequest.new
|
1946
|
+
#
|
1947
|
+
# # Call the list_assets method.
|
1948
|
+
# result = client.list_assets request
|
1949
|
+
#
|
1950
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
1951
|
+
# # iterate over all elements by calling #each, and the enumerable
|
1952
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
1953
|
+
# # methods are also available for managing paging directly.
|
1954
|
+
# result.each do |response|
|
1955
|
+
# # Each element is of type ::Google::Cloud::SecurityCenter::V1::ListAssetsResponse::ListAssetsResult.
|
1956
|
+
# p response
|
1957
|
+
# end
|
1958
|
+
#
|
1365
1959
|
def list_assets request, options = nil
|
1366
1960
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1367
1961
|
|
@@ -1379,9 +1973,11 @@ module Google
|
|
1379
1973
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
1380
1974
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1381
1975
|
|
1382
|
-
header_params = {
|
1383
|
-
|
1384
|
-
|
1976
|
+
header_params = {}
|
1977
|
+
if request.parent
|
1978
|
+
header_params["parent"] = request.parent
|
1979
|
+
end
|
1980
|
+
|
1385
1981
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1386
1982
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1387
1983
|
|
@@ -1492,6 +2088,7 @@ module Google
|
|
1492
2088
|
# * resource.project_display_name: `=`, `:`
|
1493
2089
|
# * resource.type: `=`, `:`
|
1494
2090
|
# * resource.folders.resource_folder: `=`, `:`
|
2091
|
+
# * resource.display_name: `=`, `:`
|
1495
2092
|
# @param order_by [::String]
|
1496
2093
|
# Expression that defines what fields and order to use for sorting. The
|
1497
2094
|
# string value should follow SQL syntax: comma separated list of fields. For
|
@@ -1566,6 +2163,27 @@ module Google
|
|
1566
2163
|
#
|
1567
2164
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1568
2165
|
#
|
2166
|
+
# @example Basic example
|
2167
|
+
# require "google/cloud/security_center/v1"
|
2168
|
+
#
|
2169
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2170
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
2171
|
+
#
|
2172
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2173
|
+
# request = Google::Cloud::SecurityCenter::V1::ListFindingsRequest.new
|
2174
|
+
#
|
2175
|
+
# # Call the list_findings method.
|
2176
|
+
# result = client.list_findings request
|
2177
|
+
#
|
2178
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
2179
|
+
# # iterate over all elements by calling #each, and the enumerable
|
2180
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
2181
|
+
# # methods are also available for managing paging directly.
|
2182
|
+
# result.each do |response|
|
2183
|
+
# # Each element is of type ::Google::Cloud::SecurityCenter::V1::ListFindingsResponse::ListFindingsResult.
|
2184
|
+
# p response
|
2185
|
+
# end
|
2186
|
+
#
|
1569
2187
|
def list_findings request, options = nil
|
1570
2188
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1571
2189
|
|
@@ -1583,9 +2201,11 @@ module Google
|
|
1583
2201
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
1584
2202
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1585
2203
|
|
1586
|
-
header_params = {
|
1587
|
-
|
1588
|
-
|
2204
|
+
header_params = {}
|
2205
|
+
if request.parent
|
2206
|
+
header_params["parent"] = request.parent
|
2207
|
+
end
|
2208
|
+
|
1589
2209
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1590
2210
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1591
2211
|
|
@@ -1606,6 +2226,111 @@ module Google
|
|
1606
2226
|
raise ::Google::Cloud::Error.from_error(e)
|
1607
2227
|
end
|
1608
2228
|
|
2229
|
+
##
|
2230
|
+
# Lists mute configs.
|
2231
|
+
#
|
2232
|
+
# @overload list_mute_configs(request, options = nil)
|
2233
|
+
# Pass arguments to `list_mute_configs` via a request object, either of type
|
2234
|
+
# {::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest} or an equivalent Hash.
|
2235
|
+
#
|
2236
|
+
# @param request [::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest, ::Hash]
|
2237
|
+
# A request object representing the call parameters. Required. To specify no
|
2238
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2239
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2240
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2241
|
+
#
|
2242
|
+
# @overload list_mute_configs(parent: nil, page_size: nil, page_token: nil)
|
2243
|
+
# Pass arguments to `list_mute_configs` via keyword arguments. Note that at
|
2244
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2245
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2246
|
+
#
|
2247
|
+
# @param parent [::String]
|
2248
|
+
# Required. The parent, which owns the collection of mute configs. Its format is
|
2249
|
+
# "organizations/[organization_id]", "folders/[folder_id]",
|
2250
|
+
# "projects/[project_id]".
|
2251
|
+
# @param page_size [::Integer]
|
2252
|
+
# The maximum number of configs to return. The service may return fewer than
|
2253
|
+
# this value.
|
2254
|
+
# If unspecified, at most 10 configs will be returned.
|
2255
|
+
# The maximum value is 1000; values above 1000 will be coerced to 1000.
|
2256
|
+
# @param page_token [::String]
|
2257
|
+
# A page token, received from a previous `ListMuteConfigs` call.
|
2258
|
+
# Provide this to retrieve the subsequent page.
|
2259
|
+
#
|
2260
|
+
# When paginating, all other parameters provided to `ListMuteConfigs` must
|
2261
|
+
# match the call that provided the page token.
|
2262
|
+
#
|
2263
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2264
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::MuteConfig>]
|
2265
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2266
|
+
#
|
2267
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::MuteConfig>]
|
2268
|
+
#
|
2269
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2270
|
+
#
|
2271
|
+
# @example Basic example
|
2272
|
+
# require "google/cloud/security_center/v1"
|
2273
|
+
#
|
2274
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2275
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
2276
|
+
#
|
2277
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2278
|
+
# request = Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest.new
|
2279
|
+
#
|
2280
|
+
# # Call the list_mute_configs method.
|
2281
|
+
# result = client.list_mute_configs request
|
2282
|
+
#
|
2283
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
2284
|
+
# # iterate over all elements by calling #each, and the enumerable
|
2285
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
2286
|
+
# # methods are also available for managing paging directly.
|
2287
|
+
# result.each do |response|
|
2288
|
+
# # Each element is of type ::Google::Cloud::SecurityCenter::V1::MuteConfig.
|
2289
|
+
# p response
|
2290
|
+
# end
|
2291
|
+
#
|
2292
|
+
def list_mute_configs request, options = nil
|
2293
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2294
|
+
|
2295
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest
|
2296
|
+
|
2297
|
+
# Converts hash and nil to an options object
|
2298
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2299
|
+
|
2300
|
+
# Customize the options with defaults
|
2301
|
+
metadata = @config.rpcs.list_mute_configs.metadata.to_h
|
2302
|
+
|
2303
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2304
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2305
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2306
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
2307
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2308
|
+
|
2309
|
+
header_params = {}
|
2310
|
+
if request.parent
|
2311
|
+
header_params["parent"] = request.parent
|
2312
|
+
end
|
2313
|
+
|
2314
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2315
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2316
|
+
|
2317
|
+
options.apply_defaults timeout: @config.rpcs.list_mute_configs.timeout,
|
2318
|
+
metadata: metadata,
|
2319
|
+
retry_policy: @config.rpcs.list_mute_configs.retry_policy
|
2320
|
+
|
2321
|
+
options.apply_defaults timeout: @config.timeout,
|
2322
|
+
metadata: @config.metadata,
|
2323
|
+
retry_policy: @config.retry_policy
|
2324
|
+
|
2325
|
+
@security_center_stub.call_rpc :list_mute_configs, request, options: options do |response, operation|
|
2326
|
+
response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_mute_configs, request, response, operation, options
|
2327
|
+
yield response, operation if block_given?
|
2328
|
+
return response
|
2329
|
+
end
|
2330
|
+
rescue ::GRPC::BadStatus => e
|
2331
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2332
|
+
end
|
2333
|
+
|
1609
2334
|
##
|
1610
2335
|
# Lists notification configs.
|
1611
2336
|
#
|
@@ -1643,6 +2368,27 @@ module Google
|
|
1643
2368
|
#
|
1644
2369
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1645
2370
|
#
|
2371
|
+
# @example Basic example
|
2372
|
+
# require "google/cloud/security_center/v1"
|
2373
|
+
#
|
2374
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2375
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
2376
|
+
#
|
2377
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2378
|
+
# request = Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest.new
|
2379
|
+
#
|
2380
|
+
# # Call the list_notification_configs method.
|
2381
|
+
# result = client.list_notification_configs request
|
2382
|
+
#
|
2383
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
2384
|
+
# # iterate over all elements by calling #each, and the enumerable
|
2385
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
2386
|
+
# # methods are also available for managing paging directly.
|
2387
|
+
# result.each do |response|
|
2388
|
+
# # Each element is of type ::Google::Cloud::SecurityCenter::V1::NotificationConfig.
|
2389
|
+
# p response
|
2390
|
+
# end
|
2391
|
+
#
|
1646
2392
|
def list_notification_configs request, options = nil
|
1647
2393
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1648
2394
|
|
@@ -1660,9 +2406,11 @@ module Google
|
|
1660
2406
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
1661
2407
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1662
2408
|
|
1663
|
-
header_params = {
|
1664
|
-
|
1665
|
-
|
2409
|
+
header_params = {}
|
2410
|
+
if request.parent
|
2411
|
+
header_params["parent"] = request.parent
|
2412
|
+
end
|
2413
|
+
|
1666
2414
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1667
2415
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1668
2416
|
|
@@ -1721,6 +2469,27 @@ module Google
|
|
1721
2469
|
#
|
1722
2470
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1723
2471
|
#
|
2472
|
+
# @example Basic example
|
2473
|
+
# require "google/cloud/security_center/v1"
|
2474
|
+
#
|
2475
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2476
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
2477
|
+
#
|
2478
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2479
|
+
# request = Google::Cloud::SecurityCenter::V1::ListSourcesRequest.new
|
2480
|
+
#
|
2481
|
+
# # Call the list_sources method.
|
2482
|
+
# result = client.list_sources request
|
2483
|
+
#
|
2484
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
2485
|
+
# # iterate over all elements by calling #each, and the enumerable
|
2486
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
2487
|
+
# # methods are also available for managing paging directly.
|
2488
|
+
# result.each do |response|
|
2489
|
+
# # Each element is of type ::Google::Cloud::SecurityCenter::V1::Source.
|
2490
|
+
# p response
|
2491
|
+
# end
|
2492
|
+
#
|
1724
2493
|
def list_sources request, options = nil
|
1725
2494
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1726
2495
|
|
@@ -1738,9 +2507,11 @@ module Google
|
|
1738
2507
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
1739
2508
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1740
2509
|
|
1741
|
-
header_params = {
|
1742
|
-
|
1743
|
-
|
2510
|
+
header_params = {}
|
2511
|
+
if request.parent
|
2512
|
+
header_params["parent"] = request.parent
|
2513
|
+
end
|
2514
|
+
|
1744
2515
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1745
2516
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1746
2517
|
|
@@ -1773,39 +2544,154 @@ module Google
|
|
1773
2544
|
# Pass arguments to `run_asset_discovery` via a request object, either of type
|
1774
2545
|
# {::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest} or an equivalent Hash.
|
1775
2546
|
#
|
1776
|
-
# @param request [::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest, ::Hash]
|
2547
|
+
# @param request [::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest, ::Hash]
|
2548
|
+
# A request object representing the call parameters. Required. To specify no
|
2549
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2550
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2551
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2552
|
+
#
|
2553
|
+
# @overload run_asset_discovery(parent: nil)
|
2554
|
+
# Pass arguments to `run_asset_discovery` via keyword arguments. Note that at
|
2555
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2556
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2557
|
+
#
|
2558
|
+
# @param parent [::String]
|
2559
|
+
# Required. Name of the organization to run asset discovery for. Its format is
|
2560
|
+
# "organizations/[organization_id]".
|
2561
|
+
#
|
2562
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2563
|
+
# @yieldparam response [::Gapic::Operation]
|
2564
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2565
|
+
#
|
2566
|
+
# @return [::Gapic::Operation]
|
2567
|
+
#
|
2568
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2569
|
+
#
|
2570
|
+
# @example Basic example
|
2571
|
+
# require "google/cloud/security_center/v1"
|
2572
|
+
#
|
2573
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2574
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
2575
|
+
#
|
2576
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2577
|
+
# request = Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest.new
|
2578
|
+
#
|
2579
|
+
# # Call the run_asset_discovery method.
|
2580
|
+
# result = client.run_asset_discovery request
|
2581
|
+
#
|
2582
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
2583
|
+
# # object to check the status of an operation, cancel it, or wait
|
2584
|
+
# # for results. Here is how to block until completion:
|
2585
|
+
# result.wait_until_done! timeout: 60
|
2586
|
+
# if result.response?
|
2587
|
+
# p result.response
|
2588
|
+
# else
|
2589
|
+
# puts "Error!"
|
2590
|
+
# end
|
2591
|
+
#
|
2592
|
+
def run_asset_discovery request, options = nil
|
2593
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2594
|
+
|
2595
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest
|
2596
|
+
|
2597
|
+
# Converts hash and nil to an options object
|
2598
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2599
|
+
|
2600
|
+
# Customize the options with defaults
|
2601
|
+
metadata = @config.rpcs.run_asset_discovery.metadata.to_h
|
2602
|
+
|
2603
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2604
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2605
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2606
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
2607
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2608
|
+
|
2609
|
+
header_params = {}
|
2610
|
+
if request.parent
|
2611
|
+
header_params["parent"] = request.parent
|
2612
|
+
end
|
2613
|
+
|
2614
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2615
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2616
|
+
|
2617
|
+
options.apply_defaults timeout: @config.rpcs.run_asset_discovery.timeout,
|
2618
|
+
metadata: metadata,
|
2619
|
+
retry_policy: @config.rpcs.run_asset_discovery.retry_policy
|
2620
|
+
|
2621
|
+
options.apply_defaults timeout: @config.timeout,
|
2622
|
+
metadata: @config.metadata,
|
2623
|
+
retry_policy: @config.retry_policy
|
2624
|
+
|
2625
|
+
@security_center_stub.call_rpc :run_asset_discovery, request, options: options do |response, operation|
|
2626
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
2627
|
+
yield response, operation if block_given?
|
2628
|
+
return response
|
2629
|
+
end
|
2630
|
+
rescue ::GRPC::BadStatus => e
|
2631
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2632
|
+
end
|
2633
|
+
|
2634
|
+
##
|
2635
|
+
# Updates the state of a finding.
|
2636
|
+
#
|
2637
|
+
# @overload set_finding_state(request, options = nil)
|
2638
|
+
# Pass arguments to `set_finding_state` via a request object, either of type
|
2639
|
+
# {::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest} or an equivalent Hash.
|
2640
|
+
#
|
2641
|
+
# @param request [::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest, ::Hash]
|
1777
2642
|
# A request object representing the call parameters. Required. To specify no
|
1778
2643
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1779
2644
|
# @param options [::Gapic::CallOptions, ::Hash]
|
1780
2645
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1781
2646
|
#
|
1782
|
-
# @overload
|
1783
|
-
# Pass arguments to `
|
2647
|
+
# @overload set_finding_state(name: nil, state: nil, start_time: nil)
|
2648
|
+
# Pass arguments to `set_finding_state` via keyword arguments. Note that at
|
1784
2649
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
1785
2650
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
1786
2651
|
#
|
1787
|
-
# @param
|
1788
|
-
# Required.
|
1789
|
-
#
|
2652
|
+
# @param name [::String]
|
2653
|
+
# Required. The relative resource name of the finding. See:
|
2654
|
+
# https://cloud.google.com/apis/design/resource_names#relative_resource_name
|
2655
|
+
# Example:
|
2656
|
+
# "organizations/\\{organization_id}/sources/\\{source_id}/finding/\\{finding_id}".
|
2657
|
+
# @param state [::Google::Cloud::SecurityCenter::V1::Finding::State]
|
2658
|
+
# Required. The desired State of the finding.
|
2659
|
+
# @param start_time [::Google::Protobuf::Timestamp, ::Hash]
|
2660
|
+
# Required. The time at which the updated state takes effect.
|
1790
2661
|
#
|
1791
2662
|
# @yield [response, operation] Access the result along with the RPC operation
|
1792
|
-
# @yieldparam response [::
|
2663
|
+
# @yieldparam response [::Google::Cloud::SecurityCenter::V1::Finding]
|
1793
2664
|
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1794
2665
|
#
|
1795
|
-
# @return [::
|
2666
|
+
# @return [::Google::Cloud::SecurityCenter::V1::Finding]
|
1796
2667
|
#
|
1797
2668
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1798
2669
|
#
|
1799
|
-
|
2670
|
+
# @example Basic example
|
2671
|
+
# require "google/cloud/security_center/v1"
|
2672
|
+
#
|
2673
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2674
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
2675
|
+
#
|
2676
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2677
|
+
# request = Google::Cloud::SecurityCenter::V1::SetFindingStateRequest.new
|
2678
|
+
#
|
2679
|
+
# # Call the set_finding_state method.
|
2680
|
+
# result = client.set_finding_state request
|
2681
|
+
#
|
2682
|
+
# # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding.
|
2683
|
+
# p result
|
2684
|
+
#
|
2685
|
+
def set_finding_state request, options = nil
|
1800
2686
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1801
2687
|
|
1802
|
-
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::
|
2688
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest
|
1803
2689
|
|
1804
2690
|
# Converts hash and nil to an options object
|
1805
2691
|
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1806
2692
|
|
1807
2693
|
# Customize the options with defaults
|
1808
|
-
metadata = @config.rpcs.
|
2694
|
+
metadata = @config.rpcs.set_finding_state.metadata.to_h
|
1809
2695
|
|
1810
2696
|
# Set x-goog-api-client and x-goog-user-project headers
|
1811
2697
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
@@ -1813,22 +2699,23 @@ module Google
|
|
1813
2699
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
1814
2700
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1815
2701
|
|
1816
|
-
header_params = {
|
1817
|
-
|
1818
|
-
|
2702
|
+
header_params = {}
|
2703
|
+
if request.name
|
2704
|
+
header_params["name"] = request.name
|
2705
|
+
end
|
2706
|
+
|
1819
2707
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1820
2708
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1821
2709
|
|
1822
|
-
options.apply_defaults timeout: @config.rpcs.
|
2710
|
+
options.apply_defaults timeout: @config.rpcs.set_finding_state.timeout,
|
1823
2711
|
metadata: metadata,
|
1824
|
-
retry_policy: @config.rpcs.
|
2712
|
+
retry_policy: @config.rpcs.set_finding_state.retry_policy
|
1825
2713
|
|
1826
2714
|
options.apply_defaults timeout: @config.timeout,
|
1827
2715
|
metadata: @config.metadata,
|
1828
2716
|
retry_policy: @config.retry_policy
|
1829
2717
|
|
1830
|
-
@security_center_stub.call_rpc :
|
1831
|
-
response = ::Gapic::Operation.new response, @operations_client, options: options
|
2718
|
+
@security_center_stub.call_rpc :set_finding_state, request, options: options do |response, operation|
|
1832
2719
|
yield response, operation if block_given?
|
1833
2720
|
return response
|
1834
2721
|
end
|
@@ -1837,20 +2724,20 @@ module Google
|
|
1837
2724
|
end
|
1838
2725
|
|
1839
2726
|
##
|
1840
|
-
# Updates the state of a finding.
|
2727
|
+
# Updates the mute state of a finding.
|
1841
2728
|
#
|
1842
|
-
# @overload
|
1843
|
-
# Pass arguments to `
|
1844
|
-
# {::Google::Cloud::SecurityCenter::V1::
|
2729
|
+
# @overload set_mute(request, options = nil)
|
2730
|
+
# Pass arguments to `set_mute` via a request object, either of type
|
2731
|
+
# {::Google::Cloud::SecurityCenter::V1::SetMuteRequest} or an equivalent Hash.
|
1845
2732
|
#
|
1846
|
-
# @param request [::Google::Cloud::SecurityCenter::V1::
|
2733
|
+
# @param request [::Google::Cloud::SecurityCenter::V1::SetMuteRequest, ::Hash]
|
1847
2734
|
# A request object representing the call parameters. Required. To specify no
|
1848
2735
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1849
2736
|
# @param options [::Gapic::CallOptions, ::Hash]
|
1850
2737
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1851
2738
|
#
|
1852
|
-
# @overload
|
1853
|
-
# Pass arguments to `
|
2739
|
+
# @overload set_mute(name: nil, mute: nil)
|
2740
|
+
# Pass arguments to `set_mute` via keyword arguments. Note that at
|
1854
2741
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
1855
2742
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
1856
2743
|
#
|
@@ -1858,11 +2745,11 @@ module Google
|
|
1858
2745
|
# Required. The relative resource name of the finding. See:
|
1859
2746
|
# https://cloud.google.com/apis/design/resource_names#relative_resource_name
|
1860
2747
|
# Example:
|
1861
|
-
# "organizations/\\{organization_id}/sources/\\{source_id}/finding/\\{finding_id}"
|
1862
|
-
#
|
1863
|
-
#
|
1864
|
-
# @param
|
1865
|
-
# Required. The
|
2748
|
+
# "organizations/\\{organization_id}/sources/\\{source_id}/finding/\\{finding_id}",
|
2749
|
+
# "folders/\\{folder_id}/sources/\\{source_id}/finding/\\{finding_id}",
|
2750
|
+
# "projects/\\{project_id}/sources/\\{source_id}/finding/\\{finding_id}".
|
2751
|
+
# @param mute [::Google::Cloud::SecurityCenter::V1::Finding::Mute]
|
2752
|
+
# Required. The desired state of the Mute.
|
1866
2753
|
#
|
1867
2754
|
# @yield [response, operation] Access the result along with the RPC operation
|
1868
2755
|
# @yieldparam response [::Google::Cloud::SecurityCenter::V1::Finding]
|
@@ -1872,16 +2759,31 @@ module Google
|
|
1872
2759
|
#
|
1873
2760
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1874
2761
|
#
|
1875
|
-
|
2762
|
+
# @example Basic example
|
2763
|
+
# require "google/cloud/security_center/v1"
|
2764
|
+
#
|
2765
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2766
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
2767
|
+
#
|
2768
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2769
|
+
# request = Google::Cloud::SecurityCenter::V1::SetMuteRequest.new
|
2770
|
+
#
|
2771
|
+
# # Call the set_mute method.
|
2772
|
+
# result = client.set_mute request
|
2773
|
+
#
|
2774
|
+
# # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding.
|
2775
|
+
# p result
|
2776
|
+
#
|
2777
|
+
def set_mute request, options = nil
|
1876
2778
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1877
2779
|
|
1878
|
-
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::
|
2780
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::SetMuteRequest
|
1879
2781
|
|
1880
2782
|
# Converts hash and nil to an options object
|
1881
2783
|
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1882
2784
|
|
1883
2785
|
# Customize the options with defaults
|
1884
|
-
metadata = @config.rpcs.
|
2786
|
+
metadata = @config.rpcs.set_mute.metadata.to_h
|
1885
2787
|
|
1886
2788
|
# Set x-goog-api-client and x-goog-user-project headers
|
1887
2789
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
@@ -1889,21 +2791,23 @@ module Google
|
|
1889
2791
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
1890
2792
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1891
2793
|
|
1892
|
-
header_params = {
|
1893
|
-
|
1894
|
-
|
2794
|
+
header_params = {}
|
2795
|
+
if request.name
|
2796
|
+
header_params["name"] = request.name
|
2797
|
+
end
|
2798
|
+
|
1895
2799
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1896
2800
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1897
2801
|
|
1898
|
-
options.apply_defaults timeout: @config.rpcs.
|
2802
|
+
options.apply_defaults timeout: @config.rpcs.set_mute.timeout,
|
1899
2803
|
metadata: metadata,
|
1900
|
-
retry_policy: @config.rpcs.
|
2804
|
+
retry_policy: @config.rpcs.set_mute.retry_policy
|
1901
2805
|
|
1902
2806
|
options.apply_defaults timeout: @config.timeout,
|
1903
2807
|
metadata: @config.metadata,
|
1904
2808
|
retry_policy: @config.retry_policy
|
1905
2809
|
|
1906
|
-
@security_center_stub.call_rpc :
|
2810
|
+
@security_center_stub.call_rpc :set_mute, request, options: options do |response, operation|
|
1907
2811
|
yield response, operation if block_given?
|
1908
2812
|
return response
|
1909
2813
|
end
|
@@ -1946,6 +2850,21 @@ module Google
|
|
1946
2850
|
#
|
1947
2851
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1948
2852
|
#
|
2853
|
+
# @example Basic example
|
2854
|
+
# require "google/cloud/security_center/v1"
|
2855
|
+
#
|
2856
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2857
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
2858
|
+
#
|
2859
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2860
|
+
# request = Google::Iam::V1::SetIamPolicyRequest.new
|
2861
|
+
#
|
2862
|
+
# # Call the set_iam_policy method.
|
2863
|
+
# result = client.set_iam_policy request
|
2864
|
+
#
|
2865
|
+
# # The returned object is of type Google::Iam::V1::Policy.
|
2866
|
+
# p result
|
2867
|
+
#
|
1949
2868
|
def set_iam_policy request, options = nil
|
1950
2869
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1951
2870
|
|
@@ -1963,9 +2882,11 @@ module Google
|
|
1963
2882
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
1964
2883
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1965
2884
|
|
1966
|
-
header_params = {
|
1967
|
-
|
1968
|
-
|
2885
|
+
header_params = {}
|
2886
|
+
if request.resource
|
2887
|
+
header_params["resource"] = request.resource
|
2888
|
+
end
|
2889
|
+
|
1969
2890
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1970
2891
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1971
2892
|
|
@@ -2020,6 +2941,21 @@ module Google
|
|
2020
2941
|
#
|
2021
2942
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2022
2943
|
#
|
2944
|
+
# @example Basic example
|
2945
|
+
# require "google/cloud/security_center/v1"
|
2946
|
+
#
|
2947
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2948
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
2949
|
+
#
|
2950
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2951
|
+
# request = Google::Iam::V1::TestIamPermissionsRequest.new
|
2952
|
+
#
|
2953
|
+
# # Call the test_iam_permissions method.
|
2954
|
+
# result = client.test_iam_permissions request
|
2955
|
+
#
|
2956
|
+
# # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
|
2957
|
+
# p result
|
2958
|
+
#
|
2023
2959
|
def test_iam_permissions request, options = nil
|
2024
2960
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
2025
2961
|
|
@@ -2037,9 +2973,11 @@ module Google
|
|
2037
2973
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
2038
2974
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2039
2975
|
|
2040
|
-
header_params = {
|
2041
|
-
|
2042
|
-
|
2976
|
+
header_params = {}
|
2977
|
+
if request.resource
|
2978
|
+
header_params["resource"] = request.resource
|
2979
|
+
end
|
2980
|
+
|
2043
2981
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2044
2982
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
2045
2983
|
|
@@ -2059,6 +2997,95 @@ module Google
|
|
2059
2997
|
raise ::Google::Cloud::Error.from_error(e)
|
2060
2998
|
end
|
2061
2999
|
|
3000
|
+
##
|
3001
|
+
# Updates external system. This is for a given finding.
|
3002
|
+
#
|
3003
|
+
# @overload update_external_system(request, options = nil)
|
3004
|
+
# Pass arguments to `update_external_system` via a request object, either of type
|
3005
|
+
# {::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest} or an equivalent Hash.
|
3006
|
+
#
|
3007
|
+
# @param request [::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest, ::Hash]
|
3008
|
+
# A request object representing the call parameters. Required. To specify no
|
3009
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
3010
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
3011
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
3012
|
+
#
|
3013
|
+
# @overload update_external_system(external_system: nil, update_mask: nil)
|
3014
|
+
# Pass arguments to `update_external_system` via keyword arguments. Note that at
|
3015
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
3016
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
3017
|
+
#
|
3018
|
+
# @param external_system [::Google::Cloud::SecurityCenter::V1::ExternalSystem, ::Hash]
|
3019
|
+
# Required. The external system resource to update.
|
3020
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
3021
|
+
# The FieldMask to use when updating the external system resource.
|
3022
|
+
#
|
3023
|
+
# If empty all mutable fields will be updated.
|
3024
|
+
#
|
3025
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
3026
|
+
# @yieldparam response [::Google::Cloud::SecurityCenter::V1::ExternalSystem]
|
3027
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
3028
|
+
#
|
3029
|
+
# @return [::Google::Cloud::SecurityCenter::V1::ExternalSystem]
|
3030
|
+
#
|
3031
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
3032
|
+
#
|
3033
|
+
# @example Basic example
|
3034
|
+
# require "google/cloud/security_center/v1"
|
3035
|
+
#
|
3036
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3037
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
3038
|
+
#
|
3039
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3040
|
+
# request = Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest.new
|
3041
|
+
#
|
3042
|
+
# # Call the update_external_system method.
|
3043
|
+
# result = client.update_external_system request
|
3044
|
+
#
|
3045
|
+
# # The returned object is of type Google::Cloud::SecurityCenter::V1::ExternalSystem.
|
3046
|
+
# p result
|
3047
|
+
#
|
3048
|
+
def update_external_system request, options = nil
|
3049
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
3050
|
+
|
3051
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest
|
3052
|
+
|
3053
|
+
# Converts hash and nil to an options object
|
3054
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
3055
|
+
|
3056
|
+
# Customize the options with defaults
|
3057
|
+
metadata = @config.rpcs.update_external_system.metadata.to_h
|
3058
|
+
|
3059
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
3060
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
3061
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
3062
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
3063
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
3064
|
+
|
3065
|
+
header_params = {}
|
3066
|
+
if request.external_system&.name
|
3067
|
+
header_params["external_system.name"] = request.external_system.name
|
3068
|
+
end
|
3069
|
+
|
3070
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
3071
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
3072
|
+
|
3073
|
+
options.apply_defaults timeout: @config.rpcs.update_external_system.timeout,
|
3074
|
+
metadata: metadata,
|
3075
|
+
retry_policy: @config.rpcs.update_external_system.retry_policy
|
3076
|
+
|
3077
|
+
options.apply_defaults timeout: @config.timeout,
|
3078
|
+
metadata: @config.metadata,
|
3079
|
+
retry_policy: @config.retry_policy
|
3080
|
+
|
3081
|
+
@security_center_stub.call_rpc :update_external_system, request, options: options do |response, operation|
|
3082
|
+
yield response, operation if block_given?
|
3083
|
+
return response
|
3084
|
+
end
|
3085
|
+
rescue ::GRPC::BadStatus => e
|
3086
|
+
raise ::Google::Cloud::Error.from_error(e)
|
3087
|
+
end
|
3088
|
+
|
2062
3089
|
##
|
2063
3090
|
# Creates or updates a finding. The corresponding source must exist for a
|
2064
3091
|
# finding creation to succeed.
|
@@ -2102,6 +3129,21 @@ module Google
|
|
2102
3129
|
#
|
2103
3130
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2104
3131
|
#
|
3132
|
+
# @example Basic example
|
3133
|
+
# require "google/cloud/security_center/v1"
|
3134
|
+
#
|
3135
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3136
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
3137
|
+
#
|
3138
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3139
|
+
# request = Google::Cloud::SecurityCenter::V1::UpdateFindingRequest.new
|
3140
|
+
#
|
3141
|
+
# # Call the update_finding method.
|
3142
|
+
# result = client.update_finding request
|
3143
|
+
#
|
3144
|
+
# # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding.
|
3145
|
+
# p result
|
3146
|
+
#
|
2105
3147
|
def update_finding request, options = nil
|
2106
3148
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
2107
3149
|
|
@@ -2119,9 +3161,11 @@ module Google
|
|
2119
3161
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
2120
3162
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2121
3163
|
|
2122
|
-
header_params = {
|
2123
|
-
|
2124
|
-
|
3164
|
+
header_params = {}
|
3165
|
+
if request.finding&.name
|
3166
|
+
header_params["finding.name"] = request.finding.name
|
3167
|
+
end
|
3168
|
+
|
2125
3169
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2126
3170
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
2127
3171
|
|
@@ -2141,6 +3185,94 @@ module Google
|
|
2141
3185
|
raise ::Google::Cloud::Error.from_error(e)
|
2142
3186
|
end
|
2143
3187
|
|
3188
|
+
##
|
3189
|
+
# Updates a mute config.
|
3190
|
+
#
|
3191
|
+
# @overload update_mute_config(request, options = nil)
|
3192
|
+
# Pass arguments to `update_mute_config` via a request object, either of type
|
3193
|
+
# {::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest} or an equivalent Hash.
|
3194
|
+
#
|
3195
|
+
# @param request [::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest, ::Hash]
|
3196
|
+
# A request object representing the call parameters. Required. To specify no
|
3197
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
3198
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
3199
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
3200
|
+
#
|
3201
|
+
# @overload update_mute_config(mute_config: nil, update_mask: nil)
|
3202
|
+
# Pass arguments to `update_mute_config` via keyword arguments. Note that at
|
3203
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
3204
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
3205
|
+
#
|
3206
|
+
# @param mute_config [::Google::Cloud::SecurityCenter::V1::MuteConfig, ::Hash]
|
3207
|
+
# Required. The mute config being updated.
|
3208
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
3209
|
+
# The list of fields to be updated.
|
3210
|
+
# If empty all mutable fields will be updated.
|
3211
|
+
#
|
3212
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
3213
|
+
# @yieldparam response [::Google::Cloud::SecurityCenter::V1::MuteConfig]
|
3214
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
3215
|
+
#
|
3216
|
+
# @return [::Google::Cloud::SecurityCenter::V1::MuteConfig]
|
3217
|
+
#
|
3218
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
3219
|
+
#
|
3220
|
+
# @example Basic example
|
3221
|
+
# require "google/cloud/security_center/v1"
|
3222
|
+
#
|
3223
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3224
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
3225
|
+
#
|
3226
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3227
|
+
# request = Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest.new
|
3228
|
+
#
|
3229
|
+
# # Call the update_mute_config method.
|
3230
|
+
# result = client.update_mute_config request
|
3231
|
+
#
|
3232
|
+
# # The returned object is of type Google::Cloud::SecurityCenter::V1::MuteConfig.
|
3233
|
+
# p result
|
3234
|
+
#
|
3235
|
+
def update_mute_config request, options = nil
|
3236
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
3237
|
+
|
3238
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest
|
3239
|
+
|
3240
|
+
# Converts hash and nil to an options object
|
3241
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
3242
|
+
|
3243
|
+
# Customize the options with defaults
|
3244
|
+
metadata = @config.rpcs.update_mute_config.metadata.to_h
|
3245
|
+
|
3246
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
3247
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
3248
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
3249
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
3250
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
3251
|
+
|
3252
|
+
header_params = {}
|
3253
|
+
if request.mute_config&.name
|
3254
|
+
header_params["mute_config.name"] = request.mute_config.name
|
3255
|
+
end
|
3256
|
+
|
3257
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
3258
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
3259
|
+
|
3260
|
+
options.apply_defaults timeout: @config.rpcs.update_mute_config.timeout,
|
3261
|
+
metadata: metadata,
|
3262
|
+
retry_policy: @config.rpcs.update_mute_config.retry_policy
|
3263
|
+
|
3264
|
+
options.apply_defaults timeout: @config.timeout,
|
3265
|
+
metadata: @config.metadata,
|
3266
|
+
retry_policy: @config.retry_policy
|
3267
|
+
|
3268
|
+
@security_center_stub.call_rpc :update_mute_config, request, options: options do |response, operation|
|
3269
|
+
yield response, operation if block_given?
|
3270
|
+
return response
|
3271
|
+
end
|
3272
|
+
rescue ::GRPC::BadStatus => e
|
3273
|
+
raise ::Google::Cloud::Error.from_error(e)
|
3274
|
+
end
|
3275
|
+
|
2144
3276
|
##
|
2145
3277
|
# Updates a notification config. The following update
|
2146
3278
|
# fields are allowed: description, pubsub_topic, streaming_config.filter
|
@@ -2175,6 +3307,21 @@ module Google
|
|
2175
3307
|
#
|
2176
3308
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2177
3309
|
#
|
3310
|
+
# @example Basic example
|
3311
|
+
# require "google/cloud/security_center/v1"
|
3312
|
+
#
|
3313
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3314
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
3315
|
+
#
|
3316
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3317
|
+
# request = Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest.new
|
3318
|
+
#
|
3319
|
+
# # Call the update_notification_config method.
|
3320
|
+
# result = client.update_notification_config request
|
3321
|
+
#
|
3322
|
+
# # The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig.
|
3323
|
+
# p result
|
3324
|
+
#
|
2178
3325
|
def update_notification_config request, options = nil
|
2179
3326
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
2180
3327
|
|
@@ -2192,9 +3339,11 @@ module Google
|
|
2192
3339
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
2193
3340
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2194
3341
|
|
2195
|
-
header_params = {
|
2196
|
-
|
2197
|
-
|
3342
|
+
header_params = {}
|
3343
|
+
if request.notification_config&.name
|
3344
|
+
header_params["notification_config.name"] = request.notification_config.name
|
3345
|
+
end
|
3346
|
+
|
2198
3347
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2199
3348
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
2200
3349
|
|
@@ -2247,6 +3396,21 @@ module Google
|
|
2247
3396
|
#
|
2248
3397
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2249
3398
|
#
|
3399
|
+
# @example Basic example
|
3400
|
+
# require "google/cloud/security_center/v1"
|
3401
|
+
#
|
3402
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3403
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
3404
|
+
#
|
3405
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3406
|
+
# request = Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest.new
|
3407
|
+
#
|
3408
|
+
# # Call the update_organization_settings method.
|
3409
|
+
# result = client.update_organization_settings request
|
3410
|
+
#
|
3411
|
+
# # The returned object is of type Google::Cloud::SecurityCenter::V1::OrganizationSettings.
|
3412
|
+
# p result
|
3413
|
+
#
|
2250
3414
|
def update_organization_settings request, options = nil
|
2251
3415
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
2252
3416
|
|
@@ -2264,9 +3428,11 @@ module Google
|
|
2264
3428
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
2265
3429
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2266
3430
|
|
2267
|
-
header_params = {
|
2268
|
-
|
2269
|
-
|
3431
|
+
header_params = {}
|
3432
|
+
if request.organization_settings&.name
|
3433
|
+
header_params["organization_settings.name"] = request.organization_settings.name
|
3434
|
+
end
|
3435
|
+
|
2270
3436
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2271
3437
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
2272
3438
|
|
@@ -2319,6 +3485,21 @@ module Google
|
|
2319
3485
|
#
|
2320
3486
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2321
3487
|
#
|
3488
|
+
# @example Basic example
|
3489
|
+
# require "google/cloud/security_center/v1"
|
3490
|
+
#
|
3491
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3492
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
3493
|
+
#
|
3494
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3495
|
+
# request = Google::Cloud::SecurityCenter::V1::UpdateSourceRequest.new
|
3496
|
+
#
|
3497
|
+
# # Call the update_source method.
|
3498
|
+
# result = client.update_source request
|
3499
|
+
#
|
3500
|
+
# # The returned object is of type Google::Cloud::SecurityCenter::V1::Source.
|
3501
|
+
# p result
|
3502
|
+
#
|
2322
3503
|
def update_source request, options = nil
|
2323
3504
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
2324
3505
|
|
@@ -2336,9 +3517,11 @@ module Google
|
|
2336
3517
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
2337
3518
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2338
3519
|
|
2339
|
-
header_params = {
|
2340
|
-
|
2341
|
-
|
3520
|
+
header_params = {}
|
3521
|
+
if request.source&.name
|
3522
|
+
header_params["source.name"] = request.source.name
|
3523
|
+
end
|
3524
|
+
|
2342
3525
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2343
3526
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
2344
3527
|
|
@@ -2397,6 +3580,21 @@ module Google
|
|
2397
3580
|
#
|
2398
3581
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2399
3582
|
#
|
3583
|
+
# @example Basic example
|
3584
|
+
# require "google/cloud/security_center/v1"
|
3585
|
+
#
|
3586
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3587
|
+
# client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new
|
3588
|
+
#
|
3589
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3590
|
+
# request = Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest.new
|
3591
|
+
#
|
3592
|
+
# # Call the update_security_marks method.
|
3593
|
+
# result = client.update_security_marks request
|
3594
|
+
#
|
3595
|
+
# # The returned object is of type Google::Cloud::SecurityCenter::V1::SecurityMarks.
|
3596
|
+
# p result
|
3597
|
+
#
|
2400
3598
|
def update_security_marks request, options = nil
|
2401
3599
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
2402
3600
|
|
@@ -2414,9 +3612,11 @@ module Google
|
|
2414
3612
|
gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION
|
2415
3613
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2416
3614
|
|
2417
|
-
header_params = {
|
2418
|
-
|
2419
|
-
|
3615
|
+
header_params = {}
|
3616
|
+
if request.security_marks&.name
|
3617
|
+
header_params["security_marks.name"] = request.security_marks.name
|
3618
|
+
end
|
3619
|
+
|
2420
3620
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2421
3621
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
2422
3622
|
|
@@ -2452,17 +3652,17 @@ module Google
|
|
2452
3652
|
# @example
|
2453
3653
|
#
|
2454
3654
|
# # Modify the global config, setting the timeout for
|
2455
|
-
# #
|
3655
|
+
# # bulk_mute_findings to 20 seconds,
|
2456
3656
|
# # and all remaining timeouts to 10 seconds.
|
2457
3657
|
# ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.configure do |config|
|
2458
3658
|
# config.timeout = 10.0
|
2459
|
-
# config.rpcs.
|
3659
|
+
# config.rpcs.bulk_mute_findings.timeout = 20.0
|
2460
3660
|
# end
|
2461
3661
|
#
|
2462
3662
|
# # Apply the above configuration only to a new client.
|
2463
3663
|
# client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new do |config|
|
2464
3664
|
# config.timeout = 10.0
|
2465
|
-
# config.rpcs.
|
3665
|
+
# config.rpcs.bulk_mute_findings.timeout = 20.0
|
2466
3666
|
# end
|
2467
3667
|
#
|
2468
3668
|
# @!attribute [rw] endpoint
|
@@ -2571,6 +3771,11 @@ module Google
|
|
2571
3771
|
# trigger a retry.
|
2572
3772
|
#
|
2573
3773
|
class Rpcs
|
3774
|
+
##
|
3775
|
+
# RPC-specific configuration for `bulk_mute_findings`
|
3776
|
+
# @return [::Gapic::Config::Method]
|
3777
|
+
#
|
3778
|
+
attr_reader :bulk_mute_findings
|
2574
3779
|
##
|
2575
3780
|
# RPC-specific configuration for `create_source`
|
2576
3781
|
# @return [::Gapic::Config::Method]
|
@@ -2582,11 +3787,21 @@ module Google
|
|
2582
3787
|
#
|
2583
3788
|
attr_reader :create_finding
|
2584
3789
|
##
|
3790
|
+
# RPC-specific configuration for `create_mute_config`
|
3791
|
+
# @return [::Gapic::Config::Method]
|
3792
|
+
#
|
3793
|
+
attr_reader :create_mute_config
|
3794
|
+
##
|
2585
3795
|
# RPC-specific configuration for `create_notification_config`
|
2586
3796
|
# @return [::Gapic::Config::Method]
|
2587
3797
|
#
|
2588
3798
|
attr_reader :create_notification_config
|
2589
3799
|
##
|
3800
|
+
# RPC-specific configuration for `delete_mute_config`
|
3801
|
+
# @return [::Gapic::Config::Method]
|
3802
|
+
#
|
3803
|
+
attr_reader :delete_mute_config
|
3804
|
+
##
|
2590
3805
|
# RPC-specific configuration for `delete_notification_config`
|
2591
3806
|
# @return [::Gapic::Config::Method]
|
2592
3807
|
#
|
@@ -2597,6 +3812,11 @@ module Google
|
|
2597
3812
|
#
|
2598
3813
|
attr_reader :get_iam_policy
|
2599
3814
|
##
|
3815
|
+
# RPC-specific configuration for `get_mute_config`
|
3816
|
+
# @return [::Gapic::Config::Method]
|
3817
|
+
#
|
3818
|
+
attr_reader :get_mute_config
|
3819
|
+
##
|
2600
3820
|
# RPC-specific configuration for `get_notification_config`
|
2601
3821
|
# @return [::Gapic::Config::Method]
|
2602
3822
|
#
|
@@ -2632,6 +3852,11 @@ module Google
|
|
2632
3852
|
#
|
2633
3853
|
attr_reader :list_findings
|
2634
3854
|
##
|
3855
|
+
# RPC-specific configuration for `list_mute_configs`
|
3856
|
+
# @return [::Gapic::Config::Method]
|
3857
|
+
#
|
3858
|
+
attr_reader :list_mute_configs
|
3859
|
+
##
|
2635
3860
|
# RPC-specific configuration for `list_notification_configs`
|
2636
3861
|
# @return [::Gapic::Config::Method]
|
2637
3862
|
#
|
@@ -2652,6 +3877,11 @@ module Google
|
|
2652
3877
|
#
|
2653
3878
|
attr_reader :set_finding_state
|
2654
3879
|
##
|
3880
|
+
# RPC-specific configuration for `set_mute`
|
3881
|
+
# @return [::Gapic::Config::Method]
|
3882
|
+
#
|
3883
|
+
attr_reader :set_mute
|
3884
|
+
##
|
2655
3885
|
# RPC-specific configuration for `set_iam_policy`
|
2656
3886
|
# @return [::Gapic::Config::Method]
|
2657
3887
|
#
|
@@ -2662,11 +3892,21 @@ module Google
|
|
2662
3892
|
#
|
2663
3893
|
attr_reader :test_iam_permissions
|
2664
3894
|
##
|
3895
|
+
# RPC-specific configuration for `update_external_system`
|
3896
|
+
# @return [::Gapic::Config::Method]
|
3897
|
+
#
|
3898
|
+
attr_reader :update_external_system
|
3899
|
+
##
|
2665
3900
|
# RPC-specific configuration for `update_finding`
|
2666
3901
|
# @return [::Gapic::Config::Method]
|
2667
3902
|
#
|
2668
3903
|
attr_reader :update_finding
|
2669
3904
|
##
|
3905
|
+
# RPC-specific configuration for `update_mute_config`
|
3906
|
+
# @return [::Gapic::Config::Method]
|
3907
|
+
#
|
3908
|
+
attr_reader :update_mute_config
|
3909
|
+
##
|
2670
3910
|
# RPC-specific configuration for `update_notification_config`
|
2671
3911
|
# @return [::Gapic::Config::Method]
|
2672
3912
|
#
|
@@ -2689,16 +3929,24 @@ module Google
|
|
2689
3929
|
|
2690
3930
|
# @private
|
2691
3931
|
def initialize parent_rpcs = nil
|
3932
|
+
bulk_mute_findings_config = parent_rpcs.bulk_mute_findings if parent_rpcs.respond_to? :bulk_mute_findings
|
3933
|
+
@bulk_mute_findings = ::Gapic::Config::Method.new bulk_mute_findings_config
|
2692
3934
|
create_source_config = parent_rpcs.create_source if parent_rpcs.respond_to? :create_source
|
2693
3935
|
@create_source = ::Gapic::Config::Method.new create_source_config
|
2694
3936
|
create_finding_config = parent_rpcs.create_finding if parent_rpcs.respond_to? :create_finding
|
2695
3937
|
@create_finding = ::Gapic::Config::Method.new create_finding_config
|
3938
|
+
create_mute_config_config = parent_rpcs.create_mute_config if parent_rpcs.respond_to? :create_mute_config
|
3939
|
+
@create_mute_config = ::Gapic::Config::Method.new create_mute_config_config
|
2696
3940
|
create_notification_config_config = parent_rpcs.create_notification_config if parent_rpcs.respond_to? :create_notification_config
|
2697
3941
|
@create_notification_config = ::Gapic::Config::Method.new create_notification_config_config
|
3942
|
+
delete_mute_config_config = parent_rpcs.delete_mute_config if parent_rpcs.respond_to? :delete_mute_config
|
3943
|
+
@delete_mute_config = ::Gapic::Config::Method.new delete_mute_config_config
|
2698
3944
|
delete_notification_config_config = parent_rpcs.delete_notification_config if parent_rpcs.respond_to? :delete_notification_config
|
2699
3945
|
@delete_notification_config = ::Gapic::Config::Method.new delete_notification_config_config
|
2700
3946
|
get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
|
2701
3947
|
@get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
|
3948
|
+
get_mute_config_config = parent_rpcs.get_mute_config if parent_rpcs.respond_to? :get_mute_config
|
3949
|
+
@get_mute_config = ::Gapic::Config::Method.new get_mute_config_config
|
2702
3950
|
get_notification_config_config = parent_rpcs.get_notification_config if parent_rpcs.respond_to? :get_notification_config
|
2703
3951
|
@get_notification_config = ::Gapic::Config::Method.new get_notification_config_config
|
2704
3952
|
get_organization_settings_config = parent_rpcs.get_organization_settings if parent_rpcs.respond_to? :get_organization_settings
|
@@ -2713,6 +3961,8 @@ module Google
|
|
2713
3961
|
@list_assets = ::Gapic::Config::Method.new list_assets_config
|
2714
3962
|
list_findings_config = parent_rpcs.list_findings if parent_rpcs.respond_to? :list_findings
|
2715
3963
|
@list_findings = ::Gapic::Config::Method.new list_findings_config
|
3964
|
+
list_mute_configs_config = parent_rpcs.list_mute_configs if parent_rpcs.respond_to? :list_mute_configs
|
3965
|
+
@list_mute_configs = ::Gapic::Config::Method.new list_mute_configs_config
|
2716
3966
|
list_notification_configs_config = parent_rpcs.list_notification_configs if parent_rpcs.respond_to? :list_notification_configs
|
2717
3967
|
@list_notification_configs = ::Gapic::Config::Method.new list_notification_configs_config
|
2718
3968
|
list_sources_config = parent_rpcs.list_sources if parent_rpcs.respond_to? :list_sources
|
@@ -2721,12 +3971,18 @@ module Google
|
|
2721
3971
|
@run_asset_discovery = ::Gapic::Config::Method.new run_asset_discovery_config
|
2722
3972
|
set_finding_state_config = parent_rpcs.set_finding_state if parent_rpcs.respond_to? :set_finding_state
|
2723
3973
|
@set_finding_state = ::Gapic::Config::Method.new set_finding_state_config
|
3974
|
+
set_mute_config = parent_rpcs.set_mute if parent_rpcs.respond_to? :set_mute
|
3975
|
+
@set_mute = ::Gapic::Config::Method.new set_mute_config
|
2724
3976
|
set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
|
2725
3977
|
@set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
|
2726
3978
|
test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
|
2727
3979
|
@test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
|
3980
|
+
update_external_system_config = parent_rpcs.update_external_system if parent_rpcs.respond_to? :update_external_system
|
3981
|
+
@update_external_system = ::Gapic::Config::Method.new update_external_system_config
|
2728
3982
|
update_finding_config = parent_rpcs.update_finding if parent_rpcs.respond_to? :update_finding
|
2729
3983
|
@update_finding = ::Gapic::Config::Method.new update_finding_config
|
3984
|
+
update_mute_config_config = parent_rpcs.update_mute_config if parent_rpcs.respond_to? :update_mute_config
|
3985
|
+
@update_mute_config = ::Gapic::Config::Method.new update_mute_config_config
|
2730
3986
|
update_notification_config_config = parent_rpcs.update_notification_config if parent_rpcs.respond_to? :update_notification_config
|
2731
3987
|
@update_notification_config = ::Gapic::Config::Method.new update_notification_config_config
|
2732
3988
|
update_organization_settings_config = parent_rpcs.update_organization_settings if parent_rpcs.respond_to? :update_organization_settings
|