google-cloud-security_center-v2 0.a → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/security_center/v2/rest.rb +37 -0
  6. data/lib/google/cloud/security_center/v2/security_center/client.rb +4728 -0
  7. data/lib/google/cloud/security_center/v2/security_center/credentials.rb +51 -0
  8. data/lib/google/cloud/security_center/v2/security_center/operations.rb +801 -0
  9. data/lib/google/cloud/security_center/v2/security_center/paths.rb +973 -0
  10. data/lib/google/cloud/security_center/v2/security_center/rest/client.rb +4347 -0
  11. data/lib/google/cloud/security_center/v2/security_center/rest/operations.rb +894 -0
  12. data/lib/google/cloud/security_center/v2/security_center/rest/service_stub.rb +3165 -0
  13. data/lib/google/cloud/security_center/v2/security_center/rest.rb +53 -0
  14. data/lib/google/cloud/security_center/v2/security_center.rb +56 -0
  15. data/lib/google/cloud/security_center/v2/version.rb +7 -2
  16. data/lib/google/cloud/security_center/v2.rb +45 -0
  17. data/lib/google/cloud/securitycenter/v2/access_pb.rb +44 -0
  18. data/lib/google/cloud/securitycenter/v2/application_pb.rb +42 -0
  19. data/lib/google/cloud/securitycenter/v2/attack_exposure_pb.rb +47 -0
  20. data/lib/google/cloud/securitycenter/v2/attack_path_pb.rb +49 -0
  21. data/lib/google/cloud/securitycenter/v2/backup_disaster_recovery_pb.rb +45 -0
  22. data/lib/google/cloud/securitycenter/v2/bigquery_export_pb.rb +47 -0
  23. data/lib/google/cloud/securitycenter/v2/cloud_dlp_data_profile_pb.rb +45 -0
  24. data/lib/google/cloud/securitycenter/v2/cloud_dlp_inspection_pb.rb +44 -0
  25. data/lib/google/cloud/securitycenter/v2/compliance_pb.rb +42 -0
  26. data/lib/google/cloud/securitycenter/v2/connection_pb.rb +43 -0
  27. data/lib/google/cloud/securitycenter/v2/contact_details_pb.rb +43 -0
  28. data/lib/google/cloud/securitycenter/v2/container_pb.rb +47 -0
  29. data/lib/google/cloud/securitycenter/v2/database_pb.rb +42 -0
  30. data/lib/google/cloud/securitycenter/v2/exfiltration_pb.rb +43 -0
  31. data/lib/google/cloud/securitycenter/v2/external_system_pb.rb +47 -0
  32. data/lib/google/cloud/securitycenter/v2/file_pb.rb +43 -0
  33. data/lib/google/cloud/securitycenter/v2/finding_pb.rb +105 -0
  34. data/lib/google/cloud/securitycenter/v2/iam_binding_pb.rb +43 -0
  35. data/lib/google/cloud/securitycenter/v2/indicator_pb.rb +47 -0
  36. data/lib/google/cloud/securitycenter/v2/kernel_rootkit_pb.rb +42 -0
  37. data/lib/google/cloud/securitycenter/v2/kubernetes_pb.rb +57 -0
  38. data/lib/google/cloud/securitycenter/v2/label_pb.rb +42 -0
  39. data/lib/google/cloud/securitycenter/v2/load_balancer_pb.rb +42 -0
  40. data/lib/google/cloud/securitycenter/v2/log_entry_pb.rb +46 -0
  41. data/lib/google/cloud/securitycenter/v2/mitre_attack_pb.rb +44 -0
  42. data/lib/google/cloud/securitycenter/v2/mute_config_pb.rb +48 -0
  43. data/lib/google/cloud/securitycenter/v2/notification_config_pb.rb +46 -0
  44. data/lib/google/cloud/securitycenter/v2/notification_message_pb.rb +47 -0
  45. data/lib/google/cloud/securitycenter/v2/org_policy_pb.rb +44 -0
  46. data/lib/google/cloud/securitycenter/v2/process_pb.rb +46 -0
  47. data/lib/google/cloud/securitycenter/v2/resource_pb.rb +44 -0
  48. data/lib/google/cloud/securitycenter/v2/resource_value_config_pb.rb +49 -0
  49. data/lib/google/cloud/securitycenter/v2/security_marks_pb.rb +44 -0
  50. data/lib/google/cloud/securitycenter/v2/security_posture_pb.rb +43 -0
  51. data/lib/google/cloud/securitycenter/v2/securitycenter_service_pb.rb +128 -0
  52. data/lib/google/cloud/securitycenter/v2/securitycenter_service_services_pb.rb +167 -0
  53. data/lib/google/cloud/securitycenter/v2/simulation_pb.rb +49 -0
  54. data/lib/google/cloud/securitycenter/v2/source_pb.rb +44 -0
  55. data/lib/google/cloud/securitycenter/v2/valued_resource_pb.rb +46 -0
  56. data/lib/google/cloud/securitycenter/v2/vulnerability_pb.rb +58 -0
  57. data/lib/google-cloud-security_center-v2.rb +21 -0
  58. data/proto_docs/README.md +4 -0
  59. data/proto_docs/google/api/client.rb +399 -0
  60. data/proto_docs/google/api/field_behavior.rb +85 -0
  61. data/proto_docs/google/api/launch_stage.rb +71 -0
  62. data/proto_docs/google/api/resource.rb +222 -0
  63. data/proto_docs/google/api/routing.rb +459 -0
  64. data/proto_docs/google/cloud/securitycenter/v2/access.rb +120 -0
  65. data/proto_docs/google/cloud/securitycenter/v2/application.rb +40 -0
  66. data/proto_docs/google/cloud/securitycenter/v2/attack_exposure.rb +73 -0
  67. data/proto_docs/google/cloud/securitycenter/v2/attack_path.rb +147 -0
  68. data/proto_docs/google/cloud/securitycenter/v2/backup_disaster_recovery.rb +90 -0
  69. data/proto_docs/google/cloud/securitycenter/v2/bigquery_export.rb +96 -0
  70. data/proto_docs/google/cloud/securitycenter/v2/cloud_dlp_data_profile.rb +52 -0
  71. data/proto_docs/google/cloud/securitycenter/v2/cloud_dlp_inspection.rb +50 -0
  72. data/proto_docs/google/cloud/securitycenter/v2/compliance.rb +43 -0
  73. data/proto_docs/google/cloud/securitycenter/v2/connection.rb +70 -0
  74. data/proto_docs/google/cloud/securitycenter/v2/contact_details.rb +44 -0
  75. data/proto_docs/google/cloud/securitycenter/v2/container.rb +49 -0
  76. data/proto_docs/google/cloud/securitycenter/v2/database.rb +67 -0
  77. data/proto_docs/google/cloud/securitycenter/v2/exfiltration.rb +64 -0
  78. data/proto_docs/google/cloud/securitycenter/v2/external_system.rb +106 -0
  79. data/proto_docs/google/cloud/securitycenter/v2/file.rb +72 -0
  80. data/proto_docs/google/cloud/securitycenter/v2/finding.rb +411 -0
  81. data/proto_docs/google/cloud/securitycenter/v2/iam_binding.rb +56 -0
  82. data/proto_docs/google/cloud/securitycenter/v2/indicator.rb +112 -0
  83. data/proto_docs/google/cloud/securitycenter/v2/kernel_rootkit.rb +66 -0
  84. data/proto_docs/google/cloud/securitycenter/v2/kubernetes.rb +241 -0
  85. data/proto_docs/google/cloud/securitycenter/v2/label.rb +41 -0
  86. data/proto_docs/google/cloud/securitycenter/v2/load_balancer.rb +36 -0
  87. data/proto_docs/google/cloud/securitycenter/v2/log_entry.rb +58 -0
  88. data/proto_docs/google/cloud/securitycenter/v2/mitre_attack.rb +285 -0
  89. data/proto_docs/google/cloud/securitycenter/v2/mute_config.rb +100 -0
  90. data/proto_docs/google/cloud/securitycenter/v2/notification_config.rb +90 -0
  91. data/proto_docs/google/cloud/securitycenter/v2/notification_message.rb +42 -0
  92. data/proto_docs/google/cloud/securitycenter/v2/org_policy.rb +37 -0
  93. data/proto_docs/google/cloud/securitycenter/v2/process.rb +79 -0
  94. data/proto_docs/google/cloud/securitycenter/v2/resource.rb +42 -0
  95. data/proto_docs/google/cloud/securitycenter/v2/resource_value_config.rb +122 -0
  96. data/proto_docs/google/cloud/securitycenter/v2/security_marks.rb +84 -0
  97. data/proto_docs/google/cloud/securitycenter/v2/security_posture.rb +83 -0
  98. data/proto_docs/google/cloud/securitycenter/v2/securitycenter_service.rb +1136 -0
  99. data/proto_docs/google/cloud/securitycenter/v2/simulation.rb +43 -0
  100. data/proto_docs/google/cloud/securitycenter/v2/source.rb +65 -0
  101. data/proto_docs/google/cloud/securitycenter/v2/valued_resource.rb +86 -0
  102. data/proto_docs/google/cloud/securitycenter/v2/vulnerability.rb +333 -0
  103. data/proto_docs/google/iam/v1/iam_policy.rb +87 -0
  104. data/proto_docs/google/iam/v1/options.rb +50 -0
  105. data/proto_docs/google/iam/v1/policy.rb +426 -0
  106. data/proto_docs/google/longrunning/operations.rb +164 -0
  107. data/proto_docs/google/protobuf/any.rb +145 -0
  108. data/proto_docs/google/protobuf/duration.rb +98 -0
  109. data/proto_docs/google/protobuf/empty.rb +34 -0
  110. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  111. data/proto_docs/google/protobuf/struct.rb +96 -0
  112. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  113. data/proto_docs/google/rpc/status.rb +48 -0
  114. data/proto_docs/google/type/expr.rb +75 -0
  115. metadata +169 -10
@@ -0,0 +1,4728 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/securitycenter/v2/securitycenter_service_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module SecurityCenter
25
+ module V2
26
+ module SecurityCenter
27
+ ##
28
+ # Client for the SecurityCenter service.
29
+ #
30
+ # V2 APIs for Security Center service.
31
+ #
32
+ class Client
33
+ # @private
34
+ DEFAULT_ENDPOINT_TEMPLATE = "securitycenter.$UNIVERSE_DOMAIN$"
35
+
36
+ include Paths
37
+
38
+ # @private
39
+ attr_reader :security_center_stub
40
+
41
+ ##
42
+ # Configure the SecurityCenter Client class.
43
+ #
44
+ # See {::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client::Configuration}
45
+ # for a description of the configuration fields.
46
+ #
47
+ # @example
48
+ #
49
+ # # Modify the configuration for all SecurityCenter clients
50
+ # ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.configure do |config|
51
+ # config.timeout = 10.0
52
+ # end
53
+ #
54
+ # @yield [config] Configure the Client client.
55
+ # @yieldparam config [Client::Configuration]
56
+ #
57
+ # @return [Client::Configuration]
58
+ #
59
+ def self.configure
60
+ @configure ||= begin
61
+ namespace = ["Google", "Cloud", "SecurityCenter", "V2"]
62
+ parent_config = while namespace.any?
63
+ parent_name = namespace.join "::"
64
+ parent_const = const_get parent_name
65
+ break parent_const.configure if parent_const.respond_to? :configure
66
+ namespace.pop
67
+ end
68
+ default_config = Client::Configuration.new parent_config
69
+
70
+ default_config
71
+ end
72
+ yield @configure if block_given?
73
+ @configure
74
+ end
75
+
76
+ ##
77
+ # Configure the SecurityCenter Client instance.
78
+ #
79
+ # The configuration is set to the derived mode, meaning that values can be changed,
80
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
81
+ # should be made on {Client.configure}.
82
+ #
83
+ # See {::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client::Configuration}
84
+ # for a description of the configuration fields.
85
+ #
86
+ # @yield [config] Configure the Client client.
87
+ # @yieldparam config [Client::Configuration]
88
+ #
89
+ # @return [Client::Configuration]
90
+ #
91
+ def configure
92
+ yield @config if block_given?
93
+ @config
94
+ end
95
+
96
+ ##
97
+ # The effective universe domain
98
+ #
99
+ # @return [String]
100
+ #
101
+ def universe_domain
102
+ @security_center_stub.universe_domain
103
+ end
104
+
105
+ ##
106
+ # Create a new SecurityCenter client object.
107
+ #
108
+ # @example
109
+ #
110
+ # # Create a client using the default configuration
111
+ # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
112
+ #
113
+ # # Create a client using a custom configuration
114
+ # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config|
115
+ # config.timeout = 10.0
116
+ # end
117
+ #
118
+ # @yield [config] Configure the SecurityCenter client.
119
+ # @yieldparam config [Client::Configuration]
120
+ #
121
+ def initialize
122
+ # These require statements are intentionally placed here to initialize
123
+ # the gRPC module only when it's required.
124
+ # See https://github.com/googleapis/toolkit/issues/446
125
+ require "gapic/grpc"
126
+ require "google/cloud/securitycenter/v2/securitycenter_service_services_pb"
127
+
128
+ # Create the configuration object
129
+ @config = Configuration.new Client.configure
130
+
131
+ # Yield the configuration if needed
132
+ yield @config if block_given?
133
+
134
+ # Create credentials
135
+ credentials = @config.credentials
136
+ # Use self-signed JWT if the endpoint is unchanged from default,
137
+ # but only if the default endpoint does not have a region prefix.
138
+ enable_self_signed_jwt = @config.endpoint.nil? ||
139
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
140
+ !@config.endpoint.split(".").first.include?("-"))
141
+ credentials ||= Credentials.default scope: @config.scope,
142
+ enable_self_signed_jwt: enable_self_signed_jwt
143
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
144
+ credentials = Credentials.new credentials, scope: @config.scope
145
+ end
146
+ @quota_project_id = @config.quota_project
147
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
148
+
149
+ @operations_client = Operations.new do |config|
150
+ config.credentials = credentials
151
+ config.quota_project = @quota_project_id
152
+ config.endpoint = @config.endpoint
153
+ config.universe_domain = @config.universe_domain
154
+ end
155
+
156
+ @security_center_stub = ::Gapic::ServiceStub.new(
157
+ ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Stub,
158
+ credentials: credentials,
159
+ endpoint: @config.endpoint,
160
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
161
+ universe_domain: @config.universe_domain,
162
+ channel_args: @config.channel_args,
163
+ interceptors: @config.interceptors,
164
+ channel_pool_config: @config.channel_pool
165
+ )
166
+ end
167
+
168
+ ##
169
+ # Get the associated client for long-running operations.
170
+ #
171
+ # @return [::Google::Cloud::SecurityCenter::V2::SecurityCenter::Operations]
172
+ #
173
+ attr_reader :operations_client
174
+
175
+ # Service calls
176
+
177
+ ##
178
+ # Creates a ResourceValueConfig for an organization. Maps user's tags to
179
+ # difference resource values for use by the attack path simulation.
180
+ #
181
+ # @overload batch_create_resource_value_configs(request, options = nil)
182
+ # Pass arguments to `batch_create_resource_value_configs` via a request object, either of type
183
+ # {::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest} or an equivalent Hash.
184
+ #
185
+ # @param request [::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest, ::Hash]
186
+ # A request object representing the call parameters. Required. To specify no
187
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
188
+ # @param options [::Gapic::CallOptions, ::Hash]
189
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
190
+ #
191
+ # @overload batch_create_resource_value_configs(parent: nil, requests: nil)
192
+ # Pass arguments to `batch_create_resource_value_configs` via keyword arguments. Note that at
193
+ # least one keyword argument is required. To specify no parameters, or to keep all
194
+ # the default parameter values, pass an empty Hash as a request object (see above).
195
+ #
196
+ # @param parent [::String]
197
+ # Required. Resource name of the new ResourceValueConfig's parent.
198
+ # The parent field in the CreateResourceValueConfigRequest
199
+ # messages must either be empty or match this field.
200
+ # @param requests [::Array<::Google::Cloud::SecurityCenter::V2::CreateResourceValueConfigRequest, ::Hash>]
201
+ # Required. The resource value configs to be created.
202
+ #
203
+ # @yield [response, operation] Access the result along with the RPC operation
204
+ # @yieldparam response [::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse]
205
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
206
+ #
207
+ # @return [::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse]
208
+ #
209
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
210
+ #
211
+ # @example Basic example
212
+ # require "google/cloud/security_center/v2"
213
+ #
214
+ # # Create a client object. The client can be reused for multiple calls.
215
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
216
+ #
217
+ # # Create a request. To set request fields, pass in keyword arguments.
218
+ # request = Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest.new
219
+ #
220
+ # # Call the batch_create_resource_value_configs method.
221
+ # result = client.batch_create_resource_value_configs request
222
+ #
223
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsResponse.
224
+ # p result
225
+ #
226
+ def batch_create_resource_value_configs request, options = nil
227
+ raise ::ArgumentError, "request must be provided" if request.nil?
228
+
229
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::BatchCreateResourceValueConfigsRequest
230
+
231
+ # Converts hash and nil to an options object
232
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
233
+
234
+ # Customize the options with defaults
235
+ metadata = @config.rpcs.batch_create_resource_value_configs.metadata.to_h
236
+
237
+ # Set x-goog-api-client and x-goog-user-project headers
238
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
239
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
240
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
241
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
242
+
243
+ header_params = {}
244
+ if request.parent
245
+ header_params["parent"] = request.parent
246
+ end
247
+
248
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
249
+ metadata[:"x-goog-request-params"] ||= request_params_header
250
+
251
+ options.apply_defaults timeout: @config.rpcs.batch_create_resource_value_configs.timeout,
252
+ metadata: metadata,
253
+ retry_policy: @config.rpcs.batch_create_resource_value_configs.retry_policy
254
+
255
+ options.apply_defaults timeout: @config.timeout,
256
+ metadata: @config.metadata,
257
+ retry_policy: @config.retry_policy
258
+
259
+ @security_center_stub.call_rpc :batch_create_resource_value_configs, request, options: options do |response, operation|
260
+ yield response, operation if block_given?
261
+ return response
262
+ end
263
+ rescue ::GRPC::BadStatus => e
264
+ raise ::Google::Cloud::Error.from_error(e)
265
+ end
266
+
267
+ ##
268
+ # Kicks off an LRO to bulk mute findings for a parent based on a filter. If
269
+ # no location is specified, findings are muted in global. The parent
270
+ # can be either an organization, folder, or project. The findings matched by
271
+ # the filter will be muted after the LRO is done.
272
+ #
273
+ # @overload bulk_mute_findings(request, options = nil)
274
+ # Pass arguments to `bulk_mute_findings` via a request object, either of type
275
+ # {::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest} or an equivalent Hash.
276
+ #
277
+ # @param request [::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest, ::Hash]
278
+ # A request object representing the call parameters. Required. To specify no
279
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
280
+ # @param options [::Gapic::CallOptions, ::Hash]
281
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
282
+ #
283
+ # @overload bulk_mute_findings(parent: nil, filter: nil)
284
+ # Pass arguments to `bulk_mute_findings` via keyword arguments. Note that at
285
+ # least one keyword argument is required. To specify no parameters, or to keep all
286
+ # the default parameter values, pass an empty Hash as a request object (see above).
287
+ #
288
+ # @param parent [::String]
289
+ # Required. The parent, at which bulk action needs to be applied. If no
290
+ # location is specified, findings are updated in global. The following list
291
+ # shows some examples:
292
+ #
293
+ # + `organizations/[organization_id]`
294
+ # + `organizations/[organization_id]/locations/[location_id]`
295
+ # + `folders/[folder_id]`
296
+ # + `folders/[folder_id]/locations/[location_id]`
297
+ # + `projects/[project_id]`
298
+ # + `projects/[project_id]/locations/[location_id]`
299
+ # @param filter [::String]
300
+ # Expression that identifies findings that should be updated.
301
+ # The expression is a list of zero or more restrictions combined
302
+ # via logical operators `AND` and `OR`. Parentheses are supported, and `OR`
303
+ # has higher precedence than `AND`.
304
+ #
305
+ # Restrictions have the form `<field> <operator> <value>` and may have a
306
+ # `-` character in front of them to indicate negation. The fields map to
307
+ # those defined in the corresponding resource.
308
+ #
309
+ # The supported operators are:
310
+ #
311
+ # * `=` for all value types.
312
+ # * `>`, `<`, `>=`, `<=` for integer values.
313
+ # * `:`, meaning substring matching, for strings.
314
+ #
315
+ # The supported value types are:
316
+ #
317
+ # * string literals in quotes.
318
+ # * integer literals without quotes.
319
+ # * boolean literals `true` and `false` without quotes.
320
+ #
321
+ # @yield [response, operation] Access the result along with the RPC operation
322
+ # @yieldparam response [::Gapic::Operation]
323
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
324
+ #
325
+ # @return [::Gapic::Operation]
326
+ #
327
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
328
+ #
329
+ # @example Basic example
330
+ # require "google/cloud/security_center/v2"
331
+ #
332
+ # # Create a client object. The client can be reused for multiple calls.
333
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
334
+ #
335
+ # # Create a request. To set request fields, pass in keyword arguments.
336
+ # request = Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest.new
337
+ #
338
+ # # Call the bulk_mute_findings method.
339
+ # result = client.bulk_mute_findings request
340
+ #
341
+ # # The returned object is of type Gapic::Operation. You can use it to
342
+ # # check the status of an operation, cancel it, or wait for results.
343
+ # # Here is how to wait for a response.
344
+ # result.wait_until_done! timeout: 60
345
+ # if result.response?
346
+ # p result.response
347
+ # else
348
+ # puts "No response received."
349
+ # end
350
+ #
351
+ def bulk_mute_findings request, options = nil
352
+ raise ::ArgumentError, "request must be provided" if request.nil?
353
+
354
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::BulkMuteFindingsRequest
355
+
356
+ # Converts hash and nil to an options object
357
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
358
+
359
+ # Customize the options with defaults
360
+ metadata = @config.rpcs.bulk_mute_findings.metadata.to_h
361
+
362
+ # Set x-goog-api-client and x-goog-user-project headers
363
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
364
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
365
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
366
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
367
+
368
+ header_params = {}
369
+ if request.parent
370
+ header_params["parent"] = request.parent
371
+ end
372
+
373
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
374
+ metadata[:"x-goog-request-params"] ||= request_params_header
375
+
376
+ options.apply_defaults timeout: @config.rpcs.bulk_mute_findings.timeout,
377
+ metadata: metadata,
378
+ retry_policy: @config.rpcs.bulk_mute_findings.retry_policy
379
+
380
+ options.apply_defaults timeout: @config.timeout,
381
+ metadata: @config.metadata,
382
+ retry_policy: @config.retry_policy
383
+
384
+ @security_center_stub.call_rpc :bulk_mute_findings, request, options: options do |response, operation|
385
+ response = ::Gapic::Operation.new response, @operations_client, options: options
386
+ yield response, operation if block_given?
387
+ return response
388
+ end
389
+ rescue ::GRPC::BadStatus => e
390
+ raise ::Google::Cloud::Error.from_error(e)
391
+ end
392
+
393
+ ##
394
+ # Creates a BigQuery export.
395
+ #
396
+ # @overload create_big_query_export(request, options = nil)
397
+ # Pass arguments to `create_big_query_export` via a request object, either of type
398
+ # {::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest} or an equivalent Hash.
399
+ #
400
+ # @param request [::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest, ::Hash]
401
+ # A request object representing the call parameters. Required. To specify no
402
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
403
+ # @param options [::Gapic::CallOptions, ::Hash]
404
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
405
+ #
406
+ # @overload create_big_query_export(parent: nil, big_query_export: nil, big_query_export_id: nil)
407
+ # Pass arguments to `create_big_query_export` via keyword arguments. Note that at
408
+ # least one keyword argument is required. To specify no parameters, or to keep all
409
+ # the default parameter values, pass an empty Hash as a request object (see above).
410
+ #
411
+ # @param parent [::String]
412
+ # Required. The name of the parent resource of the new BigQuery export. Its
413
+ # format is "organizations/[organization_id]/locations/[location_id]",
414
+ # "folders/[folder_id]/locations/[location_id]", or
415
+ # "projects/[project_id]/locations/[location_id]".
416
+ # @param big_query_export [::Google::Cloud::SecurityCenter::V2::BigQueryExport, ::Hash]
417
+ # Required. The BigQuery export being created.
418
+ # @param big_query_export_id [::String]
419
+ # Required. Unique identifier provided by the client within the parent scope.
420
+ # It must consist of only lowercase letters, numbers, and hyphens, must start
421
+ # with a letter, must end with either a letter or a number, and must be 63
422
+ # characters or less.
423
+ #
424
+ # @yield [response, operation] Access the result along with the RPC operation
425
+ # @yieldparam response [::Google::Cloud::SecurityCenter::V2::BigQueryExport]
426
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
427
+ #
428
+ # @return [::Google::Cloud::SecurityCenter::V2::BigQueryExport]
429
+ #
430
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
431
+ #
432
+ # @example Basic example
433
+ # require "google/cloud/security_center/v2"
434
+ #
435
+ # # Create a client object. The client can be reused for multiple calls.
436
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
437
+ #
438
+ # # Create a request. To set request fields, pass in keyword arguments.
439
+ # request = Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest.new
440
+ #
441
+ # # Call the create_big_query_export method.
442
+ # result = client.create_big_query_export request
443
+ #
444
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::BigQueryExport.
445
+ # p result
446
+ #
447
+ def create_big_query_export request, options = nil
448
+ raise ::ArgumentError, "request must be provided" if request.nil?
449
+
450
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateBigQueryExportRequest
451
+
452
+ # Converts hash and nil to an options object
453
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
454
+
455
+ # Customize the options with defaults
456
+ metadata = @config.rpcs.create_big_query_export.metadata.to_h
457
+
458
+ # Set x-goog-api-client and x-goog-user-project headers
459
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
460
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
461
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
462
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
463
+
464
+ header_params = {}
465
+ if request.parent
466
+ header_params["parent"] = request.parent
467
+ end
468
+
469
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
470
+ metadata[:"x-goog-request-params"] ||= request_params_header
471
+
472
+ options.apply_defaults timeout: @config.rpcs.create_big_query_export.timeout,
473
+ metadata: metadata,
474
+ retry_policy: @config.rpcs.create_big_query_export.retry_policy
475
+
476
+ options.apply_defaults timeout: @config.timeout,
477
+ metadata: @config.metadata,
478
+ retry_policy: @config.retry_policy
479
+
480
+ @security_center_stub.call_rpc :create_big_query_export, request, options: options do |response, operation|
481
+ yield response, operation if block_given?
482
+ return response
483
+ end
484
+ rescue ::GRPC::BadStatus => e
485
+ raise ::Google::Cloud::Error.from_error(e)
486
+ end
487
+
488
+ ##
489
+ # Creates a finding in a location. The corresponding source must exist for
490
+ # finding creation to succeed.
491
+ #
492
+ # @overload create_finding(request, options = nil)
493
+ # Pass arguments to `create_finding` via a request object, either of type
494
+ # {::Google::Cloud::SecurityCenter::V2::CreateFindingRequest} or an equivalent Hash.
495
+ #
496
+ # @param request [::Google::Cloud::SecurityCenter::V2::CreateFindingRequest, ::Hash]
497
+ # A request object representing the call parameters. Required. To specify no
498
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
499
+ # @param options [::Gapic::CallOptions, ::Hash]
500
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
501
+ #
502
+ # @overload create_finding(parent: nil, finding_id: nil, finding: nil)
503
+ # Pass arguments to `create_finding` via keyword arguments. Note that at
504
+ # least one keyword argument is required. To specify no parameters, or to keep all
505
+ # the default parameter values, pass an empty Hash as a request object (see above).
506
+ #
507
+ # @param parent [::String]
508
+ # Required. Resource name of the new finding's parent. The following list
509
+ # shows some examples of the format:
510
+ # +
511
+ # `organizations/[organization_id]/sources/[source_id]`
512
+ # +
513
+ # `organizations/[organization_id]/sources/[source_id]/locations/[location_id]`
514
+ # @param finding_id [::String]
515
+ # Required. Unique identifier provided by the client within the parent scope.
516
+ # It must be alphanumeric and less than or equal to 32 characters and
517
+ # greater than 0 characters in length.
518
+ # @param finding [::Google::Cloud::SecurityCenter::V2::Finding, ::Hash]
519
+ # Required. The Finding being created. The name and security_marks will be
520
+ # ignored as they are both output only fields on this resource.
521
+ #
522
+ # @yield [response, operation] Access the result along with the RPC operation
523
+ # @yieldparam response [::Google::Cloud::SecurityCenter::V2::Finding]
524
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
525
+ #
526
+ # @return [::Google::Cloud::SecurityCenter::V2::Finding]
527
+ #
528
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
529
+ #
530
+ # @example Basic example
531
+ # require "google/cloud/security_center/v2"
532
+ #
533
+ # # Create a client object. The client can be reused for multiple calls.
534
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
535
+ #
536
+ # # Create a request. To set request fields, pass in keyword arguments.
537
+ # request = Google::Cloud::SecurityCenter::V2::CreateFindingRequest.new
538
+ #
539
+ # # Call the create_finding method.
540
+ # result = client.create_finding request
541
+ #
542
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding.
543
+ # p result
544
+ #
545
+ def create_finding request, options = nil
546
+ raise ::ArgumentError, "request must be provided" if request.nil?
547
+
548
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateFindingRequest
549
+
550
+ # Converts hash and nil to an options object
551
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
552
+
553
+ # Customize the options with defaults
554
+ metadata = @config.rpcs.create_finding.metadata.to_h
555
+
556
+ # Set x-goog-api-client and x-goog-user-project headers
557
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
558
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
559
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
560
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
561
+
562
+ header_params = {}
563
+ if request.parent
564
+ header_params["parent"] = request.parent
565
+ end
566
+
567
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
568
+ metadata[:"x-goog-request-params"] ||= request_params_header
569
+
570
+ options.apply_defaults timeout: @config.rpcs.create_finding.timeout,
571
+ metadata: metadata,
572
+ retry_policy: @config.rpcs.create_finding.retry_policy
573
+
574
+ options.apply_defaults timeout: @config.timeout,
575
+ metadata: @config.metadata,
576
+ retry_policy: @config.retry_policy
577
+
578
+ @security_center_stub.call_rpc :create_finding, request, options: options do |response, operation|
579
+ yield response, operation if block_given?
580
+ return response
581
+ end
582
+ rescue ::GRPC::BadStatus => e
583
+ raise ::Google::Cloud::Error.from_error(e)
584
+ end
585
+
586
+ ##
587
+ # Creates a mute config.
588
+ #
589
+ # @overload create_mute_config(request, options = nil)
590
+ # Pass arguments to `create_mute_config` via a request object, either of type
591
+ # {::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest} or an equivalent Hash.
592
+ #
593
+ # @param request [::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest, ::Hash]
594
+ # A request object representing the call parameters. Required. To specify no
595
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
596
+ # @param options [::Gapic::CallOptions, ::Hash]
597
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
598
+ #
599
+ # @overload create_mute_config(parent: nil, mute_config: nil, mute_config_id: nil)
600
+ # Pass arguments to `create_mute_config` via keyword arguments. Note that at
601
+ # least one keyword argument is required. To specify no parameters, or to keep all
602
+ # the default parameter values, pass an empty Hash as a request object (see above).
603
+ #
604
+ # @param parent [::String]
605
+ # Required. Resource name of the new mute configs's parent. Its format is
606
+ # "organizations/[organization_id]/locations/[location_id]",
607
+ # "folders/[folder_id]/locations/[location_id]", or
608
+ # "projects/[project_id]/locations/[location_id]".
609
+ # @param mute_config [::Google::Cloud::SecurityCenter::V2::MuteConfig, ::Hash]
610
+ # Required. The mute config being created.
611
+ # @param mute_config_id [::String]
612
+ # Required. Unique identifier provided by the client within the parent scope.
613
+ # It must consist of only lowercase letters, numbers, and hyphens, must start
614
+ # with a letter, must end with either a letter or a number, and must be 63
615
+ # characters or less.
616
+ #
617
+ # @yield [response, operation] Access the result along with the RPC operation
618
+ # @yieldparam response [::Google::Cloud::SecurityCenter::V2::MuteConfig]
619
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
620
+ #
621
+ # @return [::Google::Cloud::SecurityCenter::V2::MuteConfig]
622
+ #
623
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
624
+ #
625
+ # @example Basic example
626
+ # require "google/cloud/security_center/v2"
627
+ #
628
+ # # Create a client object. The client can be reused for multiple calls.
629
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
630
+ #
631
+ # # Create a request. To set request fields, pass in keyword arguments.
632
+ # request = Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest.new
633
+ #
634
+ # # Call the create_mute_config method.
635
+ # result = client.create_mute_config request
636
+ #
637
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::MuteConfig.
638
+ # p result
639
+ #
640
+ def create_mute_config request, options = nil
641
+ raise ::ArgumentError, "request must be provided" if request.nil?
642
+
643
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateMuteConfigRequest
644
+
645
+ # Converts hash and nil to an options object
646
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
647
+
648
+ # Customize the options with defaults
649
+ metadata = @config.rpcs.create_mute_config.metadata.to_h
650
+
651
+ # Set x-goog-api-client and x-goog-user-project headers
652
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
653
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
654
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
655
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
656
+
657
+ header_params = {}
658
+ if request.parent
659
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/?$}.match request.parent
660
+ if regex_match
661
+ header_params["location"] = regex_match["location".to_s]
662
+ end
663
+ end
664
+ if request.parent
665
+ regex_match = %r{^organizations/[^/]+/locations/(?<location>[^/]+)/?$}.match request.parent
666
+ if regex_match
667
+ header_params["location"] = regex_match["location".to_s]
668
+ end
669
+ end
670
+ if request.parent
671
+ regex_match = %r{^folders/[^/]+/locations/(?<location>[^/]+)/?$}.match request.parent
672
+ if regex_match
673
+ header_params["location"] = regex_match["location".to_s]
674
+ end
675
+ end
676
+
677
+ request_params_header = URI.encode_www_form header_params
678
+ metadata[:"x-goog-request-params"] ||= request_params_header
679
+
680
+ options.apply_defaults timeout: @config.rpcs.create_mute_config.timeout,
681
+ metadata: metadata,
682
+ retry_policy: @config.rpcs.create_mute_config.retry_policy
683
+
684
+ options.apply_defaults timeout: @config.timeout,
685
+ metadata: @config.metadata,
686
+ retry_policy: @config.retry_policy
687
+
688
+ @security_center_stub.call_rpc :create_mute_config, request, options: options do |response, operation|
689
+ yield response, operation if block_given?
690
+ return response
691
+ end
692
+ rescue ::GRPC::BadStatus => e
693
+ raise ::Google::Cloud::Error.from_error(e)
694
+ end
695
+
696
+ ##
697
+ # Creates a notification config.
698
+ #
699
+ # @overload create_notification_config(request, options = nil)
700
+ # Pass arguments to `create_notification_config` via a request object, either of type
701
+ # {::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest} or an equivalent Hash.
702
+ #
703
+ # @param request [::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest, ::Hash]
704
+ # A request object representing the call parameters. Required. To specify no
705
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
706
+ # @param options [::Gapic::CallOptions, ::Hash]
707
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
708
+ #
709
+ # @overload create_notification_config(parent: nil, config_id: nil, notification_config: nil)
710
+ # Pass arguments to `create_notification_config` via keyword arguments. Note that at
711
+ # least one keyword argument is required. To specify no parameters, or to keep all
712
+ # the default parameter values, pass an empty Hash as a request object (see above).
713
+ #
714
+ # @param parent [::String]
715
+ # Required. Resource name of the new notification config's parent. Its format
716
+ # is "organizations/[organization_id]/locations/[location_id]",
717
+ # "folders/[folder_id]/locations/[location_id]", or
718
+ # "projects/[project_id]/locations/[location_id]".
719
+ # @param config_id [::String]
720
+ # Required.
721
+ # Unique identifier provided by the client within the parent scope.
722
+ # It must be between 1 and 128 characters and contain alphanumeric
723
+ # characters, underscores, or hyphens only.
724
+ # @param notification_config [::Google::Cloud::SecurityCenter::V2::NotificationConfig, ::Hash]
725
+ # Required. The notification config being created. The name and the service
726
+ # account will be ignored as they are both output only fields on this
727
+ # resource.
728
+ #
729
+ # @yield [response, operation] Access the result along with the RPC operation
730
+ # @yieldparam response [::Google::Cloud::SecurityCenter::V2::NotificationConfig]
731
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
732
+ #
733
+ # @return [::Google::Cloud::SecurityCenter::V2::NotificationConfig]
734
+ #
735
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
736
+ #
737
+ # @example Basic example
738
+ # require "google/cloud/security_center/v2"
739
+ #
740
+ # # Create a client object. The client can be reused for multiple calls.
741
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
742
+ #
743
+ # # Create a request. To set request fields, pass in keyword arguments.
744
+ # request = Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest.new
745
+ #
746
+ # # Call the create_notification_config method.
747
+ # result = client.create_notification_config request
748
+ #
749
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::NotificationConfig.
750
+ # p result
751
+ #
752
+ def create_notification_config request, options = nil
753
+ raise ::ArgumentError, "request must be provided" if request.nil?
754
+
755
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateNotificationConfigRequest
756
+
757
+ # Converts hash and nil to an options object
758
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
759
+
760
+ # Customize the options with defaults
761
+ metadata = @config.rpcs.create_notification_config.metadata.to_h
762
+
763
+ # Set x-goog-api-client and x-goog-user-project headers
764
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
765
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
766
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
767
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
768
+
769
+ header_params = {}
770
+ if request.parent
771
+ header_params["parent"] = request.parent
772
+ end
773
+
774
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
775
+ metadata[:"x-goog-request-params"] ||= request_params_header
776
+
777
+ options.apply_defaults timeout: @config.rpcs.create_notification_config.timeout,
778
+ metadata: metadata,
779
+ retry_policy: @config.rpcs.create_notification_config.retry_policy
780
+
781
+ options.apply_defaults timeout: @config.timeout,
782
+ metadata: @config.metadata,
783
+ retry_policy: @config.retry_policy
784
+
785
+ @security_center_stub.call_rpc :create_notification_config, request, options: options do |response, operation|
786
+ yield response, operation if block_given?
787
+ return response
788
+ end
789
+ rescue ::GRPC::BadStatus => e
790
+ raise ::Google::Cloud::Error.from_error(e)
791
+ end
792
+
793
+ ##
794
+ # Creates a source.
795
+ #
796
+ # @overload create_source(request, options = nil)
797
+ # Pass arguments to `create_source` via a request object, either of type
798
+ # {::Google::Cloud::SecurityCenter::V2::CreateSourceRequest} or an equivalent Hash.
799
+ #
800
+ # @param request [::Google::Cloud::SecurityCenter::V2::CreateSourceRequest, ::Hash]
801
+ # A request object representing the call parameters. Required. To specify no
802
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
803
+ # @param options [::Gapic::CallOptions, ::Hash]
804
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
805
+ #
806
+ # @overload create_source(parent: nil, source: nil)
807
+ # Pass arguments to `create_source` via keyword arguments. Note that at
808
+ # least one keyword argument is required. To specify no parameters, or to keep all
809
+ # the default parameter values, pass an empty Hash as a request object (see above).
810
+ #
811
+ # @param parent [::String]
812
+ # Required. Resource name of the new source's parent. Its format should be
813
+ # "organizations/[organization_id]".
814
+ # @param source [::Google::Cloud::SecurityCenter::V2::Source, ::Hash]
815
+ # Required. The Source being created, only the display_name and description
816
+ # will be used. All other fields will be ignored.
817
+ #
818
+ # @yield [response, operation] Access the result along with the RPC operation
819
+ # @yieldparam response [::Google::Cloud::SecurityCenter::V2::Source]
820
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
821
+ #
822
+ # @return [::Google::Cloud::SecurityCenter::V2::Source]
823
+ #
824
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
825
+ #
826
+ # @example Basic example
827
+ # require "google/cloud/security_center/v2"
828
+ #
829
+ # # Create a client object. The client can be reused for multiple calls.
830
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
831
+ #
832
+ # # Create a request. To set request fields, pass in keyword arguments.
833
+ # request = Google::Cloud::SecurityCenter::V2::CreateSourceRequest.new
834
+ #
835
+ # # Call the create_source method.
836
+ # result = client.create_source request
837
+ #
838
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::Source.
839
+ # p result
840
+ #
841
+ def create_source request, options = nil
842
+ raise ::ArgumentError, "request must be provided" if request.nil?
843
+
844
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::CreateSourceRequest
845
+
846
+ # Converts hash and nil to an options object
847
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
848
+
849
+ # Customize the options with defaults
850
+ metadata = @config.rpcs.create_source.metadata.to_h
851
+
852
+ # Set x-goog-api-client and x-goog-user-project headers
853
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
854
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
855
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
856
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
857
+
858
+ header_params = {}
859
+ if request.parent
860
+ header_params["parent"] = request.parent
861
+ end
862
+
863
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
864
+ metadata[:"x-goog-request-params"] ||= request_params_header
865
+
866
+ options.apply_defaults timeout: @config.rpcs.create_source.timeout,
867
+ metadata: metadata,
868
+ retry_policy: @config.rpcs.create_source.retry_policy
869
+
870
+ options.apply_defaults timeout: @config.timeout,
871
+ metadata: @config.metadata,
872
+ retry_policy: @config.retry_policy
873
+
874
+ @security_center_stub.call_rpc :create_source, request, options: options do |response, operation|
875
+ yield response, operation if block_given?
876
+ return response
877
+ end
878
+ rescue ::GRPC::BadStatus => e
879
+ raise ::Google::Cloud::Error.from_error(e)
880
+ end
881
+
882
+ ##
883
+ # Deletes an existing BigQuery export.
884
+ #
885
+ # @overload delete_big_query_export(request, options = nil)
886
+ # Pass arguments to `delete_big_query_export` via a request object, either of type
887
+ # {::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest} or an equivalent Hash.
888
+ #
889
+ # @param request [::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest, ::Hash]
890
+ # A request object representing the call parameters. Required. To specify no
891
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
892
+ # @param options [::Gapic::CallOptions, ::Hash]
893
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
894
+ #
895
+ # @overload delete_big_query_export(name: nil)
896
+ # Pass arguments to `delete_big_query_export` via keyword arguments. Note that at
897
+ # least one keyword argument is required. To specify no parameters, or to keep all
898
+ # the default parameter values, pass an empty Hash as a request object (see above).
899
+ #
900
+ # @param name [::String]
901
+ # Required. The name of the BigQuery export to delete. The following list
902
+ # shows some examples of the format:
903
+ #
904
+ # +
905
+ # `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}`
906
+ # + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}`
907
+ # + `projects/{project}/locations/{location}/bigQueryExports/{export_id}`
908
+ #
909
+ # @yield [response, operation] Access the result along with the RPC operation
910
+ # @yieldparam response [::Google::Protobuf::Empty]
911
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
912
+ #
913
+ # @return [::Google::Protobuf::Empty]
914
+ #
915
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
916
+ #
917
+ # @example Basic example
918
+ # require "google/cloud/security_center/v2"
919
+ #
920
+ # # Create a client object. The client can be reused for multiple calls.
921
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
922
+ #
923
+ # # Create a request. To set request fields, pass in keyword arguments.
924
+ # request = Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest.new
925
+ #
926
+ # # Call the delete_big_query_export method.
927
+ # result = client.delete_big_query_export request
928
+ #
929
+ # # The returned object is of type Google::Protobuf::Empty.
930
+ # p result
931
+ #
932
+ def delete_big_query_export request, options = nil
933
+ raise ::ArgumentError, "request must be provided" if request.nil?
934
+
935
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::DeleteBigQueryExportRequest
936
+
937
+ # Converts hash and nil to an options object
938
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
939
+
940
+ # Customize the options with defaults
941
+ metadata = @config.rpcs.delete_big_query_export.metadata.to_h
942
+
943
+ # Set x-goog-api-client and x-goog-user-project headers
944
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
945
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
946
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
947
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
948
+
949
+ header_params = {}
950
+ if request.name
951
+ header_params["name"] = request.name
952
+ end
953
+
954
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
955
+ metadata[:"x-goog-request-params"] ||= request_params_header
956
+
957
+ options.apply_defaults timeout: @config.rpcs.delete_big_query_export.timeout,
958
+ metadata: metadata,
959
+ retry_policy: @config.rpcs.delete_big_query_export.retry_policy
960
+
961
+ options.apply_defaults timeout: @config.timeout,
962
+ metadata: @config.metadata,
963
+ retry_policy: @config.retry_policy
964
+
965
+ @security_center_stub.call_rpc :delete_big_query_export, request, options: options do |response, operation|
966
+ yield response, operation if block_given?
967
+ return response
968
+ end
969
+ rescue ::GRPC::BadStatus => e
970
+ raise ::Google::Cloud::Error.from_error(e)
971
+ end
972
+
973
+ ##
974
+ # Deletes an existing mute config. If no location is specified, default is
975
+ # global.
976
+ #
977
+ # @overload delete_mute_config(request, options = nil)
978
+ # Pass arguments to `delete_mute_config` via a request object, either of type
979
+ # {::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest} or an equivalent Hash.
980
+ #
981
+ # @param request [::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest, ::Hash]
982
+ # A request object representing the call parameters. Required. To specify no
983
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
984
+ # @param options [::Gapic::CallOptions, ::Hash]
985
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
986
+ #
987
+ # @overload delete_mute_config(name: nil)
988
+ # Pass arguments to `delete_mute_config` via keyword arguments. Note that at
989
+ # least one keyword argument is required. To specify no parameters, or to keep all
990
+ # the default parameter values, pass an empty Hash as a request object (see above).
991
+ #
992
+ # @param name [::String]
993
+ # Required. Name of the mute config to delete. The following list shows some
994
+ # examples of the format:
995
+ #
996
+ # + `organizations/{organization}/muteConfigs/{config_id}`
997
+ # +
998
+ # `organizations/{organization}/locations/{location}/muteConfigs/{config_id}`
999
+ # + `folders/{folder}/muteConfigs/{config_id}`
1000
+ # + `folders/{folder}/locations/{location}/muteConfigs/{config_id}`
1001
+ # + `projects/{project}/muteConfigs/{config_id}`
1002
+ # + `projects/{project}/locations/{location}/muteConfigs/{config_id}`
1003
+ #
1004
+ # @yield [response, operation] Access the result along with the RPC operation
1005
+ # @yieldparam response [::Google::Protobuf::Empty]
1006
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1007
+ #
1008
+ # @return [::Google::Protobuf::Empty]
1009
+ #
1010
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1011
+ #
1012
+ # @example Basic example
1013
+ # require "google/cloud/security_center/v2"
1014
+ #
1015
+ # # Create a client object. The client can be reused for multiple calls.
1016
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
1017
+ #
1018
+ # # Create a request. To set request fields, pass in keyword arguments.
1019
+ # request = Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest.new
1020
+ #
1021
+ # # Call the delete_mute_config method.
1022
+ # result = client.delete_mute_config request
1023
+ #
1024
+ # # The returned object is of type Google::Protobuf::Empty.
1025
+ # p result
1026
+ #
1027
+ def delete_mute_config request, options = nil
1028
+ raise ::ArgumentError, "request must be provided" if request.nil?
1029
+
1030
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::DeleteMuteConfigRequest
1031
+
1032
+ # Converts hash and nil to an options object
1033
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1034
+
1035
+ # Customize the options with defaults
1036
+ metadata = @config.rpcs.delete_mute_config.metadata.to_h
1037
+
1038
+ # Set x-goog-api-client and x-goog-user-project headers
1039
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1040
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1041
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
1042
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1043
+
1044
+ header_params = {}
1045
+ if request.name
1046
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/muteConfigs/[^/]+/?$}.match request.name
1047
+ if regex_match
1048
+ header_params["location"] = regex_match["location".to_s]
1049
+ end
1050
+ end
1051
+ if request.name
1052
+ regex_match = %r{^organizations/[^/]+/locations/(?<location>[^/]+)/muteConfigs/[^/]+/?$}.match request.name
1053
+ if regex_match
1054
+ header_params["location"] = regex_match["location".to_s]
1055
+ end
1056
+ end
1057
+ if request.name
1058
+ regex_match = %r{^folders/[^/]+/locations/(?<location>[^/]+)/muteConfigs/[^/]+/?$}.match request.name
1059
+ if regex_match
1060
+ header_params["location"] = regex_match["location".to_s]
1061
+ end
1062
+ end
1063
+
1064
+ request_params_header = URI.encode_www_form header_params
1065
+ metadata[:"x-goog-request-params"] ||= request_params_header
1066
+
1067
+ options.apply_defaults timeout: @config.rpcs.delete_mute_config.timeout,
1068
+ metadata: metadata,
1069
+ retry_policy: @config.rpcs.delete_mute_config.retry_policy
1070
+
1071
+ options.apply_defaults timeout: @config.timeout,
1072
+ metadata: @config.metadata,
1073
+ retry_policy: @config.retry_policy
1074
+
1075
+ @security_center_stub.call_rpc :delete_mute_config, request, options: options do |response, operation|
1076
+ yield response, operation if block_given?
1077
+ return response
1078
+ end
1079
+ rescue ::GRPC::BadStatus => e
1080
+ raise ::Google::Cloud::Error.from_error(e)
1081
+ end
1082
+
1083
+ ##
1084
+ # Deletes a notification config.
1085
+ #
1086
+ # @overload delete_notification_config(request, options = nil)
1087
+ # Pass arguments to `delete_notification_config` via a request object, either of type
1088
+ # {::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest} or an equivalent Hash.
1089
+ #
1090
+ # @param request [::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest, ::Hash]
1091
+ # A request object representing the call parameters. Required. To specify no
1092
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1093
+ # @param options [::Gapic::CallOptions, ::Hash]
1094
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1095
+ #
1096
+ # @overload delete_notification_config(name: nil)
1097
+ # Pass arguments to `delete_notification_config` via keyword arguments. Note that at
1098
+ # least one keyword argument is required. To specify no parameters, or to keep all
1099
+ # the default parameter values, pass an empty Hash as a request object (see above).
1100
+ #
1101
+ # @param name [::String]
1102
+ # Required. Name of the notification config to delete. The following list
1103
+ # shows some examples of the format:
1104
+ #
1105
+ # +
1106
+ # `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]`
1107
+ # +
1108
+ # `folders/[folder_id]/locations/[location_id]notificationConfigs/[config_id]`
1109
+ # +
1110
+ # `projects/[project_id]/locations/[location_id]notificationConfigs/[config_id]`
1111
+ #
1112
+ # @yield [response, operation] Access the result along with the RPC operation
1113
+ # @yieldparam response [::Google::Protobuf::Empty]
1114
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1115
+ #
1116
+ # @return [::Google::Protobuf::Empty]
1117
+ #
1118
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1119
+ #
1120
+ # @example Basic example
1121
+ # require "google/cloud/security_center/v2"
1122
+ #
1123
+ # # Create a client object. The client can be reused for multiple calls.
1124
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
1125
+ #
1126
+ # # Create a request. To set request fields, pass in keyword arguments.
1127
+ # request = Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest.new
1128
+ #
1129
+ # # Call the delete_notification_config method.
1130
+ # result = client.delete_notification_config request
1131
+ #
1132
+ # # The returned object is of type Google::Protobuf::Empty.
1133
+ # p result
1134
+ #
1135
+ def delete_notification_config request, options = nil
1136
+ raise ::ArgumentError, "request must be provided" if request.nil?
1137
+
1138
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::DeleteNotificationConfigRequest
1139
+
1140
+ # Converts hash and nil to an options object
1141
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1142
+
1143
+ # Customize the options with defaults
1144
+ metadata = @config.rpcs.delete_notification_config.metadata.to_h
1145
+
1146
+ # Set x-goog-api-client and x-goog-user-project headers
1147
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1148
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1149
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
1150
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1151
+
1152
+ header_params = {}
1153
+ if request.name
1154
+ header_params["name"] = request.name
1155
+ end
1156
+
1157
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1158
+ metadata[:"x-goog-request-params"] ||= request_params_header
1159
+
1160
+ options.apply_defaults timeout: @config.rpcs.delete_notification_config.timeout,
1161
+ metadata: metadata,
1162
+ retry_policy: @config.rpcs.delete_notification_config.retry_policy
1163
+
1164
+ options.apply_defaults timeout: @config.timeout,
1165
+ metadata: @config.metadata,
1166
+ retry_policy: @config.retry_policy
1167
+
1168
+ @security_center_stub.call_rpc :delete_notification_config, request, options: options do |response, operation|
1169
+ yield response, operation if block_given?
1170
+ return response
1171
+ end
1172
+ rescue ::GRPC::BadStatus => e
1173
+ raise ::Google::Cloud::Error.from_error(e)
1174
+ end
1175
+
1176
+ ##
1177
+ # Deletes a ResourceValueConfig.
1178
+ #
1179
+ # @overload delete_resource_value_config(request, options = nil)
1180
+ # Pass arguments to `delete_resource_value_config` via a request object, either of type
1181
+ # {::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest} or an equivalent Hash.
1182
+ #
1183
+ # @param request [::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest, ::Hash]
1184
+ # A request object representing the call parameters. Required. To specify no
1185
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1186
+ # @param options [::Gapic::CallOptions, ::Hash]
1187
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1188
+ #
1189
+ # @overload delete_resource_value_config(name: nil)
1190
+ # Pass arguments to `delete_resource_value_config` via keyword arguments. Note that at
1191
+ # least one keyword argument is required. To specify no parameters, or to keep all
1192
+ # the default parameter values, pass an empty Hash as a request object (see above).
1193
+ #
1194
+ # @param name [::String]
1195
+ # Required. Name of the ResourceValueConfig to delete
1196
+ #
1197
+ # @yield [response, operation] Access the result along with the RPC operation
1198
+ # @yieldparam response [::Google::Protobuf::Empty]
1199
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1200
+ #
1201
+ # @return [::Google::Protobuf::Empty]
1202
+ #
1203
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1204
+ #
1205
+ # @example Basic example
1206
+ # require "google/cloud/security_center/v2"
1207
+ #
1208
+ # # Create a client object. The client can be reused for multiple calls.
1209
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
1210
+ #
1211
+ # # Create a request. To set request fields, pass in keyword arguments.
1212
+ # request = Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest.new
1213
+ #
1214
+ # # Call the delete_resource_value_config method.
1215
+ # result = client.delete_resource_value_config request
1216
+ #
1217
+ # # The returned object is of type Google::Protobuf::Empty.
1218
+ # p result
1219
+ #
1220
+ def delete_resource_value_config request, options = nil
1221
+ raise ::ArgumentError, "request must be provided" if request.nil?
1222
+
1223
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::DeleteResourceValueConfigRequest
1224
+
1225
+ # Converts hash and nil to an options object
1226
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1227
+
1228
+ # Customize the options with defaults
1229
+ metadata = @config.rpcs.delete_resource_value_config.metadata.to_h
1230
+
1231
+ # Set x-goog-api-client and x-goog-user-project headers
1232
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1233
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1234
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
1235
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1236
+
1237
+ header_params = {}
1238
+ if request.name
1239
+ header_params["name"] = request.name
1240
+ end
1241
+
1242
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1243
+ metadata[:"x-goog-request-params"] ||= request_params_header
1244
+
1245
+ options.apply_defaults timeout: @config.rpcs.delete_resource_value_config.timeout,
1246
+ metadata: metadata,
1247
+ retry_policy: @config.rpcs.delete_resource_value_config.retry_policy
1248
+
1249
+ options.apply_defaults timeout: @config.timeout,
1250
+ metadata: @config.metadata,
1251
+ retry_policy: @config.retry_policy
1252
+
1253
+ @security_center_stub.call_rpc :delete_resource_value_config, request, options: options do |response, operation|
1254
+ yield response, operation if block_given?
1255
+ return response
1256
+ end
1257
+ rescue ::GRPC::BadStatus => e
1258
+ raise ::Google::Cloud::Error.from_error(e)
1259
+ end
1260
+
1261
+ ##
1262
+ # Gets a BigQuery export.
1263
+ #
1264
+ # @overload get_big_query_export(request, options = nil)
1265
+ # Pass arguments to `get_big_query_export` via a request object, either of type
1266
+ # {::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest} or an equivalent Hash.
1267
+ #
1268
+ # @param request [::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest, ::Hash]
1269
+ # A request object representing the call parameters. Required. To specify no
1270
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1271
+ # @param options [::Gapic::CallOptions, ::Hash]
1272
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1273
+ #
1274
+ # @overload get_big_query_export(name: nil)
1275
+ # Pass arguments to `get_big_query_export` via keyword arguments. Note that at
1276
+ # least one keyword argument is required. To specify no parameters, or to keep all
1277
+ # the default parameter values, pass an empty Hash as a request object (see above).
1278
+ #
1279
+ # @param name [::String]
1280
+ # Required. Name of the BigQuery export to retrieve. The following list shows
1281
+ # some examples of the format:
1282
+ #
1283
+ # +
1284
+ # `organizations/{organization}/locations/{location}/bigQueryExports/{export_id}`
1285
+ # + `folders/{folder}/locations/{location}/bigQueryExports/{export_id}`
1286
+ # + `projects/{project}locations/{location}//bigQueryExports/{export_id}`
1287
+ #
1288
+ # @yield [response, operation] Access the result along with the RPC operation
1289
+ # @yieldparam response [::Google::Cloud::SecurityCenter::V2::BigQueryExport]
1290
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1291
+ #
1292
+ # @return [::Google::Cloud::SecurityCenter::V2::BigQueryExport]
1293
+ #
1294
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1295
+ #
1296
+ # @example Basic example
1297
+ # require "google/cloud/security_center/v2"
1298
+ #
1299
+ # # Create a client object. The client can be reused for multiple calls.
1300
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
1301
+ #
1302
+ # # Create a request. To set request fields, pass in keyword arguments.
1303
+ # request = Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest.new
1304
+ #
1305
+ # # Call the get_big_query_export method.
1306
+ # result = client.get_big_query_export request
1307
+ #
1308
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::BigQueryExport.
1309
+ # p result
1310
+ #
1311
+ def get_big_query_export request, options = nil
1312
+ raise ::ArgumentError, "request must be provided" if request.nil?
1313
+
1314
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetBigQueryExportRequest
1315
+
1316
+ # Converts hash and nil to an options object
1317
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1318
+
1319
+ # Customize the options with defaults
1320
+ metadata = @config.rpcs.get_big_query_export.metadata.to_h
1321
+
1322
+ # Set x-goog-api-client and x-goog-user-project headers
1323
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1324
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1325
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
1326
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1327
+
1328
+ header_params = {}
1329
+ if request.name
1330
+ header_params["name"] = request.name
1331
+ end
1332
+
1333
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1334
+ metadata[:"x-goog-request-params"] ||= request_params_header
1335
+
1336
+ options.apply_defaults timeout: @config.rpcs.get_big_query_export.timeout,
1337
+ metadata: metadata,
1338
+ retry_policy: @config.rpcs.get_big_query_export.retry_policy
1339
+
1340
+ options.apply_defaults timeout: @config.timeout,
1341
+ metadata: @config.metadata,
1342
+ retry_policy: @config.retry_policy
1343
+
1344
+ @security_center_stub.call_rpc :get_big_query_export, request, options: options do |response, operation|
1345
+ yield response, operation if block_given?
1346
+ return response
1347
+ end
1348
+ rescue ::GRPC::BadStatus => e
1349
+ raise ::Google::Cloud::Error.from_error(e)
1350
+ end
1351
+
1352
+ ##
1353
+ # Get the simulation by name or the latest simulation for the given
1354
+ # organization.
1355
+ #
1356
+ # @overload get_simulation(request, options = nil)
1357
+ # Pass arguments to `get_simulation` via a request object, either of type
1358
+ # {::Google::Cloud::SecurityCenter::V2::GetSimulationRequest} or an equivalent Hash.
1359
+ #
1360
+ # @param request [::Google::Cloud::SecurityCenter::V2::GetSimulationRequest, ::Hash]
1361
+ # A request object representing the call parameters. Required. To specify no
1362
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1363
+ # @param options [::Gapic::CallOptions, ::Hash]
1364
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1365
+ #
1366
+ # @overload get_simulation(name: nil)
1367
+ # Pass arguments to `get_simulation` via keyword arguments. Note that at
1368
+ # least one keyword argument is required. To specify no parameters, or to keep all
1369
+ # the default parameter values, pass an empty Hash as a request object (see above).
1370
+ #
1371
+ # @param name [::String]
1372
+ # Required. The organization name or simulation name of this simulation
1373
+ #
1374
+ # Valid format:
1375
+ # "organizations/\\{organization}/simulations/latest"
1376
+ # "organizations/\\{organization}/simulations/\\{simulation}"
1377
+ #
1378
+ # @yield [response, operation] Access the result along with the RPC operation
1379
+ # @yieldparam response [::Google::Cloud::SecurityCenter::V2::Simulation]
1380
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1381
+ #
1382
+ # @return [::Google::Cloud::SecurityCenter::V2::Simulation]
1383
+ #
1384
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1385
+ #
1386
+ # @example Basic example
1387
+ # require "google/cloud/security_center/v2"
1388
+ #
1389
+ # # Create a client object. The client can be reused for multiple calls.
1390
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
1391
+ #
1392
+ # # Create a request. To set request fields, pass in keyword arguments.
1393
+ # request = Google::Cloud::SecurityCenter::V2::GetSimulationRequest.new
1394
+ #
1395
+ # # Call the get_simulation method.
1396
+ # result = client.get_simulation request
1397
+ #
1398
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::Simulation.
1399
+ # p result
1400
+ #
1401
+ def get_simulation request, options = nil
1402
+ raise ::ArgumentError, "request must be provided" if request.nil?
1403
+
1404
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetSimulationRequest
1405
+
1406
+ # Converts hash and nil to an options object
1407
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1408
+
1409
+ # Customize the options with defaults
1410
+ metadata = @config.rpcs.get_simulation.metadata.to_h
1411
+
1412
+ # Set x-goog-api-client and x-goog-user-project headers
1413
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1414
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1415
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
1416
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1417
+
1418
+ header_params = {}
1419
+ if request.name
1420
+ header_params["name"] = request.name
1421
+ end
1422
+
1423
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1424
+ metadata[:"x-goog-request-params"] ||= request_params_header
1425
+
1426
+ options.apply_defaults timeout: @config.rpcs.get_simulation.timeout,
1427
+ metadata: metadata,
1428
+ retry_policy: @config.rpcs.get_simulation.retry_policy
1429
+
1430
+ options.apply_defaults timeout: @config.timeout,
1431
+ metadata: @config.metadata,
1432
+ retry_policy: @config.retry_policy
1433
+
1434
+ @security_center_stub.call_rpc :get_simulation, request, options: options do |response, operation|
1435
+ yield response, operation if block_given?
1436
+ return response
1437
+ end
1438
+ rescue ::GRPC::BadStatus => e
1439
+ raise ::Google::Cloud::Error.from_error(e)
1440
+ end
1441
+
1442
+ ##
1443
+ # Get the valued resource by name
1444
+ #
1445
+ # @overload get_valued_resource(request, options = nil)
1446
+ # Pass arguments to `get_valued_resource` via a request object, either of type
1447
+ # {::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest} or an equivalent Hash.
1448
+ #
1449
+ # @param request [::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest, ::Hash]
1450
+ # A request object representing the call parameters. Required. To specify no
1451
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1452
+ # @param options [::Gapic::CallOptions, ::Hash]
1453
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1454
+ #
1455
+ # @overload get_valued_resource(name: nil)
1456
+ # Pass arguments to `get_valued_resource` via keyword arguments. Note that at
1457
+ # least one keyword argument is required. To specify no parameters, or to keep all
1458
+ # the default parameter values, pass an empty Hash as a request object (see above).
1459
+ #
1460
+ # @param name [::String]
1461
+ # Required. The name of this valued resource
1462
+ #
1463
+ # Valid format:
1464
+ # "organizations/\\{organization}/simulations/\\{simulation}/valuedResources/\\{valued_resource}"
1465
+ #
1466
+ # @yield [response, operation] Access the result along with the RPC operation
1467
+ # @yieldparam response [::Google::Cloud::SecurityCenter::V2::ValuedResource]
1468
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1469
+ #
1470
+ # @return [::Google::Cloud::SecurityCenter::V2::ValuedResource]
1471
+ #
1472
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1473
+ #
1474
+ # @example Basic example
1475
+ # require "google/cloud/security_center/v2"
1476
+ #
1477
+ # # Create a client object. The client can be reused for multiple calls.
1478
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
1479
+ #
1480
+ # # Create a request. To set request fields, pass in keyword arguments.
1481
+ # request = Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest.new
1482
+ #
1483
+ # # Call the get_valued_resource method.
1484
+ # result = client.get_valued_resource request
1485
+ #
1486
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::ValuedResource.
1487
+ # p result
1488
+ #
1489
+ def get_valued_resource request, options = nil
1490
+ raise ::ArgumentError, "request must be provided" if request.nil?
1491
+
1492
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetValuedResourceRequest
1493
+
1494
+ # Converts hash and nil to an options object
1495
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1496
+
1497
+ # Customize the options with defaults
1498
+ metadata = @config.rpcs.get_valued_resource.metadata.to_h
1499
+
1500
+ # Set x-goog-api-client and x-goog-user-project headers
1501
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1502
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1503
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
1504
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1505
+
1506
+ header_params = {}
1507
+ if request.name
1508
+ header_params["name"] = request.name
1509
+ end
1510
+
1511
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1512
+ metadata[:"x-goog-request-params"] ||= request_params_header
1513
+
1514
+ options.apply_defaults timeout: @config.rpcs.get_valued_resource.timeout,
1515
+ metadata: metadata,
1516
+ retry_policy: @config.rpcs.get_valued_resource.retry_policy
1517
+
1518
+ options.apply_defaults timeout: @config.timeout,
1519
+ metadata: @config.metadata,
1520
+ retry_policy: @config.retry_policy
1521
+
1522
+ @security_center_stub.call_rpc :get_valued_resource, request, options: options do |response, operation|
1523
+ yield response, operation if block_given?
1524
+ return response
1525
+ end
1526
+ rescue ::GRPC::BadStatus => e
1527
+ raise ::Google::Cloud::Error.from_error(e)
1528
+ end
1529
+
1530
+ ##
1531
+ # Gets the access control policy on the specified Source.
1532
+ #
1533
+ # @overload get_iam_policy(request, options = nil)
1534
+ # Pass arguments to `get_iam_policy` via a request object, either of type
1535
+ # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
1536
+ #
1537
+ # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash]
1538
+ # A request object representing the call parameters. Required. To specify no
1539
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1540
+ # @param options [::Gapic::CallOptions, ::Hash]
1541
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1542
+ #
1543
+ # @overload get_iam_policy(resource: nil, options: nil)
1544
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
1545
+ # least one keyword argument is required. To specify no parameters, or to keep all
1546
+ # the default parameter values, pass an empty Hash as a request object (see above).
1547
+ #
1548
+ # @param resource [::String]
1549
+ # REQUIRED: The resource for which the policy is being requested.
1550
+ # See the operation documentation for the appropriate value for this field.
1551
+ # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
1552
+ # OPTIONAL: A `GetPolicyOptions` object for specifying options to
1553
+ # `GetIamPolicy`.
1554
+ #
1555
+ # @yield [response, operation] Access the result along with the RPC operation
1556
+ # @yieldparam response [::Google::Iam::V1::Policy]
1557
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1558
+ #
1559
+ # @return [::Google::Iam::V1::Policy]
1560
+ #
1561
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1562
+ #
1563
+ # @example Basic example
1564
+ # require "google/cloud/security_center/v2"
1565
+ #
1566
+ # # Create a client object. The client can be reused for multiple calls.
1567
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
1568
+ #
1569
+ # # Create a request. To set request fields, pass in keyword arguments.
1570
+ # request = Google::Iam::V1::GetIamPolicyRequest.new
1571
+ #
1572
+ # # Call the get_iam_policy method.
1573
+ # result = client.get_iam_policy request
1574
+ #
1575
+ # # The returned object is of type Google::Iam::V1::Policy.
1576
+ # p result
1577
+ #
1578
+ def get_iam_policy request, options = nil
1579
+ raise ::ArgumentError, "request must be provided" if request.nil?
1580
+
1581
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest
1582
+
1583
+ # Converts hash and nil to an options object
1584
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1585
+
1586
+ # Customize the options with defaults
1587
+ metadata = @config.rpcs.get_iam_policy.metadata.to_h
1588
+
1589
+ # Set x-goog-api-client and x-goog-user-project headers
1590
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1591
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1592
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
1593
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1594
+
1595
+ header_params = {}
1596
+ if request.resource
1597
+ header_params["resource"] = request.resource
1598
+ end
1599
+
1600
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1601
+ metadata[:"x-goog-request-params"] ||= request_params_header
1602
+
1603
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
1604
+ metadata: metadata,
1605
+ retry_policy: @config.rpcs.get_iam_policy.retry_policy
1606
+
1607
+ options.apply_defaults timeout: @config.timeout,
1608
+ metadata: @config.metadata,
1609
+ retry_policy: @config.retry_policy
1610
+
1611
+ @security_center_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
1612
+ yield response, operation if block_given?
1613
+ return response
1614
+ end
1615
+ rescue ::GRPC::BadStatus => e
1616
+ raise ::Google::Cloud::Error.from_error(e)
1617
+ end
1618
+
1619
+ ##
1620
+ # Gets a mute config. If no location is specified, default is
1621
+ # global.
1622
+ #
1623
+ # @overload get_mute_config(request, options = nil)
1624
+ # Pass arguments to `get_mute_config` via a request object, either of type
1625
+ # {::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest} or an equivalent Hash.
1626
+ #
1627
+ # @param request [::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest, ::Hash]
1628
+ # A request object representing the call parameters. Required. To specify no
1629
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1630
+ # @param options [::Gapic::CallOptions, ::Hash]
1631
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1632
+ #
1633
+ # @overload get_mute_config(name: nil)
1634
+ # Pass arguments to `get_mute_config` via keyword arguments. Note that at
1635
+ # least one keyword argument is required. To specify no parameters, or to keep all
1636
+ # the default parameter values, pass an empty Hash as a request object (see above).
1637
+ #
1638
+ # @param name [::String]
1639
+ # Required. Name of the mute config to retrieve. The following list shows
1640
+ # some examples of the format:
1641
+ #
1642
+ # + `organizations/{organization}/muteConfigs/{config_id}`
1643
+ # +
1644
+ # `organizations/{organization}/locations/{location}/muteConfigs/{config_id}`
1645
+ # + `folders/{folder}/muteConfigs/{config_id}`
1646
+ # + `folders/{folder}/locations/{location}/muteConfigs/{config_id}`
1647
+ # + `projects/{project}/muteConfigs/{config_id}`
1648
+ # + `projects/{project}/locations/{location}/muteConfigs/{config_id}`
1649
+ #
1650
+ # @yield [response, operation] Access the result along with the RPC operation
1651
+ # @yieldparam response [::Google::Cloud::SecurityCenter::V2::MuteConfig]
1652
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1653
+ #
1654
+ # @return [::Google::Cloud::SecurityCenter::V2::MuteConfig]
1655
+ #
1656
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1657
+ #
1658
+ # @example Basic example
1659
+ # require "google/cloud/security_center/v2"
1660
+ #
1661
+ # # Create a client object. The client can be reused for multiple calls.
1662
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
1663
+ #
1664
+ # # Create a request. To set request fields, pass in keyword arguments.
1665
+ # request = Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest.new
1666
+ #
1667
+ # # Call the get_mute_config method.
1668
+ # result = client.get_mute_config request
1669
+ #
1670
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::MuteConfig.
1671
+ # p result
1672
+ #
1673
+ def get_mute_config request, options = nil
1674
+ raise ::ArgumentError, "request must be provided" if request.nil?
1675
+
1676
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetMuteConfigRequest
1677
+
1678
+ # Converts hash and nil to an options object
1679
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1680
+
1681
+ # Customize the options with defaults
1682
+ metadata = @config.rpcs.get_mute_config.metadata.to_h
1683
+
1684
+ # Set x-goog-api-client and x-goog-user-project headers
1685
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1686
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1687
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
1688
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1689
+
1690
+ header_params = {}
1691
+ if request.name
1692
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/muteConfigs/[^/]+/?$}.match request.name
1693
+ if regex_match
1694
+ header_params["location"] = regex_match["location".to_s]
1695
+ end
1696
+ end
1697
+ if request.name
1698
+ regex_match = %r{^organizations/[^/]+/locations/(?<location>[^/]+)/muteConfigs/[^/]+/?$}.match request.name
1699
+ if regex_match
1700
+ header_params["location"] = regex_match["location".to_s]
1701
+ end
1702
+ end
1703
+ if request.name
1704
+ regex_match = %r{^folders/[^/]+/locations/(?<location>[^/]+)/muteConfigs/[^/]+/?$}.match request.name
1705
+ if regex_match
1706
+ header_params["location"] = regex_match["location".to_s]
1707
+ end
1708
+ end
1709
+
1710
+ request_params_header = URI.encode_www_form header_params
1711
+ metadata[:"x-goog-request-params"] ||= request_params_header
1712
+
1713
+ options.apply_defaults timeout: @config.rpcs.get_mute_config.timeout,
1714
+ metadata: metadata,
1715
+ retry_policy: @config.rpcs.get_mute_config.retry_policy
1716
+
1717
+ options.apply_defaults timeout: @config.timeout,
1718
+ metadata: @config.metadata,
1719
+ retry_policy: @config.retry_policy
1720
+
1721
+ @security_center_stub.call_rpc :get_mute_config, request, options: options do |response, operation|
1722
+ yield response, operation if block_given?
1723
+ return response
1724
+ end
1725
+ rescue ::GRPC::BadStatus => e
1726
+ raise ::Google::Cloud::Error.from_error(e)
1727
+ end
1728
+
1729
+ ##
1730
+ # Gets a notification config.
1731
+ #
1732
+ # @overload get_notification_config(request, options = nil)
1733
+ # Pass arguments to `get_notification_config` via a request object, either of type
1734
+ # {::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest} or an equivalent Hash.
1735
+ #
1736
+ # @param request [::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest, ::Hash]
1737
+ # A request object representing the call parameters. Required. To specify no
1738
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1739
+ # @param options [::Gapic::CallOptions, ::Hash]
1740
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1741
+ #
1742
+ # @overload get_notification_config(name: nil)
1743
+ # Pass arguments to `get_notification_config` via keyword arguments. Note that at
1744
+ # least one keyword argument is required. To specify no parameters, or to keep all
1745
+ # the default parameter values, pass an empty Hash as a request object (see above).
1746
+ #
1747
+ # @param name [::String]
1748
+ # Required. Name of the notification config to get. The following list shows
1749
+ # some examples of the format:
1750
+ #
1751
+ # +
1752
+ # `organizations/[organization_id]/locations/[location_id]/notificationConfigs/[config_id]`
1753
+ # +
1754
+ # `folders/[folder_id]/locations/[location_id]/notificationConfigs/[config_id]`
1755
+ # +
1756
+ # `projects/[project_id]/locations/[location_id]/notificationConfigs/[config_id]`
1757
+ #
1758
+ # @yield [response, operation] Access the result along with the RPC operation
1759
+ # @yieldparam response [::Google::Cloud::SecurityCenter::V2::NotificationConfig]
1760
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1761
+ #
1762
+ # @return [::Google::Cloud::SecurityCenter::V2::NotificationConfig]
1763
+ #
1764
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1765
+ #
1766
+ # @example Basic example
1767
+ # require "google/cloud/security_center/v2"
1768
+ #
1769
+ # # Create a client object. The client can be reused for multiple calls.
1770
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
1771
+ #
1772
+ # # Create a request. To set request fields, pass in keyword arguments.
1773
+ # request = Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest.new
1774
+ #
1775
+ # # Call the get_notification_config method.
1776
+ # result = client.get_notification_config request
1777
+ #
1778
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::NotificationConfig.
1779
+ # p result
1780
+ #
1781
+ def get_notification_config request, options = nil
1782
+ raise ::ArgumentError, "request must be provided" if request.nil?
1783
+
1784
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetNotificationConfigRequest
1785
+
1786
+ # Converts hash and nil to an options object
1787
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1788
+
1789
+ # Customize the options with defaults
1790
+ metadata = @config.rpcs.get_notification_config.metadata.to_h
1791
+
1792
+ # Set x-goog-api-client and x-goog-user-project headers
1793
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1794
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1795
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
1796
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1797
+
1798
+ header_params = {}
1799
+ if request.name
1800
+ header_params["name"] = request.name
1801
+ end
1802
+
1803
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1804
+ metadata[:"x-goog-request-params"] ||= request_params_header
1805
+
1806
+ options.apply_defaults timeout: @config.rpcs.get_notification_config.timeout,
1807
+ metadata: metadata,
1808
+ retry_policy: @config.rpcs.get_notification_config.retry_policy
1809
+
1810
+ options.apply_defaults timeout: @config.timeout,
1811
+ metadata: @config.metadata,
1812
+ retry_policy: @config.retry_policy
1813
+
1814
+ @security_center_stub.call_rpc :get_notification_config, request, options: options do |response, operation|
1815
+ yield response, operation if block_given?
1816
+ return response
1817
+ end
1818
+ rescue ::GRPC::BadStatus => e
1819
+ raise ::Google::Cloud::Error.from_error(e)
1820
+ end
1821
+
1822
+ ##
1823
+ # Gets a ResourceValueConfig.
1824
+ #
1825
+ # @overload get_resource_value_config(request, options = nil)
1826
+ # Pass arguments to `get_resource_value_config` via a request object, either of type
1827
+ # {::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest} or an equivalent Hash.
1828
+ #
1829
+ # @param request [::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest, ::Hash]
1830
+ # A request object representing the call parameters. Required. To specify no
1831
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1832
+ # @param options [::Gapic::CallOptions, ::Hash]
1833
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1834
+ #
1835
+ # @overload get_resource_value_config(name: nil)
1836
+ # Pass arguments to `get_resource_value_config` via keyword arguments. Note that at
1837
+ # least one keyword argument is required. To specify no parameters, or to keep all
1838
+ # the default parameter values, pass an empty Hash as a request object (see above).
1839
+ #
1840
+ # @param name [::String]
1841
+ # Required. Name of the resource value config to retrieve. Its format is
1842
+ # organizations/\\{organization}/resourceValueConfigs/\\{config_id}.
1843
+ #
1844
+ # @yield [response, operation] Access the result along with the RPC operation
1845
+ # @yieldparam response [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig]
1846
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1847
+ #
1848
+ # @return [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig]
1849
+ #
1850
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1851
+ #
1852
+ # @example Basic example
1853
+ # require "google/cloud/security_center/v2"
1854
+ #
1855
+ # # Create a client object. The client can be reused for multiple calls.
1856
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
1857
+ #
1858
+ # # Create a request. To set request fields, pass in keyword arguments.
1859
+ # request = Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest.new
1860
+ #
1861
+ # # Call the get_resource_value_config method.
1862
+ # result = client.get_resource_value_config request
1863
+ #
1864
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::ResourceValueConfig.
1865
+ # p result
1866
+ #
1867
+ def get_resource_value_config request, options = nil
1868
+ raise ::ArgumentError, "request must be provided" if request.nil?
1869
+
1870
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetResourceValueConfigRequest
1871
+
1872
+ # Converts hash and nil to an options object
1873
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1874
+
1875
+ # Customize the options with defaults
1876
+ metadata = @config.rpcs.get_resource_value_config.metadata.to_h
1877
+
1878
+ # Set x-goog-api-client and x-goog-user-project headers
1879
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1880
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1881
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
1882
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1883
+
1884
+ header_params = {}
1885
+ if request.name
1886
+ header_params["name"] = request.name
1887
+ end
1888
+
1889
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1890
+ metadata[:"x-goog-request-params"] ||= request_params_header
1891
+
1892
+ options.apply_defaults timeout: @config.rpcs.get_resource_value_config.timeout,
1893
+ metadata: metadata,
1894
+ retry_policy: @config.rpcs.get_resource_value_config.retry_policy
1895
+
1896
+ options.apply_defaults timeout: @config.timeout,
1897
+ metadata: @config.metadata,
1898
+ retry_policy: @config.retry_policy
1899
+
1900
+ @security_center_stub.call_rpc :get_resource_value_config, request, options: options do |response, operation|
1901
+ yield response, operation if block_given?
1902
+ return response
1903
+ end
1904
+ rescue ::GRPC::BadStatus => e
1905
+ raise ::Google::Cloud::Error.from_error(e)
1906
+ end
1907
+
1908
+ ##
1909
+ # Gets a source.
1910
+ #
1911
+ # @overload get_source(request, options = nil)
1912
+ # Pass arguments to `get_source` via a request object, either of type
1913
+ # {::Google::Cloud::SecurityCenter::V2::GetSourceRequest} or an equivalent Hash.
1914
+ #
1915
+ # @param request [::Google::Cloud::SecurityCenter::V2::GetSourceRequest, ::Hash]
1916
+ # A request object representing the call parameters. Required. To specify no
1917
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1918
+ # @param options [::Gapic::CallOptions, ::Hash]
1919
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1920
+ #
1921
+ # @overload get_source(name: nil)
1922
+ # Pass arguments to `get_source` via keyword arguments. Note that at
1923
+ # least one keyword argument is required. To specify no parameters, or to keep all
1924
+ # the default parameter values, pass an empty Hash as a request object (see above).
1925
+ #
1926
+ # @param name [::String]
1927
+ # Required. Relative resource name of the source. Its format is
1928
+ # "organizations/[organization_id]/source/[source_id]".
1929
+ #
1930
+ # @yield [response, operation] Access the result along with the RPC operation
1931
+ # @yieldparam response [::Google::Cloud::SecurityCenter::V2::Source]
1932
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1933
+ #
1934
+ # @return [::Google::Cloud::SecurityCenter::V2::Source]
1935
+ #
1936
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1937
+ #
1938
+ # @example Basic example
1939
+ # require "google/cloud/security_center/v2"
1940
+ #
1941
+ # # Create a client object. The client can be reused for multiple calls.
1942
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
1943
+ #
1944
+ # # Create a request. To set request fields, pass in keyword arguments.
1945
+ # request = Google::Cloud::SecurityCenter::V2::GetSourceRequest.new
1946
+ #
1947
+ # # Call the get_source method.
1948
+ # result = client.get_source request
1949
+ #
1950
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::Source.
1951
+ # p result
1952
+ #
1953
+ def get_source request, options = nil
1954
+ raise ::ArgumentError, "request must be provided" if request.nil?
1955
+
1956
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GetSourceRequest
1957
+
1958
+ # Converts hash and nil to an options object
1959
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1960
+
1961
+ # Customize the options with defaults
1962
+ metadata = @config.rpcs.get_source.metadata.to_h
1963
+
1964
+ # Set x-goog-api-client and x-goog-user-project headers
1965
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1966
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1967
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
1968
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1969
+
1970
+ header_params = {}
1971
+ if request.name
1972
+ header_params["name"] = request.name
1973
+ end
1974
+
1975
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1976
+ metadata[:"x-goog-request-params"] ||= request_params_header
1977
+
1978
+ options.apply_defaults timeout: @config.rpcs.get_source.timeout,
1979
+ metadata: metadata,
1980
+ retry_policy: @config.rpcs.get_source.retry_policy
1981
+
1982
+ options.apply_defaults timeout: @config.timeout,
1983
+ metadata: @config.metadata,
1984
+ retry_policy: @config.retry_policy
1985
+
1986
+ @security_center_stub.call_rpc :get_source, request, options: options do |response, operation|
1987
+ yield response, operation if block_given?
1988
+ return response
1989
+ end
1990
+ rescue ::GRPC::BadStatus => e
1991
+ raise ::Google::Cloud::Error.from_error(e)
1992
+ end
1993
+
1994
+ ##
1995
+ # Filters an organization or source's findings and groups them by their
1996
+ # specified properties in a location. If no location is specified, findings
1997
+ # are assumed to be in global
1998
+ #
1999
+ # To group across all sources provide a `-` as the source id.
2000
+ # The following list shows some examples:
2001
+ #
2002
+ # + `/v2/organizations/{organization_id}/sources/-/findings`
2003
+ # +
2004
+ # `/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings`
2005
+ # + `/v2/folders/{folder_id}/sources/-/findings`
2006
+ # + `/v2/folders/{folder_id}/sources/-/locations/{location_id}/findings`
2007
+ # + `/v2/projects/{project_id}/sources/-/findings`
2008
+ # + `/v2/projects/{project_id}/sources/-/locations/{location_id}/findings`
2009
+ #
2010
+ # @overload group_findings(request, options = nil)
2011
+ # Pass arguments to `group_findings` via a request object, either of type
2012
+ # {::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest} or an equivalent Hash.
2013
+ #
2014
+ # @param request [::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest, ::Hash]
2015
+ # A request object representing the call parameters. Required. To specify no
2016
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2017
+ # @param options [::Gapic::CallOptions, ::Hash]
2018
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2019
+ #
2020
+ # @overload group_findings(parent: nil, filter: nil, group_by: nil, page_token: nil, page_size: nil)
2021
+ # Pass arguments to `group_findings` via keyword arguments. Note that at
2022
+ # least one keyword argument is required. To specify no parameters, or to keep all
2023
+ # the default parameter values, pass an empty Hash as a request object (see above).
2024
+ #
2025
+ # @param parent [::String]
2026
+ # Required. Name of the source to groupBy. If no location is specified,
2027
+ # finding is assumed to be in global.
2028
+ # The following list shows some examples:
2029
+ #
2030
+ # + `organizations/[organization_id]/sources/[source_id]`
2031
+ # +
2032
+ # `organizations/[organization_id]/sources/[source_id]/locations/[location_id]`
2033
+ # + `folders/[folder_id]/sources/[source_id]`
2034
+ # + `folders/[folder_id]/sources/[source_id]/locations/[location_id]`
2035
+ # + `projects/[project_id]/sources/[source_id]`
2036
+ # + `projects/[project_id]/sources/[source_id]/locations/[location_id]`
2037
+ #
2038
+ # To groupBy across all sources provide a source_id of `-`. The following
2039
+ # list shows some examples:
2040
+ #
2041
+ # + `organizations/{organization_id}/sources/-`
2042
+ # + `organizations/{organization_id}/sources/-/locations/[location_id]`
2043
+ # + `folders/{folder_id}/sources/-`
2044
+ # + `folders/{folder_id}/sources/-/locations/[location_id]`
2045
+ # + `projects/{project_id}/sources/-`
2046
+ # + `projects/{project_id}/sources/-/locations/[location_id]`
2047
+ # @param filter [::String]
2048
+ # Expression that defines the filter to apply across findings.
2049
+ # The expression is a list of one or more restrictions combined via logical
2050
+ # operators `AND` and `OR`.
2051
+ # Parentheses are supported, and `OR` has higher precedence than `AND`.
2052
+ #
2053
+ # Restrictions have the form `<field> <operator> <value>` and may have a `-`
2054
+ # character in front of them to indicate negation. Examples include:
2055
+ #
2056
+ # * name
2057
+ # * security_marks.marks.marka
2058
+ #
2059
+ # The supported operators are:
2060
+ #
2061
+ # * `=` for all value types.
2062
+ # * `>`, `<`, `>=`, `<=` for integer values.
2063
+ # * `:`, meaning substring matching, for strings.
2064
+ #
2065
+ # The supported value types are:
2066
+ #
2067
+ # * string literals in quotes.
2068
+ # * integer literals without quotes.
2069
+ # * boolean literals `true` and `false` without quotes.
2070
+ #
2071
+ # The following field and operator combinations are supported:
2072
+ #
2073
+ # * name: `=`
2074
+ # * parent: `=`, `:`
2075
+ # * resource_name: `=`, `:`
2076
+ # * state: `=`, `:`
2077
+ # * category: `=`, `:`
2078
+ # * external_uri: `=`, `:`
2079
+ # * event_time: `=`, `>`, `<`, `>=`, `<=`
2080
+ #
2081
+ # Usage: This should be milliseconds since epoch or an RFC3339 string.
2082
+ # Examples:
2083
+ # `event_time = "2019-06-10T16:07:18-07:00"`
2084
+ # `event_time = 1560208038000`
2085
+ #
2086
+ # * severity: `=`, `:`
2087
+ # * security_marks.marks: `=`, `:`
2088
+ # * resource:
2089
+ # * resource.name: `=`, `:`
2090
+ # * resource.parent_name: `=`, `:`
2091
+ # * resource.parent_display_name: `=`, `:`
2092
+ # * resource.project_name: `=`, `:`
2093
+ # * resource.project_display_name: `=`, `:`
2094
+ # * resource.type: `=`, `:`
2095
+ # @param group_by [::String]
2096
+ # Required. Expression that defines what assets fields to use for grouping.
2097
+ # The string value should follow SQL syntax: comma separated list of fields.
2098
+ # For example: "parent,resource_name".
2099
+ #
2100
+ # The following fields are supported:
2101
+ #
2102
+ # * resource_name
2103
+ # * category
2104
+ # * state
2105
+ # * parent
2106
+ # * severity
2107
+ # @param page_token [::String]
2108
+ # The value returned by the last `GroupFindingsResponse`; indicates
2109
+ # that this is a continuation of a prior `GroupFindings` call, and
2110
+ # that the system should return the next page of data.
2111
+ # @param page_size [::Integer]
2112
+ # The maximum number of results to return in a single response. Default is
2113
+ # 10, minimum is 1, maximum is 1000.
2114
+ #
2115
+ # @yield [response, operation] Access the result along with the RPC operation
2116
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::GroupResult>]
2117
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2118
+ #
2119
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::GroupResult>]
2120
+ #
2121
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2122
+ #
2123
+ # @example Basic example
2124
+ # require "google/cloud/security_center/v2"
2125
+ #
2126
+ # # Create a client object. The client can be reused for multiple calls.
2127
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
2128
+ #
2129
+ # # Create a request. To set request fields, pass in keyword arguments.
2130
+ # request = Google::Cloud::SecurityCenter::V2::GroupFindingsRequest.new
2131
+ #
2132
+ # # Call the group_findings method.
2133
+ # result = client.group_findings request
2134
+ #
2135
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2136
+ # # over elements, and API calls will be issued to fetch pages as needed.
2137
+ # result.each do |item|
2138
+ # # Each element is of type ::Google::Cloud::SecurityCenter::V2::GroupResult.
2139
+ # p item
2140
+ # end
2141
+ #
2142
+ def group_findings request, options = nil
2143
+ raise ::ArgumentError, "request must be provided" if request.nil?
2144
+
2145
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::GroupFindingsRequest
2146
+
2147
+ # Converts hash and nil to an options object
2148
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2149
+
2150
+ # Customize the options with defaults
2151
+ metadata = @config.rpcs.group_findings.metadata.to_h
2152
+
2153
+ # Set x-goog-api-client and x-goog-user-project headers
2154
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2155
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2156
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
2157
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2158
+
2159
+ header_params = {}
2160
+ if request.parent
2161
+ header_params["parent"] = request.parent
2162
+ end
2163
+
2164
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2165
+ metadata[:"x-goog-request-params"] ||= request_params_header
2166
+
2167
+ options.apply_defaults timeout: @config.rpcs.group_findings.timeout,
2168
+ metadata: metadata,
2169
+ retry_policy: @config.rpcs.group_findings.retry_policy
2170
+
2171
+ options.apply_defaults timeout: @config.timeout,
2172
+ metadata: @config.metadata,
2173
+ retry_policy: @config.retry_policy
2174
+
2175
+ @security_center_stub.call_rpc :group_findings, request, options: options do |response, operation|
2176
+ response = ::Gapic::PagedEnumerable.new @security_center_stub, :group_findings, request, response, operation, options
2177
+ yield response, operation if block_given?
2178
+ return response
2179
+ end
2180
+ rescue ::GRPC::BadStatus => e
2181
+ raise ::Google::Cloud::Error.from_error(e)
2182
+ end
2183
+
2184
+ ##
2185
+ # Lists the attack paths for a set of simulation results or valued resources
2186
+ # and filter.
2187
+ #
2188
+ # @overload list_attack_paths(request, options = nil)
2189
+ # Pass arguments to `list_attack_paths` via a request object, either of type
2190
+ # {::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest} or an equivalent Hash.
2191
+ #
2192
+ # @param request [::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest, ::Hash]
2193
+ # A request object representing the call parameters. Required. To specify no
2194
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2195
+ # @param options [::Gapic::CallOptions, ::Hash]
2196
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2197
+ #
2198
+ # @overload list_attack_paths(parent: nil, filter: nil, page_token: nil, page_size: nil)
2199
+ # Pass arguments to `list_attack_paths` via keyword arguments. Note that at
2200
+ # least one keyword argument is required. To specify no parameters, or to keep all
2201
+ # the default parameter values, pass an empty Hash as a request object (see above).
2202
+ #
2203
+ # @param parent [::String]
2204
+ # Required. Name of parent to list attack paths.
2205
+ #
2206
+ # Valid formats:
2207
+ # "organizations/\\{organization}",
2208
+ # "organizations/\\{organization}/simulations/\\{simulation}"
2209
+ # "organizations/\\{organization}/simulations/\\{simulation}/attackExposureResults/\\{attack_exposure_result_v2}"
2210
+ # "organizations/\\{organization}/simulations/\\{simulation}/valuedResources/\\{valued_resource}"
2211
+ # @param filter [::String]
2212
+ # The filter expression that filters the attack path in the response.
2213
+ # Supported fields:
2214
+ #
2215
+ # * `valued_resources` supports =
2216
+ # @param page_token [::String]
2217
+ # The value returned by the last `ListAttackPathsResponse`; indicates
2218
+ # that this is a continuation of a prior `ListAttackPaths` call, and
2219
+ # that the system should return the next page of data.
2220
+ # @param page_size [::Integer]
2221
+ # The maximum number of results to return in a single response. Default is
2222
+ # 10, minimum is 1, maximum is 1000.
2223
+ #
2224
+ # @yield [response, operation] Access the result along with the RPC operation
2225
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::AttackPath>]
2226
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2227
+ #
2228
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::AttackPath>]
2229
+ #
2230
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2231
+ #
2232
+ # @example Basic example
2233
+ # require "google/cloud/security_center/v2"
2234
+ #
2235
+ # # Create a client object. The client can be reused for multiple calls.
2236
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
2237
+ #
2238
+ # # Create a request. To set request fields, pass in keyword arguments.
2239
+ # request = Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest.new
2240
+ #
2241
+ # # Call the list_attack_paths method.
2242
+ # result = client.list_attack_paths request
2243
+ #
2244
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2245
+ # # over elements, and API calls will be issued to fetch pages as needed.
2246
+ # result.each do |item|
2247
+ # # Each element is of type ::Google::Cloud::SecurityCenter::V2::AttackPath.
2248
+ # p item
2249
+ # end
2250
+ #
2251
+ def list_attack_paths request, options = nil
2252
+ raise ::ArgumentError, "request must be provided" if request.nil?
2253
+
2254
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListAttackPathsRequest
2255
+
2256
+ # Converts hash and nil to an options object
2257
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2258
+
2259
+ # Customize the options with defaults
2260
+ metadata = @config.rpcs.list_attack_paths.metadata.to_h
2261
+
2262
+ # Set x-goog-api-client and x-goog-user-project headers
2263
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2264
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2265
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
2266
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2267
+
2268
+ header_params = {}
2269
+ if request.parent
2270
+ header_params["parent"] = request.parent
2271
+ end
2272
+
2273
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2274
+ metadata[:"x-goog-request-params"] ||= request_params_header
2275
+
2276
+ options.apply_defaults timeout: @config.rpcs.list_attack_paths.timeout,
2277
+ metadata: metadata,
2278
+ retry_policy: @config.rpcs.list_attack_paths.retry_policy
2279
+
2280
+ options.apply_defaults timeout: @config.timeout,
2281
+ metadata: @config.metadata,
2282
+ retry_policy: @config.retry_policy
2283
+
2284
+ @security_center_stub.call_rpc :list_attack_paths, request, options: options do |response, operation|
2285
+ response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_attack_paths, request, response, operation, options
2286
+ yield response, operation if block_given?
2287
+ return response
2288
+ end
2289
+ rescue ::GRPC::BadStatus => e
2290
+ raise ::Google::Cloud::Error.from_error(e)
2291
+ end
2292
+
2293
+ ##
2294
+ # Lists BigQuery exports. Note that when requesting BigQuery exports at a
2295
+ # given level all exports under that level are also returned e.g. if
2296
+ # requesting BigQuery exports under a folder, then all BigQuery exports
2297
+ # immediately under the folder plus the ones created under the projects
2298
+ # within the folder are returned.
2299
+ #
2300
+ # @overload list_big_query_exports(request, options = nil)
2301
+ # Pass arguments to `list_big_query_exports` via a request object, either of type
2302
+ # {::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest} or an equivalent Hash.
2303
+ #
2304
+ # @param request [::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest, ::Hash]
2305
+ # A request object representing the call parameters. Required. To specify no
2306
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2307
+ # @param options [::Gapic::CallOptions, ::Hash]
2308
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2309
+ #
2310
+ # @overload list_big_query_exports(parent: nil, page_size: nil, page_token: nil)
2311
+ # Pass arguments to `list_big_query_exports` via keyword arguments. Note that at
2312
+ # least one keyword argument is required. To specify no parameters, or to keep all
2313
+ # the default parameter values, pass an empty Hash as a request object (see above).
2314
+ #
2315
+ # @param parent [::String]
2316
+ # Required. The parent, which owns the collection of BigQuery exports. Its
2317
+ # format is "organizations/[organization_id]/locations/[location_id]",
2318
+ # "folders/[folder_id]/locations/[location_id]", or
2319
+ # "projects/[project_id]/locations/[location_id]".
2320
+ # @param page_size [::Integer]
2321
+ # The maximum number of configs to return. The service may return fewer than
2322
+ # this value.
2323
+ # If unspecified, at most 10 configs will be returned.
2324
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
2325
+ # @param page_token [::String]
2326
+ # A page token, received from a previous `ListBigQueryExports` call.
2327
+ # Provide this to retrieve the subsequent page.
2328
+ # When paginating, all other parameters provided to `ListBigQueryExports`
2329
+ # must match the call that provided the page token.
2330
+ #
2331
+ # @yield [response, operation] Access the result along with the RPC operation
2332
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::BigQueryExport>]
2333
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2334
+ #
2335
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::BigQueryExport>]
2336
+ #
2337
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2338
+ #
2339
+ # @example Basic example
2340
+ # require "google/cloud/security_center/v2"
2341
+ #
2342
+ # # Create a client object. The client can be reused for multiple calls.
2343
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
2344
+ #
2345
+ # # Create a request. To set request fields, pass in keyword arguments.
2346
+ # request = Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest.new
2347
+ #
2348
+ # # Call the list_big_query_exports method.
2349
+ # result = client.list_big_query_exports request
2350
+ #
2351
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2352
+ # # over elements, and API calls will be issued to fetch pages as needed.
2353
+ # result.each do |item|
2354
+ # # Each element is of type ::Google::Cloud::SecurityCenter::V2::BigQueryExport.
2355
+ # p item
2356
+ # end
2357
+ #
2358
+ def list_big_query_exports request, options = nil
2359
+ raise ::ArgumentError, "request must be provided" if request.nil?
2360
+
2361
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListBigQueryExportsRequest
2362
+
2363
+ # Converts hash and nil to an options object
2364
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2365
+
2366
+ # Customize the options with defaults
2367
+ metadata = @config.rpcs.list_big_query_exports.metadata.to_h
2368
+
2369
+ # Set x-goog-api-client and x-goog-user-project headers
2370
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2371
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2372
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
2373
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2374
+
2375
+ header_params = {}
2376
+ if request.parent
2377
+ header_params["parent"] = request.parent
2378
+ end
2379
+
2380
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2381
+ metadata[:"x-goog-request-params"] ||= request_params_header
2382
+
2383
+ options.apply_defaults timeout: @config.rpcs.list_big_query_exports.timeout,
2384
+ metadata: metadata,
2385
+ retry_policy: @config.rpcs.list_big_query_exports.retry_policy
2386
+
2387
+ options.apply_defaults timeout: @config.timeout,
2388
+ metadata: @config.metadata,
2389
+ retry_policy: @config.retry_policy
2390
+
2391
+ @security_center_stub.call_rpc :list_big_query_exports, request, options: options do |response, operation|
2392
+ response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_big_query_exports, request, response, operation, options
2393
+ yield response, operation if block_given?
2394
+ return response
2395
+ end
2396
+ rescue ::GRPC::BadStatus => e
2397
+ raise ::Google::Cloud::Error.from_error(e)
2398
+ end
2399
+
2400
+ ##
2401
+ # Lists an organization or source's findings.
2402
+ #
2403
+ # To list across all sources for a given location provide a `-` as the source
2404
+ # id. If no location is specified, finding are assumed to be in global.
2405
+ # The following list shows some examples:
2406
+ #
2407
+ # + `/v2/organizations/{organization_id}/sources/-/findings`
2408
+ # +
2409
+ # `/v2/organizations/{organization_id}/sources/-/locations/{location_id}/findings`
2410
+ #
2411
+ # @overload list_findings(request, options = nil)
2412
+ # Pass arguments to `list_findings` via a request object, either of type
2413
+ # {::Google::Cloud::SecurityCenter::V2::ListFindingsRequest} or an equivalent Hash.
2414
+ #
2415
+ # @param request [::Google::Cloud::SecurityCenter::V2::ListFindingsRequest, ::Hash]
2416
+ # A request object representing the call parameters. Required. To specify no
2417
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2418
+ # @param options [::Gapic::CallOptions, ::Hash]
2419
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2420
+ #
2421
+ # @overload list_findings(parent: nil, filter: nil, order_by: nil, field_mask: nil, page_token: nil, page_size: nil)
2422
+ # Pass arguments to `list_findings` via keyword arguments. Note that at
2423
+ # least one keyword argument is required. To specify no parameters, or to keep all
2424
+ # the default parameter values, pass an empty Hash as a request object (see above).
2425
+ #
2426
+ # @param parent [::String]
2427
+ # Required. Name of the source the findings belong to. If no location is
2428
+ # specified, the default is global. The following list shows some examples:
2429
+ #
2430
+ # + `organizations/[organization_id]/sources/[source_id]`
2431
+ # +
2432
+ # `organizations/[organization_id]/sources/[source_id]/locations/[location_id]`
2433
+ # + `folders/[folder_id]/sources/[source_id]`
2434
+ # + `folders/[folder_id]/sources/[source_id]/locations/[location_id]`
2435
+ # + `projects/[project_id]/sources/[source_id]`
2436
+ # + `projects/[project_id]/sources/[source_id]/locations/[location_id]`
2437
+ #
2438
+ # To list across all sources provide a source_id of `-`. The following
2439
+ # list shows some examples:
2440
+ #
2441
+ # + `organizations/{organization_id}/sources/-`
2442
+ # + `organizations/{organization_id}/sources/-/locations/{location_id}`
2443
+ # + `folders/{folder_id}/sources/-`
2444
+ # + `folders/{folder_id}/sources/-locations/{location_id}`
2445
+ # + `projects/{projects_id}/sources/-`
2446
+ # + `projects/{projects_id}/sources/-/locations/{location_id}`
2447
+ # @param filter [::String]
2448
+ # Expression that defines the filter to apply across findings.
2449
+ # The expression is a list of one or more restrictions combined via logical
2450
+ # operators `AND` and `OR`.
2451
+ # Parentheses are supported, and `OR` has higher precedence than `AND`.
2452
+ #
2453
+ # Restrictions have the form `<field> <operator> <value>` and may have a `-`
2454
+ # character in front of them to indicate negation. Examples include:
2455
+ #
2456
+ # * name
2457
+ # * security_marks.marks.marka
2458
+ #
2459
+ # The supported operators are:
2460
+ #
2461
+ # * `=` for all value types.
2462
+ # * `>`, `<`, `>=`, `<=` for integer values.
2463
+ # * `:`, meaning substring matching, for strings.
2464
+ #
2465
+ # The supported value types are:
2466
+ #
2467
+ # * string literals in quotes.
2468
+ # * integer literals without quotes.
2469
+ # * boolean literals `true` and `false` without quotes.
2470
+ #
2471
+ # The following field and operator combinations are supported:
2472
+ #
2473
+ # * name: `=`
2474
+ # * parent: `=`, `:`
2475
+ # * resource_name: `=`, `:`
2476
+ # * state: `=`, `:`
2477
+ # * category: `=`, `:`
2478
+ # * external_uri: `=`, `:`
2479
+ # * event_time: `=`, `>`, `<`, `>=`, `<=`
2480
+ #
2481
+ # Usage: This should be milliseconds since epoch or an RFC3339 string.
2482
+ # Examples:
2483
+ # `event_time = "2019-06-10T16:07:18-07:00"`
2484
+ # `event_time = 1560208038000`
2485
+ #
2486
+ # * severity: `=`, `:`
2487
+ # * security_marks.marks: `=`, `:`
2488
+ # * resource:
2489
+ # * resource.name: `=`, `:`
2490
+ # * resource.parent_name: `=`, `:`
2491
+ # * resource.parent_display_name: `=`, `:`
2492
+ # * resource.project_name: `=`, `:`
2493
+ # * resource.project_display_name: `=`, `:`
2494
+ # * resource.type: `=`, `:`
2495
+ # * resource.folders.resource_folder: `=`, `:`
2496
+ # * resource.display_name: `=`, `:`
2497
+ # @param order_by [::String]
2498
+ # Expression that defines what fields and order to use for sorting. The
2499
+ # string value should follow SQL syntax: comma separated list of fields. For
2500
+ # example: "name,parent". The default sorting order
2501
+ # is ascending. To specify descending order for a field, a suffix " desc"
2502
+ # should be appended to the field name. For example: "name
2503
+ # desc,parent". Redundant space characters in the
2504
+ # syntax are insignificant. "name desc,parent" and "
2505
+ # name desc , parent " are equivalent.
2506
+ #
2507
+ # The following fields are supported:
2508
+ # name
2509
+ # parent
2510
+ # state
2511
+ # category
2512
+ # resource_name
2513
+ # event_time
2514
+ # security_marks.marks
2515
+ # @param field_mask [::Google::Protobuf::FieldMask, ::Hash]
2516
+ # A field mask to specify the Finding fields to be listed in the response.
2517
+ # An empty field mask will list all fields.
2518
+ # @param page_token [::String]
2519
+ # The value returned by the last `ListFindingsResponse`; indicates
2520
+ # that this is a continuation of a prior `ListFindings` call, and
2521
+ # that the system should return the next page of data.
2522
+ # @param page_size [::Integer]
2523
+ # The maximum number of results to return in a single response. Default is
2524
+ # 10, minimum is 1, maximum is 1000.
2525
+ #
2526
+ # @yield [response, operation] Access the result along with the RPC operation
2527
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ListFindingsResponse::ListFindingsResult>]
2528
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2529
+ #
2530
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ListFindingsResponse::ListFindingsResult>]
2531
+ #
2532
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2533
+ #
2534
+ # @example Basic example
2535
+ # require "google/cloud/security_center/v2"
2536
+ #
2537
+ # # Create a client object. The client can be reused for multiple calls.
2538
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
2539
+ #
2540
+ # # Create a request. To set request fields, pass in keyword arguments.
2541
+ # request = Google::Cloud::SecurityCenter::V2::ListFindingsRequest.new
2542
+ #
2543
+ # # Call the list_findings method.
2544
+ # result = client.list_findings request
2545
+ #
2546
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2547
+ # # over elements, and API calls will be issued to fetch pages as needed.
2548
+ # result.each do |item|
2549
+ # # Each element is of type ::Google::Cloud::SecurityCenter::V2::ListFindingsResponse::ListFindingsResult.
2550
+ # p item
2551
+ # end
2552
+ #
2553
+ def list_findings request, options = nil
2554
+ raise ::ArgumentError, "request must be provided" if request.nil?
2555
+
2556
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListFindingsRequest
2557
+
2558
+ # Converts hash and nil to an options object
2559
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2560
+
2561
+ # Customize the options with defaults
2562
+ metadata = @config.rpcs.list_findings.metadata.to_h
2563
+
2564
+ # Set x-goog-api-client and x-goog-user-project headers
2565
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2566
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2567
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
2568
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2569
+
2570
+ header_params = {}
2571
+ if request.parent
2572
+ header_params["parent"] = request.parent
2573
+ end
2574
+
2575
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2576
+ metadata[:"x-goog-request-params"] ||= request_params_header
2577
+
2578
+ options.apply_defaults timeout: @config.rpcs.list_findings.timeout,
2579
+ metadata: metadata,
2580
+ retry_policy: @config.rpcs.list_findings.retry_policy
2581
+
2582
+ options.apply_defaults timeout: @config.timeout,
2583
+ metadata: @config.metadata,
2584
+ retry_policy: @config.retry_policy
2585
+
2586
+ @security_center_stub.call_rpc :list_findings, request, options: options do |response, operation|
2587
+ response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_findings, request, response, operation, options
2588
+ yield response, operation if block_given?
2589
+ return response
2590
+ end
2591
+ rescue ::GRPC::BadStatus => e
2592
+ raise ::Google::Cloud::Error.from_error(e)
2593
+ end
2594
+
2595
+ ##
2596
+ # Lists mute configs. If no location is specified, default is
2597
+ # global.
2598
+ #
2599
+ # @overload list_mute_configs(request, options = nil)
2600
+ # Pass arguments to `list_mute_configs` via a request object, either of type
2601
+ # {::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest} or an equivalent Hash.
2602
+ #
2603
+ # @param request [::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest, ::Hash]
2604
+ # A request object representing the call parameters. Required. To specify no
2605
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2606
+ # @param options [::Gapic::CallOptions, ::Hash]
2607
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2608
+ #
2609
+ # @overload list_mute_configs(parent: nil, page_size: nil, page_token: nil)
2610
+ # Pass arguments to `list_mute_configs` via keyword arguments. Note that at
2611
+ # least one keyword argument is required. To specify no parameters, or to keep all
2612
+ # the default parameter values, pass an empty Hash as a request object (see above).
2613
+ #
2614
+ # @param parent [::String]
2615
+ # Required. The parent, which owns the collection of mute configs. Its format
2616
+ # is "organizations/[organization_id]", "folders/[folder_id]",
2617
+ # "projects/[project_id]",
2618
+ # "organizations/[organization_id]/locations/[location_id]",
2619
+ # "folders/[folder_id]/locations/[location_id]",
2620
+ # "projects/[project_id]/locations/[location_id]".
2621
+ # @param page_size [::Integer]
2622
+ # The maximum number of configs to return. The service may return fewer than
2623
+ # this value.
2624
+ # If unspecified, at most 10 configs will be returned.
2625
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
2626
+ # @param page_token [::String]
2627
+ # A page token, received from a previous `ListMuteConfigs` call.
2628
+ # Provide this to retrieve the subsequent page.
2629
+ #
2630
+ # When paginating, all other parameters provided to `ListMuteConfigs` must
2631
+ # match the call that provided the page token.
2632
+ #
2633
+ # @yield [response, operation] Access the result along with the RPC operation
2634
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::MuteConfig>]
2635
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2636
+ #
2637
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::MuteConfig>]
2638
+ #
2639
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2640
+ #
2641
+ # @example Basic example
2642
+ # require "google/cloud/security_center/v2"
2643
+ #
2644
+ # # Create a client object. The client can be reused for multiple calls.
2645
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
2646
+ #
2647
+ # # Create a request. To set request fields, pass in keyword arguments.
2648
+ # request = Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest.new
2649
+ #
2650
+ # # Call the list_mute_configs method.
2651
+ # result = client.list_mute_configs request
2652
+ #
2653
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2654
+ # # over elements, and API calls will be issued to fetch pages as needed.
2655
+ # result.each do |item|
2656
+ # # Each element is of type ::Google::Cloud::SecurityCenter::V2::MuteConfig.
2657
+ # p item
2658
+ # end
2659
+ #
2660
+ def list_mute_configs request, options = nil
2661
+ raise ::ArgumentError, "request must be provided" if request.nil?
2662
+
2663
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListMuteConfigsRequest
2664
+
2665
+ # Converts hash and nil to an options object
2666
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2667
+
2668
+ # Customize the options with defaults
2669
+ metadata = @config.rpcs.list_mute_configs.metadata.to_h
2670
+
2671
+ # Set x-goog-api-client and x-goog-user-project headers
2672
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2673
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2674
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
2675
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2676
+
2677
+ header_params = {}
2678
+ if request.parent
2679
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/muteConfigs/?$}.match request.parent
2680
+ if regex_match
2681
+ header_params["location"] = regex_match["location".to_s]
2682
+ end
2683
+ end
2684
+ if request.parent
2685
+ regex_match = %r{^organizations/[^/]+/locations/(?<location>[^/]+)/muteConfigs/?$}.match request.parent
2686
+ if regex_match
2687
+ header_params["location"] = regex_match["location".to_s]
2688
+ end
2689
+ end
2690
+ if request.parent
2691
+ regex_match = %r{^folders/[^/]+/locations/(?<location>[^/]+)/muteConfigs/?$}.match request.parent
2692
+ if regex_match
2693
+ header_params["location"] = regex_match["location".to_s]
2694
+ end
2695
+ end
2696
+
2697
+ request_params_header = URI.encode_www_form header_params
2698
+ metadata[:"x-goog-request-params"] ||= request_params_header
2699
+
2700
+ options.apply_defaults timeout: @config.rpcs.list_mute_configs.timeout,
2701
+ metadata: metadata,
2702
+ retry_policy: @config.rpcs.list_mute_configs.retry_policy
2703
+
2704
+ options.apply_defaults timeout: @config.timeout,
2705
+ metadata: @config.metadata,
2706
+ retry_policy: @config.retry_policy
2707
+
2708
+ @security_center_stub.call_rpc :list_mute_configs, request, options: options do |response, operation|
2709
+ response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_mute_configs, request, response, operation, options
2710
+ yield response, operation if block_given?
2711
+ return response
2712
+ end
2713
+ rescue ::GRPC::BadStatus => e
2714
+ raise ::Google::Cloud::Error.from_error(e)
2715
+ end
2716
+
2717
+ ##
2718
+ # Lists notification configs.
2719
+ #
2720
+ # @overload list_notification_configs(request, options = nil)
2721
+ # Pass arguments to `list_notification_configs` via a request object, either of type
2722
+ # {::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest} or an equivalent Hash.
2723
+ #
2724
+ # @param request [::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest, ::Hash]
2725
+ # A request object representing the call parameters. Required. To specify no
2726
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2727
+ # @param options [::Gapic::CallOptions, ::Hash]
2728
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2729
+ #
2730
+ # @overload list_notification_configs(parent: nil, page_token: nil, page_size: nil)
2731
+ # Pass arguments to `list_notification_configs` via keyword arguments. Note that at
2732
+ # least one keyword argument is required. To specify no parameters, or to keep all
2733
+ # the default parameter values, pass an empty Hash as a request object (see above).
2734
+ #
2735
+ # @param parent [::String]
2736
+ # Required. The name of the parent in which to list the notification
2737
+ # configurations. Its format is
2738
+ # "organizations/[organization_id]/locations/[location_id]",
2739
+ # "folders/[folder_id]/locations/[location_id]", or
2740
+ # "projects/[project_id]/locations/[location_id]".
2741
+ # @param page_token [::String]
2742
+ # The value returned by the last `ListNotificationConfigsResponse`; indicates
2743
+ # that this is a continuation of a prior `ListNotificationConfigs` call, and
2744
+ # that the system should return the next page of data.
2745
+ # @param page_size [::Integer]
2746
+ # The maximum number of results to return in a single response. Default is
2747
+ # 10, minimum is 1, maximum is 1000.
2748
+ #
2749
+ # @yield [response, operation] Access the result along with the RPC operation
2750
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::NotificationConfig>]
2751
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2752
+ #
2753
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::NotificationConfig>]
2754
+ #
2755
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2756
+ #
2757
+ # @example Basic example
2758
+ # require "google/cloud/security_center/v2"
2759
+ #
2760
+ # # Create a client object. The client can be reused for multiple calls.
2761
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
2762
+ #
2763
+ # # Create a request. To set request fields, pass in keyword arguments.
2764
+ # request = Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest.new
2765
+ #
2766
+ # # Call the list_notification_configs method.
2767
+ # result = client.list_notification_configs request
2768
+ #
2769
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2770
+ # # over elements, and API calls will be issued to fetch pages as needed.
2771
+ # result.each do |item|
2772
+ # # Each element is of type ::Google::Cloud::SecurityCenter::V2::NotificationConfig.
2773
+ # p item
2774
+ # end
2775
+ #
2776
+ def list_notification_configs request, options = nil
2777
+ raise ::ArgumentError, "request must be provided" if request.nil?
2778
+
2779
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListNotificationConfigsRequest
2780
+
2781
+ # Converts hash and nil to an options object
2782
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2783
+
2784
+ # Customize the options with defaults
2785
+ metadata = @config.rpcs.list_notification_configs.metadata.to_h
2786
+
2787
+ # Set x-goog-api-client and x-goog-user-project headers
2788
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2789
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2790
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
2791
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2792
+
2793
+ header_params = {}
2794
+ if request.parent
2795
+ header_params["parent"] = request.parent
2796
+ end
2797
+
2798
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2799
+ metadata[:"x-goog-request-params"] ||= request_params_header
2800
+
2801
+ options.apply_defaults timeout: @config.rpcs.list_notification_configs.timeout,
2802
+ metadata: metadata,
2803
+ retry_policy: @config.rpcs.list_notification_configs.retry_policy
2804
+
2805
+ options.apply_defaults timeout: @config.timeout,
2806
+ metadata: @config.metadata,
2807
+ retry_policy: @config.retry_policy
2808
+
2809
+ @security_center_stub.call_rpc :list_notification_configs, request, options: options do |response, operation|
2810
+ response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_notification_configs, request, response, operation, options
2811
+ yield response, operation if block_given?
2812
+ return response
2813
+ end
2814
+ rescue ::GRPC::BadStatus => e
2815
+ raise ::Google::Cloud::Error.from_error(e)
2816
+ end
2817
+
2818
+ ##
2819
+ # Lists all ResourceValueConfigs.
2820
+ #
2821
+ # @overload list_resource_value_configs(request, options = nil)
2822
+ # Pass arguments to `list_resource_value_configs` via a request object, either of type
2823
+ # {::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest} or an equivalent Hash.
2824
+ #
2825
+ # @param request [::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest, ::Hash]
2826
+ # A request object representing the call parameters. Required. To specify no
2827
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2828
+ # @param options [::Gapic::CallOptions, ::Hash]
2829
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2830
+ #
2831
+ # @overload list_resource_value_configs(parent: nil, page_size: nil, page_token: nil)
2832
+ # Pass arguments to `list_resource_value_configs` via keyword arguments. Note that at
2833
+ # least one keyword argument is required. To specify no parameters, or to keep all
2834
+ # the default parameter values, pass an empty Hash as a request object (see above).
2835
+ #
2836
+ # @param parent [::String]
2837
+ # Required. The parent, which owns the collection of resource value configs.
2838
+ # Its format is
2839
+ # "organizations/[organization_id]"
2840
+ # @param page_size [::Integer]
2841
+ # The maximum number of configs to return. The service may return fewer than
2842
+ # this value.
2843
+ # If unspecified, at most 10 configs will be returned.
2844
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
2845
+ # @param page_token [::String]
2846
+ # A page token, received from a previous `ListResourceValueConfigs` call.
2847
+ # Provide this to retrieve the subsequent page.
2848
+ #
2849
+ # When paginating, all other parameters provided to
2850
+ # `ListResourceValueConfigs` must match the call that provided the
2851
+ # page token.
2852
+ #
2853
+ # page_size can be specified, and the new page_size will be used.
2854
+ #
2855
+ # @yield [response, operation] Access the result along with the RPC operation
2856
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ResourceValueConfig>]
2857
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2858
+ #
2859
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ResourceValueConfig>]
2860
+ #
2861
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2862
+ #
2863
+ # @example Basic example
2864
+ # require "google/cloud/security_center/v2"
2865
+ #
2866
+ # # Create a client object. The client can be reused for multiple calls.
2867
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
2868
+ #
2869
+ # # Create a request. To set request fields, pass in keyword arguments.
2870
+ # request = Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest.new
2871
+ #
2872
+ # # Call the list_resource_value_configs method.
2873
+ # result = client.list_resource_value_configs request
2874
+ #
2875
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2876
+ # # over elements, and API calls will be issued to fetch pages as needed.
2877
+ # result.each do |item|
2878
+ # # Each element is of type ::Google::Cloud::SecurityCenter::V2::ResourceValueConfig.
2879
+ # p item
2880
+ # end
2881
+ #
2882
+ def list_resource_value_configs request, options = nil
2883
+ raise ::ArgumentError, "request must be provided" if request.nil?
2884
+
2885
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListResourceValueConfigsRequest
2886
+
2887
+ # Converts hash and nil to an options object
2888
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2889
+
2890
+ # Customize the options with defaults
2891
+ metadata = @config.rpcs.list_resource_value_configs.metadata.to_h
2892
+
2893
+ # Set x-goog-api-client and x-goog-user-project headers
2894
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2895
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2896
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
2897
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2898
+
2899
+ header_params = {}
2900
+ if request.parent
2901
+ header_params["parent"] = request.parent
2902
+ end
2903
+
2904
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2905
+ metadata[:"x-goog-request-params"] ||= request_params_header
2906
+
2907
+ options.apply_defaults timeout: @config.rpcs.list_resource_value_configs.timeout,
2908
+ metadata: metadata,
2909
+ retry_policy: @config.rpcs.list_resource_value_configs.retry_policy
2910
+
2911
+ options.apply_defaults timeout: @config.timeout,
2912
+ metadata: @config.metadata,
2913
+ retry_policy: @config.retry_policy
2914
+
2915
+ @security_center_stub.call_rpc :list_resource_value_configs, request, options: options do |response, operation|
2916
+ response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_resource_value_configs, request, response, operation, options
2917
+ yield response, operation if block_given?
2918
+ return response
2919
+ end
2920
+ rescue ::GRPC::BadStatus => e
2921
+ raise ::Google::Cloud::Error.from_error(e)
2922
+ end
2923
+
2924
+ ##
2925
+ # Lists all sources belonging to an organization.
2926
+ #
2927
+ # @overload list_sources(request, options = nil)
2928
+ # Pass arguments to `list_sources` via a request object, either of type
2929
+ # {::Google::Cloud::SecurityCenter::V2::ListSourcesRequest} or an equivalent Hash.
2930
+ #
2931
+ # @param request [::Google::Cloud::SecurityCenter::V2::ListSourcesRequest, ::Hash]
2932
+ # A request object representing the call parameters. Required. To specify no
2933
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2934
+ # @param options [::Gapic::CallOptions, ::Hash]
2935
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2936
+ #
2937
+ # @overload list_sources(parent: nil, page_token: nil, page_size: nil)
2938
+ # Pass arguments to `list_sources` via keyword arguments. Note that at
2939
+ # least one keyword argument is required. To specify no parameters, or to keep all
2940
+ # the default parameter values, pass an empty Hash as a request object (see above).
2941
+ #
2942
+ # @param parent [::String]
2943
+ # Required. Resource name of the parent of sources to list. Its format should
2944
+ # be "organizations/[organization_id]", "folders/[folder_id]", or
2945
+ # "projects/[project_id]".
2946
+ # @param page_token [::String]
2947
+ # The value returned by the last `ListSourcesResponse`; indicates
2948
+ # that this is a continuation of a prior `ListSources` call, and
2949
+ # that the system should return the next page of data.
2950
+ # @param page_size [::Integer]
2951
+ # The maximum number of results to return in a single response. Default is
2952
+ # 10, minimum is 1, maximum is 1000.
2953
+ #
2954
+ # @yield [response, operation] Access the result along with the RPC operation
2955
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::Source>]
2956
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2957
+ #
2958
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::Source>]
2959
+ #
2960
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2961
+ #
2962
+ # @example Basic example
2963
+ # require "google/cloud/security_center/v2"
2964
+ #
2965
+ # # Create a client object. The client can be reused for multiple calls.
2966
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
2967
+ #
2968
+ # # Create a request. To set request fields, pass in keyword arguments.
2969
+ # request = Google::Cloud::SecurityCenter::V2::ListSourcesRequest.new
2970
+ #
2971
+ # # Call the list_sources method.
2972
+ # result = client.list_sources request
2973
+ #
2974
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2975
+ # # over elements, and API calls will be issued to fetch pages as needed.
2976
+ # result.each do |item|
2977
+ # # Each element is of type ::Google::Cloud::SecurityCenter::V2::Source.
2978
+ # p item
2979
+ # end
2980
+ #
2981
+ def list_sources request, options = nil
2982
+ raise ::ArgumentError, "request must be provided" if request.nil?
2983
+
2984
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListSourcesRequest
2985
+
2986
+ # Converts hash and nil to an options object
2987
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2988
+
2989
+ # Customize the options with defaults
2990
+ metadata = @config.rpcs.list_sources.metadata.to_h
2991
+
2992
+ # Set x-goog-api-client and x-goog-user-project headers
2993
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2994
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2995
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
2996
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2997
+
2998
+ header_params = {}
2999
+ if request.parent
3000
+ header_params["parent"] = request.parent
3001
+ end
3002
+
3003
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3004
+ metadata[:"x-goog-request-params"] ||= request_params_header
3005
+
3006
+ options.apply_defaults timeout: @config.rpcs.list_sources.timeout,
3007
+ metadata: metadata,
3008
+ retry_policy: @config.rpcs.list_sources.retry_policy
3009
+
3010
+ options.apply_defaults timeout: @config.timeout,
3011
+ metadata: @config.metadata,
3012
+ retry_policy: @config.retry_policy
3013
+
3014
+ @security_center_stub.call_rpc :list_sources, request, options: options do |response, operation|
3015
+ response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_sources, request, response, operation, options
3016
+ yield response, operation if block_given?
3017
+ return response
3018
+ end
3019
+ rescue ::GRPC::BadStatus => e
3020
+ raise ::Google::Cloud::Error.from_error(e)
3021
+ end
3022
+
3023
+ ##
3024
+ # Lists the valued resources for a set of simulation results and filter.
3025
+ #
3026
+ # @overload list_valued_resources(request, options = nil)
3027
+ # Pass arguments to `list_valued_resources` via a request object, either of type
3028
+ # {::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest} or an equivalent Hash.
3029
+ #
3030
+ # @param request [::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest, ::Hash]
3031
+ # A request object representing the call parameters. Required. To specify no
3032
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3033
+ # @param options [::Gapic::CallOptions, ::Hash]
3034
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3035
+ #
3036
+ # @overload list_valued_resources(parent: nil, filter: nil, page_token: nil, page_size: nil, order_by: nil)
3037
+ # Pass arguments to `list_valued_resources` via keyword arguments. Note that at
3038
+ # least one keyword argument is required. To specify no parameters, or to keep all
3039
+ # the default parameter values, pass an empty Hash as a request object (see above).
3040
+ #
3041
+ # @param parent [::String]
3042
+ # Required. Name of parent to list exposed resources.
3043
+ #
3044
+ # Valid formats:
3045
+ # "organizations/\\{organization}",
3046
+ # "organizations/\\{organization}/simulations/\\{simulation}"
3047
+ # "organizations/\\{organization}/simulations/\\{simulation}/attackExposureResults/\\{attack_exposure_result_v2}"
3048
+ # @param filter [::String]
3049
+ # The filter expression that filters the valued resources in the response.
3050
+ # Supported fields:
3051
+ #
3052
+ # * `resource_value` supports =
3053
+ # * `resource_type` supports =
3054
+ # @param page_token [::String]
3055
+ # The value returned by the last `ListValuedResourcesResponse`; indicates
3056
+ # that this is a continuation of a prior `ListValuedResources` call, and
3057
+ # that the system should return the next page of data.
3058
+ # @param page_size [::Integer]
3059
+ # The maximum number of results to return in a single response. Default is
3060
+ # 10, minimum is 1, maximum is 1000.
3061
+ # @param order_by [::String]
3062
+ # Optional. The fields by which to order the valued resources response.
3063
+ #
3064
+ # Supported fields:
3065
+ #
3066
+ # * `exposed_score`
3067
+ #
3068
+ # * `resource_value`
3069
+ #
3070
+ # * `resource_type`
3071
+ #
3072
+ # Values should be a comma separated list of fields. For example:
3073
+ # `exposed_score,resource_value`.
3074
+ #
3075
+ # The default sorting order is descending. To specify ascending or descending
3076
+ # order for a field, append a " ASC" or a " DESC" suffix, respectively; for
3077
+ # example: `exposed_score DESC`.
3078
+ #
3079
+ # @yield [response, operation] Access the result along with the RPC operation
3080
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ValuedResource>]
3081
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3082
+ #
3083
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecurityCenter::V2::ValuedResource>]
3084
+ #
3085
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3086
+ #
3087
+ # @example Basic example
3088
+ # require "google/cloud/security_center/v2"
3089
+ #
3090
+ # # Create a client object. The client can be reused for multiple calls.
3091
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
3092
+ #
3093
+ # # Create a request. To set request fields, pass in keyword arguments.
3094
+ # request = Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest.new
3095
+ #
3096
+ # # Call the list_valued_resources method.
3097
+ # result = client.list_valued_resources request
3098
+ #
3099
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
3100
+ # # over elements, and API calls will be issued to fetch pages as needed.
3101
+ # result.each do |item|
3102
+ # # Each element is of type ::Google::Cloud::SecurityCenter::V2::ValuedResource.
3103
+ # p item
3104
+ # end
3105
+ #
3106
+ def list_valued_resources request, options = nil
3107
+ raise ::ArgumentError, "request must be provided" if request.nil?
3108
+
3109
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::ListValuedResourcesRequest
3110
+
3111
+ # Converts hash and nil to an options object
3112
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3113
+
3114
+ # Customize the options with defaults
3115
+ metadata = @config.rpcs.list_valued_resources.metadata.to_h
3116
+
3117
+ # Set x-goog-api-client and x-goog-user-project headers
3118
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3119
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3120
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
3121
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3122
+
3123
+ header_params = {}
3124
+ if request.parent
3125
+ header_params["parent"] = request.parent
3126
+ end
3127
+
3128
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3129
+ metadata[:"x-goog-request-params"] ||= request_params_header
3130
+
3131
+ options.apply_defaults timeout: @config.rpcs.list_valued_resources.timeout,
3132
+ metadata: metadata,
3133
+ retry_policy: @config.rpcs.list_valued_resources.retry_policy
3134
+
3135
+ options.apply_defaults timeout: @config.timeout,
3136
+ metadata: @config.metadata,
3137
+ retry_policy: @config.retry_policy
3138
+
3139
+ @security_center_stub.call_rpc :list_valued_resources, request, options: options do |response, operation|
3140
+ response = ::Gapic::PagedEnumerable.new @security_center_stub, :list_valued_resources, request, response, operation, options
3141
+ yield response, operation if block_given?
3142
+ return response
3143
+ end
3144
+ rescue ::GRPC::BadStatus => e
3145
+ raise ::Google::Cloud::Error.from_error(e)
3146
+ end
3147
+
3148
+ ##
3149
+ # Updates the state of a finding. If no location is specified, finding is
3150
+ # assumed to be in global
3151
+ #
3152
+ # @overload set_finding_state(request, options = nil)
3153
+ # Pass arguments to `set_finding_state` via a request object, either of type
3154
+ # {::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest} or an equivalent Hash.
3155
+ #
3156
+ # @param request [::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest, ::Hash]
3157
+ # A request object representing the call parameters. Required. To specify no
3158
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3159
+ # @param options [::Gapic::CallOptions, ::Hash]
3160
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3161
+ #
3162
+ # @overload set_finding_state(name: nil, state: nil)
3163
+ # Pass arguments to `set_finding_state` via keyword arguments. Note that at
3164
+ # least one keyword argument is required. To specify no parameters, or to keep all
3165
+ # the default parameter values, pass an empty Hash as a request object (see above).
3166
+ #
3167
+ # @param name [::String]
3168
+ # Required. The [relative resource
3169
+ # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name)
3170
+ # of the finding. If no location is specified, finding is assumed to be in
3171
+ # global. The following list shows some examples:
3172
+ #
3173
+ # +
3174
+ # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`
3175
+ # +
3176
+ # `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
3177
+ # + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`
3178
+ # +
3179
+ # `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
3180
+ # + `projects/{project_id}/sources/{source_id}/findings/{finding_id}`
3181
+ # +
3182
+ # `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
3183
+ # @param state [::Google::Cloud::SecurityCenter::V2::Finding::State]
3184
+ # Required. The desired State of the finding.
3185
+ #
3186
+ # @yield [response, operation] Access the result along with the RPC operation
3187
+ # @yieldparam response [::Google::Cloud::SecurityCenter::V2::Finding]
3188
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3189
+ #
3190
+ # @return [::Google::Cloud::SecurityCenter::V2::Finding]
3191
+ #
3192
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3193
+ #
3194
+ # @example Basic example
3195
+ # require "google/cloud/security_center/v2"
3196
+ #
3197
+ # # Create a client object. The client can be reused for multiple calls.
3198
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
3199
+ #
3200
+ # # Create a request. To set request fields, pass in keyword arguments.
3201
+ # request = Google::Cloud::SecurityCenter::V2::SetFindingStateRequest.new
3202
+ #
3203
+ # # Call the set_finding_state method.
3204
+ # result = client.set_finding_state request
3205
+ #
3206
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding.
3207
+ # p result
3208
+ #
3209
+ def set_finding_state request, options = nil
3210
+ raise ::ArgumentError, "request must be provided" if request.nil?
3211
+
3212
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::SetFindingStateRequest
3213
+
3214
+ # Converts hash and nil to an options object
3215
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3216
+
3217
+ # Customize the options with defaults
3218
+ metadata = @config.rpcs.set_finding_state.metadata.to_h
3219
+
3220
+ # Set x-goog-api-client and x-goog-user-project headers
3221
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3222
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3223
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
3224
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3225
+
3226
+ header_params = {}
3227
+ if request.name
3228
+ header_params["name"] = request.name
3229
+ end
3230
+
3231
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3232
+ metadata[:"x-goog-request-params"] ||= request_params_header
3233
+
3234
+ options.apply_defaults timeout: @config.rpcs.set_finding_state.timeout,
3235
+ metadata: metadata,
3236
+ retry_policy: @config.rpcs.set_finding_state.retry_policy
3237
+
3238
+ options.apply_defaults timeout: @config.timeout,
3239
+ metadata: @config.metadata,
3240
+ retry_policy: @config.retry_policy
3241
+
3242
+ @security_center_stub.call_rpc :set_finding_state, request, options: options do |response, operation|
3243
+ yield response, operation if block_given?
3244
+ return response
3245
+ end
3246
+ rescue ::GRPC::BadStatus => e
3247
+ raise ::Google::Cloud::Error.from_error(e)
3248
+ end
3249
+
3250
+ ##
3251
+ # Sets the access control policy on the specified Source.
3252
+ #
3253
+ # @overload set_iam_policy(request, options = nil)
3254
+ # Pass arguments to `set_iam_policy` via a request object, either of type
3255
+ # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
3256
+ #
3257
+ # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash]
3258
+ # A request object representing the call parameters. Required. To specify no
3259
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3260
+ # @param options [::Gapic::CallOptions, ::Hash]
3261
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3262
+ #
3263
+ # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil)
3264
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
3265
+ # least one keyword argument is required. To specify no parameters, or to keep all
3266
+ # the default parameter values, pass an empty Hash as a request object (see above).
3267
+ #
3268
+ # @param resource [::String]
3269
+ # REQUIRED: The resource for which the policy is being specified.
3270
+ # See the operation documentation for the appropriate value for this field.
3271
+ # @param policy [::Google::Iam::V1::Policy, ::Hash]
3272
+ # REQUIRED: The complete policy to be applied to the `resource`. The size of
3273
+ # the policy is limited to a few 10s of KB. An empty policy is a
3274
+ # valid policy but certain Cloud Platform services (such as Projects)
3275
+ # might reject them.
3276
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
3277
+ # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
3278
+ # the fields in the mask will be modified. If no mask is provided, the
3279
+ # following default mask is used:
3280
+ #
3281
+ # `paths: "bindings, etag"`
3282
+ #
3283
+ # @yield [response, operation] Access the result along with the RPC operation
3284
+ # @yieldparam response [::Google::Iam::V1::Policy]
3285
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3286
+ #
3287
+ # @return [::Google::Iam::V1::Policy]
3288
+ #
3289
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3290
+ #
3291
+ # @example Basic example
3292
+ # require "google/cloud/security_center/v2"
3293
+ #
3294
+ # # Create a client object. The client can be reused for multiple calls.
3295
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
3296
+ #
3297
+ # # Create a request. To set request fields, pass in keyword arguments.
3298
+ # request = Google::Iam::V1::SetIamPolicyRequest.new
3299
+ #
3300
+ # # Call the set_iam_policy method.
3301
+ # result = client.set_iam_policy request
3302
+ #
3303
+ # # The returned object is of type Google::Iam::V1::Policy.
3304
+ # p result
3305
+ #
3306
+ def set_iam_policy request, options = nil
3307
+ raise ::ArgumentError, "request must be provided" if request.nil?
3308
+
3309
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest
3310
+
3311
+ # Converts hash and nil to an options object
3312
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3313
+
3314
+ # Customize the options with defaults
3315
+ metadata = @config.rpcs.set_iam_policy.metadata.to_h
3316
+
3317
+ # Set x-goog-api-client and x-goog-user-project headers
3318
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3319
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3320
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
3321
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3322
+
3323
+ header_params = {}
3324
+ if request.resource
3325
+ header_params["resource"] = request.resource
3326
+ end
3327
+
3328
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3329
+ metadata[:"x-goog-request-params"] ||= request_params_header
3330
+
3331
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
3332
+ metadata: metadata,
3333
+ retry_policy: @config.rpcs.set_iam_policy.retry_policy
3334
+
3335
+ options.apply_defaults timeout: @config.timeout,
3336
+ metadata: @config.metadata,
3337
+ retry_policy: @config.retry_policy
3338
+
3339
+ @security_center_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
3340
+ yield response, operation if block_given?
3341
+ return response
3342
+ end
3343
+ rescue ::GRPC::BadStatus => e
3344
+ raise ::Google::Cloud::Error.from_error(e)
3345
+ end
3346
+
3347
+ ##
3348
+ # Updates the mute state of a finding. If no location is specified, finding
3349
+ # is assumed to be in global
3350
+ #
3351
+ # @overload set_mute(request, options = nil)
3352
+ # Pass arguments to `set_mute` via a request object, either of type
3353
+ # {::Google::Cloud::SecurityCenter::V2::SetMuteRequest} or an equivalent Hash.
3354
+ #
3355
+ # @param request [::Google::Cloud::SecurityCenter::V2::SetMuteRequest, ::Hash]
3356
+ # A request object representing the call parameters. Required. To specify no
3357
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3358
+ # @param options [::Gapic::CallOptions, ::Hash]
3359
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3360
+ #
3361
+ # @overload set_mute(name: nil, mute: nil)
3362
+ # Pass arguments to `set_mute` via keyword arguments. Note that at
3363
+ # least one keyword argument is required. To specify no parameters, or to keep all
3364
+ # the default parameter values, pass an empty Hash as a request object (see above).
3365
+ #
3366
+ # @param name [::String]
3367
+ # Required. The [relative resource
3368
+ # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name)
3369
+ # of the finding. If no location is specified, finding is assumed to be in
3370
+ # global. The following list shows some examples:
3371
+ #
3372
+ # +
3373
+ # `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`
3374
+ # +
3375
+ # `organizations/{organization_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
3376
+ # + `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`
3377
+ # +
3378
+ # `folders/{folder_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
3379
+ # + `projects/{project_id}/sources/{source_id}/findings/{finding_id}`
3380
+ # +
3381
+ # `projects/{project_id}/sources/{source_id}/locations/{location_id}/findings/{finding_id}`
3382
+ # @param mute [::Google::Cloud::SecurityCenter::V2::Finding::Mute]
3383
+ # Required. The desired state of the Mute.
3384
+ #
3385
+ # @yield [response, operation] Access the result along with the RPC operation
3386
+ # @yieldparam response [::Google::Cloud::SecurityCenter::V2::Finding]
3387
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3388
+ #
3389
+ # @return [::Google::Cloud::SecurityCenter::V2::Finding]
3390
+ #
3391
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3392
+ #
3393
+ # @example Basic example
3394
+ # require "google/cloud/security_center/v2"
3395
+ #
3396
+ # # Create a client object. The client can be reused for multiple calls.
3397
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
3398
+ #
3399
+ # # Create a request. To set request fields, pass in keyword arguments.
3400
+ # request = Google::Cloud::SecurityCenter::V2::SetMuteRequest.new
3401
+ #
3402
+ # # Call the set_mute method.
3403
+ # result = client.set_mute request
3404
+ #
3405
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding.
3406
+ # p result
3407
+ #
3408
+ def set_mute request, options = nil
3409
+ raise ::ArgumentError, "request must be provided" if request.nil?
3410
+
3411
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::SetMuteRequest
3412
+
3413
+ # Converts hash and nil to an options object
3414
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3415
+
3416
+ # Customize the options with defaults
3417
+ metadata = @config.rpcs.set_mute.metadata.to_h
3418
+
3419
+ # Set x-goog-api-client and x-goog-user-project headers
3420
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3421
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3422
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
3423
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3424
+
3425
+ header_params = {}
3426
+ if request.name
3427
+ header_params["name"] = request.name
3428
+ end
3429
+
3430
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3431
+ metadata[:"x-goog-request-params"] ||= request_params_header
3432
+
3433
+ options.apply_defaults timeout: @config.rpcs.set_mute.timeout,
3434
+ metadata: metadata,
3435
+ retry_policy: @config.rpcs.set_mute.retry_policy
3436
+
3437
+ options.apply_defaults timeout: @config.timeout,
3438
+ metadata: @config.metadata,
3439
+ retry_policy: @config.retry_policy
3440
+
3441
+ @security_center_stub.call_rpc :set_mute, request, options: options do |response, operation|
3442
+ yield response, operation if block_given?
3443
+ return response
3444
+ end
3445
+ rescue ::GRPC::BadStatus => e
3446
+ raise ::Google::Cloud::Error.from_error(e)
3447
+ end
3448
+
3449
+ ##
3450
+ # Returns the permissions that a caller has on the specified source.
3451
+ #
3452
+ # @overload test_iam_permissions(request, options = nil)
3453
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
3454
+ # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash.
3455
+ #
3456
+ # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash]
3457
+ # A request object representing the call parameters. Required. To specify no
3458
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3459
+ # @param options [::Gapic::CallOptions, ::Hash]
3460
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3461
+ #
3462
+ # @overload test_iam_permissions(resource: nil, permissions: nil)
3463
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
3464
+ # least one keyword argument is required. To specify no parameters, or to keep all
3465
+ # the default parameter values, pass an empty Hash as a request object (see above).
3466
+ #
3467
+ # @param resource [::String]
3468
+ # REQUIRED: The resource for which the policy detail is being requested.
3469
+ # See the operation documentation for the appropriate value for this field.
3470
+ # @param permissions [::Array<::String>]
3471
+ # The set of permissions to check for the `resource`. Permissions with
3472
+ # wildcards (such as '*' or 'storage.*') are not allowed. For more
3473
+ # information see
3474
+ # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
3475
+ #
3476
+ # @yield [response, operation] Access the result along with the RPC operation
3477
+ # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse]
3478
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3479
+ #
3480
+ # @return [::Google::Iam::V1::TestIamPermissionsResponse]
3481
+ #
3482
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3483
+ #
3484
+ # @example Basic example
3485
+ # require "google/cloud/security_center/v2"
3486
+ #
3487
+ # # Create a client object. The client can be reused for multiple calls.
3488
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
3489
+ #
3490
+ # # Create a request. To set request fields, pass in keyword arguments.
3491
+ # request = Google::Iam::V1::TestIamPermissionsRequest.new
3492
+ #
3493
+ # # Call the test_iam_permissions method.
3494
+ # result = client.test_iam_permissions request
3495
+ #
3496
+ # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
3497
+ # p result
3498
+ #
3499
+ def test_iam_permissions request, options = nil
3500
+ raise ::ArgumentError, "request must be provided" if request.nil?
3501
+
3502
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest
3503
+
3504
+ # Converts hash and nil to an options object
3505
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3506
+
3507
+ # Customize the options with defaults
3508
+ metadata = @config.rpcs.test_iam_permissions.metadata.to_h
3509
+
3510
+ # Set x-goog-api-client and x-goog-user-project headers
3511
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3512
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3513
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
3514
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3515
+
3516
+ header_params = {}
3517
+ if request.resource
3518
+ header_params["resource"] = request.resource
3519
+ end
3520
+
3521
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3522
+ metadata[:"x-goog-request-params"] ||= request_params_header
3523
+
3524
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
3525
+ metadata: metadata,
3526
+ retry_policy: @config.rpcs.test_iam_permissions.retry_policy
3527
+
3528
+ options.apply_defaults timeout: @config.timeout,
3529
+ metadata: @config.metadata,
3530
+ retry_policy: @config.retry_policy
3531
+
3532
+ @security_center_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
3533
+ yield response, operation if block_given?
3534
+ return response
3535
+ end
3536
+ rescue ::GRPC::BadStatus => e
3537
+ raise ::Google::Cloud::Error.from_error(e)
3538
+ end
3539
+
3540
+ ##
3541
+ # Updates a BigQuery export.
3542
+ #
3543
+ # @overload update_big_query_export(request, options = nil)
3544
+ # Pass arguments to `update_big_query_export` via a request object, either of type
3545
+ # {::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest} or an equivalent Hash.
3546
+ #
3547
+ # @param request [::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest, ::Hash]
3548
+ # A request object representing the call parameters. Required. To specify no
3549
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3550
+ # @param options [::Gapic::CallOptions, ::Hash]
3551
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3552
+ #
3553
+ # @overload update_big_query_export(big_query_export: nil, update_mask: nil)
3554
+ # Pass arguments to `update_big_query_export` via keyword arguments. Note that at
3555
+ # least one keyword argument is required. To specify no parameters, or to keep all
3556
+ # the default parameter values, pass an empty Hash as a request object (see above).
3557
+ #
3558
+ # @param big_query_export [::Google::Cloud::SecurityCenter::V2::BigQueryExport, ::Hash]
3559
+ # Required. The BigQuery export being updated.
3560
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
3561
+ # The list of fields to be updated.
3562
+ # If empty all mutable fields will be updated.
3563
+ #
3564
+ # @yield [response, operation] Access the result along with the RPC operation
3565
+ # @yieldparam response [::Google::Cloud::SecurityCenter::V2::BigQueryExport]
3566
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3567
+ #
3568
+ # @return [::Google::Cloud::SecurityCenter::V2::BigQueryExport]
3569
+ #
3570
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3571
+ #
3572
+ # @example Basic example
3573
+ # require "google/cloud/security_center/v2"
3574
+ #
3575
+ # # Create a client object. The client can be reused for multiple calls.
3576
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
3577
+ #
3578
+ # # Create a request. To set request fields, pass in keyword arguments.
3579
+ # request = Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest.new
3580
+ #
3581
+ # # Call the update_big_query_export method.
3582
+ # result = client.update_big_query_export request
3583
+ #
3584
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::BigQueryExport.
3585
+ # p result
3586
+ #
3587
+ def update_big_query_export request, options = nil
3588
+ raise ::ArgumentError, "request must be provided" if request.nil?
3589
+
3590
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateBigQueryExportRequest
3591
+
3592
+ # Converts hash and nil to an options object
3593
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3594
+
3595
+ # Customize the options with defaults
3596
+ metadata = @config.rpcs.update_big_query_export.metadata.to_h
3597
+
3598
+ # Set x-goog-api-client and x-goog-user-project headers
3599
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3600
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3601
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
3602
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3603
+
3604
+ header_params = {}
3605
+ if request.big_query_export&.name
3606
+ header_params["big_query_export.name"] = request.big_query_export.name
3607
+ end
3608
+
3609
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3610
+ metadata[:"x-goog-request-params"] ||= request_params_header
3611
+
3612
+ options.apply_defaults timeout: @config.rpcs.update_big_query_export.timeout,
3613
+ metadata: metadata,
3614
+ retry_policy: @config.rpcs.update_big_query_export.retry_policy
3615
+
3616
+ options.apply_defaults timeout: @config.timeout,
3617
+ metadata: @config.metadata,
3618
+ retry_policy: @config.retry_policy
3619
+
3620
+ @security_center_stub.call_rpc :update_big_query_export, request, options: options do |response, operation|
3621
+ yield response, operation if block_given?
3622
+ return response
3623
+ end
3624
+ rescue ::GRPC::BadStatus => e
3625
+ raise ::Google::Cloud::Error.from_error(e)
3626
+ end
3627
+
3628
+ ##
3629
+ # Updates external system. This is for a given finding. If no location is
3630
+ # specified, finding is assumed to be in global
3631
+ #
3632
+ # @overload update_external_system(request, options = nil)
3633
+ # Pass arguments to `update_external_system` via a request object, either of type
3634
+ # {::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest} or an equivalent Hash.
3635
+ #
3636
+ # @param request [::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest, ::Hash]
3637
+ # A request object representing the call parameters. Required. To specify no
3638
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3639
+ # @param options [::Gapic::CallOptions, ::Hash]
3640
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3641
+ #
3642
+ # @overload update_external_system(external_system: nil, update_mask: nil)
3643
+ # Pass arguments to `update_external_system` via keyword arguments. Note that at
3644
+ # least one keyword argument is required. To specify no parameters, or to keep all
3645
+ # the default parameter values, pass an empty Hash as a request object (see above).
3646
+ #
3647
+ # @param external_system [::Google::Cloud::SecurityCenter::V2::ExternalSystem, ::Hash]
3648
+ # Required. The external system resource to update.
3649
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
3650
+ # The FieldMask to use when updating the external system resource.
3651
+ #
3652
+ # If empty all mutable fields will be updated.
3653
+ #
3654
+ # @yield [response, operation] Access the result along with the RPC operation
3655
+ # @yieldparam response [::Google::Cloud::SecurityCenter::V2::ExternalSystem]
3656
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3657
+ #
3658
+ # @return [::Google::Cloud::SecurityCenter::V2::ExternalSystem]
3659
+ #
3660
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3661
+ #
3662
+ # @example Basic example
3663
+ # require "google/cloud/security_center/v2"
3664
+ #
3665
+ # # Create a client object. The client can be reused for multiple calls.
3666
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
3667
+ #
3668
+ # # Create a request. To set request fields, pass in keyword arguments.
3669
+ # request = Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest.new
3670
+ #
3671
+ # # Call the update_external_system method.
3672
+ # result = client.update_external_system request
3673
+ #
3674
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::ExternalSystem.
3675
+ # p result
3676
+ #
3677
+ def update_external_system request, options = nil
3678
+ raise ::ArgumentError, "request must be provided" if request.nil?
3679
+
3680
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateExternalSystemRequest
3681
+
3682
+ # Converts hash and nil to an options object
3683
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3684
+
3685
+ # Customize the options with defaults
3686
+ metadata = @config.rpcs.update_external_system.metadata.to_h
3687
+
3688
+ # Set x-goog-api-client and x-goog-user-project headers
3689
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3690
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3691
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
3692
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3693
+
3694
+ header_params = {}
3695
+ if request.external_system&.name
3696
+ header_params["external_system.name"] = request.external_system.name
3697
+ end
3698
+
3699
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3700
+ metadata[:"x-goog-request-params"] ||= request_params_header
3701
+
3702
+ options.apply_defaults timeout: @config.rpcs.update_external_system.timeout,
3703
+ metadata: metadata,
3704
+ retry_policy: @config.rpcs.update_external_system.retry_policy
3705
+
3706
+ options.apply_defaults timeout: @config.timeout,
3707
+ metadata: @config.metadata,
3708
+ retry_policy: @config.retry_policy
3709
+
3710
+ @security_center_stub.call_rpc :update_external_system, request, options: options do |response, operation|
3711
+ yield response, operation if block_given?
3712
+ return response
3713
+ end
3714
+ rescue ::GRPC::BadStatus => e
3715
+ raise ::Google::Cloud::Error.from_error(e)
3716
+ end
3717
+
3718
+ ##
3719
+ # Creates or updates a finding. If no location is specified, finding is
3720
+ # assumed to be in global. The corresponding source must exist for a finding
3721
+ # creation to succeed.
3722
+ #
3723
+ # @overload update_finding(request, options = nil)
3724
+ # Pass arguments to `update_finding` via a request object, either of type
3725
+ # {::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest} or an equivalent Hash.
3726
+ #
3727
+ # @param request [::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest, ::Hash]
3728
+ # A request object representing the call parameters. Required. To specify no
3729
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3730
+ # @param options [::Gapic::CallOptions, ::Hash]
3731
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3732
+ #
3733
+ # @overload update_finding(finding: nil, update_mask: nil)
3734
+ # Pass arguments to `update_finding` via keyword arguments. Note that at
3735
+ # least one keyword argument is required. To specify no parameters, or to keep all
3736
+ # the default parameter values, pass an empty Hash as a request object (see above).
3737
+ #
3738
+ # @param finding [::Google::Cloud::SecurityCenter::V2::Finding, ::Hash]
3739
+ # Required. The finding resource to update or create if it does not already
3740
+ # exist. parent, security_marks, and update_time will be ignored.
3741
+ #
3742
+ # In the case of creation, the finding id portion of the name must be
3743
+ # alphanumeric and less than or equal to 32 characters and greater than 0
3744
+ # characters in length.
3745
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
3746
+ # The FieldMask to use when updating the finding resource. This field should
3747
+ # not be specified when creating a finding.
3748
+ #
3749
+ # When updating a finding, an empty mask is treated as updating all mutable
3750
+ # fields and replacing source_properties. Individual source_properties can
3751
+ # be added/updated by using "source_properties.<property key>" in the field
3752
+ # mask.
3753
+ #
3754
+ # @yield [response, operation] Access the result along with the RPC operation
3755
+ # @yieldparam response [::Google::Cloud::SecurityCenter::V2::Finding]
3756
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3757
+ #
3758
+ # @return [::Google::Cloud::SecurityCenter::V2::Finding]
3759
+ #
3760
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3761
+ #
3762
+ # @example Basic example
3763
+ # require "google/cloud/security_center/v2"
3764
+ #
3765
+ # # Create a client object. The client can be reused for multiple calls.
3766
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
3767
+ #
3768
+ # # Create a request. To set request fields, pass in keyword arguments.
3769
+ # request = Google::Cloud::SecurityCenter::V2::UpdateFindingRequest.new
3770
+ #
3771
+ # # Call the update_finding method.
3772
+ # result = client.update_finding request
3773
+ #
3774
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::Finding.
3775
+ # p result
3776
+ #
3777
+ def update_finding request, options = nil
3778
+ raise ::ArgumentError, "request must be provided" if request.nil?
3779
+
3780
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateFindingRequest
3781
+
3782
+ # Converts hash and nil to an options object
3783
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3784
+
3785
+ # Customize the options with defaults
3786
+ metadata = @config.rpcs.update_finding.metadata.to_h
3787
+
3788
+ # Set x-goog-api-client and x-goog-user-project headers
3789
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3790
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3791
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
3792
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3793
+
3794
+ header_params = {}
3795
+ if request.finding&.name
3796
+ header_params["finding.name"] = request.finding.name
3797
+ end
3798
+
3799
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3800
+ metadata[:"x-goog-request-params"] ||= request_params_header
3801
+
3802
+ options.apply_defaults timeout: @config.rpcs.update_finding.timeout,
3803
+ metadata: metadata,
3804
+ retry_policy: @config.rpcs.update_finding.retry_policy
3805
+
3806
+ options.apply_defaults timeout: @config.timeout,
3807
+ metadata: @config.metadata,
3808
+ retry_policy: @config.retry_policy
3809
+
3810
+ @security_center_stub.call_rpc :update_finding, request, options: options do |response, operation|
3811
+ yield response, operation if block_given?
3812
+ return response
3813
+ end
3814
+ rescue ::GRPC::BadStatus => e
3815
+ raise ::Google::Cloud::Error.from_error(e)
3816
+ end
3817
+
3818
+ ##
3819
+ # Updates a mute config. If no location is specified, default is
3820
+ # global.
3821
+ #
3822
+ # @overload update_mute_config(request, options = nil)
3823
+ # Pass arguments to `update_mute_config` via a request object, either of type
3824
+ # {::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest} or an equivalent Hash.
3825
+ #
3826
+ # @param request [::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest, ::Hash]
3827
+ # A request object representing the call parameters. Required. To specify no
3828
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3829
+ # @param options [::Gapic::CallOptions, ::Hash]
3830
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3831
+ #
3832
+ # @overload update_mute_config(mute_config: nil, update_mask: nil)
3833
+ # Pass arguments to `update_mute_config` via keyword arguments. Note that at
3834
+ # least one keyword argument is required. To specify no parameters, or to keep all
3835
+ # the default parameter values, pass an empty Hash as a request object (see above).
3836
+ #
3837
+ # @param mute_config [::Google::Cloud::SecurityCenter::V2::MuteConfig, ::Hash]
3838
+ # Required. The mute config being updated.
3839
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
3840
+ # The list of fields to be updated.
3841
+ # If empty all mutable fields will be updated.
3842
+ #
3843
+ # @yield [response, operation] Access the result along with the RPC operation
3844
+ # @yieldparam response [::Google::Cloud::SecurityCenter::V2::MuteConfig]
3845
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3846
+ #
3847
+ # @return [::Google::Cloud::SecurityCenter::V2::MuteConfig]
3848
+ #
3849
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3850
+ #
3851
+ # @example Basic example
3852
+ # require "google/cloud/security_center/v2"
3853
+ #
3854
+ # # Create a client object. The client can be reused for multiple calls.
3855
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
3856
+ #
3857
+ # # Create a request. To set request fields, pass in keyword arguments.
3858
+ # request = Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest.new
3859
+ #
3860
+ # # Call the update_mute_config method.
3861
+ # result = client.update_mute_config request
3862
+ #
3863
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::MuteConfig.
3864
+ # p result
3865
+ #
3866
+ def update_mute_config request, options = nil
3867
+ raise ::ArgumentError, "request must be provided" if request.nil?
3868
+
3869
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateMuteConfigRequest
3870
+
3871
+ # Converts hash and nil to an options object
3872
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3873
+
3874
+ # Customize the options with defaults
3875
+ metadata = @config.rpcs.update_mute_config.metadata.to_h
3876
+
3877
+ # Set x-goog-api-client and x-goog-user-project headers
3878
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3879
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3880
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
3881
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3882
+
3883
+ header_params = {}
3884
+ if request.mute_config&.name
3885
+ regex_match = %r{^projects/[^/]+/locations/(?<location>[^/]+)/muteConfigs/[^/]+/?$}.match request.mute_config.name
3886
+ if regex_match
3887
+ header_params["location"] = regex_match["location".to_s]
3888
+ end
3889
+ end
3890
+ if request.mute_config&.name
3891
+ regex_match = %r{^organizations/[^/]+/locations/(?<location>[^/]+)/muteConfigs/[^/]+/?$}.match request.mute_config.name
3892
+ if regex_match
3893
+ header_params["location"] = regex_match["location".to_s]
3894
+ end
3895
+ end
3896
+ if request.mute_config&.name
3897
+ regex_match = %r{^folders/[^/]+/locations/(?<location>[^/]+)/muteConfigs/[^/]+/?$}.match request.mute_config.name
3898
+ if regex_match
3899
+ header_params["location"] = regex_match["location".to_s]
3900
+ end
3901
+ end
3902
+
3903
+ request_params_header = URI.encode_www_form header_params
3904
+ metadata[:"x-goog-request-params"] ||= request_params_header
3905
+
3906
+ options.apply_defaults timeout: @config.rpcs.update_mute_config.timeout,
3907
+ metadata: metadata,
3908
+ retry_policy: @config.rpcs.update_mute_config.retry_policy
3909
+
3910
+ options.apply_defaults timeout: @config.timeout,
3911
+ metadata: @config.metadata,
3912
+ retry_policy: @config.retry_policy
3913
+
3914
+ @security_center_stub.call_rpc :update_mute_config, request, options: options do |response, operation|
3915
+ yield response, operation if block_given?
3916
+ return response
3917
+ end
3918
+ rescue ::GRPC::BadStatus => e
3919
+ raise ::Google::Cloud::Error.from_error(e)
3920
+ end
3921
+
3922
+ ##
3923
+ # Updates a notification config. The following update
3924
+ # fields are allowed: description, pubsub_topic, streaming_config.filter
3925
+ #
3926
+ # @overload update_notification_config(request, options = nil)
3927
+ # Pass arguments to `update_notification_config` via a request object, either of type
3928
+ # {::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest} or an equivalent Hash.
3929
+ #
3930
+ # @param request [::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest, ::Hash]
3931
+ # A request object representing the call parameters. Required. To specify no
3932
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3933
+ # @param options [::Gapic::CallOptions, ::Hash]
3934
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3935
+ #
3936
+ # @overload update_notification_config(notification_config: nil, update_mask: nil)
3937
+ # Pass arguments to `update_notification_config` via keyword arguments. Note that at
3938
+ # least one keyword argument is required. To specify no parameters, or to keep all
3939
+ # the default parameter values, pass an empty Hash as a request object (see above).
3940
+ #
3941
+ # @param notification_config [::Google::Cloud::SecurityCenter::V2::NotificationConfig, ::Hash]
3942
+ # Required. The notification config to update.
3943
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
3944
+ # The FieldMask to use when updating the notification config.
3945
+ #
3946
+ # If empty all mutable fields will be updated.
3947
+ #
3948
+ # @yield [response, operation] Access the result along with the RPC operation
3949
+ # @yieldparam response [::Google::Cloud::SecurityCenter::V2::NotificationConfig]
3950
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3951
+ #
3952
+ # @return [::Google::Cloud::SecurityCenter::V2::NotificationConfig]
3953
+ #
3954
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3955
+ #
3956
+ # @example Basic example
3957
+ # require "google/cloud/security_center/v2"
3958
+ #
3959
+ # # Create a client object. The client can be reused for multiple calls.
3960
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
3961
+ #
3962
+ # # Create a request. To set request fields, pass in keyword arguments.
3963
+ # request = Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest.new
3964
+ #
3965
+ # # Call the update_notification_config method.
3966
+ # result = client.update_notification_config request
3967
+ #
3968
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::NotificationConfig.
3969
+ # p result
3970
+ #
3971
+ def update_notification_config request, options = nil
3972
+ raise ::ArgumentError, "request must be provided" if request.nil?
3973
+
3974
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateNotificationConfigRequest
3975
+
3976
+ # Converts hash and nil to an options object
3977
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3978
+
3979
+ # Customize the options with defaults
3980
+ metadata = @config.rpcs.update_notification_config.metadata.to_h
3981
+
3982
+ # Set x-goog-api-client and x-goog-user-project headers
3983
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3984
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3985
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
3986
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3987
+
3988
+ header_params = {}
3989
+ if request.notification_config&.name
3990
+ header_params["notification_config.name"] = request.notification_config.name
3991
+ end
3992
+
3993
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3994
+ metadata[:"x-goog-request-params"] ||= request_params_header
3995
+
3996
+ options.apply_defaults timeout: @config.rpcs.update_notification_config.timeout,
3997
+ metadata: metadata,
3998
+ retry_policy: @config.rpcs.update_notification_config.retry_policy
3999
+
4000
+ options.apply_defaults timeout: @config.timeout,
4001
+ metadata: @config.metadata,
4002
+ retry_policy: @config.retry_policy
4003
+
4004
+ @security_center_stub.call_rpc :update_notification_config, request, options: options do |response, operation|
4005
+ yield response, operation if block_given?
4006
+ return response
4007
+ end
4008
+ rescue ::GRPC::BadStatus => e
4009
+ raise ::Google::Cloud::Error.from_error(e)
4010
+ end
4011
+
4012
+ ##
4013
+ # Updates an existing ResourceValueConfigs with new rules.
4014
+ #
4015
+ # @overload update_resource_value_config(request, options = nil)
4016
+ # Pass arguments to `update_resource_value_config` via a request object, either of type
4017
+ # {::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest} or an equivalent Hash.
4018
+ #
4019
+ # @param request [::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest, ::Hash]
4020
+ # A request object representing the call parameters. Required. To specify no
4021
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
4022
+ # @param options [::Gapic::CallOptions, ::Hash]
4023
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
4024
+ #
4025
+ # @overload update_resource_value_config(resource_value_config: nil, update_mask: nil)
4026
+ # Pass arguments to `update_resource_value_config` via keyword arguments. Note that at
4027
+ # least one keyword argument is required. To specify no parameters, or to keep all
4028
+ # the default parameter values, pass an empty Hash as a request object (see above).
4029
+ #
4030
+ # @param resource_value_config [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig, ::Hash]
4031
+ # Required. The resource value config being updated.
4032
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
4033
+ # The list of fields to be updated.
4034
+ # If empty all mutable fields will be updated.
4035
+ #
4036
+ # @yield [response, operation] Access the result along with the RPC operation
4037
+ # @yieldparam response [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig]
4038
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
4039
+ #
4040
+ # @return [::Google::Cloud::SecurityCenter::V2::ResourceValueConfig]
4041
+ #
4042
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
4043
+ #
4044
+ # @example Basic example
4045
+ # require "google/cloud/security_center/v2"
4046
+ #
4047
+ # # Create a client object. The client can be reused for multiple calls.
4048
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
4049
+ #
4050
+ # # Create a request. To set request fields, pass in keyword arguments.
4051
+ # request = Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest.new
4052
+ #
4053
+ # # Call the update_resource_value_config method.
4054
+ # result = client.update_resource_value_config request
4055
+ #
4056
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::ResourceValueConfig.
4057
+ # p result
4058
+ #
4059
+ def update_resource_value_config request, options = nil
4060
+ raise ::ArgumentError, "request must be provided" if request.nil?
4061
+
4062
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateResourceValueConfigRequest
4063
+
4064
+ # Converts hash and nil to an options object
4065
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
4066
+
4067
+ # Customize the options with defaults
4068
+ metadata = @config.rpcs.update_resource_value_config.metadata.to_h
4069
+
4070
+ # Set x-goog-api-client and x-goog-user-project headers
4071
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
4072
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
4073
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
4074
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
4075
+
4076
+ header_params = {}
4077
+ if request.resource_value_config&.name
4078
+ header_params["resource_value_config.name"] = request.resource_value_config.name
4079
+ end
4080
+
4081
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
4082
+ metadata[:"x-goog-request-params"] ||= request_params_header
4083
+
4084
+ options.apply_defaults timeout: @config.rpcs.update_resource_value_config.timeout,
4085
+ metadata: metadata,
4086
+ retry_policy: @config.rpcs.update_resource_value_config.retry_policy
4087
+
4088
+ options.apply_defaults timeout: @config.timeout,
4089
+ metadata: @config.metadata,
4090
+ retry_policy: @config.retry_policy
4091
+
4092
+ @security_center_stub.call_rpc :update_resource_value_config, request, options: options do |response, operation|
4093
+ yield response, operation if block_given?
4094
+ return response
4095
+ end
4096
+ rescue ::GRPC::BadStatus => e
4097
+ raise ::Google::Cloud::Error.from_error(e)
4098
+ end
4099
+
4100
+ ##
4101
+ # Updates security marks. For Finding Security marks, if no location is
4102
+ # specified, finding is assumed to be in global. Assets Security Marks can
4103
+ # only be accessed through global endpoint.
4104
+ #
4105
+ # @overload update_security_marks(request, options = nil)
4106
+ # Pass arguments to `update_security_marks` via a request object, either of type
4107
+ # {::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest} or an equivalent Hash.
4108
+ #
4109
+ # @param request [::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest, ::Hash]
4110
+ # A request object representing the call parameters. Required. To specify no
4111
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
4112
+ # @param options [::Gapic::CallOptions, ::Hash]
4113
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
4114
+ #
4115
+ # @overload update_security_marks(security_marks: nil, update_mask: nil)
4116
+ # Pass arguments to `update_security_marks` via keyword arguments. Note that at
4117
+ # least one keyword argument is required. To specify no parameters, or to keep all
4118
+ # the default parameter values, pass an empty Hash as a request object (see above).
4119
+ #
4120
+ # @param security_marks [::Google::Cloud::SecurityCenter::V2::SecurityMarks, ::Hash]
4121
+ # Required. The security marks resource to update.
4122
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
4123
+ # The FieldMask to use when updating the security marks resource.
4124
+ #
4125
+ # The field mask must not contain duplicate fields.
4126
+ # If empty or set to "marks", all marks will be replaced. Individual
4127
+ # marks can be updated using "marks.<mark_key>".
4128
+ #
4129
+ # @yield [response, operation] Access the result along with the RPC operation
4130
+ # @yieldparam response [::Google::Cloud::SecurityCenter::V2::SecurityMarks]
4131
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
4132
+ #
4133
+ # @return [::Google::Cloud::SecurityCenter::V2::SecurityMarks]
4134
+ #
4135
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
4136
+ #
4137
+ # @example Basic example
4138
+ # require "google/cloud/security_center/v2"
4139
+ #
4140
+ # # Create a client object. The client can be reused for multiple calls.
4141
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
4142
+ #
4143
+ # # Create a request. To set request fields, pass in keyword arguments.
4144
+ # request = Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest.new
4145
+ #
4146
+ # # Call the update_security_marks method.
4147
+ # result = client.update_security_marks request
4148
+ #
4149
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::SecurityMarks.
4150
+ # p result
4151
+ #
4152
+ def update_security_marks request, options = nil
4153
+ raise ::ArgumentError, "request must be provided" if request.nil?
4154
+
4155
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateSecurityMarksRequest
4156
+
4157
+ # Converts hash and nil to an options object
4158
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
4159
+
4160
+ # Customize the options with defaults
4161
+ metadata = @config.rpcs.update_security_marks.metadata.to_h
4162
+
4163
+ # Set x-goog-api-client and x-goog-user-project headers
4164
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
4165
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
4166
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
4167
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
4168
+
4169
+ header_params = {}
4170
+ if request.security_marks&.name
4171
+ header_params["security_marks.name"] = request.security_marks.name
4172
+ end
4173
+
4174
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
4175
+ metadata[:"x-goog-request-params"] ||= request_params_header
4176
+
4177
+ options.apply_defaults timeout: @config.rpcs.update_security_marks.timeout,
4178
+ metadata: metadata,
4179
+ retry_policy: @config.rpcs.update_security_marks.retry_policy
4180
+
4181
+ options.apply_defaults timeout: @config.timeout,
4182
+ metadata: @config.metadata,
4183
+ retry_policy: @config.retry_policy
4184
+
4185
+ @security_center_stub.call_rpc :update_security_marks, request, options: options do |response, operation|
4186
+ yield response, operation if block_given?
4187
+ return response
4188
+ end
4189
+ rescue ::GRPC::BadStatus => e
4190
+ raise ::Google::Cloud::Error.from_error(e)
4191
+ end
4192
+
4193
+ ##
4194
+ # Updates a source.
4195
+ #
4196
+ # @overload update_source(request, options = nil)
4197
+ # Pass arguments to `update_source` via a request object, either of type
4198
+ # {::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest} or an equivalent Hash.
4199
+ #
4200
+ # @param request [::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest, ::Hash]
4201
+ # A request object representing the call parameters. Required. To specify no
4202
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
4203
+ # @param options [::Gapic::CallOptions, ::Hash]
4204
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
4205
+ #
4206
+ # @overload update_source(source: nil, update_mask: nil)
4207
+ # Pass arguments to `update_source` via keyword arguments. Note that at
4208
+ # least one keyword argument is required. To specify no parameters, or to keep all
4209
+ # the default parameter values, pass an empty Hash as a request object (see above).
4210
+ #
4211
+ # @param source [::Google::Cloud::SecurityCenter::V2::Source, ::Hash]
4212
+ # Required. The source resource to update.
4213
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
4214
+ # The FieldMask to use when updating the source resource.
4215
+ #
4216
+ # If empty all mutable fields will be updated.
4217
+ #
4218
+ # @yield [response, operation] Access the result along with the RPC operation
4219
+ # @yieldparam response [::Google::Cloud::SecurityCenter::V2::Source]
4220
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
4221
+ #
4222
+ # @return [::Google::Cloud::SecurityCenter::V2::Source]
4223
+ #
4224
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
4225
+ #
4226
+ # @example Basic example
4227
+ # require "google/cloud/security_center/v2"
4228
+ #
4229
+ # # Create a client object. The client can be reused for multiple calls.
4230
+ # client = Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new
4231
+ #
4232
+ # # Create a request. To set request fields, pass in keyword arguments.
4233
+ # request = Google::Cloud::SecurityCenter::V2::UpdateSourceRequest.new
4234
+ #
4235
+ # # Call the update_source method.
4236
+ # result = client.update_source request
4237
+ #
4238
+ # # The returned object is of type Google::Cloud::SecurityCenter::V2::Source.
4239
+ # p result
4240
+ #
4241
+ def update_source request, options = nil
4242
+ raise ::ArgumentError, "request must be provided" if request.nil?
4243
+
4244
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V2::UpdateSourceRequest
4245
+
4246
+ # Converts hash and nil to an options object
4247
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
4248
+
4249
+ # Customize the options with defaults
4250
+ metadata = @config.rpcs.update_source.metadata.to_h
4251
+
4252
+ # Set x-goog-api-client and x-goog-user-project headers
4253
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
4254
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
4255
+ gapic_version: ::Google::Cloud::SecurityCenter::V2::VERSION
4256
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
4257
+
4258
+ header_params = {}
4259
+ if request.source&.name
4260
+ header_params["source.name"] = request.source.name
4261
+ end
4262
+
4263
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
4264
+ metadata[:"x-goog-request-params"] ||= request_params_header
4265
+
4266
+ options.apply_defaults timeout: @config.rpcs.update_source.timeout,
4267
+ metadata: metadata,
4268
+ retry_policy: @config.rpcs.update_source.retry_policy
4269
+
4270
+ options.apply_defaults timeout: @config.timeout,
4271
+ metadata: @config.metadata,
4272
+ retry_policy: @config.retry_policy
4273
+
4274
+ @security_center_stub.call_rpc :update_source, request, options: options do |response, operation|
4275
+ yield response, operation if block_given?
4276
+ return response
4277
+ end
4278
+ rescue ::GRPC::BadStatus => e
4279
+ raise ::Google::Cloud::Error.from_error(e)
4280
+ end
4281
+
4282
+ ##
4283
+ # Configuration class for the SecurityCenter API.
4284
+ #
4285
+ # This class represents the configuration for SecurityCenter,
4286
+ # providing control over timeouts, retry behavior, logging, transport
4287
+ # parameters, and other low-level controls. Certain parameters can also be
4288
+ # applied individually to specific RPCs. See
4289
+ # {::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client::Configuration::Rpcs}
4290
+ # for a list of RPCs that can be configured independently.
4291
+ #
4292
+ # Configuration can be applied globally to all clients, or to a single client
4293
+ # on construction.
4294
+ #
4295
+ # @example
4296
+ #
4297
+ # # Modify the global config, setting the timeout for
4298
+ # # batch_create_resource_value_configs to 20 seconds,
4299
+ # # and all remaining timeouts to 10 seconds.
4300
+ # ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.configure do |config|
4301
+ # config.timeout = 10.0
4302
+ # config.rpcs.batch_create_resource_value_configs.timeout = 20.0
4303
+ # end
4304
+ #
4305
+ # # Apply the above configuration only to a new client.
4306
+ # client = ::Google::Cloud::SecurityCenter::V2::SecurityCenter::Client.new do |config|
4307
+ # config.timeout = 10.0
4308
+ # config.rpcs.batch_create_resource_value_configs.timeout = 20.0
4309
+ # end
4310
+ #
4311
+ # @!attribute [rw] endpoint
4312
+ # A custom service endpoint, as a hostname or hostname:port. The default is
4313
+ # nil, indicating to use the default endpoint in the current universe domain.
4314
+ # @return [::String,nil]
4315
+ # @!attribute [rw] credentials
4316
+ # Credentials to send with calls. You may provide any of the following types:
4317
+ # * (`String`) The path to a service account key file in JSON format
4318
+ # * (`Hash`) A service account key as a Hash
4319
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
4320
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
4321
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
4322
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
4323
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
4324
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
4325
+ # * (`nil`) indicating no credentials
4326
+ # @return [::Object]
4327
+ # @!attribute [rw] scope
4328
+ # The OAuth scopes
4329
+ # @return [::Array<::String>]
4330
+ # @!attribute [rw] lib_name
4331
+ # The library name as recorded in instrumentation and logging
4332
+ # @return [::String]
4333
+ # @!attribute [rw] lib_version
4334
+ # The library version as recorded in instrumentation and logging
4335
+ # @return [::String]
4336
+ # @!attribute [rw] channel_args
4337
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
4338
+ # `GRPC::Core::Channel` object is provided as the credential.
4339
+ # @return [::Hash]
4340
+ # @!attribute [rw] interceptors
4341
+ # An array of interceptors that are run before calls are executed.
4342
+ # @return [::Array<::GRPC::ClientInterceptor>]
4343
+ # @!attribute [rw] timeout
4344
+ # The call timeout in seconds.
4345
+ # @return [::Numeric]
4346
+ # @!attribute [rw] metadata
4347
+ # Additional gRPC headers to be sent with the call.
4348
+ # @return [::Hash{::Symbol=>::String}]
4349
+ # @!attribute [rw] retry_policy
4350
+ # The retry policy. The value is a hash with the following keys:
4351
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
4352
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
4353
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
4354
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
4355
+ # trigger a retry.
4356
+ # @return [::Hash]
4357
+ # @!attribute [rw] quota_project
4358
+ # A separate project against which to charge quota.
4359
+ # @return [::String]
4360
+ # @!attribute [rw] universe_domain
4361
+ # The universe domain within which to make requests. This determines the
4362
+ # default endpoint URL. The default value of nil uses the environment
4363
+ # universe (usually the default "googleapis.com" universe).
4364
+ # @return [::String,nil]
4365
+ #
4366
+ class Configuration
4367
+ extend ::Gapic::Config
4368
+
4369
+ # @private
4370
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
4371
+ DEFAULT_ENDPOINT = "securitycenter.googleapis.com"
4372
+
4373
+ config_attr :endpoint, nil, ::String, nil
4374
+ config_attr :credentials, nil do |value|
4375
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
4376
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
4377
+ allowed.any? { |klass| klass === value }
4378
+ end
4379
+ config_attr :scope, nil, ::String, ::Array, nil
4380
+ config_attr :lib_name, nil, ::String, nil
4381
+ config_attr :lib_version, nil, ::String, nil
4382
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
4383
+ config_attr :interceptors, nil, ::Array, nil
4384
+ config_attr :timeout, nil, ::Numeric, nil
4385
+ config_attr :metadata, nil, ::Hash, nil
4386
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
4387
+ config_attr :quota_project, nil, ::String, nil
4388
+ config_attr :universe_domain, nil, ::String, nil
4389
+
4390
+ # @private
4391
+ def initialize parent_config = nil
4392
+ @parent_config = parent_config unless parent_config.nil?
4393
+
4394
+ yield self if block_given?
4395
+ end
4396
+
4397
+ ##
4398
+ # Configurations for individual RPCs
4399
+ # @return [Rpcs]
4400
+ #
4401
+ def rpcs
4402
+ @rpcs ||= begin
4403
+ parent_rpcs = nil
4404
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
4405
+ Rpcs.new parent_rpcs
4406
+ end
4407
+ end
4408
+
4409
+ ##
4410
+ # Configuration for the channel pool
4411
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
4412
+ #
4413
+ def channel_pool
4414
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
4415
+ end
4416
+
4417
+ ##
4418
+ # Configuration RPC class for the SecurityCenter API.
4419
+ #
4420
+ # Includes fields providing the configuration for each RPC in this service.
4421
+ # Each configuration object is of type `Gapic::Config::Method` and includes
4422
+ # the following configuration fields:
4423
+ #
4424
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
4425
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
4426
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
4427
+ # include the following keys:
4428
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
4429
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
4430
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
4431
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
4432
+ # trigger a retry.
4433
+ #
4434
+ class Rpcs
4435
+ ##
4436
+ # RPC-specific configuration for `batch_create_resource_value_configs`
4437
+ # @return [::Gapic::Config::Method]
4438
+ #
4439
+ attr_reader :batch_create_resource_value_configs
4440
+ ##
4441
+ # RPC-specific configuration for `bulk_mute_findings`
4442
+ # @return [::Gapic::Config::Method]
4443
+ #
4444
+ attr_reader :bulk_mute_findings
4445
+ ##
4446
+ # RPC-specific configuration for `create_big_query_export`
4447
+ # @return [::Gapic::Config::Method]
4448
+ #
4449
+ attr_reader :create_big_query_export
4450
+ ##
4451
+ # RPC-specific configuration for `create_finding`
4452
+ # @return [::Gapic::Config::Method]
4453
+ #
4454
+ attr_reader :create_finding
4455
+ ##
4456
+ # RPC-specific configuration for `create_mute_config`
4457
+ # @return [::Gapic::Config::Method]
4458
+ #
4459
+ attr_reader :create_mute_config
4460
+ ##
4461
+ # RPC-specific configuration for `create_notification_config`
4462
+ # @return [::Gapic::Config::Method]
4463
+ #
4464
+ attr_reader :create_notification_config
4465
+ ##
4466
+ # RPC-specific configuration for `create_source`
4467
+ # @return [::Gapic::Config::Method]
4468
+ #
4469
+ attr_reader :create_source
4470
+ ##
4471
+ # RPC-specific configuration for `delete_big_query_export`
4472
+ # @return [::Gapic::Config::Method]
4473
+ #
4474
+ attr_reader :delete_big_query_export
4475
+ ##
4476
+ # RPC-specific configuration for `delete_mute_config`
4477
+ # @return [::Gapic::Config::Method]
4478
+ #
4479
+ attr_reader :delete_mute_config
4480
+ ##
4481
+ # RPC-specific configuration for `delete_notification_config`
4482
+ # @return [::Gapic::Config::Method]
4483
+ #
4484
+ attr_reader :delete_notification_config
4485
+ ##
4486
+ # RPC-specific configuration for `delete_resource_value_config`
4487
+ # @return [::Gapic::Config::Method]
4488
+ #
4489
+ attr_reader :delete_resource_value_config
4490
+ ##
4491
+ # RPC-specific configuration for `get_big_query_export`
4492
+ # @return [::Gapic::Config::Method]
4493
+ #
4494
+ attr_reader :get_big_query_export
4495
+ ##
4496
+ # RPC-specific configuration for `get_simulation`
4497
+ # @return [::Gapic::Config::Method]
4498
+ #
4499
+ attr_reader :get_simulation
4500
+ ##
4501
+ # RPC-specific configuration for `get_valued_resource`
4502
+ # @return [::Gapic::Config::Method]
4503
+ #
4504
+ attr_reader :get_valued_resource
4505
+ ##
4506
+ # RPC-specific configuration for `get_iam_policy`
4507
+ # @return [::Gapic::Config::Method]
4508
+ #
4509
+ attr_reader :get_iam_policy
4510
+ ##
4511
+ # RPC-specific configuration for `get_mute_config`
4512
+ # @return [::Gapic::Config::Method]
4513
+ #
4514
+ attr_reader :get_mute_config
4515
+ ##
4516
+ # RPC-specific configuration for `get_notification_config`
4517
+ # @return [::Gapic::Config::Method]
4518
+ #
4519
+ attr_reader :get_notification_config
4520
+ ##
4521
+ # RPC-specific configuration for `get_resource_value_config`
4522
+ # @return [::Gapic::Config::Method]
4523
+ #
4524
+ attr_reader :get_resource_value_config
4525
+ ##
4526
+ # RPC-specific configuration for `get_source`
4527
+ # @return [::Gapic::Config::Method]
4528
+ #
4529
+ attr_reader :get_source
4530
+ ##
4531
+ # RPC-specific configuration for `group_findings`
4532
+ # @return [::Gapic::Config::Method]
4533
+ #
4534
+ attr_reader :group_findings
4535
+ ##
4536
+ # RPC-specific configuration for `list_attack_paths`
4537
+ # @return [::Gapic::Config::Method]
4538
+ #
4539
+ attr_reader :list_attack_paths
4540
+ ##
4541
+ # RPC-specific configuration for `list_big_query_exports`
4542
+ # @return [::Gapic::Config::Method]
4543
+ #
4544
+ attr_reader :list_big_query_exports
4545
+ ##
4546
+ # RPC-specific configuration for `list_findings`
4547
+ # @return [::Gapic::Config::Method]
4548
+ #
4549
+ attr_reader :list_findings
4550
+ ##
4551
+ # RPC-specific configuration for `list_mute_configs`
4552
+ # @return [::Gapic::Config::Method]
4553
+ #
4554
+ attr_reader :list_mute_configs
4555
+ ##
4556
+ # RPC-specific configuration for `list_notification_configs`
4557
+ # @return [::Gapic::Config::Method]
4558
+ #
4559
+ attr_reader :list_notification_configs
4560
+ ##
4561
+ # RPC-specific configuration for `list_resource_value_configs`
4562
+ # @return [::Gapic::Config::Method]
4563
+ #
4564
+ attr_reader :list_resource_value_configs
4565
+ ##
4566
+ # RPC-specific configuration for `list_sources`
4567
+ # @return [::Gapic::Config::Method]
4568
+ #
4569
+ attr_reader :list_sources
4570
+ ##
4571
+ # RPC-specific configuration for `list_valued_resources`
4572
+ # @return [::Gapic::Config::Method]
4573
+ #
4574
+ attr_reader :list_valued_resources
4575
+ ##
4576
+ # RPC-specific configuration for `set_finding_state`
4577
+ # @return [::Gapic::Config::Method]
4578
+ #
4579
+ attr_reader :set_finding_state
4580
+ ##
4581
+ # RPC-specific configuration for `set_iam_policy`
4582
+ # @return [::Gapic::Config::Method]
4583
+ #
4584
+ attr_reader :set_iam_policy
4585
+ ##
4586
+ # RPC-specific configuration for `set_mute`
4587
+ # @return [::Gapic::Config::Method]
4588
+ #
4589
+ attr_reader :set_mute
4590
+ ##
4591
+ # RPC-specific configuration for `test_iam_permissions`
4592
+ # @return [::Gapic::Config::Method]
4593
+ #
4594
+ attr_reader :test_iam_permissions
4595
+ ##
4596
+ # RPC-specific configuration for `update_big_query_export`
4597
+ # @return [::Gapic::Config::Method]
4598
+ #
4599
+ attr_reader :update_big_query_export
4600
+ ##
4601
+ # RPC-specific configuration for `update_external_system`
4602
+ # @return [::Gapic::Config::Method]
4603
+ #
4604
+ attr_reader :update_external_system
4605
+ ##
4606
+ # RPC-specific configuration for `update_finding`
4607
+ # @return [::Gapic::Config::Method]
4608
+ #
4609
+ attr_reader :update_finding
4610
+ ##
4611
+ # RPC-specific configuration for `update_mute_config`
4612
+ # @return [::Gapic::Config::Method]
4613
+ #
4614
+ attr_reader :update_mute_config
4615
+ ##
4616
+ # RPC-specific configuration for `update_notification_config`
4617
+ # @return [::Gapic::Config::Method]
4618
+ #
4619
+ attr_reader :update_notification_config
4620
+ ##
4621
+ # RPC-specific configuration for `update_resource_value_config`
4622
+ # @return [::Gapic::Config::Method]
4623
+ #
4624
+ attr_reader :update_resource_value_config
4625
+ ##
4626
+ # RPC-specific configuration for `update_security_marks`
4627
+ # @return [::Gapic::Config::Method]
4628
+ #
4629
+ attr_reader :update_security_marks
4630
+ ##
4631
+ # RPC-specific configuration for `update_source`
4632
+ # @return [::Gapic::Config::Method]
4633
+ #
4634
+ attr_reader :update_source
4635
+
4636
+ # @private
4637
+ def initialize parent_rpcs = nil
4638
+ batch_create_resource_value_configs_config = parent_rpcs.batch_create_resource_value_configs if parent_rpcs.respond_to? :batch_create_resource_value_configs
4639
+ @batch_create_resource_value_configs = ::Gapic::Config::Method.new batch_create_resource_value_configs_config
4640
+ bulk_mute_findings_config = parent_rpcs.bulk_mute_findings if parent_rpcs.respond_to? :bulk_mute_findings
4641
+ @bulk_mute_findings = ::Gapic::Config::Method.new bulk_mute_findings_config
4642
+ create_big_query_export_config = parent_rpcs.create_big_query_export if parent_rpcs.respond_to? :create_big_query_export
4643
+ @create_big_query_export = ::Gapic::Config::Method.new create_big_query_export_config
4644
+ create_finding_config = parent_rpcs.create_finding if parent_rpcs.respond_to? :create_finding
4645
+ @create_finding = ::Gapic::Config::Method.new create_finding_config
4646
+ create_mute_config_config = parent_rpcs.create_mute_config if parent_rpcs.respond_to? :create_mute_config
4647
+ @create_mute_config = ::Gapic::Config::Method.new create_mute_config_config
4648
+ create_notification_config_config = parent_rpcs.create_notification_config if parent_rpcs.respond_to? :create_notification_config
4649
+ @create_notification_config = ::Gapic::Config::Method.new create_notification_config_config
4650
+ create_source_config = parent_rpcs.create_source if parent_rpcs.respond_to? :create_source
4651
+ @create_source = ::Gapic::Config::Method.new create_source_config
4652
+ delete_big_query_export_config = parent_rpcs.delete_big_query_export if parent_rpcs.respond_to? :delete_big_query_export
4653
+ @delete_big_query_export = ::Gapic::Config::Method.new delete_big_query_export_config
4654
+ delete_mute_config_config = parent_rpcs.delete_mute_config if parent_rpcs.respond_to? :delete_mute_config
4655
+ @delete_mute_config = ::Gapic::Config::Method.new delete_mute_config_config
4656
+ delete_notification_config_config = parent_rpcs.delete_notification_config if parent_rpcs.respond_to? :delete_notification_config
4657
+ @delete_notification_config = ::Gapic::Config::Method.new delete_notification_config_config
4658
+ delete_resource_value_config_config = parent_rpcs.delete_resource_value_config if parent_rpcs.respond_to? :delete_resource_value_config
4659
+ @delete_resource_value_config = ::Gapic::Config::Method.new delete_resource_value_config_config
4660
+ get_big_query_export_config = parent_rpcs.get_big_query_export if parent_rpcs.respond_to? :get_big_query_export
4661
+ @get_big_query_export = ::Gapic::Config::Method.new get_big_query_export_config
4662
+ get_simulation_config = parent_rpcs.get_simulation if parent_rpcs.respond_to? :get_simulation
4663
+ @get_simulation = ::Gapic::Config::Method.new get_simulation_config
4664
+ get_valued_resource_config = parent_rpcs.get_valued_resource if parent_rpcs.respond_to? :get_valued_resource
4665
+ @get_valued_resource = ::Gapic::Config::Method.new get_valued_resource_config
4666
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
4667
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
4668
+ get_mute_config_config = parent_rpcs.get_mute_config if parent_rpcs.respond_to? :get_mute_config
4669
+ @get_mute_config = ::Gapic::Config::Method.new get_mute_config_config
4670
+ get_notification_config_config = parent_rpcs.get_notification_config if parent_rpcs.respond_to? :get_notification_config
4671
+ @get_notification_config = ::Gapic::Config::Method.new get_notification_config_config
4672
+ get_resource_value_config_config = parent_rpcs.get_resource_value_config if parent_rpcs.respond_to? :get_resource_value_config
4673
+ @get_resource_value_config = ::Gapic::Config::Method.new get_resource_value_config_config
4674
+ get_source_config = parent_rpcs.get_source if parent_rpcs.respond_to? :get_source
4675
+ @get_source = ::Gapic::Config::Method.new get_source_config
4676
+ group_findings_config = parent_rpcs.group_findings if parent_rpcs.respond_to? :group_findings
4677
+ @group_findings = ::Gapic::Config::Method.new group_findings_config
4678
+ list_attack_paths_config = parent_rpcs.list_attack_paths if parent_rpcs.respond_to? :list_attack_paths
4679
+ @list_attack_paths = ::Gapic::Config::Method.new list_attack_paths_config
4680
+ list_big_query_exports_config = parent_rpcs.list_big_query_exports if parent_rpcs.respond_to? :list_big_query_exports
4681
+ @list_big_query_exports = ::Gapic::Config::Method.new list_big_query_exports_config
4682
+ list_findings_config = parent_rpcs.list_findings if parent_rpcs.respond_to? :list_findings
4683
+ @list_findings = ::Gapic::Config::Method.new list_findings_config
4684
+ list_mute_configs_config = parent_rpcs.list_mute_configs if parent_rpcs.respond_to? :list_mute_configs
4685
+ @list_mute_configs = ::Gapic::Config::Method.new list_mute_configs_config
4686
+ list_notification_configs_config = parent_rpcs.list_notification_configs if parent_rpcs.respond_to? :list_notification_configs
4687
+ @list_notification_configs = ::Gapic::Config::Method.new list_notification_configs_config
4688
+ list_resource_value_configs_config = parent_rpcs.list_resource_value_configs if parent_rpcs.respond_to? :list_resource_value_configs
4689
+ @list_resource_value_configs = ::Gapic::Config::Method.new list_resource_value_configs_config
4690
+ list_sources_config = parent_rpcs.list_sources if parent_rpcs.respond_to? :list_sources
4691
+ @list_sources = ::Gapic::Config::Method.new list_sources_config
4692
+ list_valued_resources_config = parent_rpcs.list_valued_resources if parent_rpcs.respond_to? :list_valued_resources
4693
+ @list_valued_resources = ::Gapic::Config::Method.new list_valued_resources_config
4694
+ set_finding_state_config = parent_rpcs.set_finding_state if parent_rpcs.respond_to? :set_finding_state
4695
+ @set_finding_state = ::Gapic::Config::Method.new set_finding_state_config
4696
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
4697
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
4698
+ set_mute_config = parent_rpcs.set_mute if parent_rpcs.respond_to? :set_mute
4699
+ @set_mute = ::Gapic::Config::Method.new set_mute_config
4700
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
4701
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
4702
+ update_big_query_export_config = parent_rpcs.update_big_query_export if parent_rpcs.respond_to? :update_big_query_export
4703
+ @update_big_query_export = ::Gapic::Config::Method.new update_big_query_export_config
4704
+ update_external_system_config = parent_rpcs.update_external_system if parent_rpcs.respond_to? :update_external_system
4705
+ @update_external_system = ::Gapic::Config::Method.new update_external_system_config
4706
+ update_finding_config = parent_rpcs.update_finding if parent_rpcs.respond_to? :update_finding
4707
+ @update_finding = ::Gapic::Config::Method.new update_finding_config
4708
+ update_mute_config_config = parent_rpcs.update_mute_config if parent_rpcs.respond_to? :update_mute_config
4709
+ @update_mute_config = ::Gapic::Config::Method.new update_mute_config_config
4710
+ update_notification_config_config = parent_rpcs.update_notification_config if parent_rpcs.respond_to? :update_notification_config
4711
+ @update_notification_config = ::Gapic::Config::Method.new update_notification_config_config
4712
+ update_resource_value_config_config = parent_rpcs.update_resource_value_config if parent_rpcs.respond_to? :update_resource_value_config
4713
+ @update_resource_value_config = ::Gapic::Config::Method.new update_resource_value_config_config
4714
+ update_security_marks_config = parent_rpcs.update_security_marks if parent_rpcs.respond_to? :update_security_marks
4715
+ @update_security_marks = ::Gapic::Config::Method.new update_security_marks_config
4716
+ update_source_config = parent_rpcs.update_source if parent_rpcs.respond_to? :update_source
4717
+ @update_source = ::Gapic::Config::Method.new update_source_config
4718
+
4719
+ yield self if block_given?
4720
+ end
4721
+ end
4722
+ end
4723
+ end
4724
+ end
4725
+ end
4726
+ end
4727
+ end
4728
+ end