google-cloud-security_center-v1 0.25.1 → 0.26.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3614 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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/v1/securitycenter_service_pb"
21
+ require "google/cloud/security_center/v1/security_center/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module SecurityCenter
26
+ module V1
27
+ module SecurityCenter
28
+ module Rest
29
+ ##
30
+ # REST client for the SecurityCenter service.
31
+ #
32
+ # V1 APIs for Security Center service.
33
+ #
34
+ class Client
35
+ include Paths
36
+
37
+ # @private
38
+ attr_reader :security_center_stub
39
+
40
+ ##
41
+ # Configure the SecurityCenter Client class.
42
+ #
43
+ # See {::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client::Configuration}
44
+ # for a description of the configuration fields.
45
+ #
46
+ # @example
47
+ #
48
+ # # Modify the configuration for all SecurityCenter clients
49
+ # ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.configure do |config|
50
+ # config.timeout = 10.0
51
+ # end
52
+ #
53
+ # @yield [config] Configure the Client client.
54
+ # @yieldparam config [Client::Configuration]
55
+ #
56
+ # @return [Client::Configuration]
57
+ #
58
+ def self.configure
59
+ @configure ||= begin
60
+ namespace = ["Google", "Cloud", "SecurityCenter", "V1"]
61
+ parent_config = while namespace.any?
62
+ parent_name = namespace.join "::"
63
+ parent_const = const_get parent_name
64
+ break parent_const.configure if parent_const.respond_to? :configure
65
+ namespace.pop
66
+ end
67
+ default_config = Client::Configuration.new parent_config
68
+
69
+ default_config.rpcs.create_source.timeout = 60.0
70
+
71
+ default_config.rpcs.create_finding.timeout = 60.0
72
+
73
+ default_config.rpcs.create_notification_config.timeout = 60.0
74
+
75
+ default_config.rpcs.delete_notification_config.timeout = 60.0
76
+
77
+ default_config.rpcs.get_iam_policy.timeout = 60.0
78
+ default_config.rpcs.get_iam_policy.retry_policy = {
79
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
80
+ }
81
+
82
+ default_config.rpcs.get_notification_config.timeout = 60.0
83
+ default_config.rpcs.get_notification_config.retry_policy = {
84
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
85
+ }
86
+
87
+ default_config.rpcs.get_organization_settings.timeout = 60.0
88
+ default_config.rpcs.get_organization_settings.retry_policy = {
89
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
90
+ }
91
+
92
+ default_config.rpcs.get_source.timeout = 60.0
93
+ default_config.rpcs.get_source.retry_policy = {
94
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
95
+ }
96
+
97
+ default_config.rpcs.group_assets.timeout = 480.0
98
+ default_config.rpcs.group_assets.retry_policy = {
99
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
100
+ }
101
+
102
+ default_config.rpcs.group_findings.timeout = 480.0
103
+ default_config.rpcs.group_findings.retry_policy = {
104
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
105
+ }
106
+
107
+ default_config.rpcs.list_assets.timeout = 480.0
108
+ default_config.rpcs.list_assets.retry_policy = {
109
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
110
+ }
111
+
112
+ default_config.rpcs.list_findings.timeout = 480.0
113
+ default_config.rpcs.list_findings.retry_policy = {
114
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
115
+ }
116
+
117
+ default_config.rpcs.list_notification_configs.timeout = 60.0
118
+ default_config.rpcs.list_notification_configs.retry_policy = {
119
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
120
+ }
121
+
122
+ default_config.rpcs.list_sources.timeout = 60.0
123
+ default_config.rpcs.list_sources.retry_policy = {
124
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
125
+ }
126
+
127
+ default_config.rpcs.run_asset_discovery.timeout = 60.0
128
+
129
+ default_config.rpcs.set_finding_state.timeout = 60.0
130
+
131
+ default_config.rpcs.set_iam_policy.timeout = 60.0
132
+
133
+ default_config.rpcs.test_iam_permissions.timeout = 60.0
134
+ default_config.rpcs.test_iam_permissions.retry_policy = {
135
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
136
+ }
137
+
138
+ default_config.rpcs.update_finding.timeout = 60.0
139
+
140
+ default_config.rpcs.update_notification_config.timeout = 60.0
141
+
142
+ default_config.rpcs.update_organization_settings.timeout = 60.0
143
+
144
+ default_config.rpcs.update_source.timeout = 60.0
145
+
146
+ default_config.rpcs.update_security_marks.timeout = 480.0
147
+
148
+ default_config
149
+ end
150
+ yield @configure if block_given?
151
+ @configure
152
+ end
153
+
154
+ ##
155
+ # Configure the SecurityCenter Client instance.
156
+ #
157
+ # The configuration is set to the derived mode, meaning that values can be changed,
158
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
159
+ # should be made on {Client.configure}.
160
+ #
161
+ # See {::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client::Configuration}
162
+ # for a description of the configuration fields.
163
+ #
164
+ # @yield [config] Configure the Client client.
165
+ # @yieldparam config [Client::Configuration]
166
+ #
167
+ # @return [Client::Configuration]
168
+ #
169
+ def configure
170
+ yield @config if block_given?
171
+ @config
172
+ end
173
+
174
+ ##
175
+ # Create a new SecurityCenter REST client object.
176
+ #
177
+ # @example
178
+ #
179
+ # # Create a client using the default configuration
180
+ # client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new
181
+ #
182
+ # # Create a client using a custom configuration
183
+ # client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config|
184
+ # config.timeout = 10.0
185
+ # end
186
+ #
187
+ # @yield [config] Configure the SecurityCenter client.
188
+ # @yieldparam config [Client::Configuration]
189
+ #
190
+ def initialize
191
+ # Create the configuration object
192
+ @config = Configuration.new Client.configure
193
+
194
+ # Yield the configuration if needed
195
+ yield @config if block_given?
196
+
197
+ # Create credentials
198
+ credentials = @config.credentials
199
+ # Use self-signed JWT if the endpoint is unchanged from default,
200
+ # but only if the default endpoint does not have a region prefix.
201
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
202
+ !@config.endpoint.split(".").first.include?("-")
203
+ credentials ||= Credentials.default scope: @config.scope,
204
+ enable_self_signed_jwt: enable_self_signed_jwt
205
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
206
+ credentials = Credentials.new credentials, scope: @config.scope
207
+ end
208
+
209
+ @quota_project_id = @config.quota_project
210
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
211
+
212
+ @operations_client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Operations.new do |config|
213
+ config.credentials = credentials
214
+ config.quota_project = @quota_project_id
215
+ config.endpoint = @config.endpoint
216
+ end
217
+
218
+ @security_center_stub = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
219
+ end
220
+
221
+ ##
222
+ # Get the associated client for long-running operations.
223
+ #
224
+ # @return [::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Operations]
225
+ #
226
+ attr_reader :operations_client
227
+
228
+ # Service calls
229
+
230
+ ##
231
+ # Kicks off an LRO to bulk mute findings for a parent based on a filter. The
232
+ # parent can be either an organization, folder or project. The findings
233
+ # matched by the filter will be muted after the LRO is done.
234
+ #
235
+ # @overload bulk_mute_findings(request, options = nil)
236
+ # Pass arguments to `bulk_mute_findings` via a request object, either of type
237
+ # {::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest} or an equivalent Hash.
238
+ #
239
+ # @param request [::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest, ::Hash]
240
+ # A request object representing the call parameters. Required. To specify no
241
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
242
+ # @param options [::Gapic::CallOptions, ::Hash]
243
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
244
+ #
245
+ # @overload bulk_mute_findings(parent: nil, filter: nil, mute_annotation: nil)
246
+ # Pass arguments to `bulk_mute_findings` via keyword arguments. Note that at
247
+ # least one keyword argument is required. To specify no parameters, or to keep all
248
+ # the default parameter values, pass an empty Hash as a request object (see above).
249
+ #
250
+ # @param parent [::String]
251
+ # Required. The parent, at which bulk action needs to be applied. Its format
252
+ # is "organizations/[organization_id]", "folders/[folder_id]",
253
+ # "projects/[project_id]".
254
+ # @param filter [::String]
255
+ # Expression that identifies findings that should be updated.
256
+ # The expression is a list of zero or more restrictions combined
257
+ # via logical operators `AND` and `OR`. Parentheses are supported, and `OR`
258
+ # has higher precedence than `AND`.
259
+ #
260
+ # Restrictions have the form `<field> <operator> <value>` and may have a
261
+ # `-` character in front of them to indicate negation. The fields map to
262
+ # those defined in the corresponding resource.
263
+ #
264
+ # The supported operators are:
265
+ #
266
+ # * `=` for all value types.
267
+ # * `>`, `<`, `>=`, `<=` for integer values.
268
+ # * `:`, meaning substring matching, for strings.
269
+ #
270
+ # The supported value types are:
271
+ #
272
+ # * string literals in quotes.
273
+ # * integer literals without quotes.
274
+ # * boolean literals `true` and `false` without quotes.
275
+ # @param mute_annotation [::String]
276
+ # This can be a mute configuration name or any identifier for mute/unmute
277
+ # of findings based on the filter.
278
+ # @yield [result, operation] Access the result along with the TransportOperation object
279
+ # @yieldparam result [::Gapic::Operation]
280
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
281
+ #
282
+ # @return [::Gapic::Operation]
283
+ #
284
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
285
+ def bulk_mute_findings request, options = nil
286
+ raise ::ArgumentError, "request must be provided" if request.nil?
287
+
288
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest
289
+
290
+ # Converts hash and nil to an options object
291
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
292
+
293
+ # Customize the options with defaults
294
+ call_metadata = @config.rpcs.bulk_mute_findings.metadata.to_h
295
+
296
+ # Set x-goog-api-client and x-goog-user-project headers
297
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
298
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
299
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
300
+ transports_version_send: [:rest]
301
+
302
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
303
+
304
+ options.apply_defaults timeout: @config.rpcs.bulk_mute_findings.timeout,
305
+ metadata: call_metadata,
306
+ retry_policy: @config.rpcs.bulk_mute_findings.retry_policy
307
+
308
+ options.apply_defaults timeout: @config.timeout,
309
+ metadata: @config.metadata,
310
+ retry_policy: @config.retry_policy
311
+
312
+ @security_center_stub.bulk_mute_findings request, options do |result, operation|
313
+ result = ::Gapic::Operation.new result, @operations_client, options: options
314
+ yield result, operation if block_given?
315
+ return result
316
+ end
317
+ rescue ::Gapic::Rest::Error => e
318
+ raise ::Google::Cloud::Error.from_error(e)
319
+ end
320
+
321
+ ##
322
+ # Creates a source.
323
+ #
324
+ # @overload create_source(request, options = nil)
325
+ # Pass arguments to `create_source` via a request object, either of type
326
+ # {::Google::Cloud::SecurityCenter::V1::CreateSourceRequest} or an equivalent Hash.
327
+ #
328
+ # @param request [::Google::Cloud::SecurityCenter::V1::CreateSourceRequest, ::Hash]
329
+ # A request object representing the call parameters. Required. To specify no
330
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
331
+ # @param options [::Gapic::CallOptions, ::Hash]
332
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
333
+ #
334
+ # @overload create_source(parent: nil, source: nil)
335
+ # Pass arguments to `create_source` via keyword arguments. Note that at
336
+ # least one keyword argument is required. To specify no parameters, or to keep all
337
+ # the default parameter values, pass an empty Hash as a request object (see above).
338
+ #
339
+ # @param parent [::String]
340
+ # Required. Resource name of the new source's parent. Its format should be
341
+ # "organizations/[organization_id]".
342
+ # @param source [::Google::Cloud::SecurityCenter::V1::Source, ::Hash]
343
+ # Required. The Source being created, only the display_name and description
344
+ # will be used. All other fields will be ignored.
345
+ # @yield [result, operation] Access the result along with the TransportOperation object
346
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Source]
347
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
348
+ #
349
+ # @return [::Google::Cloud::SecurityCenter::V1::Source]
350
+ #
351
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
352
+ def create_source request, options = nil
353
+ raise ::ArgumentError, "request must be provided" if request.nil?
354
+
355
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateSourceRequest
356
+
357
+ # Converts hash and nil to an options object
358
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
359
+
360
+ # Customize the options with defaults
361
+ call_metadata = @config.rpcs.create_source.metadata.to_h
362
+
363
+ # Set x-goog-api-client and x-goog-user-project headers
364
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
365
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
366
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
367
+ transports_version_send: [:rest]
368
+
369
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
370
+
371
+ options.apply_defaults timeout: @config.rpcs.create_source.timeout,
372
+ metadata: call_metadata,
373
+ retry_policy: @config.rpcs.create_source.retry_policy
374
+
375
+ options.apply_defaults timeout: @config.timeout,
376
+ metadata: @config.metadata,
377
+ retry_policy: @config.retry_policy
378
+
379
+ @security_center_stub.create_source request, options do |result, operation|
380
+ yield result, operation if block_given?
381
+ return result
382
+ end
383
+ rescue ::Gapic::Rest::Error => e
384
+ raise ::Google::Cloud::Error.from_error(e)
385
+ end
386
+
387
+ ##
388
+ # Creates a finding. The corresponding source must exist for finding creation
389
+ # to succeed.
390
+ #
391
+ # @overload create_finding(request, options = nil)
392
+ # Pass arguments to `create_finding` via a request object, either of type
393
+ # {::Google::Cloud::SecurityCenter::V1::CreateFindingRequest} or an equivalent Hash.
394
+ #
395
+ # @param request [::Google::Cloud::SecurityCenter::V1::CreateFindingRequest, ::Hash]
396
+ # A request object representing the call parameters. Required. To specify no
397
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
398
+ # @param options [::Gapic::CallOptions, ::Hash]
399
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
400
+ #
401
+ # @overload create_finding(parent: nil, finding_id: nil, finding: nil)
402
+ # Pass arguments to `create_finding` via keyword arguments. Note that at
403
+ # least one keyword argument is required. To specify no parameters, or to keep all
404
+ # the default parameter values, pass an empty Hash as a request object (see above).
405
+ #
406
+ # @param parent [::String]
407
+ # Required. Resource name of the new finding's parent. Its format should be
408
+ # "organizations/[organization_id]/sources/[source_id]".
409
+ # @param finding_id [::String]
410
+ # Required. Unique identifier provided by the client within the parent scope.
411
+ # It must be alphanumeric and less than or equal to 32 characters and
412
+ # greater than 0 characters in length.
413
+ # @param finding [::Google::Cloud::SecurityCenter::V1::Finding, ::Hash]
414
+ # Required. The Finding being created. The name and security_marks will be
415
+ # ignored as they are both output only fields on this resource.
416
+ # @yield [result, operation] Access the result along with the TransportOperation object
417
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Finding]
418
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
419
+ #
420
+ # @return [::Google::Cloud::SecurityCenter::V1::Finding]
421
+ #
422
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
423
+ def create_finding request, options = nil
424
+ raise ::ArgumentError, "request must be provided" if request.nil?
425
+
426
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateFindingRequest
427
+
428
+ # Converts hash and nil to an options object
429
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
430
+
431
+ # Customize the options with defaults
432
+ call_metadata = @config.rpcs.create_finding.metadata.to_h
433
+
434
+ # Set x-goog-api-client and x-goog-user-project headers
435
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
436
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
437
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
438
+ transports_version_send: [:rest]
439
+
440
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
441
+
442
+ options.apply_defaults timeout: @config.rpcs.create_finding.timeout,
443
+ metadata: call_metadata,
444
+ retry_policy: @config.rpcs.create_finding.retry_policy
445
+
446
+ options.apply_defaults timeout: @config.timeout,
447
+ metadata: @config.metadata,
448
+ retry_policy: @config.retry_policy
449
+
450
+ @security_center_stub.create_finding request, options do |result, operation|
451
+ yield result, operation if block_given?
452
+ return result
453
+ end
454
+ rescue ::Gapic::Rest::Error => e
455
+ raise ::Google::Cloud::Error.from_error(e)
456
+ end
457
+
458
+ ##
459
+ # Creates a mute config.
460
+ #
461
+ # @overload create_mute_config(request, options = nil)
462
+ # Pass arguments to `create_mute_config` via a request object, either of type
463
+ # {::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest} or an equivalent Hash.
464
+ #
465
+ # @param request [::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest, ::Hash]
466
+ # A request object representing the call parameters. Required. To specify no
467
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
468
+ # @param options [::Gapic::CallOptions, ::Hash]
469
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
470
+ #
471
+ # @overload create_mute_config(parent: nil, mute_config: nil, mute_config_id: nil)
472
+ # Pass arguments to `create_mute_config` via keyword arguments. Note that at
473
+ # least one keyword argument is required. To specify no parameters, or to keep all
474
+ # the default parameter values, pass an empty Hash as a request object (see above).
475
+ #
476
+ # @param parent [::String]
477
+ # Required. Resource name of the new mute configs's parent. Its format is
478
+ # "organizations/[organization_id]", "folders/[folder_id]", or
479
+ # "projects/[project_id]".
480
+ # @param mute_config [::Google::Cloud::SecurityCenter::V1::MuteConfig, ::Hash]
481
+ # Required. The mute config being created.
482
+ # @param mute_config_id [::String]
483
+ # Required. Unique identifier provided by the client within the parent scope.
484
+ # It must consist of lower case letters, numbers, and hyphen, with the first
485
+ # character a letter, the last a letter or a number, and a 63 character
486
+ # maximum.
487
+ # @yield [result, operation] Access the result along with the TransportOperation object
488
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V1::MuteConfig]
489
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
490
+ #
491
+ # @return [::Google::Cloud::SecurityCenter::V1::MuteConfig]
492
+ #
493
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
494
+ def create_mute_config request, options = nil
495
+ raise ::ArgumentError, "request must be provided" if request.nil?
496
+
497
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest
498
+
499
+ # Converts hash and nil to an options object
500
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
501
+
502
+ # Customize the options with defaults
503
+ call_metadata = @config.rpcs.create_mute_config.metadata.to_h
504
+
505
+ # Set x-goog-api-client and x-goog-user-project headers
506
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
507
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
508
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
509
+ transports_version_send: [:rest]
510
+
511
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
512
+
513
+ options.apply_defaults timeout: @config.rpcs.create_mute_config.timeout,
514
+ metadata: call_metadata,
515
+ retry_policy: @config.rpcs.create_mute_config.retry_policy
516
+
517
+ options.apply_defaults timeout: @config.timeout,
518
+ metadata: @config.metadata,
519
+ retry_policy: @config.retry_policy
520
+
521
+ @security_center_stub.create_mute_config request, options do |result, operation|
522
+ yield result, operation if block_given?
523
+ return result
524
+ end
525
+ rescue ::Gapic::Rest::Error => e
526
+ raise ::Google::Cloud::Error.from_error(e)
527
+ end
528
+
529
+ ##
530
+ # Creates a notification config.
531
+ #
532
+ # @overload create_notification_config(request, options = nil)
533
+ # Pass arguments to `create_notification_config` via a request object, either of type
534
+ # {::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest} or an equivalent Hash.
535
+ #
536
+ # @param request [::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest, ::Hash]
537
+ # A request object representing the call parameters. Required. To specify no
538
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
539
+ # @param options [::Gapic::CallOptions, ::Hash]
540
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
541
+ #
542
+ # @overload create_notification_config(parent: nil, config_id: nil, notification_config: nil)
543
+ # Pass arguments to `create_notification_config` via keyword arguments. Note that at
544
+ # least one keyword argument is required. To specify no parameters, or to keep all
545
+ # the default parameter values, pass an empty Hash as a request object (see above).
546
+ #
547
+ # @param parent [::String]
548
+ # Required. Resource name of the new notification config's parent. Its format
549
+ # is "organizations/[organization_id]", "folders/[folder_id]", or
550
+ # "projects/[project_id]".
551
+ # @param config_id [::String]
552
+ # Required.
553
+ # Unique identifier provided by the client within the parent scope.
554
+ # It must be between 1 and 128 characters and contain alphanumeric
555
+ # characters, underscores, or hyphens only.
556
+ # @param notification_config [::Google::Cloud::SecurityCenter::V1::NotificationConfig, ::Hash]
557
+ # Required. The notification config being created. The name and the service
558
+ # account will be ignored as they are both output only fields on this
559
+ # resource.
560
+ # @yield [result, operation] Access the result along with the TransportOperation object
561
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V1::NotificationConfig]
562
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
563
+ #
564
+ # @return [::Google::Cloud::SecurityCenter::V1::NotificationConfig]
565
+ #
566
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
567
+ def create_notification_config request, options = nil
568
+ raise ::ArgumentError, "request must be provided" if request.nil?
569
+
570
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest
571
+
572
+ # Converts hash and nil to an options object
573
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
574
+
575
+ # Customize the options with defaults
576
+ call_metadata = @config.rpcs.create_notification_config.metadata.to_h
577
+
578
+ # Set x-goog-api-client and x-goog-user-project headers
579
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
580
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
581
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
582
+ transports_version_send: [:rest]
583
+
584
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
585
+
586
+ options.apply_defaults timeout: @config.rpcs.create_notification_config.timeout,
587
+ metadata: call_metadata,
588
+ retry_policy: @config.rpcs.create_notification_config.retry_policy
589
+
590
+ options.apply_defaults timeout: @config.timeout,
591
+ metadata: @config.metadata,
592
+ retry_policy: @config.retry_policy
593
+
594
+ @security_center_stub.create_notification_config request, options do |result, operation|
595
+ yield result, operation if block_given?
596
+ return result
597
+ end
598
+ rescue ::Gapic::Rest::Error => e
599
+ raise ::Google::Cloud::Error.from_error(e)
600
+ end
601
+
602
+ ##
603
+ # Deletes an existing mute config.
604
+ #
605
+ # @overload delete_mute_config(request, options = nil)
606
+ # Pass arguments to `delete_mute_config` via a request object, either of type
607
+ # {::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest} or an equivalent Hash.
608
+ #
609
+ # @param request [::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest, ::Hash]
610
+ # A request object representing the call parameters. Required. To specify no
611
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
612
+ # @param options [::Gapic::CallOptions, ::Hash]
613
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
614
+ #
615
+ # @overload delete_mute_config(name: nil)
616
+ # Pass arguments to `delete_mute_config` via keyword arguments. Note that at
617
+ # least one keyword argument is required. To specify no parameters, or to keep all
618
+ # the default parameter values, pass an empty Hash as a request object (see above).
619
+ #
620
+ # @param name [::String]
621
+ # Required. Name of the mute config to delete. Its format is
622
+ # organizations/\\{organization}/muteConfigs/\\{config_id},
623
+ # folders/\\{folder}/muteConfigs/\\{config_id}, or
624
+ # projects/\\{project}/muteConfigs/\\{config_id}
625
+ # @yield [result, operation] Access the result along with the TransportOperation object
626
+ # @yieldparam result [::Google::Protobuf::Empty]
627
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
628
+ #
629
+ # @return [::Google::Protobuf::Empty]
630
+ #
631
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
632
+ def delete_mute_config request, options = nil
633
+ raise ::ArgumentError, "request must be provided" if request.nil?
634
+
635
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest
636
+
637
+ # Converts hash and nil to an options object
638
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
639
+
640
+ # Customize the options with defaults
641
+ call_metadata = @config.rpcs.delete_mute_config.metadata.to_h
642
+
643
+ # Set x-goog-api-client and x-goog-user-project headers
644
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
645
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
646
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
647
+ transports_version_send: [:rest]
648
+
649
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
650
+
651
+ options.apply_defaults timeout: @config.rpcs.delete_mute_config.timeout,
652
+ metadata: call_metadata,
653
+ retry_policy: @config.rpcs.delete_mute_config.retry_policy
654
+
655
+ options.apply_defaults timeout: @config.timeout,
656
+ metadata: @config.metadata,
657
+ retry_policy: @config.retry_policy
658
+
659
+ @security_center_stub.delete_mute_config request, options do |result, operation|
660
+ yield result, operation if block_given?
661
+ return result
662
+ end
663
+ rescue ::Gapic::Rest::Error => e
664
+ raise ::Google::Cloud::Error.from_error(e)
665
+ end
666
+
667
+ ##
668
+ # Deletes a notification config.
669
+ #
670
+ # @overload delete_notification_config(request, options = nil)
671
+ # Pass arguments to `delete_notification_config` via a request object, either of type
672
+ # {::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest} or an equivalent Hash.
673
+ #
674
+ # @param request [::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest, ::Hash]
675
+ # A request object representing the call parameters. Required. To specify no
676
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
677
+ # @param options [::Gapic::CallOptions, ::Hash]
678
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
679
+ #
680
+ # @overload delete_notification_config(name: nil)
681
+ # Pass arguments to `delete_notification_config` via keyword arguments. Note that at
682
+ # least one keyword argument is required. To specify no parameters, or to keep all
683
+ # the default parameter values, pass an empty Hash as a request object (see above).
684
+ #
685
+ # @param name [::String]
686
+ # Required. Name of the notification config to delete. Its format is
687
+ # "organizations/[organization_id]/notificationConfigs/[config_id]",
688
+ # "folders/[folder_id]/notificationConfigs/[config_id]",
689
+ # or "projects/[project_id]/notificationConfigs/[config_id]".
690
+ # @yield [result, operation] Access the result along with the TransportOperation object
691
+ # @yieldparam result [::Google::Protobuf::Empty]
692
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
693
+ #
694
+ # @return [::Google::Protobuf::Empty]
695
+ #
696
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
697
+ def delete_notification_config request, options = nil
698
+ raise ::ArgumentError, "request must be provided" if request.nil?
699
+
700
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest
701
+
702
+ # Converts hash and nil to an options object
703
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
704
+
705
+ # Customize the options with defaults
706
+ call_metadata = @config.rpcs.delete_notification_config.metadata.to_h
707
+
708
+ # Set x-goog-api-client and x-goog-user-project headers
709
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
710
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
711
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
712
+ transports_version_send: [:rest]
713
+
714
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
715
+
716
+ options.apply_defaults timeout: @config.rpcs.delete_notification_config.timeout,
717
+ metadata: call_metadata,
718
+ retry_policy: @config.rpcs.delete_notification_config.retry_policy
719
+
720
+ options.apply_defaults timeout: @config.timeout,
721
+ metadata: @config.metadata,
722
+ retry_policy: @config.retry_policy
723
+
724
+ @security_center_stub.delete_notification_config request, options do |result, operation|
725
+ yield result, operation if block_given?
726
+ return result
727
+ end
728
+ rescue ::Gapic::Rest::Error => e
729
+ raise ::Google::Cloud::Error.from_error(e)
730
+ end
731
+
732
+ ##
733
+ # Gets a BigQuery export.
734
+ #
735
+ # @overload get_big_query_export(request, options = nil)
736
+ # Pass arguments to `get_big_query_export` via a request object, either of type
737
+ # {::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest} or an equivalent Hash.
738
+ #
739
+ # @param request [::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest, ::Hash]
740
+ # A request object representing the call parameters. Required. To specify no
741
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
742
+ # @param options [::Gapic::CallOptions, ::Hash]
743
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
744
+ #
745
+ # @overload get_big_query_export(name: nil)
746
+ # Pass arguments to `get_big_query_export` via keyword arguments. Note that at
747
+ # least one keyword argument is required. To specify no parameters, or to keep all
748
+ # the default parameter values, pass an empty Hash as a request object (see above).
749
+ #
750
+ # @param name [::String]
751
+ # Required. Name of the BigQuery export to retrieve. Its format is
752
+ # organizations/\\{organization}/bigQueryExports/\\{export_id},
753
+ # folders/\\{folder}/bigQueryExports/\\{export_id}, or
754
+ # projects/\\{project}/bigQueryExports/\\{export_id}
755
+ # @yield [result, operation] Access the result along with the TransportOperation object
756
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V1::BigQueryExport]
757
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
758
+ #
759
+ # @return [::Google::Cloud::SecurityCenter::V1::BigQueryExport]
760
+ #
761
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
762
+ def get_big_query_export request, options = nil
763
+ raise ::ArgumentError, "request must be provided" if request.nil?
764
+
765
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest
766
+
767
+ # Converts hash and nil to an options object
768
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
769
+
770
+ # Customize the options with defaults
771
+ call_metadata = @config.rpcs.get_big_query_export.metadata.to_h
772
+
773
+ # Set x-goog-api-client and x-goog-user-project headers
774
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
775
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
776
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
777
+ transports_version_send: [:rest]
778
+
779
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
780
+
781
+ options.apply_defaults timeout: @config.rpcs.get_big_query_export.timeout,
782
+ metadata: call_metadata,
783
+ retry_policy: @config.rpcs.get_big_query_export.retry_policy
784
+
785
+ options.apply_defaults timeout: @config.timeout,
786
+ metadata: @config.metadata,
787
+ retry_policy: @config.retry_policy
788
+
789
+ @security_center_stub.get_big_query_export request, options do |result, operation|
790
+ yield result, operation if block_given?
791
+ return result
792
+ end
793
+ rescue ::Gapic::Rest::Error => e
794
+ raise ::Google::Cloud::Error.from_error(e)
795
+ end
796
+
797
+ ##
798
+ # Gets the access control policy on the specified Source.
799
+ #
800
+ # @overload get_iam_policy(request, options = nil)
801
+ # Pass arguments to `get_iam_policy` via a request object, either of type
802
+ # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
803
+ #
804
+ # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash]
805
+ # A request object representing the call parameters. Required. To specify no
806
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
807
+ # @param options [::Gapic::CallOptions, ::Hash]
808
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
809
+ #
810
+ # @overload get_iam_policy(resource: nil, options: nil)
811
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
812
+ # least one keyword argument is required. To specify no parameters, or to keep all
813
+ # the default parameter values, pass an empty Hash as a request object (see above).
814
+ #
815
+ # @param resource [::String]
816
+ # REQUIRED: The resource for which the policy is being requested.
817
+ # See the operation documentation for the appropriate value for this field.
818
+ # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
819
+ # OPTIONAL: A `GetPolicyOptions` object for specifying options to
820
+ # `GetIamPolicy`.
821
+ # @yield [result, operation] Access the result along with the TransportOperation object
822
+ # @yieldparam result [::Google::Iam::V1::Policy]
823
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
824
+ #
825
+ # @return [::Google::Iam::V1::Policy]
826
+ #
827
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
828
+ def get_iam_policy request, options = nil
829
+ raise ::ArgumentError, "request must be provided" if request.nil?
830
+
831
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest
832
+
833
+ # Converts hash and nil to an options object
834
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
835
+
836
+ # Customize the options with defaults
837
+ call_metadata = @config.rpcs.get_iam_policy.metadata.to_h
838
+
839
+ # Set x-goog-api-client and x-goog-user-project headers
840
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
841
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
842
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
843
+ transports_version_send: [:rest]
844
+
845
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
846
+
847
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
848
+ metadata: call_metadata,
849
+ retry_policy: @config.rpcs.get_iam_policy.retry_policy
850
+
851
+ options.apply_defaults timeout: @config.timeout,
852
+ metadata: @config.metadata,
853
+ retry_policy: @config.retry_policy
854
+
855
+ @security_center_stub.get_iam_policy request, options do |result, operation|
856
+ yield result, operation if block_given?
857
+ return result
858
+ end
859
+ rescue ::Gapic::Rest::Error => e
860
+ raise ::Google::Cloud::Error.from_error(e)
861
+ end
862
+
863
+ ##
864
+ # Gets a mute config.
865
+ #
866
+ # @overload get_mute_config(request, options = nil)
867
+ # Pass arguments to `get_mute_config` via a request object, either of type
868
+ # {::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest} or an equivalent Hash.
869
+ #
870
+ # @param request [::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest, ::Hash]
871
+ # A request object representing the call parameters. Required. To specify no
872
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
873
+ # @param options [::Gapic::CallOptions, ::Hash]
874
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
875
+ #
876
+ # @overload get_mute_config(name: nil)
877
+ # Pass arguments to `get_mute_config` via keyword arguments. Note that at
878
+ # least one keyword argument is required. To specify no parameters, or to keep all
879
+ # the default parameter values, pass an empty Hash as a request object (see above).
880
+ #
881
+ # @param name [::String]
882
+ # Required. Name of the mute config to retrieve. Its format is
883
+ # organizations/\\{organization}/muteConfigs/\\{config_id},
884
+ # folders/\\{folder}/muteConfigs/\\{config_id}, or
885
+ # projects/\\{project}/muteConfigs/\\{config_id}
886
+ # @yield [result, operation] Access the result along with the TransportOperation object
887
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V1::MuteConfig]
888
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
889
+ #
890
+ # @return [::Google::Cloud::SecurityCenter::V1::MuteConfig]
891
+ #
892
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
893
+ def get_mute_config request, options = nil
894
+ raise ::ArgumentError, "request must be provided" if request.nil?
895
+
896
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest
897
+
898
+ # Converts hash and nil to an options object
899
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
900
+
901
+ # Customize the options with defaults
902
+ call_metadata = @config.rpcs.get_mute_config.metadata.to_h
903
+
904
+ # Set x-goog-api-client and x-goog-user-project headers
905
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
906
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
907
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
908
+ transports_version_send: [:rest]
909
+
910
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
911
+
912
+ options.apply_defaults timeout: @config.rpcs.get_mute_config.timeout,
913
+ metadata: call_metadata,
914
+ retry_policy: @config.rpcs.get_mute_config.retry_policy
915
+
916
+ options.apply_defaults timeout: @config.timeout,
917
+ metadata: @config.metadata,
918
+ retry_policy: @config.retry_policy
919
+
920
+ @security_center_stub.get_mute_config request, options do |result, operation|
921
+ yield result, operation if block_given?
922
+ return result
923
+ end
924
+ rescue ::Gapic::Rest::Error => e
925
+ raise ::Google::Cloud::Error.from_error(e)
926
+ end
927
+
928
+ ##
929
+ # Gets a notification config.
930
+ #
931
+ # @overload get_notification_config(request, options = nil)
932
+ # Pass arguments to `get_notification_config` via a request object, either of type
933
+ # {::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest} or an equivalent Hash.
934
+ #
935
+ # @param request [::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest, ::Hash]
936
+ # A request object representing the call parameters. Required. To specify no
937
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
938
+ # @param options [::Gapic::CallOptions, ::Hash]
939
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
940
+ #
941
+ # @overload get_notification_config(name: nil)
942
+ # Pass arguments to `get_notification_config` via keyword arguments. Note that at
943
+ # least one keyword argument is required. To specify no parameters, or to keep all
944
+ # the default parameter values, pass an empty Hash as a request object (see above).
945
+ #
946
+ # @param name [::String]
947
+ # Required. Name of the notification config to get. Its format is
948
+ # "organizations/[organization_id]/notificationConfigs/[config_id]",
949
+ # "folders/[folder_id]/notificationConfigs/[config_id]",
950
+ # or "projects/[project_id]/notificationConfigs/[config_id]".
951
+ # @yield [result, operation] Access the result along with the TransportOperation object
952
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V1::NotificationConfig]
953
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
954
+ #
955
+ # @return [::Google::Cloud::SecurityCenter::V1::NotificationConfig]
956
+ #
957
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
958
+ def get_notification_config request, options = nil
959
+ raise ::ArgumentError, "request must be provided" if request.nil?
960
+
961
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest
962
+
963
+ # Converts hash and nil to an options object
964
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
965
+
966
+ # Customize the options with defaults
967
+ call_metadata = @config.rpcs.get_notification_config.metadata.to_h
968
+
969
+ # Set x-goog-api-client and x-goog-user-project headers
970
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
971
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
972
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
973
+ transports_version_send: [:rest]
974
+
975
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
976
+
977
+ options.apply_defaults timeout: @config.rpcs.get_notification_config.timeout,
978
+ metadata: call_metadata,
979
+ retry_policy: @config.rpcs.get_notification_config.retry_policy
980
+
981
+ options.apply_defaults timeout: @config.timeout,
982
+ metadata: @config.metadata,
983
+ retry_policy: @config.retry_policy
984
+
985
+ @security_center_stub.get_notification_config request, options do |result, operation|
986
+ yield result, operation if block_given?
987
+ return result
988
+ end
989
+ rescue ::Gapic::Rest::Error => e
990
+ raise ::Google::Cloud::Error.from_error(e)
991
+ end
992
+
993
+ ##
994
+ # Gets the settings for an organization.
995
+ #
996
+ # @overload get_organization_settings(request, options = nil)
997
+ # Pass arguments to `get_organization_settings` via a request object, either of type
998
+ # {::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest} or an equivalent Hash.
999
+ #
1000
+ # @param request [::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest, ::Hash]
1001
+ # A request object representing the call parameters. Required. To specify no
1002
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1003
+ # @param options [::Gapic::CallOptions, ::Hash]
1004
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1005
+ #
1006
+ # @overload get_organization_settings(name: nil)
1007
+ # Pass arguments to `get_organization_settings` via keyword arguments. Note that at
1008
+ # least one keyword argument is required. To specify no parameters, or to keep all
1009
+ # the default parameter values, pass an empty Hash as a request object (see above).
1010
+ #
1011
+ # @param name [::String]
1012
+ # Required. Name of the organization to get organization settings for. Its
1013
+ # format is "organizations/[organization_id]/organizationSettings".
1014
+ # @yield [result, operation] Access the result along with the TransportOperation object
1015
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V1::OrganizationSettings]
1016
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1017
+ #
1018
+ # @return [::Google::Cloud::SecurityCenter::V1::OrganizationSettings]
1019
+ #
1020
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1021
+ def get_organization_settings request, options = nil
1022
+ raise ::ArgumentError, "request must be provided" if request.nil?
1023
+
1024
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest
1025
+
1026
+ # Converts hash and nil to an options object
1027
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1028
+
1029
+ # Customize the options with defaults
1030
+ call_metadata = @config.rpcs.get_organization_settings.metadata.to_h
1031
+
1032
+ # Set x-goog-api-client and x-goog-user-project headers
1033
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1034
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1035
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
1036
+ transports_version_send: [:rest]
1037
+
1038
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1039
+
1040
+ options.apply_defaults timeout: @config.rpcs.get_organization_settings.timeout,
1041
+ metadata: call_metadata,
1042
+ retry_policy: @config.rpcs.get_organization_settings.retry_policy
1043
+
1044
+ options.apply_defaults timeout: @config.timeout,
1045
+ metadata: @config.metadata,
1046
+ retry_policy: @config.retry_policy
1047
+
1048
+ @security_center_stub.get_organization_settings request, options do |result, operation|
1049
+ yield result, operation if block_given?
1050
+ return result
1051
+ end
1052
+ rescue ::Gapic::Rest::Error => e
1053
+ raise ::Google::Cloud::Error.from_error(e)
1054
+ end
1055
+
1056
+ ##
1057
+ # Gets a source.
1058
+ #
1059
+ # @overload get_source(request, options = nil)
1060
+ # Pass arguments to `get_source` via a request object, either of type
1061
+ # {::Google::Cloud::SecurityCenter::V1::GetSourceRequest} or an equivalent Hash.
1062
+ #
1063
+ # @param request [::Google::Cloud::SecurityCenter::V1::GetSourceRequest, ::Hash]
1064
+ # A request object representing the call parameters. Required. To specify no
1065
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1066
+ # @param options [::Gapic::CallOptions, ::Hash]
1067
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1068
+ #
1069
+ # @overload get_source(name: nil)
1070
+ # Pass arguments to `get_source` via keyword arguments. Note that at
1071
+ # least one keyword argument is required. To specify no parameters, or to keep all
1072
+ # the default parameter values, pass an empty Hash as a request object (see above).
1073
+ #
1074
+ # @param name [::String]
1075
+ # Required. Relative resource name of the source. Its format is
1076
+ # "organizations/[organization_id]/source/[source_id]".
1077
+ # @yield [result, operation] Access the result along with the TransportOperation object
1078
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Source]
1079
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1080
+ #
1081
+ # @return [::Google::Cloud::SecurityCenter::V1::Source]
1082
+ #
1083
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1084
+ def get_source request, options = nil
1085
+ raise ::ArgumentError, "request must be provided" if request.nil?
1086
+
1087
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GetSourceRequest
1088
+
1089
+ # Converts hash and nil to an options object
1090
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1091
+
1092
+ # Customize the options with defaults
1093
+ call_metadata = @config.rpcs.get_source.metadata.to_h
1094
+
1095
+ # Set x-goog-api-client and x-goog-user-project headers
1096
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1097
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1098
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
1099
+ transports_version_send: [:rest]
1100
+
1101
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1102
+
1103
+ options.apply_defaults timeout: @config.rpcs.get_source.timeout,
1104
+ metadata: call_metadata,
1105
+ retry_policy: @config.rpcs.get_source.retry_policy
1106
+
1107
+ options.apply_defaults timeout: @config.timeout,
1108
+ metadata: @config.metadata,
1109
+ retry_policy: @config.retry_policy
1110
+
1111
+ @security_center_stub.get_source request, options do |result, operation|
1112
+ yield result, operation if block_given?
1113
+ return result
1114
+ end
1115
+ rescue ::Gapic::Rest::Error => e
1116
+ raise ::Google::Cloud::Error.from_error(e)
1117
+ end
1118
+
1119
+ ##
1120
+ # Filters an organization's assets and groups them by their specified
1121
+ # properties.
1122
+ #
1123
+ # @overload group_assets(request, options = nil)
1124
+ # Pass arguments to `group_assets` via a request object, either of type
1125
+ # {::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest} or an equivalent Hash.
1126
+ #
1127
+ # @param request [::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest, ::Hash]
1128
+ # A request object representing the call parameters. Required. To specify no
1129
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1130
+ # @param options [::Gapic::CallOptions, ::Hash]
1131
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1132
+ #
1133
+ # @overload group_assets(parent: nil, filter: nil, group_by: nil, compare_duration: nil, read_time: nil, page_token: nil, page_size: nil)
1134
+ # Pass arguments to `group_assets` via keyword arguments. Note that at
1135
+ # least one keyword argument is required. To specify no parameters, or to keep all
1136
+ # the default parameter values, pass an empty Hash as a request object (see above).
1137
+ #
1138
+ # @param parent [::String]
1139
+ # Required. The name of the parent to group the assets by. Its format is
1140
+ # "organizations/[organization_id]", "folders/[folder_id]", or
1141
+ # "projects/[project_id]".
1142
+ # @param filter [::String]
1143
+ # Expression that defines the filter to apply across assets.
1144
+ # The expression is a list of zero or more restrictions combined via logical
1145
+ # operators `AND` and `OR`.
1146
+ # Parentheses are supported, and `OR` has higher precedence than `AND`.
1147
+ #
1148
+ # Restrictions have the form `<field> <operator> <value>` and may have a `-`
1149
+ # character in front of them to indicate negation. The fields map to those
1150
+ # defined in the Asset resource. Examples include:
1151
+ #
1152
+ # * name
1153
+ # * security_center_properties.resource_name
1154
+ # * resource_properties.a_property
1155
+ # * security_marks.marks.marka
1156
+ #
1157
+ # The supported operators are:
1158
+ #
1159
+ # * `=` for all value types.
1160
+ # * `>`, `<`, `>=`, `<=` for integer values.
1161
+ # * `:`, meaning substring matching, for strings.
1162
+ #
1163
+ # The supported value types are:
1164
+ #
1165
+ # * string literals in quotes.
1166
+ # * integer literals without quotes.
1167
+ # * boolean literals `true` and `false` without quotes.
1168
+ #
1169
+ # The following field and operator combinations are supported:
1170
+ #
1171
+ # * name: `=`
1172
+ # * update_time: `=`, `>`, `<`, `>=`, `<=`
1173
+ #
1174
+ # Usage: This should be milliseconds since epoch or an RFC3339 string.
1175
+ # Examples:
1176
+ # `update_time = "2019-06-10T16:07:18-07:00"`
1177
+ # `update_time = 1560208038000`
1178
+ #
1179
+ # * create_time: `=`, `>`, `<`, `>=`, `<=`
1180
+ #
1181
+ # Usage: This should be milliseconds since epoch or an RFC3339 string.
1182
+ # Examples:
1183
+ # `create_time = "2019-06-10T16:07:18-07:00"`
1184
+ # `create_time = 1560208038000`
1185
+ #
1186
+ # * iam_policy.policy_blob: `=`, `:`
1187
+ # * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
1188
+ # * security_marks.marks: `=`, `:`
1189
+ # * security_center_properties.resource_name: `=`, `:`
1190
+ # * security_center_properties.resource_display_name: `=`, `:`
1191
+ # * security_center_properties.resource_type: `=`, `:`
1192
+ # * security_center_properties.resource_parent: `=`, `:`
1193
+ # * security_center_properties.resource_parent_display_name: `=`, `:`
1194
+ # * security_center_properties.resource_project: `=`, `:`
1195
+ # * security_center_properties.resource_project_display_name: `=`, `:`
1196
+ # * security_center_properties.resource_owners: `=`, `:`
1197
+ #
1198
+ # For example, `resource_properties.size = 100` is a valid filter string.
1199
+ #
1200
+ # Use a partial match on the empty string to filter based on a property
1201
+ # existing: `resource_properties.my_property : ""`
1202
+ #
1203
+ # Use a negated partial match on the empty string to filter based on a
1204
+ # property not existing: `-resource_properties.my_property : ""`
1205
+ # @param group_by [::String]
1206
+ # Required. Expression that defines what assets fields to use for grouping.
1207
+ # The string value should follow SQL syntax: comma separated list of fields.
1208
+ # For example:
1209
+ # "security_center_properties.resource_project,security_center_properties.project".
1210
+ #
1211
+ # The following fields are supported when compare_duration is not set:
1212
+ #
1213
+ # * security_center_properties.resource_project
1214
+ # * security_center_properties.resource_project_display_name
1215
+ # * security_center_properties.resource_type
1216
+ # * security_center_properties.resource_parent
1217
+ # * security_center_properties.resource_parent_display_name
1218
+ #
1219
+ # The following fields are supported when compare_duration is set:
1220
+ #
1221
+ # * security_center_properties.resource_type
1222
+ # * security_center_properties.resource_project_display_name
1223
+ # * security_center_properties.resource_parent_display_name
1224
+ # @param compare_duration [::Google::Protobuf::Duration, ::Hash]
1225
+ # When compare_duration is set, the GroupResult's "state_change" property is
1226
+ # updated to indicate whether the asset was added, removed, or remained
1227
+ # present during the compare_duration period of time that precedes the
1228
+ # read_time. This is the time between (read_time - compare_duration) and
1229
+ # read_time.
1230
+ #
1231
+ # The state change value is derived based on the presence of the asset at the
1232
+ # two points in time. Intermediate state changes between the two times don't
1233
+ # affect the result. For example, the results aren't affected if the asset is
1234
+ # removed and re-created again.
1235
+ #
1236
+ # Possible "state_change" values when compare_duration is specified:
1237
+ #
1238
+ # * "ADDED": indicates that the asset was not present at the start of
1239
+ # compare_duration, but present at reference_time.
1240
+ # * "REMOVED": indicates that the asset was present at the start of
1241
+ # compare_duration, but not present at reference_time.
1242
+ # * "ACTIVE": indicates that the asset was present at both the
1243
+ # start and the end of the time period defined by
1244
+ # compare_duration and reference_time.
1245
+ #
1246
+ # If compare_duration is not specified, then the only possible state_change
1247
+ # is "UNUSED", which will be the state_change set for all assets present at
1248
+ # read_time.
1249
+ #
1250
+ # If this field is set then `state_change` must be a specified field in
1251
+ # `group_by`.
1252
+ # @param read_time [::Google::Protobuf::Timestamp, ::Hash]
1253
+ # Time used as a reference point when filtering assets. The filter is limited
1254
+ # to assets existing at the supplied time and their values are those at that
1255
+ # specific time. Absence of this field will default to the API's version of
1256
+ # NOW.
1257
+ # @param page_token [::String]
1258
+ # The value returned by the last `GroupAssetsResponse`; indicates
1259
+ # that this is a continuation of a prior `GroupAssets` call, and that the
1260
+ # system should return the next page of data.
1261
+ # @param page_size [::Integer]
1262
+ # The maximum number of results to return in a single response. Default is
1263
+ # 10, minimum is 1, maximum is 1000.
1264
+ # @yield [result, operation] Access the result along with the TransportOperation object
1265
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::GroupResult>]
1266
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1267
+ #
1268
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::GroupResult>]
1269
+ #
1270
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1271
+ def group_assets request, options = nil
1272
+ raise ::ArgumentError, "request must be provided" if request.nil?
1273
+
1274
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GroupAssetsRequest
1275
+
1276
+ # Converts hash and nil to an options object
1277
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1278
+
1279
+ # Customize the options with defaults
1280
+ call_metadata = @config.rpcs.group_assets.metadata.to_h
1281
+
1282
+ # Set x-goog-api-client and x-goog-user-project headers
1283
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1284
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1285
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
1286
+ transports_version_send: [:rest]
1287
+
1288
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1289
+
1290
+ options.apply_defaults timeout: @config.rpcs.group_assets.timeout,
1291
+ metadata: call_metadata,
1292
+ retry_policy: @config.rpcs.group_assets.retry_policy
1293
+
1294
+ options.apply_defaults timeout: @config.timeout,
1295
+ metadata: @config.metadata,
1296
+ retry_policy: @config.retry_policy
1297
+
1298
+ @security_center_stub.group_assets request, options do |result, operation|
1299
+ result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :group_assets, "group_by_results", request, result, options
1300
+ yield result, operation if block_given?
1301
+ return result
1302
+ end
1303
+ rescue ::Gapic::Rest::Error => e
1304
+ raise ::Google::Cloud::Error.from_error(e)
1305
+ end
1306
+
1307
+ ##
1308
+ # Filters an organization or source's findings and groups them by their
1309
+ # specified properties.
1310
+ #
1311
+ # To group across all sources provide a `-` as the source id.
1312
+ # Example: /v1/organizations/\\{organization_id}/sources/-/findings,
1313
+ # /v1/folders/\\{folder_id}/sources/-/findings,
1314
+ # /v1/projects/\\{project_id}/sources/-/findings
1315
+ #
1316
+ # @overload group_findings(request, options = nil)
1317
+ # Pass arguments to `group_findings` via a request object, either of type
1318
+ # {::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest} or an equivalent Hash.
1319
+ #
1320
+ # @param request [::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest, ::Hash]
1321
+ # A request object representing the call parameters. Required. To specify no
1322
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1323
+ # @param options [::Gapic::CallOptions, ::Hash]
1324
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1325
+ #
1326
+ # @overload group_findings(parent: nil, filter: nil, group_by: nil, read_time: nil, compare_duration: nil, page_token: nil, page_size: nil)
1327
+ # Pass arguments to `group_findings` via keyword arguments. Note that at
1328
+ # least one keyword argument is required. To specify no parameters, or to keep all
1329
+ # the default parameter values, pass an empty Hash as a request object (see above).
1330
+ #
1331
+ # @param parent [::String]
1332
+ # Required. Name of the source to groupBy. Its format is
1333
+ # "organizations/[organization_id]/sources/[source_id]",
1334
+ # folders/[folder_id]/sources/[source_id], or
1335
+ # projects/[project_id]/sources/[source_id]. To groupBy across all sources
1336
+ # provide a source_id of `-`. For example:
1337
+ # organizations/\\{organization_id}/sources/-, folders/\\{folder_id}/sources/-,
1338
+ # or projects/\\{project_id}/sources/-
1339
+ # @param filter [::String]
1340
+ # Expression that defines the filter to apply across findings.
1341
+ # The expression is a list of one or more restrictions combined via logical
1342
+ # operators `AND` and `OR`.
1343
+ # Parentheses are supported, and `OR` has higher precedence than `AND`.
1344
+ #
1345
+ # Restrictions have the form `<field> <operator> <value>` and may have a `-`
1346
+ # character in front of them to indicate negation. Examples include:
1347
+ #
1348
+ # * name
1349
+ # * source_properties.a_property
1350
+ # * security_marks.marks.marka
1351
+ #
1352
+ # The supported operators are:
1353
+ #
1354
+ # * `=` for all value types.
1355
+ # * `>`, `<`, `>=`, `<=` for integer values.
1356
+ # * `:`, meaning substring matching, for strings.
1357
+ #
1358
+ # The supported value types are:
1359
+ #
1360
+ # * string literals in quotes.
1361
+ # * integer literals without quotes.
1362
+ # * boolean literals `true` and `false` without quotes.
1363
+ #
1364
+ # The following field and operator combinations are supported:
1365
+ #
1366
+ # * name: `=`
1367
+ # * parent: `=`, `:`
1368
+ # * resource_name: `=`, `:`
1369
+ # * state: `=`, `:`
1370
+ # * category: `=`, `:`
1371
+ # * external_uri: `=`, `:`
1372
+ # * event_time: `=`, `>`, `<`, `>=`, `<=`
1373
+ #
1374
+ # Usage: This should be milliseconds since epoch or an RFC3339 string.
1375
+ # Examples:
1376
+ # `event_time = "2019-06-10T16:07:18-07:00"`
1377
+ # `event_time = 1560208038000`
1378
+ #
1379
+ # * severity: `=`, `:`
1380
+ # * workflow_state: `=`, `:`
1381
+ # * security_marks.marks: `=`, `:`
1382
+ # * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
1383
+ #
1384
+ # For example, `source_properties.size = 100` is a valid filter string.
1385
+ #
1386
+ # Use a partial match on the empty string to filter based on a property
1387
+ # existing: `source_properties.my_property : ""`
1388
+ #
1389
+ # Use a negated partial match on the empty string to filter based on a
1390
+ # property not existing: `-source_properties.my_property : ""`
1391
+ #
1392
+ # * resource:
1393
+ # * resource.name: `=`, `:`
1394
+ # * resource.parent_name: `=`, `:`
1395
+ # * resource.parent_display_name: `=`, `:`
1396
+ # * resource.project_name: `=`, `:`
1397
+ # * resource.project_display_name: `=`, `:`
1398
+ # * resource.type: `=`, `:`
1399
+ # @param group_by [::String]
1400
+ # Required. Expression that defines what assets fields to use for grouping
1401
+ # (including `state_change`). The string value should follow SQL syntax:
1402
+ # comma separated list of fields. For example: "parent,resource_name".
1403
+ #
1404
+ # The following fields are supported:
1405
+ #
1406
+ # * resource_name
1407
+ # * category
1408
+ # * state
1409
+ # * parent
1410
+ # * severity
1411
+ #
1412
+ # The following fields are supported when compare_duration is set:
1413
+ #
1414
+ # * state_change
1415
+ # @param read_time [::Google::Protobuf::Timestamp, ::Hash]
1416
+ # Time used as a reference point when filtering findings. The filter is
1417
+ # limited to findings existing at the supplied time and their values are
1418
+ # those at that specific time. Absence of this field will default to the
1419
+ # API's version of NOW.
1420
+ # @param compare_duration [::Google::Protobuf::Duration, ::Hash]
1421
+ # When compare_duration is set, the GroupResult's "state_change" attribute is
1422
+ # updated to indicate whether the finding had its state changed, the
1423
+ # finding's state remained unchanged, or if the finding was added during the
1424
+ # compare_duration period of time that precedes the read_time. This is the
1425
+ # time between (read_time - compare_duration) and read_time.
1426
+ #
1427
+ # The state_change value is derived based on the presence and state of the
1428
+ # finding at the two points in time. Intermediate state changes between the
1429
+ # two times don't affect the result. For example, the results aren't affected
1430
+ # if the finding is made inactive and then active again.
1431
+ #
1432
+ # Possible "state_change" values when compare_duration is specified:
1433
+ #
1434
+ # * "CHANGED": indicates that the finding was present and matched the given
1435
+ # filter at the start of compare_duration, but changed its
1436
+ # state at read_time.
1437
+ # * "UNCHANGED": indicates that the finding was present and matched the given
1438
+ # filter at the start of compare_duration and did not change
1439
+ # state at read_time.
1440
+ # * "ADDED": indicates that the finding did not match the given filter or
1441
+ # was not present at the start of compare_duration, but was
1442
+ # present at read_time.
1443
+ # * "REMOVED": indicates that the finding was present and matched the
1444
+ # filter at the start of compare_duration, but did not match
1445
+ # the filter at read_time.
1446
+ #
1447
+ # If compare_duration is not specified, then the only possible state_change
1448
+ # is "UNUSED", which will be the state_change set for all findings present
1449
+ # at read_time.
1450
+ #
1451
+ # If this field is set then `state_change` must be a specified field in
1452
+ # `group_by`.
1453
+ # @param page_token [::String]
1454
+ # The value returned by the last `GroupFindingsResponse`; indicates
1455
+ # that this is a continuation of a prior `GroupFindings` call, and
1456
+ # that the system should return the next page of data.
1457
+ # @param page_size [::Integer]
1458
+ # The maximum number of results to return in a single response. Default is
1459
+ # 10, minimum is 1, maximum is 1000.
1460
+ # @yield [result, operation] Access the result along with the TransportOperation object
1461
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::GroupResult>]
1462
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1463
+ #
1464
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::GroupResult>]
1465
+ #
1466
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1467
+ def group_findings request, options = nil
1468
+ raise ::ArgumentError, "request must be provided" if request.nil?
1469
+
1470
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::GroupFindingsRequest
1471
+
1472
+ # Converts hash and nil to an options object
1473
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1474
+
1475
+ # Customize the options with defaults
1476
+ call_metadata = @config.rpcs.group_findings.metadata.to_h
1477
+
1478
+ # Set x-goog-api-client and x-goog-user-project headers
1479
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1480
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1481
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
1482
+ transports_version_send: [:rest]
1483
+
1484
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1485
+
1486
+ options.apply_defaults timeout: @config.rpcs.group_findings.timeout,
1487
+ metadata: call_metadata,
1488
+ retry_policy: @config.rpcs.group_findings.retry_policy
1489
+
1490
+ options.apply_defaults timeout: @config.timeout,
1491
+ metadata: @config.metadata,
1492
+ retry_policy: @config.retry_policy
1493
+
1494
+ @security_center_stub.group_findings request, options do |result, operation|
1495
+ result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :group_findings, "group_by_results", request, result, options
1496
+ yield result, operation if block_given?
1497
+ return result
1498
+ end
1499
+ rescue ::Gapic::Rest::Error => e
1500
+ raise ::Google::Cloud::Error.from_error(e)
1501
+ end
1502
+
1503
+ ##
1504
+ # Lists an organization's assets.
1505
+ #
1506
+ # @overload list_assets(request, options = nil)
1507
+ # Pass arguments to `list_assets` via a request object, either of type
1508
+ # {::Google::Cloud::SecurityCenter::V1::ListAssetsRequest} or an equivalent Hash.
1509
+ #
1510
+ # @param request [::Google::Cloud::SecurityCenter::V1::ListAssetsRequest, ::Hash]
1511
+ # A request object representing the call parameters. Required. To specify no
1512
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1513
+ # @param options [::Gapic::CallOptions, ::Hash]
1514
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1515
+ #
1516
+ # @overload list_assets(parent: nil, filter: nil, order_by: nil, read_time: nil, compare_duration: nil, field_mask: nil, page_token: nil, page_size: nil)
1517
+ # Pass arguments to `list_assets` via keyword arguments. Note that at
1518
+ # least one keyword argument is required. To specify no parameters, or to keep all
1519
+ # the default parameter values, pass an empty Hash as a request object (see above).
1520
+ #
1521
+ # @param parent [::String]
1522
+ # Required. The name of the parent resource that contains the assets. The
1523
+ # value that you can specify on parent depends on the method in which you
1524
+ # specify parent. You can specify one of the following values:
1525
+ # "organizations/[organization_id]", "folders/[folder_id]", or
1526
+ # "projects/[project_id]".
1527
+ # @param filter [::String]
1528
+ # Expression that defines the filter to apply across assets.
1529
+ # The expression is a list of zero or more restrictions combined via logical
1530
+ # operators `AND` and `OR`.
1531
+ # Parentheses are supported, and `OR` has higher precedence than `AND`.
1532
+ #
1533
+ # Restrictions have the form `<field> <operator> <value>` and may have a `-`
1534
+ # character in front of them to indicate negation. The fields map to those
1535
+ # defined in the Asset resource. Examples include:
1536
+ #
1537
+ # * name
1538
+ # * security_center_properties.resource_name
1539
+ # * resource_properties.a_property
1540
+ # * security_marks.marks.marka
1541
+ #
1542
+ # The supported operators are:
1543
+ #
1544
+ # * `=` for all value types.
1545
+ # * `>`, `<`, `>=`, `<=` for integer values.
1546
+ # * `:`, meaning substring matching, for strings.
1547
+ #
1548
+ # The supported value types are:
1549
+ #
1550
+ # * string literals in quotes.
1551
+ # * integer literals without quotes.
1552
+ # * boolean literals `true` and `false` without quotes.
1553
+ #
1554
+ # The following are the allowed field and operator combinations:
1555
+ #
1556
+ # * name: `=`
1557
+ # * update_time: `=`, `>`, `<`, `>=`, `<=`
1558
+ #
1559
+ # Usage: This should be milliseconds since epoch or an RFC3339 string.
1560
+ # Examples:
1561
+ # `update_time = "2019-06-10T16:07:18-07:00"`
1562
+ # `update_time = 1560208038000`
1563
+ #
1564
+ # * create_time: `=`, `>`, `<`, `>=`, `<=`
1565
+ #
1566
+ # Usage: This should be milliseconds since epoch or an RFC3339 string.
1567
+ # Examples:
1568
+ # `create_time = "2019-06-10T16:07:18-07:00"`
1569
+ # `create_time = 1560208038000`
1570
+ #
1571
+ # * iam_policy.policy_blob: `=`, `:`
1572
+ # * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
1573
+ # * security_marks.marks: `=`, `:`
1574
+ # * security_center_properties.resource_name: `=`, `:`
1575
+ # * security_center_properties.resource_display_name: `=`, `:`
1576
+ # * security_center_properties.resource_type: `=`, `:`
1577
+ # * security_center_properties.resource_parent: `=`, `:`
1578
+ # * security_center_properties.resource_parent_display_name: `=`, `:`
1579
+ # * security_center_properties.resource_project: `=`, `:`
1580
+ # * security_center_properties.resource_project_display_name: `=`, `:`
1581
+ # * security_center_properties.resource_owners: `=`, `:`
1582
+ #
1583
+ # For example, `resource_properties.size = 100` is a valid filter string.
1584
+ #
1585
+ # Use a partial match on the empty string to filter based on a property
1586
+ # existing: `resource_properties.my_property : ""`
1587
+ #
1588
+ # Use a negated partial match on the empty string to filter based on a
1589
+ # property not existing: `-resource_properties.my_property : ""`
1590
+ # @param order_by [::String]
1591
+ # Expression that defines what fields and order to use for sorting. The
1592
+ # string value should follow SQL syntax: comma separated list of fields. For
1593
+ # example: "name,resource_properties.a_property". The default sorting order
1594
+ # is ascending. To specify descending order for a field, a suffix " desc"
1595
+ # should be appended to the field name. For example: "name
1596
+ # desc,resource_properties.a_property". Redundant space characters in the
1597
+ # syntax are insignificant. "name desc,resource_properties.a_property" and "
1598
+ # name desc , resource_properties.a_property " are equivalent.
1599
+ #
1600
+ # The following fields are supported:
1601
+ # name
1602
+ # update_time
1603
+ # resource_properties
1604
+ # security_marks.marks
1605
+ # security_center_properties.resource_name
1606
+ # security_center_properties.resource_display_name
1607
+ # security_center_properties.resource_parent
1608
+ # security_center_properties.resource_parent_display_name
1609
+ # security_center_properties.resource_project
1610
+ # security_center_properties.resource_project_display_name
1611
+ # security_center_properties.resource_type
1612
+ # @param read_time [::Google::Protobuf::Timestamp, ::Hash]
1613
+ # Time used as a reference point when filtering assets. The filter is limited
1614
+ # to assets existing at the supplied time and their values are those at that
1615
+ # specific time. Absence of this field will default to the API's version of
1616
+ # NOW.
1617
+ # @param compare_duration [::Google::Protobuf::Duration, ::Hash]
1618
+ # When compare_duration is set, the ListAssetsResult's "state_change"
1619
+ # attribute is updated to indicate whether the asset was added, removed, or
1620
+ # remained present during the compare_duration period of time that precedes
1621
+ # the read_time. This is the time between (read_time - compare_duration) and
1622
+ # read_time.
1623
+ #
1624
+ # The state_change value is derived based on the presence of the asset at the
1625
+ # two points in time. Intermediate state changes between the two times don't
1626
+ # affect the result. For example, the results aren't affected if the asset is
1627
+ # removed and re-created again.
1628
+ #
1629
+ # Possible "state_change" values when compare_duration is specified:
1630
+ #
1631
+ # * "ADDED": indicates that the asset was not present at the start of
1632
+ # compare_duration, but present at read_time.
1633
+ # * "REMOVED": indicates that the asset was present at the start of
1634
+ # compare_duration, but not present at read_time.
1635
+ # * "ACTIVE": indicates that the asset was present at both the
1636
+ # start and the end of the time period defined by
1637
+ # compare_duration and read_time.
1638
+ #
1639
+ # If compare_duration is not specified, then the only possible state_change
1640
+ # is "UNUSED", which will be the state_change set for all assets present at
1641
+ # read_time.
1642
+ # @param field_mask [::Google::Protobuf::FieldMask, ::Hash]
1643
+ # A field mask to specify the ListAssetsResult fields to be listed in the
1644
+ # response.
1645
+ # An empty field mask will list all fields.
1646
+ # @param page_token [::String]
1647
+ # The value returned by the last `ListAssetsResponse`; indicates
1648
+ # that this is a continuation of a prior `ListAssets` call, and
1649
+ # that the system should return the next page of data.
1650
+ # @param page_size [::Integer]
1651
+ # The maximum number of results to return in a single response. Default is
1652
+ # 10, minimum is 1, maximum is 1000.
1653
+ # @yield [result, operation] Access the result along with the TransportOperation object
1654
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ListAssetsResponse::ListAssetsResult>]
1655
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1656
+ #
1657
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ListAssetsResponse::ListAssetsResult>]
1658
+ #
1659
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1660
+ def list_assets request, options = nil
1661
+ raise ::ArgumentError, "request must be provided" if request.nil?
1662
+
1663
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListAssetsRequest
1664
+
1665
+ # Converts hash and nil to an options object
1666
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1667
+
1668
+ # Customize the options with defaults
1669
+ call_metadata = @config.rpcs.list_assets.metadata.to_h
1670
+
1671
+ # Set x-goog-api-client and x-goog-user-project headers
1672
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1673
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1674
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
1675
+ transports_version_send: [:rest]
1676
+
1677
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1678
+
1679
+ options.apply_defaults timeout: @config.rpcs.list_assets.timeout,
1680
+ metadata: call_metadata,
1681
+ retry_policy: @config.rpcs.list_assets.retry_policy
1682
+
1683
+ options.apply_defaults timeout: @config.timeout,
1684
+ metadata: @config.metadata,
1685
+ retry_policy: @config.retry_policy
1686
+
1687
+ @security_center_stub.list_assets request, options do |result, operation|
1688
+ result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_assets, "list_assets_results", request, result, options
1689
+ yield result, operation if block_given?
1690
+ return result
1691
+ end
1692
+ rescue ::Gapic::Rest::Error => e
1693
+ raise ::Google::Cloud::Error.from_error(e)
1694
+ end
1695
+
1696
+ ##
1697
+ # Lists an organization or source's findings.
1698
+ #
1699
+ # To list across all sources provide a `-` as the source id.
1700
+ # Example: /v1/organizations/\\{organization_id}/sources/-/findings
1701
+ #
1702
+ # @overload list_findings(request, options = nil)
1703
+ # Pass arguments to `list_findings` via a request object, either of type
1704
+ # {::Google::Cloud::SecurityCenter::V1::ListFindingsRequest} or an equivalent Hash.
1705
+ #
1706
+ # @param request [::Google::Cloud::SecurityCenter::V1::ListFindingsRequest, ::Hash]
1707
+ # A request object representing the call parameters. Required. To specify no
1708
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1709
+ # @param options [::Gapic::CallOptions, ::Hash]
1710
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1711
+ #
1712
+ # @overload list_findings(parent: nil, filter: nil, order_by: nil, read_time: nil, compare_duration: nil, field_mask: nil, page_token: nil, page_size: nil)
1713
+ # Pass arguments to `list_findings` via keyword arguments. Note that at
1714
+ # least one keyword argument is required. To specify no parameters, or to keep all
1715
+ # the default parameter values, pass an empty Hash as a request object (see above).
1716
+ #
1717
+ # @param parent [::String]
1718
+ # Required. Name of the source the findings belong to. Its format is
1719
+ # "organizations/[organization_id]/sources/[source_id],
1720
+ # folders/[folder_id]/sources/[source_id], or
1721
+ # projects/[project_id]/sources/[source_id]". To list across all sources
1722
+ # provide a source_id of `-`. For example:
1723
+ # organizations/\\{organization_id}/sources/-, folders/\\{folder_id}/sources/- or
1724
+ # projects/\\{projects_id}/sources/-
1725
+ # @param filter [::String]
1726
+ # Expression that defines the filter to apply across findings.
1727
+ # The expression is a list of one or more restrictions combined via logical
1728
+ # operators `AND` and `OR`.
1729
+ # Parentheses are supported, and `OR` has higher precedence than `AND`.
1730
+ #
1731
+ # Restrictions have the form `<field> <operator> <value>` and may have a `-`
1732
+ # character in front of them to indicate negation. Examples include:
1733
+ #
1734
+ # * name
1735
+ # * source_properties.a_property
1736
+ # * security_marks.marks.marka
1737
+ #
1738
+ # The supported operators are:
1739
+ #
1740
+ # * `=` for all value types.
1741
+ # * `>`, `<`, `>=`, `<=` for integer values.
1742
+ # * `:`, meaning substring matching, for strings.
1743
+ #
1744
+ # The supported value types are:
1745
+ #
1746
+ # * string literals in quotes.
1747
+ # * integer literals without quotes.
1748
+ # * boolean literals `true` and `false` without quotes.
1749
+ #
1750
+ # The following field and operator combinations are supported:
1751
+ #
1752
+ # * name: `=`
1753
+ # * parent: `=`, `:`
1754
+ # * resource_name: `=`, `:`
1755
+ # * state: `=`, `:`
1756
+ # * category: `=`, `:`
1757
+ # * external_uri: `=`, `:`
1758
+ # * event_time: `=`, `>`, `<`, `>=`, `<=`
1759
+ #
1760
+ # Usage: This should be milliseconds since epoch or an RFC3339 string.
1761
+ # Examples:
1762
+ # `event_time = "2019-06-10T16:07:18-07:00"`
1763
+ # `event_time = 1560208038000`
1764
+ #
1765
+ # * severity: `=`, `:`
1766
+ # * workflow_state: `=`, `:`
1767
+ # * security_marks.marks: `=`, `:`
1768
+ # * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
1769
+ #
1770
+ # For example, `source_properties.size = 100` is a valid filter string.
1771
+ #
1772
+ # Use a partial match on the empty string to filter based on a property
1773
+ # existing: `source_properties.my_property : ""`
1774
+ #
1775
+ # Use a negated partial match on the empty string to filter based on a
1776
+ # property not existing: `-source_properties.my_property : ""`
1777
+ #
1778
+ # * resource:
1779
+ # * resource.name: `=`, `:`
1780
+ # * resource.parent_name: `=`, `:`
1781
+ # * resource.parent_display_name: `=`, `:`
1782
+ # * resource.project_name: `=`, `:`
1783
+ # * resource.project_display_name: `=`, `:`
1784
+ # * resource.type: `=`, `:`
1785
+ # * resource.folders.resource_folder: `=`, `:`
1786
+ # * resource.display_name: `=`, `:`
1787
+ # @param order_by [::String]
1788
+ # Expression that defines what fields and order to use for sorting. The
1789
+ # string value should follow SQL syntax: comma separated list of fields. For
1790
+ # example: "name,resource_properties.a_property". The default sorting order
1791
+ # is ascending. To specify descending order for a field, a suffix " desc"
1792
+ # should be appended to the field name. For example: "name
1793
+ # desc,source_properties.a_property". Redundant space characters in the
1794
+ # syntax are insignificant. "name desc,source_properties.a_property" and "
1795
+ # name desc , source_properties.a_property " are equivalent.
1796
+ #
1797
+ # The following fields are supported:
1798
+ # name
1799
+ # parent
1800
+ # state
1801
+ # category
1802
+ # resource_name
1803
+ # event_time
1804
+ # source_properties
1805
+ # security_marks.marks
1806
+ # @param read_time [::Google::Protobuf::Timestamp, ::Hash]
1807
+ # Time used as a reference point when filtering findings. The filter is
1808
+ # limited to findings existing at the supplied time and their values are
1809
+ # those at that specific time. Absence of this field will default to the
1810
+ # API's version of NOW.
1811
+ # @param compare_duration [::Google::Protobuf::Duration, ::Hash]
1812
+ # When compare_duration is set, the ListFindingsResult's "state_change"
1813
+ # attribute is updated to indicate whether the finding had its state changed,
1814
+ # the finding's state remained unchanged, or if the finding was added in any
1815
+ # state during the compare_duration period of time that precedes the
1816
+ # read_time. This is the time between (read_time - compare_duration) and
1817
+ # read_time.
1818
+ #
1819
+ # The state_change value is derived based on the presence and state of the
1820
+ # finding at the two points in time. Intermediate state changes between the
1821
+ # two times don't affect the result. For example, the results aren't affected
1822
+ # if the finding is made inactive and then active again.
1823
+ #
1824
+ # Possible "state_change" values when compare_duration is specified:
1825
+ #
1826
+ # * "CHANGED": indicates that the finding was present and matched the given
1827
+ # filter at the start of compare_duration, but changed its
1828
+ # state at read_time.
1829
+ # * "UNCHANGED": indicates that the finding was present and matched the given
1830
+ # filter at the start of compare_duration and did not change
1831
+ # state at read_time.
1832
+ # * "ADDED": indicates that the finding did not match the given filter or
1833
+ # was not present at the start of compare_duration, but was
1834
+ # present at read_time.
1835
+ # * "REMOVED": indicates that the finding was present and matched the
1836
+ # filter at the start of compare_duration, but did not match
1837
+ # the filter at read_time.
1838
+ #
1839
+ # If compare_duration is not specified, then the only possible state_change
1840
+ # is "UNUSED", which will be the state_change set for all findings present at
1841
+ # read_time.
1842
+ # @param field_mask [::Google::Protobuf::FieldMask, ::Hash]
1843
+ # A field mask to specify the Finding fields to be listed in the response.
1844
+ # An empty field mask will list all fields.
1845
+ # @param page_token [::String]
1846
+ # The value returned by the last `ListFindingsResponse`; indicates
1847
+ # that this is a continuation of a prior `ListFindings` call, and
1848
+ # that the system should return the next page of data.
1849
+ # @param page_size [::Integer]
1850
+ # The maximum number of results to return in a single response. Default is
1851
+ # 10, minimum is 1, maximum is 1000.
1852
+ # @yield [result, operation] Access the result along with the TransportOperation object
1853
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ListFindingsResponse::ListFindingsResult>]
1854
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1855
+ #
1856
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::ListFindingsResponse::ListFindingsResult>]
1857
+ #
1858
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1859
+ def list_findings request, options = nil
1860
+ raise ::ArgumentError, "request must be provided" if request.nil?
1861
+
1862
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListFindingsRequest
1863
+
1864
+ # Converts hash and nil to an options object
1865
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1866
+
1867
+ # Customize the options with defaults
1868
+ call_metadata = @config.rpcs.list_findings.metadata.to_h
1869
+
1870
+ # Set x-goog-api-client and x-goog-user-project headers
1871
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1872
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1873
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
1874
+ transports_version_send: [:rest]
1875
+
1876
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1877
+
1878
+ options.apply_defaults timeout: @config.rpcs.list_findings.timeout,
1879
+ metadata: call_metadata,
1880
+ retry_policy: @config.rpcs.list_findings.retry_policy
1881
+
1882
+ options.apply_defaults timeout: @config.timeout,
1883
+ metadata: @config.metadata,
1884
+ retry_policy: @config.retry_policy
1885
+
1886
+ @security_center_stub.list_findings request, options do |result, operation|
1887
+ result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_findings, "list_findings_results", request, result, options
1888
+ yield result, operation if block_given?
1889
+ return result
1890
+ end
1891
+ rescue ::Gapic::Rest::Error => e
1892
+ raise ::Google::Cloud::Error.from_error(e)
1893
+ end
1894
+
1895
+ ##
1896
+ # Lists mute configs.
1897
+ #
1898
+ # @overload list_mute_configs(request, options = nil)
1899
+ # Pass arguments to `list_mute_configs` via a request object, either of type
1900
+ # {::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest} or an equivalent Hash.
1901
+ #
1902
+ # @param request [::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest, ::Hash]
1903
+ # A request object representing the call parameters. Required. To specify no
1904
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1905
+ # @param options [::Gapic::CallOptions, ::Hash]
1906
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1907
+ #
1908
+ # @overload list_mute_configs(parent: nil, page_size: nil, page_token: nil)
1909
+ # Pass arguments to `list_mute_configs` via keyword arguments. Note that at
1910
+ # least one keyword argument is required. To specify no parameters, or to keep all
1911
+ # the default parameter values, pass an empty Hash as a request object (see above).
1912
+ #
1913
+ # @param parent [::String]
1914
+ # Required. The parent, which owns the collection of mute configs. Its format
1915
+ # is "organizations/[organization_id]", "folders/[folder_id]",
1916
+ # "projects/[project_id]".
1917
+ # @param page_size [::Integer]
1918
+ # The maximum number of configs to return. The service may return fewer than
1919
+ # this value.
1920
+ # If unspecified, at most 10 configs will be returned.
1921
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
1922
+ # @param page_token [::String]
1923
+ # A page token, received from a previous `ListMuteConfigs` call.
1924
+ # Provide this to retrieve the subsequent page.
1925
+ #
1926
+ # When paginating, all other parameters provided to `ListMuteConfigs` must
1927
+ # match the call that provided the page token.
1928
+ # @yield [result, operation] Access the result along with the TransportOperation object
1929
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::MuteConfig>]
1930
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1931
+ #
1932
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::MuteConfig>]
1933
+ #
1934
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1935
+ def list_mute_configs request, options = nil
1936
+ raise ::ArgumentError, "request must be provided" if request.nil?
1937
+
1938
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest
1939
+
1940
+ # Converts hash and nil to an options object
1941
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1942
+
1943
+ # Customize the options with defaults
1944
+ call_metadata = @config.rpcs.list_mute_configs.metadata.to_h
1945
+
1946
+ # Set x-goog-api-client and x-goog-user-project headers
1947
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1948
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1949
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
1950
+ transports_version_send: [:rest]
1951
+
1952
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1953
+
1954
+ options.apply_defaults timeout: @config.rpcs.list_mute_configs.timeout,
1955
+ metadata: call_metadata,
1956
+ retry_policy: @config.rpcs.list_mute_configs.retry_policy
1957
+
1958
+ options.apply_defaults timeout: @config.timeout,
1959
+ metadata: @config.metadata,
1960
+ retry_policy: @config.retry_policy
1961
+
1962
+ @security_center_stub.list_mute_configs request, options do |result, operation|
1963
+ result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_mute_configs, "mute_configs", request, result, options
1964
+ yield result, operation if block_given?
1965
+ return result
1966
+ end
1967
+ rescue ::Gapic::Rest::Error => e
1968
+ raise ::Google::Cloud::Error.from_error(e)
1969
+ end
1970
+
1971
+ ##
1972
+ # Lists notification configs.
1973
+ #
1974
+ # @overload list_notification_configs(request, options = nil)
1975
+ # Pass arguments to `list_notification_configs` via a request object, either of type
1976
+ # {::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest} or an equivalent Hash.
1977
+ #
1978
+ # @param request [::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest, ::Hash]
1979
+ # A request object representing the call parameters. Required. To specify no
1980
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1981
+ # @param options [::Gapic::CallOptions, ::Hash]
1982
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1983
+ #
1984
+ # @overload list_notification_configs(parent: nil, page_token: nil, page_size: nil)
1985
+ # Pass arguments to `list_notification_configs` via keyword arguments. Note that at
1986
+ # least one keyword argument is required. To specify no parameters, or to keep all
1987
+ # the default parameter values, pass an empty Hash as a request object (see above).
1988
+ #
1989
+ # @param parent [::String]
1990
+ # Required. The name of the parent in which to list the notification
1991
+ # configurations. Its format is "organizations/[organization_id]",
1992
+ # "folders/[folder_id]", or "projects/[project_id]".
1993
+ # @param page_token [::String]
1994
+ # The value returned by the last `ListNotificationConfigsResponse`; indicates
1995
+ # that this is a continuation of a prior `ListNotificationConfigs` call, and
1996
+ # that the system should return the next page of data.
1997
+ # @param page_size [::Integer]
1998
+ # The maximum number of results to return in a single response. Default is
1999
+ # 10, minimum is 1, maximum is 1000.
2000
+ # @yield [result, operation] Access the result along with the TransportOperation object
2001
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::NotificationConfig>]
2002
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2003
+ #
2004
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::NotificationConfig>]
2005
+ #
2006
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2007
+ def list_notification_configs request, options = nil
2008
+ raise ::ArgumentError, "request must be provided" if request.nil?
2009
+
2010
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest
2011
+
2012
+ # Converts hash and nil to an options object
2013
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2014
+
2015
+ # Customize the options with defaults
2016
+ call_metadata = @config.rpcs.list_notification_configs.metadata.to_h
2017
+
2018
+ # Set x-goog-api-client and x-goog-user-project headers
2019
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2020
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2021
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
2022
+ transports_version_send: [:rest]
2023
+
2024
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2025
+
2026
+ options.apply_defaults timeout: @config.rpcs.list_notification_configs.timeout,
2027
+ metadata: call_metadata,
2028
+ retry_policy: @config.rpcs.list_notification_configs.retry_policy
2029
+
2030
+ options.apply_defaults timeout: @config.timeout,
2031
+ metadata: @config.metadata,
2032
+ retry_policy: @config.retry_policy
2033
+
2034
+ @security_center_stub.list_notification_configs request, options do |result, operation|
2035
+ result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_notification_configs, "notification_configs", request, result, options
2036
+ yield result, operation if block_given?
2037
+ return result
2038
+ end
2039
+ rescue ::Gapic::Rest::Error => e
2040
+ raise ::Google::Cloud::Error.from_error(e)
2041
+ end
2042
+
2043
+ ##
2044
+ # Lists all sources belonging to an organization.
2045
+ #
2046
+ # @overload list_sources(request, options = nil)
2047
+ # Pass arguments to `list_sources` via a request object, either of type
2048
+ # {::Google::Cloud::SecurityCenter::V1::ListSourcesRequest} or an equivalent Hash.
2049
+ #
2050
+ # @param request [::Google::Cloud::SecurityCenter::V1::ListSourcesRequest, ::Hash]
2051
+ # A request object representing the call parameters. Required. To specify no
2052
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2053
+ # @param options [::Gapic::CallOptions, ::Hash]
2054
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2055
+ #
2056
+ # @overload list_sources(parent: nil, page_token: nil, page_size: nil)
2057
+ # Pass arguments to `list_sources` via keyword arguments. Note that at
2058
+ # least one keyword argument is required. To specify no parameters, or to keep all
2059
+ # the default parameter values, pass an empty Hash as a request object (see above).
2060
+ #
2061
+ # @param parent [::String]
2062
+ # Required. Resource name of the parent of sources to list. Its format should
2063
+ # be "organizations/[organization_id]", "folders/[folder_id]", or
2064
+ # "projects/[project_id]".
2065
+ # @param page_token [::String]
2066
+ # The value returned by the last `ListSourcesResponse`; indicates
2067
+ # that this is a continuation of a prior `ListSources` call, and
2068
+ # that the system should return the next page of data.
2069
+ # @param page_size [::Integer]
2070
+ # The maximum number of results to return in a single response. Default is
2071
+ # 10, minimum is 1, maximum is 1000.
2072
+ # @yield [result, operation] Access the result along with the TransportOperation object
2073
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::Source>]
2074
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2075
+ #
2076
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::Source>]
2077
+ #
2078
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2079
+ def list_sources request, options = nil
2080
+ raise ::ArgumentError, "request must be provided" if request.nil?
2081
+
2082
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListSourcesRequest
2083
+
2084
+ # Converts hash and nil to an options object
2085
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2086
+
2087
+ # Customize the options with defaults
2088
+ call_metadata = @config.rpcs.list_sources.metadata.to_h
2089
+
2090
+ # Set x-goog-api-client and x-goog-user-project headers
2091
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2092
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2093
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
2094
+ transports_version_send: [:rest]
2095
+
2096
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2097
+
2098
+ options.apply_defaults timeout: @config.rpcs.list_sources.timeout,
2099
+ metadata: call_metadata,
2100
+ retry_policy: @config.rpcs.list_sources.retry_policy
2101
+
2102
+ options.apply_defaults timeout: @config.timeout,
2103
+ metadata: @config.metadata,
2104
+ retry_policy: @config.retry_policy
2105
+
2106
+ @security_center_stub.list_sources request, options do |result, operation|
2107
+ result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_sources, "sources", request, result, options
2108
+ yield result, operation if block_given?
2109
+ return result
2110
+ end
2111
+ rescue ::Gapic::Rest::Error => e
2112
+ raise ::Google::Cloud::Error.from_error(e)
2113
+ end
2114
+
2115
+ ##
2116
+ # Runs asset discovery. The discovery is tracked with a long-running
2117
+ # operation.
2118
+ #
2119
+ # This API can only be called with limited frequency for an organization. If
2120
+ # it is called too frequently the caller will receive a TOO_MANY_REQUESTS
2121
+ # error.
2122
+ #
2123
+ # @overload run_asset_discovery(request, options = nil)
2124
+ # Pass arguments to `run_asset_discovery` via a request object, either of type
2125
+ # {::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest} or an equivalent Hash.
2126
+ #
2127
+ # @param request [::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest, ::Hash]
2128
+ # A request object representing the call parameters. Required. To specify no
2129
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2130
+ # @param options [::Gapic::CallOptions, ::Hash]
2131
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2132
+ #
2133
+ # @overload run_asset_discovery(parent: nil)
2134
+ # Pass arguments to `run_asset_discovery` via keyword arguments. Note that at
2135
+ # least one keyword argument is required. To specify no parameters, or to keep all
2136
+ # the default parameter values, pass an empty Hash as a request object (see above).
2137
+ #
2138
+ # @param parent [::String]
2139
+ # Required. Name of the organization to run asset discovery for. Its format
2140
+ # is "organizations/[organization_id]".
2141
+ # @yield [result, operation] Access the result along with the TransportOperation object
2142
+ # @yieldparam result [::Gapic::Operation]
2143
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2144
+ #
2145
+ # @return [::Gapic::Operation]
2146
+ #
2147
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2148
+ def run_asset_discovery request, options = nil
2149
+ raise ::ArgumentError, "request must be provided" if request.nil?
2150
+
2151
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest
2152
+
2153
+ # Converts hash and nil to an options object
2154
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2155
+
2156
+ # Customize the options with defaults
2157
+ call_metadata = @config.rpcs.run_asset_discovery.metadata.to_h
2158
+
2159
+ # Set x-goog-api-client and x-goog-user-project headers
2160
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2161
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2162
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
2163
+ transports_version_send: [:rest]
2164
+
2165
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2166
+
2167
+ options.apply_defaults timeout: @config.rpcs.run_asset_discovery.timeout,
2168
+ metadata: call_metadata,
2169
+ retry_policy: @config.rpcs.run_asset_discovery.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.run_asset_discovery request, options do |result, operation|
2176
+ result = ::Gapic::Operation.new result, @operations_client, options: options
2177
+ yield result, operation if block_given?
2178
+ return result
2179
+ end
2180
+ rescue ::Gapic::Rest::Error => e
2181
+ raise ::Google::Cloud::Error.from_error(e)
2182
+ end
2183
+
2184
+ ##
2185
+ # Updates the state of a finding.
2186
+ #
2187
+ # @overload set_finding_state(request, options = nil)
2188
+ # Pass arguments to `set_finding_state` via a request object, either of type
2189
+ # {::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest} or an equivalent Hash.
2190
+ #
2191
+ # @param request [::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest, ::Hash]
2192
+ # A request object representing the call parameters. Required. To specify no
2193
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2194
+ # @param options [::Gapic::CallOptions, ::Hash]
2195
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2196
+ #
2197
+ # @overload set_finding_state(name: nil, state: nil, start_time: nil)
2198
+ # Pass arguments to `set_finding_state` via keyword arguments. Note that at
2199
+ # least one keyword argument is required. To specify no parameters, or to keep all
2200
+ # the default parameter values, pass an empty Hash as a request object (see above).
2201
+ #
2202
+ # @param name [::String]
2203
+ # Required. The [relative resource
2204
+ # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name)
2205
+ # of the finding. Example:
2206
+ # "organizations/\\{organization_id}/sources/\\{source_id}/findings/\\{finding_id}",
2207
+ # "folders/\\{folder_id}/sources/\\{source_id}/findings/\\{finding_id}",
2208
+ # "projects/\\{project_id}/sources/\\{source_id}/findings/\\{finding_id}".
2209
+ # @param state [::Google::Cloud::SecurityCenter::V1::Finding::State]
2210
+ # Required. The desired State of the finding.
2211
+ # @param start_time [::Google::Protobuf::Timestamp, ::Hash]
2212
+ # Required. The time at which the updated state takes effect.
2213
+ # @yield [result, operation] Access the result along with the TransportOperation object
2214
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Finding]
2215
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2216
+ #
2217
+ # @return [::Google::Cloud::SecurityCenter::V1::Finding]
2218
+ #
2219
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2220
+ def set_finding_state request, options = nil
2221
+ raise ::ArgumentError, "request must be provided" if request.nil?
2222
+
2223
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::SetFindingStateRequest
2224
+
2225
+ # Converts hash and nil to an options object
2226
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2227
+
2228
+ # Customize the options with defaults
2229
+ call_metadata = @config.rpcs.set_finding_state.metadata.to_h
2230
+
2231
+ # Set x-goog-api-client and x-goog-user-project headers
2232
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2233
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2234
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
2235
+ transports_version_send: [:rest]
2236
+
2237
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2238
+
2239
+ options.apply_defaults timeout: @config.rpcs.set_finding_state.timeout,
2240
+ metadata: call_metadata,
2241
+ retry_policy: @config.rpcs.set_finding_state.retry_policy
2242
+
2243
+ options.apply_defaults timeout: @config.timeout,
2244
+ metadata: @config.metadata,
2245
+ retry_policy: @config.retry_policy
2246
+
2247
+ @security_center_stub.set_finding_state request, options do |result, operation|
2248
+ yield result, operation if block_given?
2249
+ return result
2250
+ end
2251
+ rescue ::Gapic::Rest::Error => e
2252
+ raise ::Google::Cloud::Error.from_error(e)
2253
+ end
2254
+
2255
+ ##
2256
+ # Updates the mute state of a finding.
2257
+ #
2258
+ # @overload set_mute(request, options = nil)
2259
+ # Pass arguments to `set_mute` via a request object, either of type
2260
+ # {::Google::Cloud::SecurityCenter::V1::SetMuteRequest} or an equivalent Hash.
2261
+ #
2262
+ # @param request [::Google::Cloud::SecurityCenter::V1::SetMuteRequest, ::Hash]
2263
+ # A request object representing the call parameters. Required. To specify no
2264
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2265
+ # @param options [::Gapic::CallOptions, ::Hash]
2266
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2267
+ #
2268
+ # @overload set_mute(name: nil, mute: nil)
2269
+ # Pass arguments to `set_mute` via keyword arguments. Note that at
2270
+ # least one keyword argument is required. To specify no parameters, or to keep all
2271
+ # the default parameter values, pass an empty Hash as a request object (see above).
2272
+ #
2273
+ # @param name [::String]
2274
+ # Required. The [relative resource
2275
+ # name](https://cloud.google.com/apis/design/resource_names#relative_resource_name)
2276
+ # of the finding. Example:
2277
+ # "organizations/\\{organization_id}/sources/\\{source_id}/findings/\\{finding_id}",
2278
+ # "folders/\\{folder_id}/sources/\\{source_id}/findings/\\{finding_id}",
2279
+ # "projects/\\{project_id}/sources/\\{source_id}/findings/\\{finding_id}".
2280
+ # @param mute [::Google::Cloud::SecurityCenter::V1::Finding::Mute]
2281
+ # Required. The desired state of the Mute.
2282
+ # @yield [result, operation] Access the result along with the TransportOperation object
2283
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Finding]
2284
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2285
+ #
2286
+ # @return [::Google::Cloud::SecurityCenter::V1::Finding]
2287
+ #
2288
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2289
+ def set_mute request, options = nil
2290
+ raise ::ArgumentError, "request must be provided" if request.nil?
2291
+
2292
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::SetMuteRequest
2293
+
2294
+ # Converts hash and nil to an options object
2295
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2296
+
2297
+ # Customize the options with defaults
2298
+ call_metadata = @config.rpcs.set_mute.metadata.to_h
2299
+
2300
+ # Set x-goog-api-client and x-goog-user-project headers
2301
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2302
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2303
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
2304
+ transports_version_send: [:rest]
2305
+
2306
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2307
+
2308
+ options.apply_defaults timeout: @config.rpcs.set_mute.timeout,
2309
+ metadata: call_metadata,
2310
+ retry_policy: @config.rpcs.set_mute.retry_policy
2311
+
2312
+ options.apply_defaults timeout: @config.timeout,
2313
+ metadata: @config.metadata,
2314
+ retry_policy: @config.retry_policy
2315
+
2316
+ @security_center_stub.set_mute request, options do |result, operation|
2317
+ yield result, operation if block_given?
2318
+ return result
2319
+ end
2320
+ rescue ::Gapic::Rest::Error => e
2321
+ raise ::Google::Cloud::Error.from_error(e)
2322
+ end
2323
+
2324
+ ##
2325
+ # Sets the access control policy on the specified Source.
2326
+ #
2327
+ # @overload set_iam_policy(request, options = nil)
2328
+ # Pass arguments to `set_iam_policy` via a request object, either of type
2329
+ # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
2330
+ #
2331
+ # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash]
2332
+ # A request object representing the call parameters. Required. To specify no
2333
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2334
+ # @param options [::Gapic::CallOptions, ::Hash]
2335
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2336
+ #
2337
+ # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil)
2338
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
2339
+ # least one keyword argument is required. To specify no parameters, or to keep all
2340
+ # the default parameter values, pass an empty Hash as a request object (see above).
2341
+ #
2342
+ # @param resource [::String]
2343
+ # REQUIRED: The resource for which the policy is being specified.
2344
+ # See the operation documentation for the appropriate value for this field.
2345
+ # @param policy [::Google::Iam::V1::Policy, ::Hash]
2346
+ # REQUIRED: The complete policy to be applied to the `resource`. The size of
2347
+ # the policy is limited to a few 10s of KB. An empty policy is a
2348
+ # valid policy but certain Cloud Platform services (such as Projects)
2349
+ # might reject them.
2350
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2351
+ # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
2352
+ # the fields in the mask will be modified. If no mask is provided, the
2353
+ # following default mask is used:
2354
+ #
2355
+ # `paths: "bindings, etag"`
2356
+ # @yield [result, operation] Access the result along with the TransportOperation object
2357
+ # @yieldparam result [::Google::Iam::V1::Policy]
2358
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2359
+ #
2360
+ # @return [::Google::Iam::V1::Policy]
2361
+ #
2362
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2363
+ def set_iam_policy request, options = nil
2364
+ raise ::ArgumentError, "request must be provided" if request.nil?
2365
+
2366
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest
2367
+
2368
+ # Converts hash and nil to an options object
2369
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2370
+
2371
+ # Customize the options with defaults
2372
+ call_metadata = @config.rpcs.set_iam_policy.metadata.to_h
2373
+
2374
+ # Set x-goog-api-client and x-goog-user-project headers
2375
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2376
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2377
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
2378
+ transports_version_send: [:rest]
2379
+
2380
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2381
+
2382
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
2383
+ metadata: call_metadata,
2384
+ retry_policy: @config.rpcs.set_iam_policy.retry_policy
2385
+
2386
+ options.apply_defaults timeout: @config.timeout,
2387
+ metadata: @config.metadata,
2388
+ retry_policy: @config.retry_policy
2389
+
2390
+ @security_center_stub.set_iam_policy request, options do |result, operation|
2391
+ yield result, operation if block_given?
2392
+ return result
2393
+ end
2394
+ rescue ::Gapic::Rest::Error => e
2395
+ raise ::Google::Cloud::Error.from_error(e)
2396
+ end
2397
+
2398
+ ##
2399
+ # Returns the permissions that a caller has on the specified source.
2400
+ #
2401
+ # @overload test_iam_permissions(request, options = nil)
2402
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
2403
+ # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash.
2404
+ #
2405
+ # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash]
2406
+ # A request object representing the call parameters. Required. To specify no
2407
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2408
+ # @param options [::Gapic::CallOptions, ::Hash]
2409
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2410
+ #
2411
+ # @overload test_iam_permissions(resource: nil, permissions: nil)
2412
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
2413
+ # least one keyword argument is required. To specify no parameters, or to keep all
2414
+ # the default parameter values, pass an empty Hash as a request object (see above).
2415
+ #
2416
+ # @param resource [::String]
2417
+ # REQUIRED: The resource for which the policy detail is being requested.
2418
+ # See the operation documentation for the appropriate value for this field.
2419
+ # @param permissions [::Array<::String>]
2420
+ # The set of permissions to check for the `resource`. Permissions with
2421
+ # wildcards (such as '*' or 'storage.*') are not allowed. For more
2422
+ # information see
2423
+ # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
2424
+ # @yield [result, operation] Access the result along with the TransportOperation object
2425
+ # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse]
2426
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2427
+ #
2428
+ # @return [::Google::Iam::V1::TestIamPermissionsResponse]
2429
+ #
2430
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2431
+ def test_iam_permissions request, options = nil
2432
+ raise ::ArgumentError, "request must be provided" if request.nil?
2433
+
2434
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest
2435
+
2436
+ # Converts hash and nil to an options object
2437
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2438
+
2439
+ # Customize the options with defaults
2440
+ call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
2441
+
2442
+ # Set x-goog-api-client and x-goog-user-project headers
2443
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2444
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2445
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
2446
+ transports_version_send: [:rest]
2447
+
2448
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2449
+
2450
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
2451
+ metadata: call_metadata,
2452
+ retry_policy: @config.rpcs.test_iam_permissions.retry_policy
2453
+
2454
+ options.apply_defaults timeout: @config.timeout,
2455
+ metadata: @config.metadata,
2456
+ retry_policy: @config.retry_policy
2457
+
2458
+ @security_center_stub.test_iam_permissions request, options do |result, operation|
2459
+ yield result, operation if block_given?
2460
+ return result
2461
+ end
2462
+ rescue ::Gapic::Rest::Error => e
2463
+ raise ::Google::Cloud::Error.from_error(e)
2464
+ end
2465
+
2466
+ ##
2467
+ # Updates external system. This is for a given finding.
2468
+ #
2469
+ # @overload update_external_system(request, options = nil)
2470
+ # Pass arguments to `update_external_system` via a request object, either of type
2471
+ # {::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest} or an equivalent Hash.
2472
+ #
2473
+ # @param request [::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest, ::Hash]
2474
+ # A request object representing the call parameters. Required. To specify no
2475
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2476
+ # @param options [::Gapic::CallOptions, ::Hash]
2477
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2478
+ #
2479
+ # @overload update_external_system(external_system: nil, update_mask: nil)
2480
+ # Pass arguments to `update_external_system` via keyword arguments. Note that at
2481
+ # least one keyword argument is required. To specify no parameters, or to keep all
2482
+ # the default parameter values, pass an empty Hash as a request object (see above).
2483
+ #
2484
+ # @param external_system [::Google::Cloud::SecurityCenter::V1::ExternalSystem, ::Hash]
2485
+ # Required. The external system resource to update.
2486
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2487
+ # The FieldMask to use when updating the external system resource.
2488
+ #
2489
+ # If empty all mutable fields will be updated.
2490
+ # @yield [result, operation] Access the result along with the TransportOperation object
2491
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V1::ExternalSystem]
2492
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2493
+ #
2494
+ # @return [::Google::Cloud::SecurityCenter::V1::ExternalSystem]
2495
+ #
2496
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2497
+ def update_external_system request, options = nil
2498
+ raise ::ArgumentError, "request must be provided" if request.nil?
2499
+
2500
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest
2501
+
2502
+ # Converts hash and nil to an options object
2503
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2504
+
2505
+ # Customize the options with defaults
2506
+ call_metadata = @config.rpcs.update_external_system.metadata.to_h
2507
+
2508
+ # Set x-goog-api-client and x-goog-user-project headers
2509
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2510
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2511
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
2512
+ transports_version_send: [:rest]
2513
+
2514
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2515
+
2516
+ options.apply_defaults timeout: @config.rpcs.update_external_system.timeout,
2517
+ metadata: call_metadata,
2518
+ retry_policy: @config.rpcs.update_external_system.retry_policy
2519
+
2520
+ options.apply_defaults timeout: @config.timeout,
2521
+ metadata: @config.metadata,
2522
+ retry_policy: @config.retry_policy
2523
+
2524
+ @security_center_stub.update_external_system request, options do |result, operation|
2525
+ yield result, operation if block_given?
2526
+ return result
2527
+ end
2528
+ rescue ::Gapic::Rest::Error => e
2529
+ raise ::Google::Cloud::Error.from_error(e)
2530
+ end
2531
+
2532
+ ##
2533
+ # Creates or updates a finding. The corresponding source must exist for a
2534
+ # finding creation to succeed.
2535
+ #
2536
+ # @overload update_finding(request, options = nil)
2537
+ # Pass arguments to `update_finding` via a request object, either of type
2538
+ # {::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest} or an equivalent Hash.
2539
+ #
2540
+ # @param request [::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest, ::Hash]
2541
+ # A request object representing the call parameters. Required. To specify no
2542
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2543
+ # @param options [::Gapic::CallOptions, ::Hash]
2544
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2545
+ #
2546
+ # @overload update_finding(finding: nil, update_mask: nil)
2547
+ # Pass arguments to `update_finding` via keyword arguments. Note that at
2548
+ # least one keyword argument is required. To specify no parameters, or to keep all
2549
+ # the default parameter values, pass an empty Hash as a request object (see above).
2550
+ #
2551
+ # @param finding [::Google::Cloud::SecurityCenter::V1::Finding, ::Hash]
2552
+ # Required. The finding resource to update or create if it does not already
2553
+ # exist. parent, security_marks, and update_time will be ignored.
2554
+ #
2555
+ # In the case of creation, the finding id portion of the name must be
2556
+ # alphanumeric and less than or equal to 32 characters and greater than 0
2557
+ # characters in length.
2558
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2559
+ # The FieldMask to use when updating the finding resource. This field should
2560
+ # not be specified when creating a finding.
2561
+ #
2562
+ # When updating a finding, an empty mask is treated as updating all mutable
2563
+ # fields and replacing source_properties. Individual source_properties can
2564
+ # be added/updated by using "source_properties.<property key>" in the field
2565
+ # mask.
2566
+ # @yield [result, operation] Access the result along with the TransportOperation object
2567
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Finding]
2568
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2569
+ #
2570
+ # @return [::Google::Cloud::SecurityCenter::V1::Finding]
2571
+ #
2572
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2573
+ def update_finding request, options = nil
2574
+ raise ::ArgumentError, "request must be provided" if request.nil?
2575
+
2576
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateFindingRequest
2577
+
2578
+ # Converts hash and nil to an options object
2579
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2580
+
2581
+ # Customize the options with defaults
2582
+ call_metadata = @config.rpcs.update_finding.metadata.to_h
2583
+
2584
+ # Set x-goog-api-client and x-goog-user-project headers
2585
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2586
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2587
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
2588
+ transports_version_send: [:rest]
2589
+
2590
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2591
+
2592
+ options.apply_defaults timeout: @config.rpcs.update_finding.timeout,
2593
+ metadata: call_metadata,
2594
+ retry_policy: @config.rpcs.update_finding.retry_policy
2595
+
2596
+ options.apply_defaults timeout: @config.timeout,
2597
+ metadata: @config.metadata,
2598
+ retry_policy: @config.retry_policy
2599
+
2600
+ @security_center_stub.update_finding request, options do |result, operation|
2601
+ yield result, operation if block_given?
2602
+ return result
2603
+ end
2604
+ rescue ::Gapic::Rest::Error => e
2605
+ raise ::Google::Cloud::Error.from_error(e)
2606
+ end
2607
+
2608
+ ##
2609
+ # Updates a mute config.
2610
+ #
2611
+ # @overload update_mute_config(request, options = nil)
2612
+ # Pass arguments to `update_mute_config` via a request object, either of type
2613
+ # {::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest} or an equivalent Hash.
2614
+ #
2615
+ # @param request [::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest, ::Hash]
2616
+ # A request object representing the call parameters. Required. To specify no
2617
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2618
+ # @param options [::Gapic::CallOptions, ::Hash]
2619
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2620
+ #
2621
+ # @overload update_mute_config(mute_config: nil, update_mask: nil)
2622
+ # Pass arguments to `update_mute_config` via keyword arguments. Note that at
2623
+ # least one keyword argument is required. To specify no parameters, or to keep all
2624
+ # the default parameter values, pass an empty Hash as a request object (see above).
2625
+ #
2626
+ # @param mute_config [::Google::Cloud::SecurityCenter::V1::MuteConfig, ::Hash]
2627
+ # Required. The mute config being updated.
2628
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2629
+ # The list of fields to be updated.
2630
+ # If empty all mutable fields will be updated.
2631
+ # @yield [result, operation] Access the result along with the TransportOperation object
2632
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V1::MuteConfig]
2633
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2634
+ #
2635
+ # @return [::Google::Cloud::SecurityCenter::V1::MuteConfig]
2636
+ #
2637
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2638
+ def update_mute_config request, options = nil
2639
+ raise ::ArgumentError, "request must be provided" if request.nil?
2640
+
2641
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest
2642
+
2643
+ # Converts hash and nil to an options object
2644
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2645
+
2646
+ # Customize the options with defaults
2647
+ call_metadata = @config.rpcs.update_mute_config.metadata.to_h
2648
+
2649
+ # Set x-goog-api-client and x-goog-user-project headers
2650
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2651
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2652
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
2653
+ transports_version_send: [:rest]
2654
+
2655
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2656
+
2657
+ options.apply_defaults timeout: @config.rpcs.update_mute_config.timeout,
2658
+ metadata: call_metadata,
2659
+ retry_policy: @config.rpcs.update_mute_config.retry_policy
2660
+
2661
+ options.apply_defaults timeout: @config.timeout,
2662
+ metadata: @config.metadata,
2663
+ retry_policy: @config.retry_policy
2664
+
2665
+ @security_center_stub.update_mute_config request, options do |result, operation|
2666
+ yield result, operation if block_given?
2667
+ return result
2668
+ end
2669
+ rescue ::Gapic::Rest::Error => e
2670
+ raise ::Google::Cloud::Error.from_error(e)
2671
+ end
2672
+
2673
+ ##
2674
+ # Updates a notification config. The following update
2675
+ # fields are allowed: description, pubsub_topic, streaming_config.filter
2676
+ #
2677
+ # @overload update_notification_config(request, options = nil)
2678
+ # Pass arguments to `update_notification_config` via a request object, either of type
2679
+ # {::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest} or an equivalent Hash.
2680
+ #
2681
+ # @param request [::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest, ::Hash]
2682
+ # A request object representing the call parameters. Required. To specify no
2683
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2684
+ # @param options [::Gapic::CallOptions, ::Hash]
2685
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2686
+ #
2687
+ # @overload update_notification_config(notification_config: nil, update_mask: nil)
2688
+ # Pass arguments to `update_notification_config` via keyword arguments. Note that at
2689
+ # least one keyword argument is required. To specify no parameters, or to keep all
2690
+ # the default parameter values, pass an empty Hash as a request object (see above).
2691
+ #
2692
+ # @param notification_config [::Google::Cloud::SecurityCenter::V1::NotificationConfig, ::Hash]
2693
+ # Required. The notification config to update.
2694
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2695
+ # The FieldMask to use when updating the notification config.
2696
+ #
2697
+ # If empty all mutable fields will be updated.
2698
+ # @yield [result, operation] Access the result along with the TransportOperation object
2699
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V1::NotificationConfig]
2700
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2701
+ #
2702
+ # @return [::Google::Cloud::SecurityCenter::V1::NotificationConfig]
2703
+ #
2704
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2705
+ def update_notification_config request, options = nil
2706
+ raise ::ArgumentError, "request must be provided" if request.nil?
2707
+
2708
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest
2709
+
2710
+ # Converts hash and nil to an options object
2711
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2712
+
2713
+ # Customize the options with defaults
2714
+ call_metadata = @config.rpcs.update_notification_config.metadata.to_h
2715
+
2716
+ # Set x-goog-api-client and x-goog-user-project headers
2717
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2718
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2719
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
2720
+ transports_version_send: [:rest]
2721
+
2722
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2723
+
2724
+ options.apply_defaults timeout: @config.rpcs.update_notification_config.timeout,
2725
+ metadata: call_metadata,
2726
+ retry_policy: @config.rpcs.update_notification_config.retry_policy
2727
+
2728
+ options.apply_defaults timeout: @config.timeout,
2729
+ metadata: @config.metadata,
2730
+ retry_policy: @config.retry_policy
2731
+
2732
+ @security_center_stub.update_notification_config request, options do |result, operation|
2733
+ yield result, operation if block_given?
2734
+ return result
2735
+ end
2736
+ rescue ::Gapic::Rest::Error => e
2737
+ raise ::Google::Cloud::Error.from_error(e)
2738
+ end
2739
+
2740
+ ##
2741
+ # Updates an organization's settings.
2742
+ #
2743
+ # @overload update_organization_settings(request, options = nil)
2744
+ # Pass arguments to `update_organization_settings` via a request object, either of type
2745
+ # {::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest} or an equivalent Hash.
2746
+ #
2747
+ # @param request [::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest, ::Hash]
2748
+ # A request object representing the call parameters. Required. To specify no
2749
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2750
+ # @param options [::Gapic::CallOptions, ::Hash]
2751
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2752
+ #
2753
+ # @overload update_organization_settings(organization_settings: nil, update_mask: nil)
2754
+ # Pass arguments to `update_organization_settings` via keyword arguments. Note that at
2755
+ # least one keyword argument is required. To specify no parameters, or to keep all
2756
+ # the default parameter values, pass an empty Hash as a request object (see above).
2757
+ #
2758
+ # @param organization_settings [::Google::Cloud::SecurityCenter::V1::OrganizationSettings, ::Hash]
2759
+ # Required. The organization settings resource to update.
2760
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2761
+ # The FieldMask to use when updating the settings resource.
2762
+ #
2763
+ # If empty all mutable fields will be updated.
2764
+ # @yield [result, operation] Access the result along with the TransportOperation object
2765
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V1::OrganizationSettings]
2766
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2767
+ #
2768
+ # @return [::Google::Cloud::SecurityCenter::V1::OrganizationSettings]
2769
+ #
2770
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2771
+ def update_organization_settings request, options = nil
2772
+ raise ::ArgumentError, "request must be provided" if request.nil?
2773
+
2774
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest
2775
+
2776
+ # Converts hash and nil to an options object
2777
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2778
+
2779
+ # Customize the options with defaults
2780
+ call_metadata = @config.rpcs.update_organization_settings.metadata.to_h
2781
+
2782
+ # Set x-goog-api-client and x-goog-user-project headers
2783
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2784
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2785
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
2786
+ transports_version_send: [:rest]
2787
+
2788
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2789
+
2790
+ options.apply_defaults timeout: @config.rpcs.update_organization_settings.timeout,
2791
+ metadata: call_metadata,
2792
+ retry_policy: @config.rpcs.update_organization_settings.retry_policy
2793
+
2794
+ options.apply_defaults timeout: @config.timeout,
2795
+ metadata: @config.metadata,
2796
+ retry_policy: @config.retry_policy
2797
+
2798
+ @security_center_stub.update_organization_settings request, options do |result, operation|
2799
+ yield result, operation if block_given?
2800
+ return result
2801
+ end
2802
+ rescue ::Gapic::Rest::Error => e
2803
+ raise ::Google::Cloud::Error.from_error(e)
2804
+ end
2805
+
2806
+ ##
2807
+ # Updates a source.
2808
+ #
2809
+ # @overload update_source(request, options = nil)
2810
+ # Pass arguments to `update_source` via a request object, either of type
2811
+ # {::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest} or an equivalent Hash.
2812
+ #
2813
+ # @param request [::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest, ::Hash]
2814
+ # A request object representing the call parameters. Required. To specify no
2815
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2816
+ # @param options [::Gapic::CallOptions, ::Hash]
2817
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2818
+ #
2819
+ # @overload update_source(source: nil, update_mask: nil)
2820
+ # Pass arguments to `update_source` via keyword arguments. Note that at
2821
+ # least one keyword argument is required. To specify no parameters, or to keep all
2822
+ # the default parameter values, pass an empty Hash as a request object (see above).
2823
+ #
2824
+ # @param source [::Google::Cloud::SecurityCenter::V1::Source, ::Hash]
2825
+ # Required. The source resource to update.
2826
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2827
+ # The FieldMask to use when updating the source resource.
2828
+ #
2829
+ # If empty all mutable fields will be updated.
2830
+ # @yield [result, operation] Access the result along with the TransportOperation object
2831
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V1::Source]
2832
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2833
+ #
2834
+ # @return [::Google::Cloud::SecurityCenter::V1::Source]
2835
+ #
2836
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2837
+ def update_source request, options = nil
2838
+ raise ::ArgumentError, "request must be provided" if request.nil?
2839
+
2840
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateSourceRequest
2841
+
2842
+ # Converts hash and nil to an options object
2843
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2844
+
2845
+ # Customize the options with defaults
2846
+ call_metadata = @config.rpcs.update_source.metadata.to_h
2847
+
2848
+ # Set x-goog-api-client and x-goog-user-project headers
2849
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2850
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2851
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
2852
+ transports_version_send: [:rest]
2853
+
2854
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2855
+
2856
+ options.apply_defaults timeout: @config.rpcs.update_source.timeout,
2857
+ metadata: call_metadata,
2858
+ retry_policy: @config.rpcs.update_source.retry_policy
2859
+
2860
+ options.apply_defaults timeout: @config.timeout,
2861
+ metadata: @config.metadata,
2862
+ retry_policy: @config.retry_policy
2863
+
2864
+ @security_center_stub.update_source request, options do |result, operation|
2865
+ yield result, operation if block_given?
2866
+ return result
2867
+ end
2868
+ rescue ::Gapic::Rest::Error => e
2869
+ raise ::Google::Cloud::Error.from_error(e)
2870
+ end
2871
+
2872
+ ##
2873
+ # Updates security marks.
2874
+ #
2875
+ # @overload update_security_marks(request, options = nil)
2876
+ # Pass arguments to `update_security_marks` via a request object, either of type
2877
+ # {::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest} or an equivalent Hash.
2878
+ #
2879
+ # @param request [::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest, ::Hash]
2880
+ # A request object representing the call parameters. Required. To specify no
2881
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2882
+ # @param options [::Gapic::CallOptions, ::Hash]
2883
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2884
+ #
2885
+ # @overload update_security_marks(security_marks: nil, update_mask: nil, start_time: nil)
2886
+ # Pass arguments to `update_security_marks` via keyword arguments. Note that at
2887
+ # least one keyword argument is required. To specify no parameters, or to keep all
2888
+ # the default parameter values, pass an empty Hash as a request object (see above).
2889
+ #
2890
+ # @param security_marks [::Google::Cloud::SecurityCenter::V1::SecurityMarks, ::Hash]
2891
+ # Required. The security marks resource to update.
2892
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2893
+ # The FieldMask to use when updating the security marks resource.
2894
+ #
2895
+ # The field mask must not contain duplicate fields.
2896
+ # If empty or set to "marks", all marks will be replaced. Individual
2897
+ # marks can be updated using "marks.<mark_key>".
2898
+ # @param start_time [::Google::Protobuf::Timestamp, ::Hash]
2899
+ # The time at which the updated SecurityMarks take effect.
2900
+ # If not set uses current server time. Updates will be applied to the
2901
+ # SecurityMarks that are active immediately preceding this time. Must be
2902
+ # earlier or equal to the server time.
2903
+ # @yield [result, operation] Access the result along with the TransportOperation object
2904
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V1::SecurityMarks]
2905
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2906
+ #
2907
+ # @return [::Google::Cloud::SecurityCenter::V1::SecurityMarks]
2908
+ #
2909
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2910
+ def update_security_marks request, options = nil
2911
+ raise ::ArgumentError, "request must be provided" if request.nil?
2912
+
2913
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest
2914
+
2915
+ # Converts hash and nil to an options object
2916
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2917
+
2918
+ # Customize the options with defaults
2919
+ call_metadata = @config.rpcs.update_security_marks.metadata.to_h
2920
+
2921
+ # Set x-goog-api-client and x-goog-user-project headers
2922
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2923
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2924
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
2925
+ transports_version_send: [:rest]
2926
+
2927
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2928
+
2929
+ options.apply_defaults timeout: @config.rpcs.update_security_marks.timeout,
2930
+ metadata: call_metadata,
2931
+ retry_policy: @config.rpcs.update_security_marks.retry_policy
2932
+
2933
+ options.apply_defaults timeout: @config.timeout,
2934
+ metadata: @config.metadata,
2935
+ retry_policy: @config.retry_policy
2936
+
2937
+ @security_center_stub.update_security_marks request, options do |result, operation|
2938
+ yield result, operation if block_given?
2939
+ return result
2940
+ end
2941
+ rescue ::Gapic::Rest::Error => e
2942
+ raise ::Google::Cloud::Error.from_error(e)
2943
+ end
2944
+
2945
+ ##
2946
+ # Creates a BigQuery export.
2947
+ #
2948
+ # @overload create_big_query_export(request, options = nil)
2949
+ # Pass arguments to `create_big_query_export` via a request object, either of type
2950
+ # {::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest} or an equivalent Hash.
2951
+ #
2952
+ # @param request [::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest, ::Hash]
2953
+ # A request object representing the call parameters. Required. To specify no
2954
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2955
+ # @param options [::Gapic::CallOptions, ::Hash]
2956
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2957
+ #
2958
+ # @overload create_big_query_export(parent: nil, big_query_export: nil, big_query_export_id: nil)
2959
+ # Pass arguments to `create_big_query_export` via keyword arguments. Note that at
2960
+ # least one keyword argument is required. To specify no parameters, or to keep all
2961
+ # the default parameter values, pass an empty Hash as a request object (see above).
2962
+ #
2963
+ # @param parent [::String]
2964
+ # Required. The name of the parent resource of the new BigQuery export. Its
2965
+ # format is "organizations/[organization_id]", "folders/[folder_id]", or
2966
+ # "projects/[project_id]".
2967
+ # @param big_query_export [::Google::Cloud::SecurityCenter::V1::BigQueryExport, ::Hash]
2968
+ # Required. The BigQuery export being created.
2969
+ # @param big_query_export_id [::String]
2970
+ # Required. Unique identifier provided by the client within the parent scope.
2971
+ # It must consist of lower case letters, numbers, and hyphen, with the first
2972
+ # character a letter, the last a letter or a number, and a 63 character
2973
+ # maximum.
2974
+ # @yield [result, operation] Access the result along with the TransportOperation object
2975
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V1::BigQueryExport]
2976
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2977
+ #
2978
+ # @return [::Google::Cloud::SecurityCenter::V1::BigQueryExport]
2979
+ #
2980
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2981
+ def create_big_query_export request, options = nil
2982
+ raise ::ArgumentError, "request must be provided" if request.nil?
2983
+
2984
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest
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
+ call_metadata = @config.rpcs.create_big_query_export.metadata.to_h
2991
+
2992
+ # Set x-goog-api-client and x-goog-user-project headers
2993
+ call_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::V1::VERSION,
2996
+ transports_version_send: [:rest]
2997
+
2998
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2999
+
3000
+ options.apply_defaults timeout: @config.rpcs.create_big_query_export.timeout,
3001
+ metadata: call_metadata,
3002
+ retry_policy: @config.rpcs.create_big_query_export.retry_policy
3003
+
3004
+ options.apply_defaults timeout: @config.timeout,
3005
+ metadata: @config.metadata,
3006
+ retry_policy: @config.retry_policy
3007
+
3008
+ @security_center_stub.create_big_query_export request, options do |result, operation|
3009
+ yield result, operation if block_given?
3010
+ return result
3011
+ end
3012
+ rescue ::Gapic::Rest::Error => e
3013
+ raise ::Google::Cloud::Error.from_error(e)
3014
+ end
3015
+
3016
+ ##
3017
+ # Deletes an existing BigQuery export.
3018
+ #
3019
+ # @overload delete_big_query_export(request, options = nil)
3020
+ # Pass arguments to `delete_big_query_export` via a request object, either of type
3021
+ # {::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest} or an equivalent Hash.
3022
+ #
3023
+ # @param request [::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest, ::Hash]
3024
+ # A request object representing the call parameters. Required. To specify no
3025
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3026
+ # @param options [::Gapic::CallOptions, ::Hash]
3027
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3028
+ #
3029
+ # @overload delete_big_query_export(name: nil)
3030
+ # Pass arguments to `delete_big_query_export` via keyword arguments. Note that at
3031
+ # least one keyword argument is required. To specify no parameters, or to keep all
3032
+ # the default parameter values, pass an empty Hash as a request object (see above).
3033
+ #
3034
+ # @param name [::String]
3035
+ # Required. The name of the BigQuery export to delete. Its format is
3036
+ # organizations/\\{organization}/bigQueryExports/\\{export_id},
3037
+ # folders/\\{folder}/bigQueryExports/\\{export_id}, or
3038
+ # projects/\\{project}/bigQueryExports/\\{export_id}
3039
+ # @yield [result, operation] Access the result along with the TransportOperation object
3040
+ # @yieldparam result [::Google::Protobuf::Empty]
3041
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3042
+ #
3043
+ # @return [::Google::Protobuf::Empty]
3044
+ #
3045
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3046
+ def delete_big_query_export request, options = nil
3047
+ raise ::ArgumentError, "request must be provided" if request.nil?
3048
+
3049
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest
3050
+
3051
+ # Converts hash and nil to an options object
3052
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3053
+
3054
+ # Customize the options with defaults
3055
+ call_metadata = @config.rpcs.delete_big_query_export.metadata.to_h
3056
+
3057
+ # Set x-goog-api-client and x-goog-user-project headers
3058
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3059
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3060
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
3061
+ transports_version_send: [:rest]
3062
+
3063
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3064
+
3065
+ options.apply_defaults timeout: @config.rpcs.delete_big_query_export.timeout,
3066
+ metadata: call_metadata,
3067
+ retry_policy: @config.rpcs.delete_big_query_export.retry_policy
3068
+
3069
+ options.apply_defaults timeout: @config.timeout,
3070
+ metadata: @config.metadata,
3071
+ retry_policy: @config.retry_policy
3072
+
3073
+ @security_center_stub.delete_big_query_export request, options do |result, operation|
3074
+ yield result, operation if block_given?
3075
+ return result
3076
+ end
3077
+ rescue ::Gapic::Rest::Error => e
3078
+ raise ::Google::Cloud::Error.from_error(e)
3079
+ end
3080
+
3081
+ ##
3082
+ # Updates a BigQuery export.
3083
+ #
3084
+ # @overload update_big_query_export(request, options = nil)
3085
+ # Pass arguments to `update_big_query_export` via a request object, either of type
3086
+ # {::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest} or an equivalent Hash.
3087
+ #
3088
+ # @param request [::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest, ::Hash]
3089
+ # A request object representing the call parameters. Required. To specify no
3090
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3091
+ # @param options [::Gapic::CallOptions, ::Hash]
3092
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3093
+ #
3094
+ # @overload update_big_query_export(big_query_export: nil, update_mask: nil)
3095
+ # Pass arguments to `update_big_query_export` via keyword arguments. Note that at
3096
+ # least one keyword argument is required. To specify no parameters, or to keep all
3097
+ # the default parameter values, pass an empty Hash as a request object (see above).
3098
+ #
3099
+ # @param big_query_export [::Google::Cloud::SecurityCenter::V1::BigQueryExport, ::Hash]
3100
+ # Required. The BigQuery export being updated.
3101
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
3102
+ # The list of fields to be updated.
3103
+ # If empty all mutable fields will be updated.
3104
+ # @yield [result, operation] Access the result along with the TransportOperation object
3105
+ # @yieldparam result [::Google::Cloud::SecurityCenter::V1::BigQueryExport]
3106
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3107
+ #
3108
+ # @return [::Google::Cloud::SecurityCenter::V1::BigQueryExport]
3109
+ #
3110
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3111
+ def update_big_query_export request, options = nil
3112
+ raise ::ArgumentError, "request must be provided" if request.nil?
3113
+
3114
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest
3115
+
3116
+ # Converts hash and nil to an options object
3117
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3118
+
3119
+ # Customize the options with defaults
3120
+ call_metadata = @config.rpcs.update_big_query_export.metadata.to_h
3121
+
3122
+ # Set x-goog-api-client and x-goog-user-project headers
3123
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3124
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3125
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
3126
+ transports_version_send: [:rest]
3127
+
3128
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3129
+
3130
+ options.apply_defaults timeout: @config.rpcs.update_big_query_export.timeout,
3131
+ metadata: call_metadata,
3132
+ retry_policy: @config.rpcs.update_big_query_export.retry_policy
3133
+
3134
+ options.apply_defaults timeout: @config.timeout,
3135
+ metadata: @config.metadata,
3136
+ retry_policy: @config.retry_policy
3137
+
3138
+ @security_center_stub.update_big_query_export request, options do |result, operation|
3139
+ yield result, operation if block_given?
3140
+ return result
3141
+ end
3142
+ rescue ::Gapic::Rest::Error => e
3143
+ raise ::Google::Cloud::Error.from_error(e)
3144
+ end
3145
+
3146
+ ##
3147
+ # Lists BigQuery exports. Note that when requesting BigQuery exports at a
3148
+ # given level all exports under that level are also returned e.g. if
3149
+ # requesting BigQuery exports under a folder, then all BigQuery exports
3150
+ # immediately under the folder plus the ones created under the projects
3151
+ # within the folder are returned.
3152
+ #
3153
+ # @overload list_big_query_exports(request, options = nil)
3154
+ # Pass arguments to `list_big_query_exports` via a request object, either of type
3155
+ # {::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest} or an equivalent Hash.
3156
+ #
3157
+ # @param request [::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest, ::Hash]
3158
+ # A request object representing the call parameters. Required. To specify no
3159
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3160
+ # @param options [::Gapic::CallOptions, ::Hash]
3161
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3162
+ #
3163
+ # @overload list_big_query_exports(parent: nil, page_size: nil, page_token: nil)
3164
+ # Pass arguments to `list_big_query_exports` via keyword arguments. Note that at
3165
+ # least one keyword argument is required. To specify no parameters, or to keep all
3166
+ # the default parameter values, pass an empty Hash as a request object (see above).
3167
+ #
3168
+ # @param parent [::String]
3169
+ # Required. The parent, which owns the collection of BigQuery exports. Its
3170
+ # format is "organizations/[organization_id]", "folders/[folder_id]",
3171
+ # "projects/[project_id]".
3172
+ # @param page_size [::Integer]
3173
+ # The maximum number of configs to return. The service may return fewer than
3174
+ # this value.
3175
+ # If unspecified, at most 10 configs will be returned.
3176
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
3177
+ # @param page_token [::String]
3178
+ # A page token, received from a previous `ListBigQueryExports` call.
3179
+ # Provide this to retrieve the subsequent page.
3180
+ # When paginating, all other parameters provided to `ListBigQueryExports`
3181
+ # must match the call that provided the page token.
3182
+ # @yield [result, operation] Access the result along with the TransportOperation object
3183
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::BigQueryExport>]
3184
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3185
+ #
3186
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1::BigQueryExport>]
3187
+ #
3188
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3189
+ def list_big_query_exports request, options = nil
3190
+ raise ::ArgumentError, "request must be provided" if request.nil?
3191
+
3192
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest
3193
+
3194
+ # Converts hash and nil to an options object
3195
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3196
+
3197
+ # Customize the options with defaults
3198
+ call_metadata = @config.rpcs.list_big_query_exports.metadata.to_h
3199
+
3200
+ # Set x-goog-api-client and x-goog-user-project headers
3201
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3202
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3203
+ gapic_version: ::Google::Cloud::SecurityCenter::V1::VERSION,
3204
+ transports_version_send: [:rest]
3205
+
3206
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3207
+
3208
+ options.apply_defaults timeout: @config.rpcs.list_big_query_exports.timeout,
3209
+ metadata: call_metadata,
3210
+ retry_policy: @config.rpcs.list_big_query_exports.retry_policy
3211
+
3212
+ options.apply_defaults timeout: @config.timeout,
3213
+ metadata: @config.metadata,
3214
+ retry_policy: @config.retry_policy
3215
+
3216
+ @security_center_stub.list_big_query_exports request, options do |result, operation|
3217
+ result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_big_query_exports, "big_query_exports", request, result, options
3218
+ yield result, operation if block_given?
3219
+ return result
3220
+ end
3221
+ rescue ::Gapic::Rest::Error => e
3222
+ raise ::Google::Cloud::Error.from_error(e)
3223
+ end
3224
+
3225
+ ##
3226
+ # Configuration class for the SecurityCenter REST API.
3227
+ #
3228
+ # This class represents the configuration for SecurityCenter REST,
3229
+ # providing control over timeouts, retry behavior, logging, transport
3230
+ # parameters, and other low-level controls. Certain parameters can also be
3231
+ # applied individually to specific RPCs. See
3232
+ # {::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client::Configuration::Rpcs}
3233
+ # for a list of RPCs that can be configured independently.
3234
+ #
3235
+ # Configuration can be applied globally to all clients, or to a single client
3236
+ # on construction.
3237
+ #
3238
+ # @example
3239
+ #
3240
+ # # Modify the global config, setting the timeout for
3241
+ # # bulk_mute_findings to 20 seconds,
3242
+ # # and all remaining timeouts to 10 seconds.
3243
+ # ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.configure do |config|
3244
+ # config.timeout = 10.0
3245
+ # config.rpcs.bulk_mute_findings.timeout = 20.0
3246
+ # end
3247
+ #
3248
+ # # Apply the above configuration only to a new client.
3249
+ # client = ::Google::Cloud::SecurityCenter::V1::SecurityCenter::Rest::Client.new do |config|
3250
+ # config.timeout = 10.0
3251
+ # config.rpcs.bulk_mute_findings.timeout = 20.0
3252
+ # end
3253
+ #
3254
+ # @!attribute [rw] endpoint
3255
+ # The hostname or hostname:port of the service endpoint.
3256
+ # Defaults to `"securitycenter.googleapis.com"`.
3257
+ # @return [::String]
3258
+ # @!attribute [rw] credentials
3259
+ # Credentials to send with calls. You may provide any of the following types:
3260
+ # * (`String`) The path to a service account key file in JSON format
3261
+ # * (`Hash`) A service account key as a Hash
3262
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
3263
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
3264
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
3265
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
3266
+ # * (`nil`) indicating no credentials
3267
+ # @return [::Object]
3268
+ # @!attribute [rw] scope
3269
+ # The OAuth scopes
3270
+ # @return [::Array<::String>]
3271
+ # @!attribute [rw] lib_name
3272
+ # The library name as recorded in instrumentation and logging
3273
+ # @return [::String]
3274
+ # @!attribute [rw] lib_version
3275
+ # The library version as recorded in instrumentation and logging
3276
+ # @return [::String]
3277
+ # @!attribute [rw] timeout
3278
+ # The call timeout in seconds.
3279
+ # @return [::Numeric]
3280
+ # @!attribute [rw] metadata
3281
+ # Additional headers to be sent with the call.
3282
+ # @return [::Hash{::Symbol=>::String}]
3283
+ # @!attribute [rw] retry_policy
3284
+ # The retry policy. The value is a hash with the following keys:
3285
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
3286
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
3287
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
3288
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
3289
+ # trigger a retry.
3290
+ # @return [::Hash]
3291
+ # @!attribute [rw] quota_project
3292
+ # A separate project against which to charge quota.
3293
+ # @return [::String]
3294
+ #
3295
+ class Configuration
3296
+ extend ::Gapic::Config
3297
+
3298
+ config_attr :endpoint, "securitycenter.googleapis.com", ::String
3299
+ config_attr :credentials, nil do |value|
3300
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
3301
+ allowed.any? { |klass| klass === value }
3302
+ end
3303
+ config_attr :scope, nil, ::String, ::Array, nil
3304
+ config_attr :lib_name, nil, ::String, nil
3305
+ config_attr :lib_version, nil, ::String, nil
3306
+ config_attr :timeout, nil, ::Numeric, nil
3307
+ config_attr :metadata, nil, ::Hash, nil
3308
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
3309
+ config_attr :quota_project, nil, ::String, nil
3310
+
3311
+ # @private
3312
+ def initialize parent_config = nil
3313
+ @parent_config = parent_config unless parent_config.nil?
3314
+
3315
+ yield self if block_given?
3316
+ end
3317
+
3318
+ ##
3319
+ # Configurations for individual RPCs
3320
+ # @return [Rpcs]
3321
+ #
3322
+ def rpcs
3323
+ @rpcs ||= begin
3324
+ parent_rpcs = nil
3325
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
3326
+ Rpcs.new parent_rpcs
3327
+ end
3328
+ end
3329
+
3330
+ ##
3331
+ # Configuration RPC class for the SecurityCenter API.
3332
+ #
3333
+ # Includes fields providing the configuration for each RPC in this service.
3334
+ # Each configuration object is of type `Gapic::Config::Method` and includes
3335
+ # the following configuration fields:
3336
+ #
3337
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
3338
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
3339
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
3340
+ # include the following keys:
3341
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
3342
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
3343
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
3344
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
3345
+ # trigger a retry.
3346
+ #
3347
+ class Rpcs
3348
+ ##
3349
+ # RPC-specific configuration for `bulk_mute_findings`
3350
+ # @return [::Gapic::Config::Method]
3351
+ #
3352
+ attr_reader :bulk_mute_findings
3353
+ ##
3354
+ # RPC-specific configuration for `create_source`
3355
+ # @return [::Gapic::Config::Method]
3356
+ #
3357
+ attr_reader :create_source
3358
+ ##
3359
+ # RPC-specific configuration for `create_finding`
3360
+ # @return [::Gapic::Config::Method]
3361
+ #
3362
+ attr_reader :create_finding
3363
+ ##
3364
+ # RPC-specific configuration for `create_mute_config`
3365
+ # @return [::Gapic::Config::Method]
3366
+ #
3367
+ attr_reader :create_mute_config
3368
+ ##
3369
+ # RPC-specific configuration for `create_notification_config`
3370
+ # @return [::Gapic::Config::Method]
3371
+ #
3372
+ attr_reader :create_notification_config
3373
+ ##
3374
+ # RPC-specific configuration for `delete_mute_config`
3375
+ # @return [::Gapic::Config::Method]
3376
+ #
3377
+ attr_reader :delete_mute_config
3378
+ ##
3379
+ # RPC-specific configuration for `delete_notification_config`
3380
+ # @return [::Gapic::Config::Method]
3381
+ #
3382
+ attr_reader :delete_notification_config
3383
+ ##
3384
+ # RPC-specific configuration for `get_big_query_export`
3385
+ # @return [::Gapic::Config::Method]
3386
+ #
3387
+ attr_reader :get_big_query_export
3388
+ ##
3389
+ # RPC-specific configuration for `get_iam_policy`
3390
+ # @return [::Gapic::Config::Method]
3391
+ #
3392
+ attr_reader :get_iam_policy
3393
+ ##
3394
+ # RPC-specific configuration for `get_mute_config`
3395
+ # @return [::Gapic::Config::Method]
3396
+ #
3397
+ attr_reader :get_mute_config
3398
+ ##
3399
+ # RPC-specific configuration for `get_notification_config`
3400
+ # @return [::Gapic::Config::Method]
3401
+ #
3402
+ attr_reader :get_notification_config
3403
+ ##
3404
+ # RPC-specific configuration for `get_organization_settings`
3405
+ # @return [::Gapic::Config::Method]
3406
+ #
3407
+ attr_reader :get_organization_settings
3408
+ ##
3409
+ # RPC-specific configuration for `get_source`
3410
+ # @return [::Gapic::Config::Method]
3411
+ #
3412
+ attr_reader :get_source
3413
+ ##
3414
+ # RPC-specific configuration for `group_assets`
3415
+ # @return [::Gapic::Config::Method]
3416
+ #
3417
+ attr_reader :group_assets
3418
+ ##
3419
+ # RPC-specific configuration for `group_findings`
3420
+ # @return [::Gapic::Config::Method]
3421
+ #
3422
+ attr_reader :group_findings
3423
+ ##
3424
+ # RPC-specific configuration for `list_assets`
3425
+ # @return [::Gapic::Config::Method]
3426
+ #
3427
+ attr_reader :list_assets
3428
+ ##
3429
+ # RPC-specific configuration for `list_findings`
3430
+ # @return [::Gapic::Config::Method]
3431
+ #
3432
+ attr_reader :list_findings
3433
+ ##
3434
+ # RPC-specific configuration for `list_mute_configs`
3435
+ # @return [::Gapic::Config::Method]
3436
+ #
3437
+ attr_reader :list_mute_configs
3438
+ ##
3439
+ # RPC-specific configuration for `list_notification_configs`
3440
+ # @return [::Gapic::Config::Method]
3441
+ #
3442
+ attr_reader :list_notification_configs
3443
+ ##
3444
+ # RPC-specific configuration for `list_sources`
3445
+ # @return [::Gapic::Config::Method]
3446
+ #
3447
+ attr_reader :list_sources
3448
+ ##
3449
+ # RPC-specific configuration for `run_asset_discovery`
3450
+ # @return [::Gapic::Config::Method]
3451
+ #
3452
+ attr_reader :run_asset_discovery
3453
+ ##
3454
+ # RPC-specific configuration for `set_finding_state`
3455
+ # @return [::Gapic::Config::Method]
3456
+ #
3457
+ attr_reader :set_finding_state
3458
+ ##
3459
+ # RPC-specific configuration for `set_mute`
3460
+ # @return [::Gapic::Config::Method]
3461
+ #
3462
+ attr_reader :set_mute
3463
+ ##
3464
+ # RPC-specific configuration for `set_iam_policy`
3465
+ # @return [::Gapic::Config::Method]
3466
+ #
3467
+ attr_reader :set_iam_policy
3468
+ ##
3469
+ # RPC-specific configuration for `test_iam_permissions`
3470
+ # @return [::Gapic::Config::Method]
3471
+ #
3472
+ attr_reader :test_iam_permissions
3473
+ ##
3474
+ # RPC-specific configuration for `update_external_system`
3475
+ # @return [::Gapic::Config::Method]
3476
+ #
3477
+ attr_reader :update_external_system
3478
+ ##
3479
+ # RPC-specific configuration for `update_finding`
3480
+ # @return [::Gapic::Config::Method]
3481
+ #
3482
+ attr_reader :update_finding
3483
+ ##
3484
+ # RPC-specific configuration for `update_mute_config`
3485
+ # @return [::Gapic::Config::Method]
3486
+ #
3487
+ attr_reader :update_mute_config
3488
+ ##
3489
+ # RPC-specific configuration for `update_notification_config`
3490
+ # @return [::Gapic::Config::Method]
3491
+ #
3492
+ attr_reader :update_notification_config
3493
+ ##
3494
+ # RPC-specific configuration for `update_organization_settings`
3495
+ # @return [::Gapic::Config::Method]
3496
+ #
3497
+ attr_reader :update_organization_settings
3498
+ ##
3499
+ # RPC-specific configuration for `update_source`
3500
+ # @return [::Gapic::Config::Method]
3501
+ #
3502
+ attr_reader :update_source
3503
+ ##
3504
+ # RPC-specific configuration for `update_security_marks`
3505
+ # @return [::Gapic::Config::Method]
3506
+ #
3507
+ attr_reader :update_security_marks
3508
+ ##
3509
+ # RPC-specific configuration for `create_big_query_export`
3510
+ # @return [::Gapic::Config::Method]
3511
+ #
3512
+ attr_reader :create_big_query_export
3513
+ ##
3514
+ # RPC-specific configuration for `delete_big_query_export`
3515
+ # @return [::Gapic::Config::Method]
3516
+ #
3517
+ attr_reader :delete_big_query_export
3518
+ ##
3519
+ # RPC-specific configuration for `update_big_query_export`
3520
+ # @return [::Gapic::Config::Method]
3521
+ #
3522
+ attr_reader :update_big_query_export
3523
+ ##
3524
+ # RPC-specific configuration for `list_big_query_exports`
3525
+ # @return [::Gapic::Config::Method]
3526
+ #
3527
+ attr_reader :list_big_query_exports
3528
+
3529
+ # @private
3530
+ def initialize parent_rpcs = nil
3531
+ bulk_mute_findings_config = parent_rpcs.bulk_mute_findings if parent_rpcs.respond_to? :bulk_mute_findings
3532
+ @bulk_mute_findings = ::Gapic::Config::Method.new bulk_mute_findings_config
3533
+ create_source_config = parent_rpcs.create_source if parent_rpcs.respond_to? :create_source
3534
+ @create_source = ::Gapic::Config::Method.new create_source_config
3535
+ create_finding_config = parent_rpcs.create_finding if parent_rpcs.respond_to? :create_finding
3536
+ @create_finding = ::Gapic::Config::Method.new create_finding_config
3537
+ create_mute_config_config = parent_rpcs.create_mute_config if parent_rpcs.respond_to? :create_mute_config
3538
+ @create_mute_config = ::Gapic::Config::Method.new create_mute_config_config
3539
+ create_notification_config_config = parent_rpcs.create_notification_config if parent_rpcs.respond_to? :create_notification_config
3540
+ @create_notification_config = ::Gapic::Config::Method.new create_notification_config_config
3541
+ delete_mute_config_config = parent_rpcs.delete_mute_config if parent_rpcs.respond_to? :delete_mute_config
3542
+ @delete_mute_config = ::Gapic::Config::Method.new delete_mute_config_config
3543
+ delete_notification_config_config = parent_rpcs.delete_notification_config if parent_rpcs.respond_to? :delete_notification_config
3544
+ @delete_notification_config = ::Gapic::Config::Method.new delete_notification_config_config
3545
+ get_big_query_export_config = parent_rpcs.get_big_query_export if parent_rpcs.respond_to? :get_big_query_export
3546
+ @get_big_query_export = ::Gapic::Config::Method.new get_big_query_export_config
3547
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
3548
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
3549
+ get_mute_config_config = parent_rpcs.get_mute_config if parent_rpcs.respond_to? :get_mute_config
3550
+ @get_mute_config = ::Gapic::Config::Method.new get_mute_config_config
3551
+ get_notification_config_config = parent_rpcs.get_notification_config if parent_rpcs.respond_to? :get_notification_config
3552
+ @get_notification_config = ::Gapic::Config::Method.new get_notification_config_config
3553
+ get_organization_settings_config = parent_rpcs.get_organization_settings if parent_rpcs.respond_to? :get_organization_settings
3554
+ @get_organization_settings = ::Gapic::Config::Method.new get_organization_settings_config
3555
+ get_source_config = parent_rpcs.get_source if parent_rpcs.respond_to? :get_source
3556
+ @get_source = ::Gapic::Config::Method.new get_source_config
3557
+ group_assets_config = parent_rpcs.group_assets if parent_rpcs.respond_to? :group_assets
3558
+ @group_assets = ::Gapic::Config::Method.new group_assets_config
3559
+ group_findings_config = parent_rpcs.group_findings if parent_rpcs.respond_to? :group_findings
3560
+ @group_findings = ::Gapic::Config::Method.new group_findings_config
3561
+ list_assets_config = parent_rpcs.list_assets if parent_rpcs.respond_to? :list_assets
3562
+ @list_assets = ::Gapic::Config::Method.new list_assets_config
3563
+ list_findings_config = parent_rpcs.list_findings if parent_rpcs.respond_to? :list_findings
3564
+ @list_findings = ::Gapic::Config::Method.new list_findings_config
3565
+ list_mute_configs_config = parent_rpcs.list_mute_configs if parent_rpcs.respond_to? :list_mute_configs
3566
+ @list_mute_configs = ::Gapic::Config::Method.new list_mute_configs_config
3567
+ list_notification_configs_config = parent_rpcs.list_notification_configs if parent_rpcs.respond_to? :list_notification_configs
3568
+ @list_notification_configs = ::Gapic::Config::Method.new list_notification_configs_config
3569
+ list_sources_config = parent_rpcs.list_sources if parent_rpcs.respond_to? :list_sources
3570
+ @list_sources = ::Gapic::Config::Method.new list_sources_config
3571
+ run_asset_discovery_config = parent_rpcs.run_asset_discovery if parent_rpcs.respond_to? :run_asset_discovery
3572
+ @run_asset_discovery = ::Gapic::Config::Method.new run_asset_discovery_config
3573
+ set_finding_state_config = parent_rpcs.set_finding_state if parent_rpcs.respond_to? :set_finding_state
3574
+ @set_finding_state = ::Gapic::Config::Method.new set_finding_state_config
3575
+ set_mute_config = parent_rpcs.set_mute if parent_rpcs.respond_to? :set_mute
3576
+ @set_mute = ::Gapic::Config::Method.new set_mute_config
3577
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
3578
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
3579
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
3580
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
3581
+ update_external_system_config = parent_rpcs.update_external_system if parent_rpcs.respond_to? :update_external_system
3582
+ @update_external_system = ::Gapic::Config::Method.new update_external_system_config
3583
+ update_finding_config = parent_rpcs.update_finding if parent_rpcs.respond_to? :update_finding
3584
+ @update_finding = ::Gapic::Config::Method.new update_finding_config
3585
+ update_mute_config_config = parent_rpcs.update_mute_config if parent_rpcs.respond_to? :update_mute_config
3586
+ @update_mute_config = ::Gapic::Config::Method.new update_mute_config_config
3587
+ update_notification_config_config = parent_rpcs.update_notification_config if parent_rpcs.respond_to? :update_notification_config
3588
+ @update_notification_config = ::Gapic::Config::Method.new update_notification_config_config
3589
+ update_organization_settings_config = parent_rpcs.update_organization_settings if parent_rpcs.respond_to? :update_organization_settings
3590
+ @update_organization_settings = ::Gapic::Config::Method.new update_organization_settings_config
3591
+ update_source_config = parent_rpcs.update_source if parent_rpcs.respond_to? :update_source
3592
+ @update_source = ::Gapic::Config::Method.new update_source_config
3593
+ update_security_marks_config = parent_rpcs.update_security_marks if parent_rpcs.respond_to? :update_security_marks
3594
+ @update_security_marks = ::Gapic::Config::Method.new update_security_marks_config
3595
+ create_big_query_export_config = parent_rpcs.create_big_query_export if parent_rpcs.respond_to? :create_big_query_export
3596
+ @create_big_query_export = ::Gapic::Config::Method.new create_big_query_export_config
3597
+ delete_big_query_export_config = parent_rpcs.delete_big_query_export if parent_rpcs.respond_to? :delete_big_query_export
3598
+ @delete_big_query_export = ::Gapic::Config::Method.new delete_big_query_export_config
3599
+ update_big_query_export_config = parent_rpcs.update_big_query_export if parent_rpcs.respond_to? :update_big_query_export
3600
+ @update_big_query_export = ::Gapic::Config::Method.new update_big_query_export_config
3601
+ list_big_query_exports_config = parent_rpcs.list_big_query_exports if parent_rpcs.respond_to? :list_big_query_exports
3602
+ @list_big_query_exports = ::Gapic::Config::Method.new list_big_query_exports_config
3603
+
3604
+ yield self if block_given?
3605
+ end
3606
+ end
3607
+ end
3608
+ end
3609
+ end
3610
+ end
3611
+ end
3612
+ end
3613
+ end
3614
+ end