Class: Google::Cloud::SecurityCenter::V2::SecurityCenter::Client
- Inherits:
-
Object
- Object
- Google::Cloud::SecurityCenter::V2::SecurityCenter::Client
- Includes:
- Paths
- Defined in:
- lib/google/cloud/security_center/v2/security_center/client.rb
Overview
Client for the SecurityCenter service.
V2 APIs for Security Center service.
Defined Under Namespace
Classes: Configuration
Instance Attribute Summary collapse
-
#operations_client ⇒ ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Operations
readonly
Get the associated client for long-running operations.
Class Method Summary collapse
-
.configure {|config| ... } ⇒ Client::Configuration
Configure the SecurityCenter Client class.
Instance Method Summary collapse
-
#batch_create_resource_value_configs(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse
Creates a ResourceValueConfig for an organization.
-
#bulk_mute_findings(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::Operation
Kicks off an LRO to bulk mute findings for a parent based on a filter.
-
#configure {|config| ... } ⇒ Client::Configuration
Configure the SecurityCenter Client instance.
-
#create_big_query_export(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V2::BigQueryExport
Creates a BigQuery export.
-
#create_finding(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V2::Finding
Creates a finding in a location.
-
#create_mute_config(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V2::MuteConfig
Creates a mute config.
-
#create_notification_config(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V2::NotificationConfig
Creates a notification config.
-
#create_source(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V2::Source
Creates a source.
-
#delete_big_query_export(request, options = nil) {|response, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes an existing BigQuery export.
-
#delete_mute_config(request, options = nil) {|response, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes an existing mute config.
-
#delete_notification_config(request, options = nil) {|response, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes a notification config.
-
#delete_resource_value_config(request, options = nil) {|response, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes a ResourceValueConfig.
-
#get_big_query_export(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V2::BigQueryExport
Gets a BigQuery export.
-
#get_iam_policy(request, options = nil) {|response, operation| ... } ⇒ ::Google::Iam::V1::Policy
Gets the access control policy on the specified Source.
-
#get_mute_config(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V2::MuteConfig
Gets a mute config.
-
#get_notification_config(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V2::NotificationConfig
Gets a notification config.
-
#get_resource_value_config(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig
Gets a ResourceValueConfig.
-
#get_simulation(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V2::Simulation
Get the simulation by name or the latest simulation for the given organization.
-
#get_source(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V2::Source
Gets a source.
-
#get_valued_resource(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V2::ValuedResource
Get the valued resource by name.
-
#group_findings(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::GroupResult>
Filters an organization or source's findings and groups them by their specified properties in a location.
-
#initialize {|config| ... } ⇒ Client
constructor
Create a new SecurityCenter client object.
-
#list_attack_paths(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::AttackPath>
Lists the attack paths for a set of simulation results or valued resources and filter.
-
#list_big_query_exports(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::BigQueryExport>
Lists BigQuery exports.
-
#list_findings(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ListFindingsResponse::ListFindingsResult>
Lists an organization or source's findings.
-
#list_mute_configs(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::MuteConfig>
Lists mute configs.
-
#list_notification_configs(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::NotificationConfig>
Lists notification configs.
-
#list_resource_value_configs(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ResourceValueConfig>
Lists all ResourceValueConfigs.
-
#list_sources(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::Source>
Lists all sources belonging to an organization.
-
#list_valued_resources(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ValuedResource>
Lists the valued resources for a set of simulation results and filter.
-
#set_finding_state(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V2::Finding
Updates the state of a finding.
-
#set_iam_policy(request, options = nil) {|response, operation| ... } ⇒ ::Google::Iam::V1::Policy
Sets the access control policy on the specified Source.
-
#set_mute(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V2::Finding
Updates the mute state of a finding.
-
#test_iam_permissions(request, options = nil) {|response, operation| ... } ⇒ ::Google::Iam::V1::TestIamPermissionsResponse
Returns the permissions that a caller has on the specified source.
-
#universe_domain ⇒ String
The effective universe domain.
-
#update_big_query_export(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V2::BigQueryExport
Updates a BigQuery export.
-
#update_external_system(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V2::ExternalSystem
Updates external system.
-
#update_finding(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V2::Finding
Creates or updates a finding.
-
#update_mute_config(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V2::MuteConfig
Updates a mute config.
-
#update_notification_config(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V2::NotificationConfig
Updates a notification config.
-
#update_resource_value_config(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig
Updates an existing ResourceValueConfigs with new rules.
-
#update_security_marks(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V2::SecurityMarks
Updates security marks.
-
#update_source(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::SecurityCenter::V2::Source
Updates a source.
Methods included from Paths
#big_query_export_path, #dlp_job_path, #external_system_path, #finding_path, #folder_location_path, #folder_path, #location_path, #mute_config_path, #notification_config_path, #organization_location_path, #organization_path, #policy_path, #project_path, #resource_value_config_path, #security_marks_path, #simulation_path, #source_path, #table_data_profile_path, #topic_path, #valued_resource_path
Constructor Details
#initialize {|config| ... } ⇒ Client
Create a new SecurityCenter client object.
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 121 def initialize # These require statements are intentionally placed here to initialize # the gRPC module only when it's required. # See https://github.com/googleapis/toolkit/issues/446 require "gapic/grpc" require "google/cloud/securitycenter/v2/securitycenter_service_services_pb" # Create the configuration object @config = Configuration.new Client.configure # Yield the configuration if needed yield @config if block_given? # Create credentials credentials = @config.credentials # Use self-signed JWT if the endpoint is unchanged from default, # but only if the default endpoint does not have a region prefix. enable_self_signed_jwt = @config.endpoint.nil? || (@config.endpoint == Configuration::DEFAULT_ENDPOINT && !@config.endpoint.split(".").first.include?("-")) credentials ||= Credentials.default scope: @config.scope, enable_self_signed_jwt: enable_self_signed_jwt if credentials.is_a?(::String) || credentials.is_a?(::Hash) credentials = Credentials.new credentials, scope: @config.scope end @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id @operations_client = Operations.new do |config| config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint config.universe_domain = @config.universe_domain end @security_center_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Stub, credentials: credentials, endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, channel_args: @config.channel_args, interceptors: @config.interceptors, channel_pool_config: @config.channel_pool ) end |
Instance Attribute Details
#operations_client ⇒ ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Operations (readonly)
Get the associated client for long-running operations.
173 174 175 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 173 def operations_client @operations_client end |
Class Method Details
.configure {|config| ... } ⇒ Client::Configuration
Configure the SecurityCenter Client class.
See Configuration for a description of the configuration fields.
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 59 def self.configure @configure ||= begin namespace = ["Google", "Cloud", "SecurityCenter", "V2"] parent_config = while namespace.any? parent_name = namespace.join "::" parent_const = const_get parent_name break parent_const.configure if parent_const.respond_to? :configure namespace.pop end default_config = Client::Configuration.new parent_config default_config end yield @configure if block_given? @configure end |
Instance Method Details
#batch_create_resource_value_configs(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse #batch_create_resource_value_configs(parent: nil, requests: nil) ⇒ ::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse
Creates a ResourceValueConfig for an organization. Maps user's tags to difference resource values for use by the attack path simulation.
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 226 def batch_create_resource_value_configs request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.batch_create_resource_value_configs..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.batch_create_resource_value_configs.timeout, metadata: , retry_policy: @config.rpcs.batch_create_resource_value_configs.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :batch_create_resource_value_configs, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#bulk_mute_findings(request, options = nil) ⇒ ::Gapic::Operation #bulk_mute_findings(parent: nil, filter: nil) ⇒ ::Gapic::Operation
Kicks off an LRO to bulk mute findings for a parent based on a filter. If no location is specified, findings are muted in global. The parent can be either an organization, folder, or project. The findings matched by the filter will be muted after the LRO is done.
351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 351 def bulk_mute_findings request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.bulk_mute_findings..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.bulk_mute_findings.timeout, metadata: , retry_policy: @config.rpcs.bulk_mute_findings.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :bulk_mute_findings, request, options: do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#configure {|config| ... } ⇒ Client::Configuration
Configure the SecurityCenter Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on configure.
See Configuration for a description of the configuration fields.
91 92 93 94 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 91 def configure yield @config if block_given? @config end |
#create_big_query_export(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V2::BigQueryExport #create_big_query_export(parent: nil, big_query_export: nil, big_query_export_id: nil) ⇒ ::Google::Cloud::SecurityCenter::V2::BigQueryExport
Creates a BigQuery export.
447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 447 def create_big_query_export request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_big_query_export..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.create_big_query_export.timeout, metadata: , retry_policy: @config.rpcs.create_big_query_export.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :create_big_query_export, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#create_finding(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V2::Finding #create_finding(parent: nil, finding_id: nil, finding: nil) ⇒ ::Google::Cloud::SecurityCenter::V2::Finding
Creates a finding in a location. The corresponding source must exist for finding creation to succeed.
545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 545 def create_finding request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateFindingRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_finding..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.create_finding.timeout, metadata: , retry_policy: @config.rpcs.create_finding.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :create_finding, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#create_mute_config(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V2::MuteConfig #create_mute_config(parent: nil, mute_config: nil, mute_config_id: nil) ⇒ ::Google::Cloud::SecurityCenter::V2::MuteConfig
Creates a mute config.
640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 640 def create_mute_config request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_mute_config..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/?$}.match request.parent if regex_match header_params["location"] = regex_match["location".to_s] end end if request.parent regex_match = %r{^organizations/[^/]+/locations/(?<location>[^/]+)/?$}.match request.parent if regex_match header_params["location"] = regex_match["location".to_s] end end if request.parent regex_match = %r{^folders/[^/]+/locations/(?<location>[^/]+)/?$}.match request.parent if regex_match header_params["location"] = regex_match["location".to_s] end end request_params_header = URI.encode_www_form header_params [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.create_mute_config.timeout, metadata: , retry_policy: @config.rpcs.create_mute_config.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :create_mute_config, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#create_notification_config(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V2::NotificationConfig #create_notification_config(parent: nil, config_id: nil, notification_config: nil) ⇒ ::Google::Cloud::SecurityCenter::V2::NotificationConfig
Creates a notification config.
752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 752 def create_notification_config request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_notification_config..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.create_notification_config.timeout, metadata: , retry_policy: @config.rpcs.create_notification_config.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :create_notification_config, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#create_source(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V2::Source #create_source(parent: nil, source: nil) ⇒ ::Google::Cloud::SecurityCenter::V2::Source
Creates a source.
841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 841 def create_source request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateSourceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_source..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.create_source.timeout, metadata: , retry_policy: @config.rpcs.create_source.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :create_source, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_big_query_export(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_big_query_export(name: nil) ⇒ ::Google::Protobuf::Empty
Deletes an existing BigQuery export.
932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 932 def delete_big_query_export request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_big_query_export..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.delete_big_query_export.timeout, metadata: , retry_policy: @config.rpcs.delete_big_query_export.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :delete_big_query_export, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_mute_config(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_mute_config(name: nil) ⇒ ::Google::Protobuf::Empty
Deletes an existing mute config. If no location is specified, default is global.
1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 1027 def delete_mute_config request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_mute_config..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/muteConfigs/[^/]+/?$}.match request.name if regex_match header_params["location"] = regex_match["location".to_s] end end if request.name regex_match = %r{^organizations/[^/]+/locations/(?<location>[^/]+)/muteConfigs/[^/]+/?$}.match request.name if regex_match header_params["location"] = regex_match["location".to_s] end end if request.name regex_match = %r{^folders/[^/]+/locations/(?<location>[^/]+)/muteConfigs/[^/]+/?$}.match request.name if regex_match header_params["location"] = regex_match["location".to_s] end end request_params_header = URI.encode_www_form header_params [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.delete_mute_config.timeout, metadata: , retry_policy: @config.rpcs.delete_mute_config.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :delete_mute_config, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_notification_config(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_notification_config(name: nil) ⇒ ::Google::Protobuf::Empty
Deletes a notification config.
1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 1135 def delete_notification_config request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_notification_config..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.delete_notification_config.timeout, metadata: , retry_policy: @config.rpcs.delete_notification_config.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :delete_notification_config, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_resource_value_config(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_resource_value_config(name: nil) ⇒ ::Google::Protobuf::Empty
Deletes a ResourceValueConfig.
1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 1220 def delete_resource_value_config request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_resource_value_config..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.delete_resource_value_config.timeout, metadata: , retry_policy: @config.rpcs.delete_resource_value_config.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :delete_resource_value_config, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_big_query_export(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V2::BigQueryExport #get_big_query_export(name: nil) ⇒ ::Google::Cloud::SecurityCenter::V2::BigQueryExport
Gets a BigQuery export.
1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 1311 def get_big_query_export request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_big_query_export..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_big_query_export.timeout, metadata: , retry_policy: @config.rpcs.get_big_query_export.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :get_big_query_export, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy #get_iam_policy(resource: nil, options: nil) ⇒ ::Google::Iam::V1::Policy
Gets the access control policy on the specified Source.
1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 1578 def get_iam_policy request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_iam_policy..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.resource header_params["resource"] = request.resource end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, metadata: , retry_policy: @config.rpcs.get_iam_policy.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :get_iam_policy, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_mute_config(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V2::MuteConfig #get_mute_config(name: nil) ⇒ ::Google::Cloud::SecurityCenter::V2::MuteConfig
Gets a mute config. If no location is specified, default is global.
1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 1673 def get_mute_config request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_mute_config..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/muteConfigs/[^/]+/?$}.match request.name if regex_match header_params["location"] = regex_match["location".to_s] end end if request.name regex_match = %r{^organizations/[^/]+/locations/(?<location>[^/]+)/muteConfigs/[^/]+/?$}.match request.name if regex_match header_params["location"] = regex_match["location".to_s] end end if request.name regex_match = %r{^folders/[^/]+/locations/(?<location>[^/]+)/muteConfigs/[^/]+/?$}.match request.name if regex_match header_params["location"] = regex_match["location".to_s] end end request_params_header = URI.encode_www_form header_params [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_mute_config.timeout, metadata: , retry_policy: @config.rpcs.get_mute_config.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :get_mute_config, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_notification_config(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V2::NotificationConfig #get_notification_config(name: nil) ⇒ ::Google::Cloud::SecurityCenter::V2::NotificationConfig
Gets a notification config.
1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 1781 def get_notification_config request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_notification_config..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_notification_config.timeout, metadata: , retry_policy: @config.rpcs.get_notification_config.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :get_notification_config, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_resource_value_config(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig #get_resource_value_config(name: nil) ⇒ ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig
Gets a ResourceValueConfig.
1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 1867 def get_resource_value_config request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_resource_value_config..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_resource_value_config.timeout, metadata: , retry_policy: @config.rpcs.get_resource_value_config.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :get_resource_value_config, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_simulation(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V2::Simulation #get_simulation(name: nil) ⇒ ::Google::Cloud::SecurityCenter::V2::Simulation
Get the simulation by name or the latest simulation for the given organization.
1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 1401 def get_simulation request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetSimulationRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_simulation..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_simulation.timeout, metadata: , retry_policy: @config.rpcs.get_simulation.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :get_simulation, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_source(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V2::Source #get_source(name: nil) ⇒ ::Google::Cloud::SecurityCenter::V2::Source
Gets a source.
1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 1953 def get_source request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetSourceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_source..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_source.timeout, metadata: , retry_policy: @config.rpcs.get_source.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :get_source, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_valued_resource(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V2::ValuedResource #get_valued_resource(name: nil) ⇒ ::Google::Cloud::SecurityCenter::V2::ValuedResource
Get the valued resource by name
1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 1489 def get_valued_resource request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_valued_resource..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_valued_resource.timeout, metadata: , retry_policy: @config.rpcs.get_valued_resource.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :get_valued_resource, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#group_findings(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::GroupResult> #group_findings(parent: nil, filter: nil, group_by: nil, page_token: nil, page_size: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::GroupResult>
Filters an organization or source's findings and groups them by their specified properties in a location. If no location is specified, findings are assumed to be in global
To group across all sources provide a -
as the source id.
The following list shows some examples:
/v2/organizations/{organization_id}/sources/-/findings
+/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings
/v2/folders/{folder_id}/sources/-/findings
/v2/folders/{folder_id}/sources/-/locations/{location_id}/findings
/v2/projects/{project_id}/sources/-/findings
/v2/projects/{project_id}/sources/-/locations/{location_id}/findings
2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 2142 def group_findings request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.group_findings..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.group_findings.timeout, metadata: , retry_policy: @config.rpcs.group_findings.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :group_findings, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @security_center_stub, :group_findings, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_attack_paths(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::AttackPath> #list_attack_paths(parent: nil, filter: nil, page_token: nil, page_size: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::AttackPath>
Lists the attack paths for a set of simulation results or valued resources and filter.
2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 2251 def list_attack_paths request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_attack_paths..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_attack_paths.timeout, metadata: , retry_policy: @config.rpcs.list_attack_paths.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :list_attack_paths, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_attack_paths, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_big_query_exports(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::BigQueryExport> #list_big_query_exports(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::BigQueryExport>
Lists BigQuery exports. Note that when requesting BigQuery exports at a given level all exports under that level are also returned e.g. if requesting BigQuery exports under a folder, then all BigQuery exports immediately under the folder plus the ones created under the projects within the folder are returned.
2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 2358 def list_big_query_exports request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_big_query_exports..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_big_query_exports.timeout, metadata: , retry_policy: @config.rpcs.list_big_query_exports.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :list_big_query_exports, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_big_query_exports, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_findings(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ListFindingsResponse::ListFindingsResult> #list_findings(parent: nil, filter: nil, order_by: nil, field_mask: nil, page_token: nil, page_size: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ListFindingsResponse::ListFindingsResult>
Lists an organization or source's findings.
To list across all sources for a given location provide a -
as the source
id. If no location is specified, finding are assumed to be in global.
The following list shows some examples:
/v2/organizations/{organization_id}/sources/-/findings
+/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings
2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 2553 def list_findings request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListFindingsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_findings..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_findings.timeout, metadata: , retry_policy: @config.rpcs.list_findings.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :list_findings, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_findings, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_mute_configs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::MuteConfig> #list_mute_configs(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::MuteConfig>
Lists mute configs. If no location is specified, default is global.
2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 2660 def list_mute_configs request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_mute_configs..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/muteConfigs/?$}.match request.parent if regex_match header_params["location"] = regex_match["location".to_s] end end if request.parent regex_match = %r{^organizations/[^/]+/locations/(?<location>[^/]+)/muteConfigs/?$}.match request.parent if regex_match header_params["location"] = regex_match["location".to_s] end end if request.parent regex_match = %r{^folders/[^/]+/locations/(?<location>[^/]+)/muteConfigs/?$}.match request.parent if regex_match header_params["location"] = regex_match["location".to_s] end end request_params_header = URI.encode_www_form header_params [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_mute_configs.timeout, metadata: , retry_policy: @config.rpcs.list_mute_configs.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :list_mute_configs, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_mute_configs, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_notification_configs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::NotificationConfig> #list_notification_configs(parent: nil, page_token: nil, page_size: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::NotificationConfig>
Lists notification configs.
2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 2776 def list_notification_configs request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_notification_configs..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_notification_configs.timeout, metadata: , retry_policy: @config.rpcs.list_notification_configs.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :list_notification_configs, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_notification_configs, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_resource_value_configs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ResourceValueConfig> #list_resource_value_configs(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ResourceValueConfig>
Lists all ResourceValueConfigs.
2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 2882 def list_resource_value_configs request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_resource_value_configs..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_resource_value_configs.timeout, metadata: , retry_policy: @config.rpcs.list_resource_value_configs.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :list_resource_value_configs, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_resource_value_configs, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_sources(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::Source> #list_sources(parent: nil, page_token: nil, page_size: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::Source>
Lists all sources belonging to an organization.
2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 2981 def list_sources request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListSourcesRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_sources..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_sources.timeout, metadata: , retry_policy: @config.rpcs.list_sources.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :list_sources, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_sources, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_valued_resources(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ValuedResource> #list_valued_resources(parent: nil, filter: nil, page_token: nil, page_size: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ValuedResource>
Lists the valued resources for a set of simulation results and filter.
3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 3106 def list_valued_resources request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_valued_resources..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_valued_resources.timeout, metadata: , retry_policy: @config.rpcs.list_valued_resources.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :list_valued_resources, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_valued_resources, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#set_finding_state(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V2::Finding #set_finding_state(name: nil, state: nil) ⇒ ::Google::Cloud::SecurityCenter::V2::Finding
Updates the state of a finding. If no location is specified, finding is assumed to be in global
3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 3209 def set_finding_state request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.set_finding_state..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.set_finding_state.timeout, metadata: , retry_policy: @config.rpcs.set_finding_state.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :set_finding_state, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#set_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy #set_iam_policy(resource: nil, policy: nil, update_mask: nil) ⇒ ::Google::Iam::V1::Policy
Sets the access control policy on the specified Source.
3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 3306 def set_iam_policy request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.set_iam_policy..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.resource header_params["resource"] = request.resource end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, metadata: , retry_policy: @config.rpcs.set_iam_policy.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :set_iam_policy, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#set_mute(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V2::Finding #set_mute(name: nil, mute: nil) ⇒ ::Google::Cloud::SecurityCenter::V2::Finding
Updates the mute state of a finding. If no location is specified, finding is assumed to be in global
3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 3408 def set_mute request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::SetMuteRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.set_mute..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.set_mute.timeout, metadata: , retry_policy: @config.rpcs.set_mute.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :set_mute, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#test_iam_permissions(request, options = nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse #test_iam_permissions(resource: nil, permissions: nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse
Returns the permissions that a caller has on the specified source.
3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 3499 def request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs...to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.resource header_params["resource"] = request.resource end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs..timeout, metadata: , retry_policy: @config.rpcs..retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :test_iam_permissions, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#universe_domain ⇒ String
The effective universe domain
101 102 103 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 101 def universe_domain @security_center_stub.universe_domain end |
#update_big_query_export(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V2::BigQueryExport #update_big_query_export(big_query_export: nil, update_mask: nil) ⇒ ::Google::Cloud::SecurityCenter::V2::BigQueryExport
Updates a BigQuery export.
3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 3587 def update_big_query_export request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_big_query_export..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.big_query_export&.name header_params["big_query_export.name"] = request.big_query_export.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_big_query_export.timeout, metadata: , retry_policy: @config.rpcs.update_big_query_export.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :update_big_query_export, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_external_system(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V2::ExternalSystem #update_external_system(external_system: nil, update_mask: nil) ⇒ ::Google::Cloud::SecurityCenter::V2::ExternalSystem
Updates external system. This is for a given finding. If no location is specified, finding is assumed to be in global
3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 3677 def update_external_system request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_external_system..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.external_system&.name header_params["external_system.name"] = request.external_system.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_external_system.timeout, metadata: , retry_policy: @config.rpcs.update_external_system.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :update_external_system, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_finding(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V2::Finding #update_finding(finding: nil, update_mask: nil) ⇒ ::Google::Cloud::SecurityCenter::V2::Finding
Creates or updates a finding. If no location is specified, finding is assumed to be in global. The corresponding source must exist for a finding creation to succeed.
3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 3777 def update_finding request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_finding..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.finding&.name header_params["finding.name"] = request.finding.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_finding.timeout, metadata: , retry_policy: @config.rpcs.update_finding.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :update_finding, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_mute_config(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V2::MuteConfig #update_mute_config(mute_config: nil, update_mask: nil) ⇒ ::Google::Cloud::SecurityCenter::V2::MuteConfig
Updates a mute config. If no location is specified, default is global.
3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 3866 def update_mute_config request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_mute_config..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.mute_config&.name regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/muteConfigs/[^/]+/?$}.match request.mute_config.name if regex_match header_params["location"] = regex_match["location".to_s] end end if request.mute_config&.name regex_match = %r{^organizations/[^/]+/locations/(?<location>[^/]+)/muteConfigs/[^/]+/?$}.match request.mute_config.name if regex_match header_params["location"] = regex_match["location".to_s] end end if request.mute_config&.name regex_match = %r{^folders/[^/]+/locations/(?<location>[^/]+)/muteConfigs/[^/]+/?$}.match request.mute_config.name if regex_match header_params["location"] = regex_match["location".to_s] end end request_params_header = URI.encode_www_form header_params [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_mute_config.timeout, metadata: , retry_policy: @config.rpcs.update_mute_config.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :update_mute_config, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_notification_config(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V2::NotificationConfig #update_notification_config(notification_config: nil, update_mask: nil) ⇒ ::Google::Cloud::SecurityCenter::V2::NotificationConfig
Updates a notification config. The following update fields are allowed: description, pubsub_topic, streaming_config.filter
3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 3971 def update_notification_config request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_notification_config..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.notification_config&.name header_params["notification_config.name"] = request.notification_config.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_notification_config.timeout, metadata: , retry_policy: @config.rpcs.update_notification_config.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :update_notification_config, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_resource_value_config(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig #update_resource_value_config(resource_value_config: nil, update_mask: nil) ⇒ ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig
Updates an existing ResourceValueConfigs with new rules.
4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 4059 def update_resource_value_config request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_resource_value_config..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.resource_value_config&.name header_params["resource_value_config.name"] = request.resource_value_config.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_resource_value_config.timeout, metadata: , retry_policy: @config.rpcs.update_resource_value_config.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :update_resource_value_config, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_security_marks(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V2::SecurityMarks #update_security_marks(security_marks: nil, update_mask: nil) ⇒ ::Google::Cloud::SecurityCenter::V2::SecurityMarks
Updates security marks. For Finding Security marks, if no location is specified, finding is assumed to be in global. Assets Security Marks can only be accessed through global endpoint.
4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 4152 def update_security_marks request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_security_marks..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.security_marks&.name header_params["security_marks.name"] = request.security_marks.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_security_marks.timeout, metadata: , retry_policy: @config.rpcs.update_security_marks.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :update_security_marks, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_source(request, options = nil) ⇒ ::Google::Cloud::SecurityCenter::V2::Source #update_source(source: nil, update_mask: nil) ⇒ ::Google::Cloud::SecurityCenter::V2::Source
Updates a source.
4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 |
# File 'lib/google/cloud/security_center/v2/security_center/client.rb', line 4241 def update_source request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_source..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.source&.name header_params["source.name"] = request.source.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_source.timeout, metadata: , retry_policy: @config.rpcs.update_source.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @security_center_stub.call_rpc :update_source, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |