google-cloud-security_center-v1p1beta1 0.8.0 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +1 -1
- data/README.md +12 -7
- data/lib/google/cloud/security_center/v1p1beta1/rest.rb +37 -0
- data/lib/google/cloud/security_center/v1p1beta1/security_center/client.rb +28 -40
- data/lib/google/cloud/security_center/v1p1beta1/security_center/operations.rb +15 -14
- data/lib/google/cloud/security_center/v1p1beta1/security_center/rest/client.rb +2575 -0
- data/lib/google/cloud/security_center/v1p1beta1/security_center/rest/operations.rb +793 -0
- data/lib/google/cloud/security_center/v1p1beta1/security_center/rest/service_stub.rb +1566 -0
- data/lib/google/cloud/security_center/v1p1beta1/security_center/rest.rb +53 -0
- data/lib/google/cloud/security_center/v1p1beta1/security_center.rb +7 -1
- data/lib/google/cloud/security_center/v1p1beta1/version.rb +1 -1
- data/lib/google/cloud/security_center/v1p1beta1.rb +7 -2
- data/lib/google/cloud/securitycenter/v1p1beta1/asset_pb.rb +2 -2
- data/lib/google/cloud/securitycenter/v1p1beta1/finding_pb.rb +2 -2
- data/lib/google/cloud/securitycenter/v1p1beta1/folder_pb.rb +0 -1
- data/lib/google/cloud/securitycenter/v1p1beta1/notification_config_pb.rb +2 -2
- data/lib/google/cloud/securitycenter/v1p1beta1/notification_message_pb.rb +2 -2
- data/lib/google/cloud/securitycenter/v1p1beta1/organization_settings_pb.rb +2 -2
- data/lib/google/cloud/securitycenter/v1p1beta1/resource_pb.rb +2 -2
- data/lib/google/cloud/securitycenter/v1p1beta1/run_asset_discovery_response_pb.rb +2 -2
- data/lib/google/cloud/securitycenter/v1p1beta1/security_marks_pb.rb +2 -2
- data/lib/google/cloud/securitycenter/v1p1beta1/securitycenter_service_pb.rb +2 -1
- data/lib/google/cloud/securitycenter/v1p1beta1/source_pb.rb +2 -2
- data/proto_docs/google/api/client.rb +318 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/protobuf/any.rb +3 -3
- data/proto_docs/google/protobuf/empty.rb +0 -2
- data/proto_docs/google/protobuf/struct.rb +2 -2
- data/proto_docs/google/rpc/status.rb +4 -2
- metadata +21 -13
@@ -0,0 +1,2575 @@
|
|
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/v1p1beta1/securitycenter_service_pb"
|
21
|
+
require "google/cloud/security_center/v1p1beta1/security_center/rest/service_stub"
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Cloud
|
25
|
+
module SecurityCenter
|
26
|
+
module V1p1beta1
|
27
|
+
module SecurityCenter
|
28
|
+
module Rest
|
29
|
+
##
|
30
|
+
# REST client for the SecurityCenter service.
|
31
|
+
#
|
32
|
+
# V1p1Beta1 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::V1p1beta1::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::V1p1beta1::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", "V1p1beta1"]
|
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::V1p1beta1::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::V1p1beta1::SecurityCenter::Rest::Client.new
|
181
|
+
#
|
182
|
+
# # Create a client using a custom configuration
|
183
|
+
# client = ::Google::Cloud::SecurityCenter::V1p1beta1::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::V1p1beta1::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::V1p1beta1::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::V1p1beta1::SecurityCenter::Rest::Operations]
|
225
|
+
#
|
226
|
+
attr_reader :operations_client
|
227
|
+
|
228
|
+
# Service calls
|
229
|
+
|
230
|
+
##
|
231
|
+
# Creates a source.
|
232
|
+
#
|
233
|
+
# @overload create_source(request, options = nil)
|
234
|
+
# Pass arguments to `create_source` via a request object, either of type
|
235
|
+
# {::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest} or an equivalent Hash.
|
236
|
+
#
|
237
|
+
# @param request [::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest, ::Hash]
|
238
|
+
# A request object representing the call parameters. Required. To specify no
|
239
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
240
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
241
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
242
|
+
#
|
243
|
+
# @overload create_source(parent: nil, source: nil)
|
244
|
+
# Pass arguments to `create_source` via keyword arguments. Note that at
|
245
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
246
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
247
|
+
#
|
248
|
+
# @param parent [::String]
|
249
|
+
# Required. Resource name of the new source's parent. Its format should be
|
250
|
+
# "organizations/[organization_id]".
|
251
|
+
# @param source [::Google::Cloud::SecurityCenter::V1p1beta1::Source, ::Hash]
|
252
|
+
# Required. The Source being created, only the display_name and description will be
|
253
|
+
# used. All other fields will be ignored.
|
254
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
255
|
+
# @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::Source]
|
256
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
257
|
+
#
|
258
|
+
# @return [::Google::Cloud::SecurityCenter::V1p1beta1::Source]
|
259
|
+
#
|
260
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
261
|
+
def create_source request, options = nil
|
262
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
263
|
+
|
264
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest
|
265
|
+
|
266
|
+
# Converts hash and nil to an options object
|
267
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
268
|
+
|
269
|
+
# Customize the options with defaults
|
270
|
+
call_metadata = @config.rpcs.create_source.metadata.to_h
|
271
|
+
|
272
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
273
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
274
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
275
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION,
|
276
|
+
transports_version_send: [:rest]
|
277
|
+
|
278
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
279
|
+
|
280
|
+
options.apply_defaults timeout: @config.rpcs.create_source.timeout,
|
281
|
+
metadata: call_metadata,
|
282
|
+
retry_policy: @config.rpcs.create_source.retry_policy
|
283
|
+
|
284
|
+
options.apply_defaults timeout: @config.timeout,
|
285
|
+
metadata: @config.metadata,
|
286
|
+
retry_policy: @config.retry_policy
|
287
|
+
|
288
|
+
@security_center_stub.create_source request, options do |result, operation|
|
289
|
+
yield result, operation if block_given?
|
290
|
+
return result
|
291
|
+
end
|
292
|
+
rescue ::Gapic::Rest::Error => e
|
293
|
+
raise ::Google::Cloud::Error.from_error(e)
|
294
|
+
end
|
295
|
+
|
296
|
+
##
|
297
|
+
# Creates a finding. The corresponding source must exist for finding
|
298
|
+
# creation to succeed.
|
299
|
+
#
|
300
|
+
# @overload create_finding(request, options = nil)
|
301
|
+
# Pass arguments to `create_finding` via a request object, either of type
|
302
|
+
# {::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest} or an equivalent Hash.
|
303
|
+
#
|
304
|
+
# @param request [::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest, ::Hash]
|
305
|
+
# A request object representing the call parameters. Required. To specify no
|
306
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
307
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
308
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
309
|
+
#
|
310
|
+
# @overload create_finding(parent: nil, finding_id: nil, finding: nil)
|
311
|
+
# Pass arguments to `create_finding` via keyword arguments. Note that at
|
312
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
313
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
314
|
+
#
|
315
|
+
# @param parent [::String]
|
316
|
+
# Required. Resource name of the new finding's parent. Its format should be
|
317
|
+
# "organizations/[organization_id]/sources/[source_id]".
|
318
|
+
# @param finding_id [::String]
|
319
|
+
# Required. Unique identifier provided by the client within the parent scope.
|
320
|
+
# @param finding [::Google::Cloud::SecurityCenter::V1p1beta1::Finding, ::Hash]
|
321
|
+
# Required. The Finding being created. The name and security_marks will be ignored as
|
322
|
+
# they are both output only fields on this resource.
|
323
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
324
|
+
# @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::Finding]
|
325
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
326
|
+
#
|
327
|
+
# @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding]
|
328
|
+
#
|
329
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
330
|
+
def create_finding request, options = nil
|
331
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
332
|
+
|
333
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest
|
334
|
+
|
335
|
+
# Converts hash and nil to an options object
|
336
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
337
|
+
|
338
|
+
# Customize the options with defaults
|
339
|
+
call_metadata = @config.rpcs.create_finding.metadata.to_h
|
340
|
+
|
341
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
342
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
343
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
344
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION,
|
345
|
+
transports_version_send: [:rest]
|
346
|
+
|
347
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
348
|
+
|
349
|
+
options.apply_defaults timeout: @config.rpcs.create_finding.timeout,
|
350
|
+
metadata: call_metadata,
|
351
|
+
retry_policy: @config.rpcs.create_finding.retry_policy
|
352
|
+
|
353
|
+
options.apply_defaults timeout: @config.timeout,
|
354
|
+
metadata: @config.metadata,
|
355
|
+
retry_policy: @config.retry_policy
|
356
|
+
|
357
|
+
@security_center_stub.create_finding request, options do |result, operation|
|
358
|
+
yield result, operation if block_given?
|
359
|
+
return result
|
360
|
+
end
|
361
|
+
rescue ::Gapic::Rest::Error => e
|
362
|
+
raise ::Google::Cloud::Error.from_error(e)
|
363
|
+
end
|
364
|
+
|
365
|
+
##
|
366
|
+
# Creates a notification config.
|
367
|
+
#
|
368
|
+
# @overload create_notification_config(request, options = nil)
|
369
|
+
# Pass arguments to `create_notification_config` via a request object, either of type
|
370
|
+
# {::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest} or an equivalent Hash.
|
371
|
+
#
|
372
|
+
# @param request [::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest, ::Hash]
|
373
|
+
# A request object representing the call parameters. Required. To specify no
|
374
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
375
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
376
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
377
|
+
#
|
378
|
+
# @overload create_notification_config(parent: nil, config_id: nil, notification_config: nil)
|
379
|
+
# Pass arguments to `create_notification_config` via keyword arguments. Note that at
|
380
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
381
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
382
|
+
#
|
383
|
+
# @param parent [::String]
|
384
|
+
# Required. Resource name of the new notification config's parent. Its format is
|
385
|
+
# "organizations/[organization_id]".
|
386
|
+
# @param config_id [::String]
|
387
|
+
# Required. Unique identifier provided by the client within the parent scope.
|
388
|
+
# It must be between 1 and 128 characters, and contains alphanumeric
|
389
|
+
# characters, underscores or hyphens only.
|
390
|
+
# @param notification_config [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig, ::Hash]
|
391
|
+
# Required. The notification config being created. The name and the service account
|
392
|
+
# will be ignored as they are both output only fields on this resource.
|
393
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
394
|
+
# @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig]
|
395
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
396
|
+
#
|
397
|
+
# @return [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig]
|
398
|
+
#
|
399
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
400
|
+
def create_notification_config request, options = nil
|
401
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
402
|
+
|
403
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest
|
404
|
+
|
405
|
+
# Converts hash and nil to an options object
|
406
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
407
|
+
|
408
|
+
# Customize the options with defaults
|
409
|
+
call_metadata = @config.rpcs.create_notification_config.metadata.to_h
|
410
|
+
|
411
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
412
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
413
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
414
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION,
|
415
|
+
transports_version_send: [:rest]
|
416
|
+
|
417
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
418
|
+
|
419
|
+
options.apply_defaults timeout: @config.rpcs.create_notification_config.timeout,
|
420
|
+
metadata: call_metadata,
|
421
|
+
retry_policy: @config.rpcs.create_notification_config.retry_policy
|
422
|
+
|
423
|
+
options.apply_defaults timeout: @config.timeout,
|
424
|
+
metadata: @config.metadata,
|
425
|
+
retry_policy: @config.retry_policy
|
426
|
+
|
427
|
+
@security_center_stub.create_notification_config request, options do |result, operation|
|
428
|
+
yield result, operation if block_given?
|
429
|
+
return result
|
430
|
+
end
|
431
|
+
rescue ::Gapic::Rest::Error => e
|
432
|
+
raise ::Google::Cloud::Error.from_error(e)
|
433
|
+
end
|
434
|
+
|
435
|
+
##
|
436
|
+
# Deletes a notification config.
|
437
|
+
#
|
438
|
+
# @overload delete_notification_config(request, options = nil)
|
439
|
+
# Pass arguments to `delete_notification_config` via a request object, either of type
|
440
|
+
# {::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest} or an equivalent Hash.
|
441
|
+
#
|
442
|
+
# @param request [::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest, ::Hash]
|
443
|
+
# A request object representing the call parameters. Required. To specify no
|
444
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
445
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
446
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
447
|
+
#
|
448
|
+
# @overload delete_notification_config(name: nil)
|
449
|
+
# Pass arguments to `delete_notification_config` via keyword arguments. Note that at
|
450
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
451
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
452
|
+
#
|
453
|
+
# @param name [::String]
|
454
|
+
# Required. Name of the notification config to delete. Its format is
|
455
|
+
# "organizations/[organization_id]/notificationConfigs/[config_id]".
|
456
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
457
|
+
# @yieldparam result [::Google::Protobuf::Empty]
|
458
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
459
|
+
#
|
460
|
+
# @return [::Google::Protobuf::Empty]
|
461
|
+
#
|
462
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
463
|
+
def delete_notification_config request, options = nil
|
464
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
465
|
+
|
466
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest
|
467
|
+
|
468
|
+
# Converts hash and nil to an options object
|
469
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
470
|
+
|
471
|
+
# Customize the options with defaults
|
472
|
+
call_metadata = @config.rpcs.delete_notification_config.metadata.to_h
|
473
|
+
|
474
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
475
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
476
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
477
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION,
|
478
|
+
transports_version_send: [:rest]
|
479
|
+
|
480
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
481
|
+
|
482
|
+
options.apply_defaults timeout: @config.rpcs.delete_notification_config.timeout,
|
483
|
+
metadata: call_metadata,
|
484
|
+
retry_policy: @config.rpcs.delete_notification_config.retry_policy
|
485
|
+
|
486
|
+
options.apply_defaults timeout: @config.timeout,
|
487
|
+
metadata: @config.metadata,
|
488
|
+
retry_policy: @config.retry_policy
|
489
|
+
|
490
|
+
@security_center_stub.delete_notification_config request, options do |result, operation|
|
491
|
+
yield result, operation if block_given?
|
492
|
+
return result
|
493
|
+
end
|
494
|
+
rescue ::Gapic::Rest::Error => e
|
495
|
+
raise ::Google::Cloud::Error.from_error(e)
|
496
|
+
end
|
497
|
+
|
498
|
+
##
|
499
|
+
# Gets the access control policy on the specified Source.
|
500
|
+
#
|
501
|
+
# @overload get_iam_policy(request, options = nil)
|
502
|
+
# Pass arguments to `get_iam_policy` via a request object, either of type
|
503
|
+
# {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
|
504
|
+
#
|
505
|
+
# @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash]
|
506
|
+
# A request object representing the call parameters. Required. To specify no
|
507
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
508
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
509
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
510
|
+
#
|
511
|
+
# @overload get_iam_policy(resource: nil, options: nil)
|
512
|
+
# Pass arguments to `get_iam_policy` via keyword arguments. Note that at
|
513
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
514
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
515
|
+
#
|
516
|
+
# @param resource [::String]
|
517
|
+
# REQUIRED: The resource for which the policy is being requested.
|
518
|
+
# See the operation documentation for the appropriate value for this field.
|
519
|
+
# @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
|
520
|
+
# OPTIONAL: A `GetPolicyOptions` object for specifying options to
|
521
|
+
# `GetIamPolicy`.
|
522
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
523
|
+
# @yieldparam result [::Google::Iam::V1::Policy]
|
524
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
525
|
+
#
|
526
|
+
# @return [::Google::Iam::V1::Policy]
|
527
|
+
#
|
528
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
529
|
+
def get_iam_policy request, options = nil
|
530
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
531
|
+
|
532
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest
|
533
|
+
|
534
|
+
# Converts hash and nil to an options object
|
535
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
536
|
+
|
537
|
+
# Customize the options with defaults
|
538
|
+
call_metadata = @config.rpcs.get_iam_policy.metadata.to_h
|
539
|
+
|
540
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
541
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
542
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
543
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION,
|
544
|
+
transports_version_send: [:rest]
|
545
|
+
|
546
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
547
|
+
|
548
|
+
options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
|
549
|
+
metadata: call_metadata,
|
550
|
+
retry_policy: @config.rpcs.get_iam_policy.retry_policy
|
551
|
+
|
552
|
+
options.apply_defaults timeout: @config.timeout,
|
553
|
+
metadata: @config.metadata,
|
554
|
+
retry_policy: @config.retry_policy
|
555
|
+
|
556
|
+
@security_center_stub.get_iam_policy request, options do |result, operation|
|
557
|
+
yield result, operation if block_given?
|
558
|
+
return result
|
559
|
+
end
|
560
|
+
rescue ::Gapic::Rest::Error => e
|
561
|
+
raise ::Google::Cloud::Error.from_error(e)
|
562
|
+
end
|
563
|
+
|
564
|
+
##
|
565
|
+
# Gets a notification config.
|
566
|
+
#
|
567
|
+
# @overload get_notification_config(request, options = nil)
|
568
|
+
# Pass arguments to `get_notification_config` via a request object, either of type
|
569
|
+
# {::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest} or an equivalent Hash.
|
570
|
+
#
|
571
|
+
# @param request [::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest, ::Hash]
|
572
|
+
# A request object representing the call parameters. Required. To specify no
|
573
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
574
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
575
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
576
|
+
#
|
577
|
+
# @overload get_notification_config(name: nil)
|
578
|
+
# Pass arguments to `get_notification_config` via keyword arguments. Note that at
|
579
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
580
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
581
|
+
#
|
582
|
+
# @param name [::String]
|
583
|
+
# Required. Name of the notification config to get. Its format is
|
584
|
+
# "organizations/[organization_id]/notificationConfigs/[config_id]".
|
585
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
586
|
+
# @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig]
|
587
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
588
|
+
#
|
589
|
+
# @return [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig]
|
590
|
+
#
|
591
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
592
|
+
def get_notification_config request, options = nil
|
593
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
594
|
+
|
595
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest
|
596
|
+
|
597
|
+
# Converts hash and nil to an options object
|
598
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
599
|
+
|
600
|
+
# Customize the options with defaults
|
601
|
+
call_metadata = @config.rpcs.get_notification_config.metadata.to_h
|
602
|
+
|
603
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
604
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
605
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
606
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION,
|
607
|
+
transports_version_send: [:rest]
|
608
|
+
|
609
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
610
|
+
|
611
|
+
options.apply_defaults timeout: @config.rpcs.get_notification_config.timeout,
|
612
|
+
metadata: call_metadata,
|
613
|
+
retry_policy: @config.rpcs.get_notification_config.retry_policy
|
614
|
+
|
615
|
+
options.apply_defaults timeout: @config.timeout,
|
616
|
+
metadata: @config.metadata,
|
617
|
+
retry_policy: @config.retry_policy
|
618
|
+
|
619
|
+
@security_center_stub.get_notification_config request, options do |result, operation|
|
620
|
+
yield result, operation if block_given?
|
621
|
+
return result
|
622
|
+
end
|
623
|
+
rescue ::Gapic::Rest::Error => e
|
624
|
+
raise ::Google::Cloud::Error.from_error(e)
|
625
|
+
end
|
626
|
+
|
627
|
+
##
|
628
|
+
# Gets the settings for an organization.
|
629
|
+
#
|
630
|
+
# @overload get_organization_settings(request, options = nil)
|
631
|
+
# Pass arguments to `get_organization_settings` via a request object, either of type
|
632
|
+
# {::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest} or an equivalent Hash.
|
633
|
+
#
|
634
|
+
# @param request [::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest, ::Hash]
|
635
|
+
# A request object representing the call parameters. Required. To specify no
|
636
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
637
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
638
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
639
|
+
#
|
640
|
+
# @overload get_organization_settings(name: nil)
|
641
|
+
# Pass arguments to `get_organization_settings` via keyword arguments. Note that at
|
642
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
643
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
644
|
+
#
|
645
|
+
# @param name [::String]
|
646
|
+
# Required. Name of the organization to get organization settings for. Its format is
|
647
|
+
# "organizations/[organization_id]/organizationSettings".
|
648
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
649
|
+
# @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings]
|
650
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
651
|
+
#
|
652
|
+
# @return [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings]
|
653
|
+
#
|
654
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
655
|
+
def get_organization_settings request, options = nil
|
656
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
657
|
+
|
658
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest
|
659
|
+
|
660
|
+
# Converts hash and nil to an options object
|
661
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
662
|
+
|
663
|
+
# Customize the options with defaults
|
664
|
+
call_metadata = @config.rpcs.get_organization_settings.metadata.to_h
|
665
|
+
|
666
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
667
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
668
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
669
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION,
|
670
|
+
transports_version_send: [:rest]
|
671
|
+
|
672
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
673
|
+
|
674
|
+
options.apply_defaults timeout: @config.rpcs.get_organization_settings.timeout,
|
675
|
+
metadata: call_metadata,
|
676
|
+
retry_policy: @config.rpcs.get_organization_settings.retry_policy
|
677
|
+
|
678
|
+
options.apply_defaults timeout: @config.timeout,
|
679
|
+
metadata: @config.metadata,
|
680
|
+
retry_policy: @config.retry_policy
|
681
|
+
|
682
|
+
@security_center_stub.get_organization_settings request, options do |result, operation|
|
683
|
+
yield result, operation if block_given?
|
684
|
+
return result
|
685
|
+
end
|
686
|
+
rescue ::Gapic::Rest::Error => e
|
687
|
+
raise ::Google::Cloud::Error.from_error(e)
|
688
|
+
end
|
689
|
+
|
690
|
+
##
|
691
|
+
# Gets a source.
|
692
|
+
#
|
693
|
+
# @overload get_source(request, options = nil)
|
694
|
+
# Pass arguments to `get_source` via a request object, either of type
|
695
|
+
# {::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest} or an equivalent Hash.
|
696
|
+
#
|
697
|
+
# @param request [::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest, ::Hash]
|
698
|
+
# A request object representing the call parameters. Required. To specify no
|
699
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
700
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
701
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
702
|
+
#
|
703
|
+
# @overload get_source(name: nil)
|
704
|
+
# Pass arguments to `get_source` via keyword arguments. Note that at
|
705
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
706
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
707
|
+
#
|
708
|
+
# @param name [::String]
|
709
|
+
# Required. Relative resource name of the source. Its format is
|
710
|
+
# "organizations/[organization_id]/source/[source_id]".
|
711
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
712
|
+
# @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::Source]
|
713
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
714
|
+
#
|
715
|
+
# @return [::Google::Cloud::SecurityCenter::V1p1beta1::Source]
|
716
|
+
#
|
717
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
718
|
+
def get_source request, options = nil
|
719
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
720
|
+
|
721
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest
|
722
|
+
|
723
|
+
# Converts hash and nil to an options object
|
724
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
725
|
+
|
726
|
+
# Customize the options with defaults
|
727
|
+
call_metadata = @config.rpcs.get_source.metadata.to_h
|
728
|
+
|
729
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
730
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
731
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
732
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION,
|
733
|
+
transports_version_send: [:rest]
|
734
|
+
|
735
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
736
|
+
|
737
|
+
options.apply_defaults timeout: @config.rpcs.get_source.timeout,
|
738
|
+
metadata: call_metadata,
|
739
|
+
retry_policy: @config.rpcs.get_source.retry_policy
|
740
|
+
|
741
|
+
options.apply_defaults timeout: @config.timeout,
|
742
|
+
metadata: @config.metadata,
|
743
|
+
retry_policy: @config.retry_policy
|
744
|
+
|
745
|
+
@security_center_stub.get_source request, options do |result, operation|
|
746
|
+
yield result, operation if block_given?
|
747
|
+
return result
|
748
|
+
end
|
749
|
+
rescue ::Gapic::Rest::Error => e
|
750
|
+
raise ::Google::Cloud::Error.from_error(e)
|
751
|
+
end
|
752
|
+
|
753
|
+
##
|
754
|
+
# Filters an organization's assets and groups them by their specified
|
755
|
+
# properties.
|
756
|
+
#
|
757
|
+
# @overload group_assets(request, options = nil)
|
758
|
+
# Pass arguments to `group_assets` via a request object, either of type
|
759
|
+
# {::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest} or an equivalent Hash.
|
760
|
+
#
|
761
|
+
# @param request [::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest, ::Hash]
|
762
|
+
# A request object representing the call parameters. Required. To specify no
|
763
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
764
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
765
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
766
|
+
#
|
767
|
+
# @overload group_assets(parent: nil, filter: nil, group_by: nil, compare_duration: nil, read_time: nil, page_token: nil, page_size: nil)
|
768
|
+
# Pass arguments to `group_assets` via keyword arguments. Note that at
|
769
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
770
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
771
|
+
#
|
772
|
+
# @param parent [::String]
|
773
|
+
# Required. Name of the organization to groupBy. Its format is
|
774
|
+
# "organizations/[organization_id], folders/[folder_id], or
|
775
|
+
# projects/[project_id]".
|
776
|
+
# @param filter [::String]
|
777
|
+
# Expression that defines the filter to apply across assets.
|
778
|
+
# The expression is a list of zero or more restrictions combined via logical
|
779
|
+
# operators `AND` and `OR`.
|
780
|
+
# Parentheses are supported, and `OR` has higher precedence than `AND`.
|
781
|
+
#
|
782
|
+
# Restrictions have the form `<field> <operator> <value>` and may have a `-`
|
783
|
+
# character in front of them to indicate negation. The fields map to those
|
784
|
+
# defined in the Asset resource. Examples include:
|
785
|
+
#
|
786
|
+
# * name
|
787
|
+
# * security_center_properties.resource_name
|
788
|
+
# * resource_properties.a_property
|
789
|
+
# * security_marks.marks.marka
|
790
|
+
#
|
791
|
+
# The supported operators are:
|
792
|
+
#
|
793
|
+
# * `=` for all value types.
|
794
|
+
# * `>`, `<`, `>=`, `<=` for integer values.
|
795
|
+
# * `:`, meaning substring matching, for strings.
|
796
|
+
#
|
797
|
+
# The supported value types are:
|
798
|
+
#
|
799
|
+
# * string literals in quotes.
|
800
|
+
# * integer literals without quotes.
|
801
|
+
# * boolean literals `true` and `false` without quotes.
|
802
|
+
#
|
803
|
+
# The following field and operator combinations are supported:
|
804
|
+
#
|
805
|
+
# * name: `=`
|
806
|
+
# * update_time: `=`, `>`, `<`, `>=`, `<=`
|
807
|
+
#
|
808
|
+
# Usage: This should be milliseconds since epoch or an RFC3339 string.
|
809
|
+
# Examples:
|
810
|
+
# `update_time = "2019-06-10T16:07:18-07:00"`
|
811
|
+
# `update_time = 1560208038000`
|
812
|
+
#
|
813
|
+
# * create_time: `=`, `>`, `<`, `>=`, `<=`
|
814
|
+
#
|
815
|
+
# Usage: This should be milliseconds since epoch or an RFC3339 string.
|
816
|
+
# Examples:
|
817
|
+
# `create_time = "2019-06-10T16:07:18-07:00"`
|
818
|
+
# `create_time = 1560208038000`
|
819
|
+
#
|
820
|
+
# * iam_policy.policy_blob: `=`, `:`
|
821
|
+
# * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
|
822
|
+
# * security_marks.marks: `=`, `:`
|
823
|
+
# * security_center_properties.resource_name: `=`, `:`
|
824
|
+
# * security_center_properties.resource_name_display_name: `=`, `:`
|
825
|
+
# * security_center_properties.resource_type: `=`, `:`
|
826
|
+
# * security_center_properties.resource_parent: `=`, `:`
|
827
|
+
# * security_center_properties.resource_parent_display_name: `=`, `:`
|
828
|
+
# * security_center_properties.resource_project: `=`, `:`
|
829
|
+
# * security_center_properties.resource_project_display_name: `=`, `:`
|
830
|
+
# * security_center_properties.resource_owners: `=`, `:`
|
831
|
+
#
|
832
|
+
# For example, `resource_properties.size = 100` is a valid filter string.
|
833
|
+
#
|
834
|
+
# Use a partial match on the empty string to filter based on a property
|
835
|
+
# existing: `resource_properties.my_property : ""`
|
836
|
+
#
|
837
|
+
# Use a negated partial match on the empty string to filter based on a
|
838
|
+
# property not existing: `-resource_properties.my_property : ""`
|
839
|
+
# @param group_by [::String]
|
840
|
+
# Required. Expression that defines what assets fields to use for grouping. The string
|
841
|
+
# value should follow SQL syntax: comma separated list of fields. For
|
842
|
+
# example:
|
843
|
+
# "security_center_properties.resource_project,security_center_properties.project".
|
844
|
+
#
|
845
|
+
# The following fields are supported when compare_duration is not set:
|
846
|
+
#
|
847
|
+
# * security_center_properties.resource_project
|
848
|
+
# * security_center_properties.resource_project_display_name
|
849
|
+
# * security_center_properties.resource_type
|
850
|
+
# * security_center_properties.resource_parent
|
851
|
+
# * security_center_properties.resource_parent_display_name
|
852
|
+
#
|
853
|
+
# The following fields are supported when compare_duration is set:
|
854
|
+
#
|
855
|
+
# * security_center_properties.resource_type
|
856
|
+
# * security_center_properties.resource_project_display_name
|
857
|
+
# * security_center_properties.resource_parent_display_name
|
858
|
+
# @param compare_duration [::Google::Protobuf::Duration, ::Hash]
|
859
|
+
# When compare_duration is set, the GroupResult's "state_change" property is
|
860
|
+
# updated to indicate whether the asset was added, removed, or remained
|
861
|
+
# present during the compare_duration period of time that precedes the
|
862
|
+
# read_time. This is the time between (read_time - compare_duration) and
|
863
|
+
# read_time.
|
864
|
+
#
|
865
|
+
# The state change value is derived based on the presence of the asset at the
|
866
|
+
# two points in time. Intermediate state changes between the two times don't
|
867
|
+
# affect the result. For example, the results aren't affected if the asset is
|
868
|
+
# removed and re-created again.
|
869
|
+
#
|
870
|
+
# Possible "state_change" values when compare_duration is specified:
|
871
|
+
#
|
872
|
+
# * "ADDED": indicates that the asset was not present at the start of
|
873
|
+
# compare_duration, but present at reference_time.
|
874
|
+
# * "REMOVED": indicates that the asset was present at the start of
|
875
|
+
# compare_duration, but not present at reference_time.
|
876
|
+
# * "ACTIVE": indicates that the asset was present at both the
|
877
|
+
# start and the end of the time period defined by
|
878
|
+
# compare_duration and reference_time.
|
879
|
+
#
|
880
|
+
# If compare_duration is not specified, then the only possible state_change
|
881
|
+
# is "UNUSED", which will be the state_change set for all assets present at
|
882
|
+
# read_time.
|
883
|
+
#
|
884
|
+
# If this field is set then `state_change` must be a specified field in
|
885
|
+
# `group_by`.
|
886
|
+
# @param read_time [::Google::Protobuf::Timestamp, ::Hash]
|
887
|
+
# Time used as a reference point when filtering assets. The filter is limited
|
888
|
+
# to assets existing at the supplied time and their values are those at that
|
889
|
+
# specific time. Absence of this field will default to the API's version of
|
890
|
+
# NOW.
|
891
|
+
# @param page_token [::String]
|
892
|
+
# The value returned by the last `GroupAssetsResponse`; indicates
|
893
|
+
# that this is a continuation of a prior `GroupAssets` call, and that the
|
894
|
+
# system should return the next page of data.
|
895
|
+
# @param page_size [::Integer]
|
896
|
+
# The maximum number of results to return in a single response. Default is
|
897
|
+
# 10, minimum is 1, maximum is 1000.
|
898
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
899
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult>]
|
900
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
901
|
+
#
|
902
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult>]
|
903
|
+
#
|
904
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
905
|
+
def group_assets request, options = nil
|
906
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
907
|
+
|
908
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest
|
909
|
+
|
910
|
+
# Converts hash and nil to an options object
|
911
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
912
|
+
|
913
|
+
# Customize the options with defaults
|
914
|
+
call_metadata = @config.rpcs.group_assets.metadata.to_h
|
915
|
+
|
916
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
917
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
918
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
919
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION,
|
920
|
+
transports_version_send: [:rest]
|
921
|
+
|
922
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
923
|
+
|
924
|
+
options.apply_defaults timeout: @config.rpcs.group_assets.timeout,
|
925
|
+
metadata: call_metadata,
|
926
|
+
retry_policy: @config.rpcs.group_assets.retry_policy
|
927
|
+
|
928
|
+
options.apply_defaults timeout: @config.timeout,
|
929
|
+
metadata: @config.metadata,
|
930
|
+
retry_policy: @config.retry_policy
|
931
|
+
|
932
|
+
@security_center_stub.group_assets request, options do |result, operation|
|
933
|
+
result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :group_assets, "group_by_results", request, result, options
|
934
|
+
yield result, operation if block_given?
|
935
|
+
return result
|
936
|
+
end
|
937
|
+
rescue ::Gapic::Rest::Error => e
|
938
|
+
raise ::Google::Cloud::Error.from_error(e)
|
939
|
+
end
|
940
|
+
|
941
|
+
##
|
942
|
+
# Filters an organization or source's findings and groups them by their
|
943
|
+
# specified properties.
|
944
|
+
#
|
945
|
+
# To group across all sources provide a `-` as the source id.
|
946
|
+
# Example: /v1/organizations/\\{organization_id}/sources/-/findings,
|
947
|
+
# /v1/folders/\\{folder_id}/sources/-/findings,
|
948
|
+
# /v1/projects/\\{project_id}/sources/-/findings
|
949
|
+
#
|
950
|
+
# @overload group_findings(request, options = nil)
|
951
|
+
# Pass arguments to `group_findings` via a request object, either of type
|
952
|
+
# {::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest} or an equivalent Hash.
|
953
|
+
#
|
954
|
+
# @param request [::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest, ::Hash]
|
955
|
+
# A request object representing the call parameters. Required. To specify no
|
956
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
957
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
958
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
959
|
+
#
|
960
|
+
# @overload group_findings(parent: nil, filter: nil, group_by: nil, read_time: nil, compare_duration: nil, page_token: nil, page_size: nil)
|
961
|
+
# Pass arguments to `group_findings` via keyword arguments. Note that at
|
962
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
963
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
964
|
+
#
|
965
|
+
# @param parent [::String]
|
966
|
+
# Required. Name of the source to groupBy. Its format is
|
967
|
+
# "organizations/[organization_id]/sources/[source_id]",
|
968
|
+
# folders/[folder_id]/sources/[source_id], or
|
969
|
+
# projects/[project_id]/sources/[source_id]. To groupBy across all sources
|
970
|
+
# provide a source_id of `-`. For example:
|
971
|
+
# organizations/\\{organization_id}/sources/-, folders/\\{folder_id}/sources/-,
|
972
|
+
# or projects/\\{project_id}/sources/-
|
973
|
+
# @param filter [::String]
|
974
|
+
# Expression that defines the filter to apply across findings.
|
975
|
+
# The expression is a list of one or more restrictions combined via logical
|
976
|
+
# operators `AND` and `OR`.
|
977
|
+
# Parentheses are supported, and `OR` has higher precedence than `AND`.
|
978
|
+
#
|
979
|
+
# Restrictions have the form `<field> <operator> <value>` and may have a `-`
|
980
|
+
# character in front of them to indicate negation. Examples include:
|
981
|
+
#
|
982
|
+
# * name
|
983
|
+
# * source_properties.a_property
|
984
|
+
# * security_marks.marks.marka
|
985
|
+
#
|
986
|
+
# The supported operators are:
|
987
|
+
#
|
988
|
+
# * `=` for all value types.
|
989
|
+
# * `>`, `<`, `>=`, `<=` for integer values.
|
990
|
+
# * `:`, meaning substring matching, for strings.
|
991
|
+
#
|
992
|
+
# The supported value types are:
|
993
|
+
#
|
994
|
+
# * string literals in quotes.
|
995
|
+
# * integer literals without quotes.
|
996
|
+
# * boolean literals `true` and `false` without quotes.
|
997
|
+
#
|
998
|
+
# The following field and operator combinations are supported:
|
999
|
+
#
|
1000
|
+
# * name: `=`
|
1001
|
+
# * parent: `=`, `:`
|
1002
|
+
# * resource_name: `=`, `:`
|
1003
|
+
# * state: `=`, `:`
|
1004
|
+
# * category: `=`, `:`
|
1005
|
+
# * external_uri: `=`, `:`
|
1006
|
+
# * event_time: `=`, `>`, `<`, `>=`, `<=`
|
1007
|
+
# * severity: `=`, `:`
|
1008
|
+
#
|
1009
|
+
# Usage: This should be milliseconds since epoch or an RFC3339 string.
|
1010
|
+
# Examples:
|
1011
|
+
# `event_time = "2019-06-10T16:07:18-07:00"`
|
1012
|
+
# `event_time = 1560208038000`
|
1013
|
+
#
|
1014
|
+
# * security_marks.marks: `=`, `:`
|
1015
|
+
# * source_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
|
1016
|
+
#
|
1017
|
+
# For example, `source_properties.size = 100` is a valid filter string.
|
1018
|
+
#
|
1019
|
+
# Use a partial match on the empty string to filter based on a property
|
1020
|
+
# existing: `source_properties.my_property : ""`
|
1021
|
+
#
|
1022
|
+
# Use a negated partial match on the empty string to filter based on a
|
1023
|
+
# property not existing: `-source_properties.my_property : ""`
|
1024
|
+
# @param group_by [::String]
|
1025
|
+
# Required. Expression that defines what assets fields to use for grouping (including
|
1026
|
+
# `state_change`). The string value should follow SQL syntax: comma separated
|
1027
|
+
# list of fields. For example: "parent,resource_name".
|
1028
|
+
#
|
1029
|
+
# The following fields are supported:
|
1030
|
+
#
|
1031
|
+
# * resource_name
|
1032
|
+
# * category
|
1033
|
+
# * state
|
1034
|
+
# * parent
|
1035
|
+
# * severity
|
1036
|
+
#
|
1037
|
+
# The following fields are supported when compare_duration is set:
|
1038
|
+
#
|
1039
|
+
# * state_change
|
1040
|
+
# @param read_time [::Google::Protobuf::Timestamp, ::Hash]
|
1041
|
+
# Time used as a reference point when filtering findings. The filter is
|
1042
|
+
# limited to findings existing at the supplied time and their values are
|
1043
|
+
# those at that specific time. Absence of this field will default to the
|
1044
|
+
# API's version of NOW.
|
1045
|
+
# @param compare_duration [::Google::Protobuf::Duration, ::Hash]
|
1046
|
+
# When compare_duration is set, the GroupResult's "state_change" attribute is
|
1047
|
+
# updated to indicate whether the finding had its state changed, the
|
1048
|
+
# finding's state remained unchanged, or if the finding was added during the
|
1049
|
+
# compare_duration period of time that precedes the read_time. This is the
|
1050
|
+
# time between (read_time - compare_duration) and read_time.
|
1051
|
+
#
|
1052
|
+
# The state_change value is derived based on the presence and state of the
|
1053
|
+
# finding at the two points in time. Intermediate state changes between the
|
1054
|
+
# two times don't affect the result. For example, the results aren't affected
|
1055
|
+
# if the finding is made inactive and then active again.
|
1056
|
+
#
|
1057
|
+
# Possible "state_change" values when compare_duration is specified:
|
1058
|
+
#
|
1059
|
+
# * "CHANGED": indicates that the finding was present and matched the given
|
1060
|
+
# filter at the start of compare_duration, but changed its
|
1061
|
+
# state at read_time.
|
1062
|
+
# * "UNCHANGED": indicates that the finding was present and matched the given
|
1063
|
+
# filter at the start of compare_duration and did not change
|
1064
|
+
# state at read_time.
|
1065
|
+
# * "ADDED": indicates that the finding did not match the given filter or
|
1066
|
+
# was not present at the start of compare_duration, but was
|
1067
|
+
# present at read_time.
|
1068
|
+
# * "REMOVED": indicates that the finding was present and matched the
|
1069
|
+
# filter at the start of compare_duration, but did not match
|
1070
|
+
# the filter at read_time.
|
1071
|
+
#
|
1072
|
+
# If compare_duration is not specified, then the only possible state_change
|
1073
|
+
# is "UNUSED", which will be the state_change set for all findings present
|
1074
|
+
# at read_time.
|
1075
|
+
#
|
1076
|
+
# If this field is set then `state_change` must be a specified field in
|
1077
|
+
# `group_by`.
|
1078
|
+
# @param page_token [::String]
|
1079
|
+
# The value returned by the last `GroupFindingsResponse`; indicates
|
1080
|
+
# that this is a continuation of a prior `GroupFindings` call, and
|
1081
|
+
# that the system should return the next page of data.
|
1082
|
+
# @param page_size [::Integer]
|
1083
|
+
# The maximum number of results to return in a single response. Default is
|
1084
|
+
# 10, minimum is 1, maximum is 1000.
|
1085
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1086
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult>]
|
1087
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1088
|
+
#
|
1089
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult>]
|
1090
|
+
#
|
1091
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1092
|
+
def group_findings request, options = nil
|
1093
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1094
|
+
|
1095
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest
|
1096
|
+
|
1097
|
+
# Converts hash and nil to an options object
|
1098
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1099
|
+
|
1100
|
+
# Customize the options with defaults
|
1101
|
+
call_metadata = @config.rpcs.group_findings.metadata.to_h
|
1102
|
+
|
1103
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1104
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1105
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1106
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION,
|
1107
|
+
transports_version_send: [:rest]
|
1108
|
+
|
1109
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1110
|
+
|
1111
|
+
options.apply_defaults timeout: @config.rpcs.group_findings.timeout,
|
1112
|
+
metadata: call_metadata,
|
1113
|
+
retry_policy: @config.rpcs.group_findings.retry_policy
|
1114
|
+
|
1115
|
+
options.apply_defaults timeout: @config.timeout,
|
1116
|
+
metadata: @config.metadata,
|
1117
|
+
retry_policy: @config.retry_policy
|
1118
|
+
|
1119
|
+
@security_center_stub.group_findings request, options do |result, operation|
|
1120
|
+
result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :group_findings, "group_by_results", request, result, options
|
1121
|
+
yield result, operation if block_given?
|
1122
|
+
return result
|
1123
|
+
end
|
1124
|
+
rescue ::Gapic::Rest::Error => e
|
1125
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1126
|
+
end
|
1127
|
+
|
1128
|
+
##
|
1129
|
+
# Lists an organization's assets.
|
1130
|
+
#
|
1131
|
+
# @overload list_assets(request, options = nil)
|
1132
|
+
# Pass arguments to `list_assets` via a request object, either of type
|
1133
|
+
# {::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest} or an equivalent Hash.
|
1134
|
+
#
|
1135
|
+
# @param request [::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest, ::Hash]
|
1136
|
+
# A request object representing the call parameters. Required. To specify no
|
1137
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1138
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1139
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1140
|
+
#
|
1141
|
+
# @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)
|
1142
|
+
# Pass arguments to `list_assets` via keyword arguments. Note that at
|
1143
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1144
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1145
|
+
#
|
1146
|
+
# @param parent [::String]
|
1147
|
+
# Required. Name of the organization assets should belong to. Its format is
|
1148
|
+
# "organizations/[organization_id], folders/[folder_id], or
|
1149
|
+
# projects/[project_id]".
|
1150
|
+
# @param filter [::String]
|
1151
|
+
# Expression that defines the filter to apply across assets.
|
1152
|
+
# The expression is a list of zero or more restrictions combined via logical
|
1153
|
+
# operators `AND` and `OR`.
|
1154
|
+
# Parentheses are supported, and `OR` has higher precedence than `AND`.
|
1155
|
+
#
|
1156
|
+
# Restrictions have the form `<field> <operator> <value>` and may have a `-`
|
1157
|
+
# character in front of them to indicate negation. The fields map to those
|
1158
|
+
# defined in the Asset resource. Examples include:
|
1159
|
+
#
|
1160
|
+
# * name
|
1161
|
+
# * security_center_properties.resource_name
|
1162
|
+
# * resource_properties.a_property
|
1163
|
+
# * security_marks.marks.marka
|
1164
|
+
#
|
1165
|
+
# The supported operators are:
|
1166
|
+
#
|
1167
|
+
# * `=` for all value types.
|
1168
|
+
# * `>`, `<`, `>=`, `<=` for integer values.
|
1169
|
+
# * `:`, meaning substring matching, for strings.
|
1170
|
+
#
|
1171
|
+
# The supported value types are:
|
1172
|
+
#
|
1173
|
+
# * string literals in quotes.
|
1174
|
+
# * integer literals without quotes.
|
1175
|
+
# * boolean literals `true` and `false` without quotes.
|
1176
|
+
#
|
1177
|
+
# The following are the allowed field and operator combinations:
|
1178
|
+
#
|
1179
|
+
# * name: `=`
|
1180
|
+
# * update_time: `=`, `>`, `<`, `>=`, `<=`
|
1181
|
+
#
|
1182
|
+
# Usage: This should be milliseconds since epoch or an RFC3339 string.
|
1183
|
+
# Examples:
|
1184
|
+
# `update_time = "2019-06-10T16:07:18-07:00"`
|
1185
|
+
# `update_time = 1560208038000`
|
1186
|
+
#
|
1187
|
+
# * create_time: `=`, `>`, `<`, `>=`, `<=`
|
1188
|
+
#
|
1189
|
+
# Usage: This should be milliseconds since epoch or an RFC3339 string.
|
1190
|
+
# Examples:
|
1191
|
+
# `create_time = "2019-06-10T16:07:18-07:00"`
|
1192
|
+
# `create_time = 1560208038000`
|
1193
|
+
#
|
1194
|
+
# * iam_policy.policy_blob: `=`, `:`
|
1195
|
+
# * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
|
1196
|
+
# * security_marks.marks: `=`, `:`
|
1197
|
+
# * security_center_properties.resource_name: `=`, `:`
|
1198
|
+
# * security_center_properties.resource_display_name: `=`, `:`
|
1199
|
+
# * security_center_properties.resource_type: `=`, `:`
|
1200
|
+
# * security_center_properties.resource_parent: `=`, `:`
|
1201
|
+
# * security_center_properties.resource_parent_display_name: `=`, `:`
|
1202
|
+
# * security_center_properties.resource_project: `=`, `:`
|
1203
|
+
# * security_center_properties.resource_project_display_name: `=`, `:`
|
1204
|
+
# * security_center_properties.resource_owners: `=`, `:`
|
1205
|
+
#
|
1206
|
+
# For example, `resource_properties.size = 100` is a valid filter string.
|
1207
|
+
#
|
1208
|
+
# Use a partial match on the empty string to filter based on a property
|
1209
|
+
# existing: `resource_properties.my_property : ""`
|
1210
|
+
#
|
1211
|
+
# Use a negated partial match on the empty string to filter based on a
|
1212
|
+
# property not existing: `-resource_properties.my_property : ""`
|
1213
|
+
# @param order_by [::String]
|
1214
|
+
# Expression that defines what fields and order to use for sorting. The
|
1215
|
+
# string value should follow SQL syntax: comma separated list of fields. For
|
1216
|
+
# example: "name,resource_properties.a_property". The default sorting order
|
1217
|
+
# is ascending. To specify descending order for a field, a suffix " desc"
|
1218
|
+
# should be appended to the field name. For example: "name
|
1219
|
+
# desc,resource_properties.a_property". Redundant space characters in the
|
1220
|
+
# syntax are insignificant. "name desc,resource_properties.a_property" and "
|
1221
|
+
# name desc , resource_properties.a_property " are equivalent.
|
1222
|
+
#
|
1223
|
+
# The following fields are supported:
|
1224
|
+
# name
|
1225
|
+
# update_time
|
1226
|
+
# resource_properties
|
1227
|
+
# security_marks.marks
|
1228
|
+
# security_center_properties.resource_name
|
1229
|
+
# security_center_properties.resource_display_name
|
1230
|
+
# security_center_properties.resource_parent
|
1231
|
+
# security_center_properties.resource_parent_display_name
|
1232
|
+
# security_center_properties.resource_project
|
1233
|
+
# security_center_properties.resource_project_display_name
|
1234
|
+
# security_center_properties.resource_type
|
1235
|
+
# @param read_time [::Google::Protobuf::Timestamp, ::Hash]
|
1236
|
+
# Time used as a reference point when filtering assets. The filter is limited
|
1237
|
+
# to assets existing at the supplied time and their values are those at that
|
1238
|
+
# specific time. Absence of this field will default to the API's version of
|
1239
|
+
# NOW.
|
1240
|
+
# @param compare_duration [::Google::Protobuf::Duration, ::Hash]
|
1241
|
+
# When compare_duration is set, the ListAssetsResult's "state_change"
|
1242
|
+
# attribute is updated to indicate whether the asset was added, removed, or
|
1243
|
+
# remained present during the compare_duration period of time that precedes
|
1244
|
+
# the read_time. This is the time between (read_time - compare_duration) and
|
1245
|
+
# read_time.
|
1246
|
+
#
|
1247
|
+
# The state_change value is derived based on the presence of the asset at the
|
1248
|
+
# two points in time. Intermediate state changes between the two times don't
|
1249
|
+
# affect the result. For example, the results aren't affected if the asset is
|
1250
|
+
# removed and re-created again.
|
1251
|
+
#
|
1252
|
+
# Possible "state_change" values when compare_duration is specified:
|
1253
|
+
#
|
1254
|
+
# * "ADDED": indicates that the asset was not present at the start of
|
1255
|
+
# compare_duration, but present at read_time.
|
1256
|
+
# * "REMOVED": indicates that the asset was present at the start of
|
1257
|
+
# compare_duration, but not present at read_time.
|
1258
|
+
# * "ACTIVE": indicates that the asset was present at both the
|
1259
|
+
# start and the end of the time period defined by
|
1260
|
+
# compare_duration and read_time.
|
1261
|
+
#
|
1262
|
+
# If compare_duration is not specified, then the only possible state_change
|
1263
|
+
# is "UNUSED", which will be the state_change set for all assets present at
|
1264
|
+
# read_time.
|
1265
|
+
# @param field_mask [::Google::Protobuf::FieldMask, ::Hash]
|
1266
|
+
# A field mask to specify the ListAssetsResult fields to be listed in the
|
1267
|
+
# response.
|
1268
|
+
# An empty field mask will list all fields.
|
1269
|
+
# @param page_token [::String]
|
1270
|
+
# The value returned by the last `ListAssetsResponse`; indicates
|
1271
|
+
# that this is a continuation of a prior `ListAssets` call, and
|
1272
|
+
# that the system should return the next page of data.
|
1273
|
+
# @param page_size [::Integer]
|
1274
|
+
# The maximum number of results to return in a single response. Default is
|
1275
|
+
# 10, minimum is 1, maximum is 1000.
|
1276
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1277
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse::ListAssetsResult>]
|
1278
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1279
|
+
#
|
1280
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse::ListAssetsResult>]
|
1281
|
+
#
|
1282
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1283
|
+
def list_assets request, options = nil
|
1284
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1285
|
+
|
1286
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest
|
1287
|
+
|
1288
|
+
# Converts hash and nil to an options object
|
1289
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1290
|
+
|
1291
|
+
# Customize the options with defaults
|
1292
|
+
call_metadata = @config.rpcs.list_assets.metadata.to_h
|
1293
|
+
|
1294
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1295
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1296
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1297
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION,
|
1298
|
+
transports_version_send: [:rest]
|
1299
|
+
|
1300
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1301
|
+
|
1302
|
+
options.apply_defaults timeout: @config.rpcs.list_assets.timeout,
|
1303
|
+
metadata: call_metadata,
|
1304
|
+
retry_policy: @config.rpcs.list_assets.retry_policy
|
1305
|
+
|
1306
|
+
options.apply_defaults timeout: @config.timeout,
|
1307
|
+
metadata: @config.metadata,
|
1308
|
+
retry_policy: @config.retry_policy
|
1309
|
+
|
1310
|
+
@security_center_stub.list_assets request, options do |result, operation|
|
1311
|
+
result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_assets, "list_assets_results", request, result, options
|
1312
|
+
yield result, operation if block_given?
|
1313
|
+
return result
|
1314
|
+
end
|
1315
|
+
rescue ::Gapic::Rest::Error => e
|
1316
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1317
|
+
end
|
1318
|
+
|
1319
|
+
##
|
1320
|
+
# Lists an organization or source's findings.
|
1321
|
+
#
|
1322
|
+
# To list across all sources provide a `-` as the source id.
|
1323
|
+
# Example: /v1p1beta1/organizations/\\{organization_id}/sources/-/findings
|
1324
|
+
#
|
1325
|
+
# @overload list_findings(request, options = nil)
|
1326
|
+
# Pass arguments to `list_findings` via a request object, either of type
|
1327
|
+
# {::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest} or an equivalent Hash.
|
1328
|
+
#
|
1329
|
+
# @param request [::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest, ::Hash]
|
1330
|
+
# A request object representing the call parameters. Required. To specify no
|
1331
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1332
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1333
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1334
|
+
#
|
1335
|
+
# @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)
|
1336
|
+
# Pass arguments to `list_findings` via keyword arguments. Note that at
|
1337
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1338
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1339
|
+
#
|
1340
|
+
# @param parent [::String]
|
1341
|
+
# Required. Name of the source the findings belong to. Its format is
|
1342
|
+
# "organizations/[organization_id]/sources/[source_id],
|
1343
|
+
# folders/[folder_id]/sources/[source_id], or
|
1344
|
+
# projects/[project_id]/sources/[source_id]". To list across all sources
|
1345
|
+
# provide a source_id of `-`. For example:
|
1346
|
+
# organizations/\\{organization_id}/sources/-, folders/\\{folder_id}/sources/- or
|
1347
|
+
# projects/\\{projects_id}/sources/-
|
1348
|
+
# @param filter [::String]
|
1349
|
+
# Expression that defines the filter to apply across findings.
|
1350
|
+
# The expression is a list of one or more restrictions combined via logical
|
1351
|
+
# operators `AND` and `OR`.
|
1352
|
+
# Parentheses are supported, and `OR` has higher precedence than `AND`.
|
1353
|
+
#
|
1354
|
+
# Restrictions have the form `<field> <operator> <value>` and may have a `-`
|
1355
|
+
# character in front of them to indicate negation. Examples include:
|
1356
|
+
#
|
1357
|
+
# * name
|
1358
|
+
# * source_properties.a_property
|
1359
|
+
# * security_marks.marks.marka
|
1360
|
+
#
|
1361
|
+
# The supported operators are:
|
1362
|
+
#
|
1363
|
+
# * `=` for all value types.
|
1364
|
+
# * `>`, `<`, `>=`, `<=` for integer values.
|
1365
|
+
# * `:`, meaning substring matching, for strings.
|
1366
|
+
#
|
1367
|
+
# The supported value types are:
|
1368
|
+
#
|
1369
|
+
# * string literals in quotes.
|
1370
|
+
# * integer literals without quotes.
|
1371
|
+
# * boolean literals `true` and `false` without quotes.
|
1372
|
+
#
|
1373
|
+
# The following field and operator combinations are supported:
|
1374
|
+
#
|
1375
|
+
# * name: `=`
|
1376
|
+
# * parent: `=`, `:`
|
1377
|
+
# * resource_name: `=`, `:`
|
1378
|
+
# * state: `=`, `:`
|
1379
|
+
# * category: `=`, `:`
|
1380
|
+
# * external_uri: `=`, `:`
|
1381
|
+
# * event_time: `=`, `>`, `<`, `>=`, `<=`
|
1382
|
+
# * severity: `=`, `:`
|
1383
|
+
#
|
1384
|
+
# Usage: This should be milliseconds since epoch or an RFC3339 string.
|
1385
|
+
# Examples:
|
1386
|
+
# `event_time = "2019-06-10T16:07:18-07:00"`
|
1387
|
+
# `event_time = 1560208038000`
|
1388
|
+
#
|
1389
|
+
# security_marks.marks: `=`, `:`
|
1390
|
+
# source_properties: `=`, `:`, `>`, `<`, `>=`, `<=`
|
1391
|
+
#
|
1392
|
+
# For example, `source_properties.size = 100` is a valid filter string.
|
1393
|
+
#
|
1394
|
+
# Use a partial match on the empty string to filter based on a property
|
1395
|
+
# existing: `source_properties.my_property : ""`
|
1396
|
+
#
|
1397
|
+
# Use a negated partial match on the empty string to filter based on a
|
1398
|
+
# property not existing: `-source_properties.my_property : ""`
|
1399
|
+
# @param order_by [::String]
|
1400
|
+
# Expression that defines what fields and order to use for sorting. The
|
1401
|
+
# string value should follow SQL syntax: comma separated list of fields. For
|
1402
|
+
# example: "name,resource_properties.a_property". The default sorting order
|
1403
|
+
# is ascending. To specify descending order for a field, a suffix " desc"
|
1404
|
+
# should be appended to the field name. For example: "name
|
1405
|
+
# desc,source_properties.a_property". Redundant space characters in the
|
1406
|
+
# syntax are insignificant. "name desc,source_properties.a_property" and "
|
1407
|
+
# name desc , source_properties.a_property " are equivalent.
|
1408
|
+
#
|
1409
|
+
# The following fields are supported:
|
1410
|
+
# name
|
1411
|
+
# parent
|
1412
|
+
# state
|
1413
|
+
# category
|
1414
|
+
# resource_name
|
1415
|
+
# event_time
|
1416
|
+
# source_properties
|
1417
|
+
# security_marks.marks
|
1418
|
+
# @param read_time [::Google::Protobuf::Timestamp, ::Hash]
|
1419
|
+
# Time used as a reference point when filtering findings. The filter is
|
1420
|
+
# limited to findings existing at the supplied time and their values are
|
1421
|
+
# those at that specific time. Absence of this field will default to the
|
1422
|
+
# API's version of NOW.
|
1423
|
+
# @param compare_duration [::Google::Protobuf::Duration, ::Hash]
|
1424
|
+
# When compare_duration is set, the ListFindingsResult's "state_change"
|
1425
|
+
# attribute is updated to indicate whether the finding had its state changed,
|
1426
|
+
# the finding's state remained unchanged, or if the finding was added in any
|
1427
|
+
# state during the compare_duration period of time that precedes the
|
1428
|
+
# read_time. This is the time between (read_time - compare_duration) and
|
1429
|
+
# read_time.
|
1430
|
+
#
|
1431
|
+
# The state_change value is derived based on the presence and state of the
|
1432
|
+
# finding at the two points in time. Intermediate state changes between the
|
1433
|
+
# two times don't affect the result. For example, the results aren't affected
|
1434
|
+
# if the finding is made inactive and then active again.
|
1435
|
+
#
|
1436
|
+
# Possible "state_change" values when compare_duration is specified:
|
1437
|
+
#
|
1438
|
+
# * "CHANGED": indicates that the finding was present and matched the given
|
1439
|
+
# filter at the start of compare_duration, but changed its
|
1440
|
+
# state at read_time.
|
1441
|
+
# * "UNCHANGED": indicates that the finding was present and matched the given
|
1442
|
+
# filter at the start of compare_duration and did not change
|
1443
|
+
# state at read_time.
|
1444
|
+
# * "ADDED": indicates that the finding did not match the given filter or
|
1445
|
+
# was not present at the start of compare_duration, but was
|
1446
|
+
# present at read_time.
|
1447
|
+
# * "REMOVED": indicates that the finding was present and matched the
|
1448
|
+
# filter at the start of compare_duration, but did not match
|
1449
|
+
# the filter at read_time.
|
1450
|
+
#
|
1451
|
+
# If compare_duration is not specified, then the only possible state_change
|
1452
|
+
# is "UNUSED", which will be the state_change set for all findings present at
|
1453
|
+
# read_time.
|
1454
|
+
# @param field_mask [::Google::Protobuf::FieldMask, ::Hash]
|
1455
|
+
# A field mask to specify the Finding fields to be listed in the response.
|
1456
|
+
# An empty field mask will list all fields.
|
1457
|
+
# @param page_token [::String]
|
1458
|
+
# The value returned by the last `ListFindingsResponse`; indicates
|
1459
|
+
# that this is a continuation of a prior `ListFindings` call, and
|
1460
|
+
# that the system should return the next page of data.
|
1461
|
+
# @param page_size [::Integer]
|
1462
|
+
# The maximum number of results to return in a single response. Default is
|
1463
|
+
# 10, minimum is 1, maximum is 1000.
|
1464
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1465
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse::ListFindingsResult>]
|
1466
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1467
|
+
#
|
1468
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse::ListFindingsResult>]
|
1469
|
+
#
|
1470
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1471
|
+
def list_findings request, options = nil
|
1472
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1473
|
+
|
1474
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest
|
1475
|
+
|
1476
|
+
# Converts hash and nil to an options object
|
1477
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1478
|
+
|
1479
|
+
# Customize the options with defaults
|
1480
|
+
call_metadata = @config.rpcs.list_findings.metadata.to_h
|
1481
|
+
|
1482
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1483
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1484
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1485
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION,
|
1486
|
+
transports_version_send: [:rest]
|
1487
|
+
|
1488
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1489
|
+
|
1490
|
+
options.apply_defaults timeout: @config.rpcs.list_findings.timeout,
|
1491
|
+
metadata: call_metadata,
|
1492
|
+
retry_policy: @config.rpcs.list_findings.retry_policy
|
1493
|
+
|
1494
|
+
options.apply_defaults timeout: @config.timeout,
|
1495
|
+
metadata: @config.metadata,
|
1496
|
+
retry_policy: @config.retry_policy
|
1497
|
+
|
1498
|
+
@security_center_stub.list_findings request, options do |result, operation|
|
1499
|
+
result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_findings, "list_findings_results", request, result, options
|
1500
|
+
yield result, operation if block_given?
|
1501
|
+
return result
|
1502
|
+
end
|
1503
|
+
rescue ::Gapic::Rest::Error => e
|
1504
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1505
|
+
end
|
1506
|
+
|
1507
|
+
##
|
1508
|
+
# Lists notification configs.
|
1509
|
+
#
|
1510
|
+
# @overload list_notification_configs(request, options = nil)
|
1511
|
+
# Pass arguments to `list_notification_configs` via a request object, either of type
|
1512
|
+
# {::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest} or an equivalent Hash.
|
1513
|
+
#
|
1514
|
+
# @param request [::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest, ::Hash]
|
1515
|
+
# A request object representing the call parameters. Required. To specify no
|
1516
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1517
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1518
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1519
|
+
#
|
1520
|
+
# @overload list_notification_configs(parent: nil, page_token: nil, page_size: nil)
|
1521
|
+
# Pass arguments to `list_notification_configs` via keyword arguments. Note that at
|
1522
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1523
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1524
|
+
#
|
1525
|
+
# @param parent [::String]
|
1526
|
+
# Required. Name of the organization to list notification configs.
|
1527
|
+
# Its format is "organizations/[organization_id]".
|
1528
|
+
# @param page_token [::String]
|
1529
|
+
# The value returned by the last `ListNotificationConfigsResponse`; indicates
|
1530
|
+
# that this is a continuation of a prior `ListNotificationConfigs` call, and
|
1531
|
+
# that the system should return the next page of data.
|
1532
|
+
# @param page_size [::Integer]
|
1533
|
+
# The maximum number of results to return in a single response. Default is
|
1534
|
+
# 10, minimum is 1, maximum is 1000.
|
1535
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1536
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig>]
|
1537
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1538
|
+
#
|
1539
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig>]
|
1540
|
+
#
|
1541
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1542
|
+
def list_notification_configs request, options = nil
|
1543
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1544
|
+
|
1545
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest
|
1546
|
+
|
1547
|
+
# Converts hash and nil to an options object
|
1548
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1549
|
+
|
1550
|
+
# Customize the options with defaults
|
1551
|
+
call_metadata = @config.rpcs.list_notification_configs.metadata.to_h
|
1552
|
+
|
1553
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1554
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1555
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1556
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION,
|
1557
|
+
transports_version_send: [:rest]
|
1558
|
+
|
1559
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1560
|
+
|
1561
|
+
options.apply_defaults timeout: @config.rpcs.list_notification_configs.timeout,
|
1562
|
+
metadata: call_metadata,
|
1563
|
+
retry_policy: @config.rpcs.list_notification_configs.retry_policy
|
1564
|
+
|
1565
|
+
options.apply_defaults timeout: @config.timeout,
|
1566
|
+
metadata: @config.metadata,
|
1567
|
+
retry_policy: @config.retry_policy
|
1568
|
+
|
1569
|
+
@security_center_stub.list_notification_configs request, options do |result, operation|
|
1570
|
+
result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_notification_configs, "notification_configs", request, result, options
|
1571
|
+
yield result, operation if block_given?
|
1572
|
+
return result
|
1573
|
+
end
|
1574
|
+
rescue ::Gapic::Rest::Error => e
|
1575
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1576
|
+
end
|
1577
|
+
|
1578
|
+
##
|
1579
|
+
# Lists all sources belonging to an organization.
|
1580
|
+
#
|
1581
|
+
# @overload list_sources(request, options = nil)
|
1582
|
+
# Pass arguments to `list_sources` via a request object, either of type
|
1583
|
+
# {::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest} or an equivalent Hash.
|
1584
|
+
#
|
1585
|
+
# @param request [::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest, ::Hash]
|
1586
|
+
# A request object representing the call parameters. Required. To specify no
|
1587
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1588
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1589
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1590
|
+
#
|
1591
|
+
# @overload list_sources(parent: nil, page_token: nil, page_size: nil)
|
1592
|
+
# Pass arguments to `list_sources` via keyword arguments. Note that at
|
1593
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1594
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1595
|
+
#
|
1596
|
+
# @param parent [::String]
|
1597
|
+
# Required. Resource name of the parent of sources to list. Its format should be
|
1598
|
+
# "organizations/[organization_id], folders/[folder_id], or
|
1599
|
+
# projects/[project_id]".
|
1600
|
+
# @param page_token [::String]
|
1601
|
+
# The value returned by the last `ListSourcesResponse`; indicates
|
1602
|
+
# that this is a continuation of a prior `ListSources` call, and
|
1603
|
+
# that the system should return the next page of data.
|
1604
|
+
# @param page_size [::Integer]
|
1605
|
+
# The maximum number of results to return in a single response. Default is
|
1606
|
+
# 10, minimum is 1, maximum is 1000.
|
1607
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1608
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::Source>]
|
1609
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1610
|
+
#
|
1611
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecurityCenter::V1p1beta1::Source>]
|
1612
|
+
#
|
1613
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1614
|
+
def list_sources request, options = nil
|
1615
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1616
|
+
|
1617
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest
|
1618
|
+
|
1619
|
+
# Converts hash and nil to an options object
|
1620
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1621
|
+
|
1622
|
+
# Customize the options with defaults
|
1623
|
+
call_metadata = @config.rpcs.list_sources.metadata.to_h
|
1624
|
+
|
1625
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1626
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1627
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1628
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION,
|
1629
|
+
transports_version_send: [:rest]
|
1630
|
+
|
1631
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1632
|
+
|
1633
|
+
options.apply_defaults timeout: @config.rpcs.list_sources.timeout,
|
1634
|
+
metadata: call_metadata,
|
1635
|
+
retry_policy: @config.rpcs.list_sources.retry_policy
|
1636
|
+
|
1637
|
+
options.apply_defaults timeout: @config.timeout,
|
1638
|
+
metadata: @config.metadata,
|
1639
|
+
retry_policy: @config.retry_policy
|
1640
|
+
|
1641
|
+
@security_center_stub.list_sources request, options do |result, operation|
|
1642
|
+
result = ::Gapic::Rest::PagedEnumerable.new @security_center_stub, :list_sources, "sources", request, result, options
|
1643
|
+
yield result, operation if block_given?
|
1644
|
+
return result
|
1645
|
+
end
|
1646
|
+
rescue ::Gapic::Rest::Error => e
|
1647
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1648
|
+
end
|
1649
|
+
|
1650
|
+
##
|
1651
|
+
# Runs asset discovery. The discovery is tracked with a long-running
|
1652
|
+
# operation.
|
1653
|
+
#
|
1654
|
+
# This API can only be called with limited frequency for an organization. If
|
1655
|
+
# it is called too frequently the caller will receive a TOO_MANY_REQUESTS
|
1656
|
+
# error.
|
1657
|
+
#
|
1658
|
+
# @overload run_asset_discovery(request, options = nil)
|
1659
|
+
# Pass arguments to `run_asset_discovery` via a request object, either of type
|
1660
|
+
# {::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest} or an equivalent Hash.
|
1661
|
+
#
|
1662
|
+
# @param request [::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest, ::Hash]
|
1663
|
+
# A request object representing the call parameters. Required. To specify no
|
1664
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1665
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1666
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1667
|
+
#
|
1668
|
+
# @overload run_asset_discovery(parent: nil)
|
1669
|
+
# Pass arguments to `run_asset_discovery` via keyword arguments. Note that at
|
1670
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1671
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1672
|
+
#
|
1673
|
+
# @param parent [::String]
|
1674
|
+
# Required. Name of the organization to run asset discovery for. Its format is
|
1675
|
+
# "organizations/[organization_id]".
|
1676
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1677
|
+
# @yieldparam result [::Gapic::Operation]
|
1678
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1679
|
+
#
|
1680
|
+
# @return [::Gapic::Operation]
|
1681
|
+
#
|
1682
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1683
|
+
def run_asset_discovery request, options = nil
|
1684
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1685
|
+
|
1686
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest
|
1687
|
+
|
1688
|
+
# Converts hash and nil to an options object
|
1689
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1690
|
+
|
1691
|
+
# Customize the options with defaults
|
1692
|
+
call_metadata = @config.rpcs.run_asset_discovery.metadata.to_h
|
1693
|
+
|
1694
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1695
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1696
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1697
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION,
|
1698
|
+
transports_version_send: [:rest]
|
1699
|
+
|
1700
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1701
|
+
|
1702
|
+
options.apply_defaults timeout: @config.rpcs.run_asset_discovery.timeout,
|
1703
|
+
metadata: call_metadata,
|
1704
|
+
retry_policy: @config.rpcs.run_asset_discovery.retry_policy
|
1705
|
+
|
1706
|
+
options.apply_defaults timeout: @config.timeout,
|
1707
|
+
metadata: @config.metadata,
|
1708
|
+
retry_policy: @config.retry_policy
|
1709
|
+
|
1710
|
+
@security_center_stub.run_asset_discovery request, options do |result, operation|
|
1711
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1712
|
+
yield result, operation if block_given?
|
1713
|
+
return result
|
1714
|
+
end
|
1715
|
+
rescue ::Gapic::Rest::Error => e
|
1716
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1717
|
+
end
|
1718
|
+
|
1719
|
+
##
|
1720
|
+
# Updates the state of a finding.
|
1721
|
+
#
|
1722
|
+
# @overload set_finding_state(request, options = nil)
|
1723
|
+
# Pass arguments to `set_finding_state` via a request object, either of type
|
1724
|
+
# {::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest} or an equivalent Hash.
|
1725
|
+
#
|
1726
|
+
# @param request [::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest, ::Hash]
|
1727
|
+
# A request object representing the call parameters. Required. To specify no
|
1728
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1729
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1730
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1731
|
+
#
|
1732
|
+
# @overload set_finding_state(name: nil, state: nil, start_time: nil)
|
1733
|
+
# Pass arguments to `set_finding_state` via keyword arguments. Note that at
|
1734
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1735
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1736
|
+
#
|
1737
|
+
# @param name [::String]
|
1738
|
+
# Required. The relative resource name of the finding. See:
|
1739
|
+
# https://cloud.google.com/apis/design/resource_names#relative_resource_name
|
1740
|
+
# Example:
|
1741
|
+
# "organizations/\\{organization_id}/sources/\\{source_id}/finding/\\{finding_id}".
|
1742
|
+
# @param state [::Google::Cloud::SecurityCenter::V1p1beta1::Finding::State]
|
1743
|
+
# Required. The desired State of the finding.
|
1744
|
+
# @param start_time [::Google::Protobuf::Timestamp, ::Hash]
|
1745
|
+
# Required. The time at which the updated state takes effect.
|
1746
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1747
|
+
# @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::Finding]
|
1748
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1749
|
+
#
|
1750
|
+
# @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding]
|
1751
|
+
#
|
1752
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1753
|
+
def set_finding_state request, options = nil
|
1754
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1755
|
+
|
1756
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest
|
1757
|
+
|
1758
|
+
# Converts hash and nil to an options object
|
1759
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1760
|
+
|
1761
|
+
# Customize the options with defaults
|
1762
|
+
call_metadata = @config.rpcs.set_finding_state.metadata.to_h
|
1763
|
+
|
1764
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1765
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1766
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1767
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION,
|
1768
|
+
transports_version_send: [:rest]
|
1769
|
+
|
1770
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1771
|
+
|
1772
|
+
options.apply_defaults timeout: @config.rpcs.set_finding_state.timeout,
|
1773
|
+
metadata: call_metadata,
|
1774
|
+
retry_policy: @config.rpcs.set_finding_state.retry_policy
|
1775
|
+
|
1776
|
+
options.apply_defaults timeout: @config.timeout,
|
1777
|
+
metadata: @config.metadata,
|
1778
|
+
retry_policy: @config.retry_policy
|
1779
|
+
|
1780
|
+
@security_center_stub.set_finding_state request, options do |result, operation|
|
1781
|
+
yield result, operation if block_given?
|
1782
|
+
return result
|
1783
|
+
end
|
1784
|
+
rescue ::Gapic::Rest::Error => e
|
1785
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1786
|
+
end
|
1787
|
+
|
1788
|
+
##
|
1789
|
+
# Sets the access control policy on the specified Source.
|
1790
|
+
#
|
1791
|
+
# @overload set_iam_policy(request, options = nil)
|
1792
|
+
# Pass arguments to `set_iam_policy` via a request object, either of type
|
1793
|
+
# {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
|
1794
|
+
#
|
1795
|
+
# @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash]
|
1796
|
+
# A request object representing the call parameters. Required. To specify no
|
1797
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1798
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1799
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1800
|
+
#
|
1801
|
+
# @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil)
|
1802
|
+
# Pass arguments to `set_iam_policy` via keyword arguments. Note that at
|
1803
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1804
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1805
|
+
#
|
1806
|
+
# @param resource [::String]
|
1807
|
+
# REQUIRED: The resource for which the policy is being specified.
|
1808
|
+
# See the operation documentation for the appropriate value for this field.
|
1809
|
+
# @param policy [::Google::Iam::V1::Policy, ::Hash]
|
1810
|
+
# REQUIRED: The complete policy to be applied to the `resource`. The size of
|
1811
|
+
# the policy is limited to a few 10s of KB. An empty policy is a
|
1812
|
+
# valid policy but certain Cloud Platform services (such as Projects)
|
1813
|
+
# might reject them.
|
1814
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
1815
|
+
# OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
|
1816
|
+
# the fields in the mask will be modified. If no mask is provided, the
|
1817
|
+
# following default mask is used:
|
1818
|
+
#
|
1819
|
+
# `paths: "bindings, etag"`
|
1820
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1821
|
+
# @yieldparam result [::Google::Iam::V1::Policy]
|
1822
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1823
|
+
#
|
1824
|
+
# @return [::Google::Iam::V1::Policy]
|
1825
|
+
#
|
1826
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1827
|
+
def set_iam_policy request, options = nil
|
1828
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1829
|
+
|
1830
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest
|
1831
|
+
|
1832
|
+
# Converts hash and nil to an options object
|
1833
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1834
|
+
|
1835
|
+
# Customize the options with defaults
|
1836
|
+
call_metadata = @config.rpcs.set_iam_policy.metadata.to_h
|
1837
|
+
|
1838
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1839
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1840
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1841
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION,
|
1842
|
+
transports_version_send: [:rest]
|
1843
|
+
|
1844
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1845
|
+
|
1846
|
+
options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
|
1847
|
+
metadata: call_metadata,
|
1848
|
+
retry_policy: @config.rpcs.set_iam_policy.retry_policy
|
1849
|
+
|
1850
|
+
options.apply_defaults timeout: @config.timeout,
|
1851
|
+
metadata: @config.metadata,
|
1852
|
+
retry_policy: @config.retry_policy
|
1853
|
+
|
1854
|
+
@security_center_stub.set_iam_policy request, options do |result, operation|
|
1855
|
+
yield result, operation if block_given?
|
1856
|
+
return result
|
1857
|
+
end
|
1858
|
+
rescue ::Gapic::Rest::Error => e
|
1859
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1860
|
+
end
|
1861
|
+
|
1862
|
+
##
|
1863
|
+
# Returns the permissions that a caller has on the specified source.
|
1864
|
+
#
|
1865
|
+
# @overload test_iam_permissions(request, options = nil)
|
1866
|
+
# Pass arguments to `test_iam_permissions` via a request object, either of type
|
1867
|
+
# {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash.
|
1868
|
+
#
|
1869
|
+
# @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash]
|
1870
|
+
# A request object representing the call parameters. Required. To specify no
|
1871
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1872
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1873
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1874
|
+
#
|
1875
|
+
# @overload test_iam_permissions(resource: nil, permissions: nil)
|
1876
|
+
# Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
|
1877
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1878
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1879
|
+
#
|
1880
|
+
# @param resource [::String]
|
1881
|
+
# REQUIRED: The resource for which the policy detail is being requested.
|
1882
|
+
# See the operation documentation for the appropriate value for this field.
|
1883
|
+
# @param permissions [::Array<::String>]
|
1884
|
+
# The set of permissions to check for the `resource`. Permissions with
|
1885
|
+
# wildcards (such as '*' or 'storage.*') are not allowed. For more
|
1886
|
+
# information see
|
1887
|
+
# [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
|
1888
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1889
|
+
# @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse]
|
1890
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1891
|
+
#
|
1892
|
+
# @return [::Google::Iam::V1::TestIamPermissionsResponse]
|
1893
|
+
#
|
1894
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1895
|
+
def test_iam_permissions request, options = nil
|
1896
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1897
|
+
|
1898
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest
|
1899
|
+
|
1900
|
+
# Converts hash and nil to an options object
|
1901
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1902
|
+
|
1903
|
+
# Customize the options with defaults
|
1904
|
+
call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
|
1905
|
+
|
1906
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1907
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1908
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1909
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION,
|
1910
|
+
transports_version_send: [:rest]
|
1911
|
+
|
1912
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1913
|
+
|
1914
|
+
options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
|
1915
|
+
metadata: call_metadata,
|
1916
|
+
retry_policy: @config.rpcs.test_iam_permissions.retry_policy
|
1917
|
+
|
1918
|
+
options.apply_defaults timeout: @config.timeout,
|
1919
|
+
metadata: @config.metadata,
|
1920
|
+
retry_policy: @config.retry_policy
|
1921
|
+
|
1922
|
+
@security_center_stub.test_iam_permissions request, options do |result, operation|
|
1923
|
+
yield result, operation if block_given?
|
1924
|
+
return result
|
1925
|
+
end
|
1926
|
+
rescue ::Gapic::Rest::Error => e
|
1927
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1928
|
+
end
|
1929
|
+
|
1930
|
+
##
|
1931
|
+
# Creates or updates a finding. The corresponding source must exist for a
|
1932
|
+
# finding creation to succeed.
|
1933
|
+
#
|
1934
|
+
# @overload update_finding(request, options = nil)
|
1935
|
+
# Pass arguments to `update_finding` via a request object, either of type
|
1936
|
+
# {::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest} or an equivalent Hash.
|
1937
|
+
#
|
1938
|
+
# @param request [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest, ::Hash]
|
1939
|
+
# A request object representing the call parameters. Required. To specify no
|
1940
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1941
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1942
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1943
|
+
#
|
1944
|
+
# @overload update_finding(finding: nil, update_mask: nil)
|
1945
|
+
# Pass arguments to `update_finding` via keyword arguments. Note that at
|
1946
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1947
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1948
|
+
#
|
1949
|
+
# @param finding [::Google::Cloud::SecurityCenter::V1p1beta1::Finding, ::Hash]
|
1950
|
+
# Required. The finding resource to update or create if it does not already exist.
|
1951
|
+
# parent, security_marks, and update_time will be ignored.
|
1952
|
+
#
|
1953
|
+
# In the case of creation, the finding id portion of the name must be
|
1954
|
+
# alphanumeric and less than or equal to 32 characters and greater than 0
|
1955
|
+
# characters in length.
|
1956
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
1957
|
+
# The FieldMask to use when updating the finding resource. This field should
|
1958
|
+
# not be specified when creating a finding.
|
1959
|
+
#
|
1960
|
+
# When updating a finding, an empty mask is treated as updating all mutable
|
1961
|
+
# fields and replacing source_properties. Individual source_properties can
|
1962
|
+
# be added/updated by using "source_properties.<property key>" in the field
|
1963
|
+
# mask.
|
1964
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1965
|
+
# @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::Finding]
|
1966
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1967
|
+
#
|
1968
|
+
# @return [::Google::Cloud::SecurityCenter::V1p1beta1::Finding]
|
1969
|
+
#
|
1970
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1971
|
+
def update_finding request, options = nil
|
1972
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1973
|
+
|
1974
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest
|
1975
|
+
|
1976
|
+
# Converts hash and nil to an options object
|
1977
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1978
|
+
|
1979
|
+
# Customize the options with defaults
|
1980
|
+
call_metadata = @config.rpcs.update_finding.metadata.to_h
|
1981
|
+
|
1982
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1983
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1984
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1985
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION,
|
1986
|
+
transports_version_send: [:rest]
|
1987
|
+
|
1988
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1989
|
+
|
1990
|
+
options.apply_defaults timeout: @config.rpcs.update_finding.timeout,
|
1991
|
+
metadata: call_metadata,
|
1992
|
+
retry_policy: @config.rpcs.update_finding.retry_policy
|
1993
|
+
|
1994
|
+
options.apply_defaults timeout: @config.timeout,
|
1995
|
+
metadata: @config.metadata,
|
1996
|
+
retry_policy: @config.retry_policy
|
1997
|
+
|
1998
|
+
@security_center_stub.update_finding request, options do |result, operation|
|
1999
|
+
yield result, operation if block_given?
|
2000
|
+
return result
|
2001
|
+
end
|
2002
|
+
rescue ::Gapic::Rest::Error => e
|
2003
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2004
|
+
end
|
2005
|
+
|
2006
|
+
##
|
2007
|
+
# Updates a notification config. The following update
|
2008
|
+
# fields are allowed: description, pubsub_topic, streaming_config.filter
|
2009
|
+
#
|
2010
|
+
# @overload update_notification_config(request, options = nil)
|
2011
|
+
# Pass arguments to `update_notification_config` via a request object, either of type
|
2012
|
+
# {::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest} or an equivalent Hash.
|
2013
|
+
#
|
2014
|
+
# @param request [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest, ::Hash]
|
2015
|
+
# A request object representing the call parameters. Required. To specify no
|
2016
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2017
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2018
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2019
|
+
#
|
2020
|
+
# @overload update_notification_config(notification_config: nil, update_mask: nil)
|
2021
|
+
# Pass arguments to `update_notification_config` via keyword arguments. Note that at
|
2022
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2023
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2024
|
+
#
|
2025
|
+
# @param notification_config [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig, ::Hash]
|
2026
|
+
# Required. The notification config to update.
|
2027
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
2028
|
+
# The FieldMask to use when updating the notification config.
|
2029
|
+
#
|
2030
|
+
# If empty all mutable fields will be updated.
|
2031
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2032
|
+
# @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig]
|
2033
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2034
|
+
#
|
2035
|
+
# @return [::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig]
|
2036
|
+
#
|
2037
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2038
|
+
def update_notification_config request, options = nil
|
2039
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2040
|
+
|
2041
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest
|
2042
|
+
|
2043
|
+
# Converts hash and nil to an options object
|
2044
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2045
|
+
|
2046
|
+
# Customize the options with defaults
|
2047
|
+
call_metadata = @config.rpcs.update_notification_config.metadata.to_h
|
2048
|
+
|
2049
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2050
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2051
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2052
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION,
|
2053
|
+
transports_version_send: [:rest]
|
2054
|
+
|
2055
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2056
|
+
|
2057
|
+
options.apply_defaults timeout: @config.rpcs.update_notification_config.timeout,
|
2058
|
+
metadata: call_metadata,
|
2059
|
+
retry_policy: @config.rpcs.update_notification_config.retry_policy
|
2060
|
+
|
2061
|
+
options.apply_defaults timeout: @config.timeout,
|
2062
|
+
metadata: @config.metadata,
|
2063
|
+
retry_policy: @config.retry_policy
|
2064
|
+
|
2065
|
+
@security_center_stub.update_notification_config request, options do |result, operation|
|
2066
|
+
yield result, operation if block_given?
|
2067
|
+
return result
|
2068
|
+
end
|
2069
|
+
rescue ::Gapic::Rest::Error => e
|
2070
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2071
|
+
end
|
2072
|
+
|
2073
|
+
##
|
2074
|
+
# Updates an organization's settings.
|
2075
|
+
#
|
2076
|
+
# @overload update_organization_settings(request, options = nil)
|
2077
|
+
# Pass arguments to `update_organization_settings` via a request object, either of type
|
2078
|
+
# {::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest} or an equivalent Hash.
|
2079
|
+
#
|
2080
|
+
# @param request [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest, ::Hash]
|
2081
|
+
# A request object representing the call parameters. Required. To specify no
|
2082
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2083
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2084
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2085
|
+
#
|
2086
|
+
# @overload update_organization_settings(organization_settings: nil, update_mask: nil)
|
2087
|
+
# Pass arguments to `update_organization_settings` via keyword arguments. Note that at
|
2088
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2089
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2090
|
+
#
|
2091
|
+
# @param organization_settings [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings, ::Hash]
|
2092
|
+
# Required. The organization settings resource to update.
|
2093
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
2094
|
+
# The FieldMask to use when updating the settings resource.
|
2095
|
+
#
|
2096
|
+
# If empty all mutable fields will be updated.
|
2097
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2098
|
+
# @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings]
|
2099
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2100
|
+
#
|
2101
|
+
# @return [::Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings]
|
2102
|
+
#
|
2103
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2104
|
+
def update_organization_settings request, options = nil
|
2105
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2106
|
+
|
2107
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest
|
2108
|
+
|
2109
|
+
# Converts hash and nil to an options object
|
2110
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2111
|
+
|
2112
|
+
# Customize the options with defaults
|
2113
|
+
call_metadata = @config.rpcs.update_organization_settings.metadata.to_h
|
2114
|
+
|
2115
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2116
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2117
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2118
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION,
|
2119
|
+
transports_version_send: [:rest]
|
2120
|
+
|
2121
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2122
|
+
|
2123
|
+
options.apply_defaults timeout: @config.rpcs.update_organization_settings.timeout,
|
2124
|
+
metadata: call_metadata,
|
2125
|
+
retry_policy: @config.rpcs.update_organization_settings.retry_policy
|
2126
|
+
|
2127
|
+
options.apply_defaults timeout: @config.timeout,
|
2128
|
+
metadata: @config.metadata,
|
2129
|
+
retry_policy: @config.retry_policy
|
2130
|
+
|
2131
|
+
@security_center_stub.update_organization_settings request, options do |result, operation|
|
2132
|
+
yield result, operation if block_given?
|
2133
|
+
return result
|
2134
|
+
end
|
2135
|
+
rescue ::Gapic::Rest::Error => e
|
2136
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2137
|
+
end
|
2138
|
+
|
2139
|
+
##
|
2140
|
+
# Updates a source.
|
2141
|
+
#
|
2142
|
+
# @overload update_source(request, options = nil)
|
2143
|
+
# Pass arguments to `update_source` via a request object, either of type
|
2144
|
+
# {::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest} or an equivalent Hash.
|
2145
|
+
#
|
2146
|
+
# @param request [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest, ::Hash]
|
2147
|
+
# A request object representing the call parameters. Required. To specify no
|
2148
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2149
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2150
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2151
|
+
#
|
2152
|
+
# @overload update_source(source: nil, update_mask: nil)
|
2153
|
+
# Pass arguments to `update_source` via keyword arguments. Note that at
|
2154
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2155
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2156
|
+
#
|
2157
|
+
# @param source [::Google::Cloud::SecurityCenter::V1p1beta1::Source, ::Hash]
|
2158
|
+
# Required. The source resource to update.
|
2159
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
2160
|
+
# The FieldMask to use when updating the source resource.
|
2161
|
+
#
|
2162
|
+
# If empty all mutable fields will be updated.
|
2163
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2164
|
+
# @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::Source]
|
2165
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2166
|
+
#
|
2167
|
+
# @return [::Google::Cloud::SecurityCenter::V1p1beta1::Source]
|
2168
|
+
#
|
2169
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2170
|
+
def update_source request, options = nil
|
2171
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2172
|
+
|
2173
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest
|
2174
|
+
|
2175
|
+
# Converts hash and nil to an options object
|
2176
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2177
|
+
|
2178
|
+
# Customize the options with defaults
|
2179
|
+
call_metadata = @config.rpcs.update_source.metadata.to_h
|
2180
|
+
|
2181
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2182
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2183
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2184
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION,
|
2185
|
+
transports_version_send: [:rest]
|
2186
|
+
|
2187
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2188
|
+
|
2189
|
+
options.apply_defaults timeout: @config.rpcs.update_source.timeout,
|
2190
|
+
metadata: call_metadata,
|
2191
|
+
retry_policy: @config.rpcs.update_source.retry_policy
|
2192
|
+
|
2193
|
+
options.apply_defaults timeout: @config.timeout,
|
2194
|
+
metadata: @config.metadata,
|
2195
|
+
retry_policy: @config.retry_policy
|
2196
|
+
|
2197
|
+
@security_center_stub.update_source request, options do |result, operation|
|
2198
|
+
yield result, operation if block_given?
|
2199
|
+
return result
|
2200
|
+
end
|
2201
|
+
rescue ::Gapic::Rest::Error => e
|
2202
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2203
|
+
end
|
2204
|
+
|
2205
|
+
##
|
2206
|
+
# Updates security marks.
|
2207
|
+
#
|
2208
|
+
# @overload update_security_marks(request, options = nil)
|
2209
|
+
# Pass arguments to `update_security_marks` via a request object, either of type
|
2210
|
+
# {::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest} or an equivalent Hash.
|
2211
|
+
#
|
2212
|
+
# @param request [::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest, ::Hash]
|
2213
|
+
# A request object representing the call parameters. Required. To specify no
|
2214
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2215
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2216
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
2217
|
+
#
|
2218
|
+
# @overload update_security_marks(security_marks: nil, update_mask: nil, start_time: nil)
|
2219
|
+
# Pass arguments to `update_security_marks` via keyword arguments. Note that at
|
2220
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2221
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2222
|
+
#
|
2223
|
+
# @param security_marks [::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks, ::Hash]
|
2224
|
+
# Required. The security marks resource to update.
|
2225
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
2226
|
+
# The FieldMask to use when updating the security marks resource.
|
2227
|
+
#
|
2228
|
+
# The field mask must not contain duplicate fields.
|
2229
|
+
# If empty or set to "marks", all marks will be replaced. Individual
|
2230
|
+
# marks can be updated using "marks.<mark_key>".
|
2231
|
+
# @param start_time [::Google::Protobuf::Timestamp, ::Hash]
|
2232
|
+
# The time at which the updated SecurityMarks take effect.
|
2233
|
+
# If not set uses current server time. Updates will be applied to the
|
2234
|
+
# SecurityMarks that are active immediately preceding this time.
|
2235
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
2236
|
+
# @yieldparam result [::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks]
|
2237
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
2238
|
+
#
|
2239
|
+
# @return [::Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks]
|
2240
|
+
#
|
2241
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
2242
|
+
def update_security_marks request, options = nil
|
2243
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2244
|
+
|
2245
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest
|
2246
|
+
|
2247
|
+
# Converts hash and nil to an options object
|
2248
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2249
|
+
|
2250
|
+
# Customize the options with defaults
|
2251
|
+
call_metadata = @config.rpcs.update_security_marks.metadata.to_h
|
2252
|
+
|
2253
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2254
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2255
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2256
|
+
gapic_version: ::Google::Cloud::SecurityCenter::V1p1beta1::VERSION,
|
2257
|
+
transports_version_send: [:rest]
|
2258
|
+
|
2259
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2260
|
+
|
2261
|
+
options.apply_defaults timeout: @config.rpcs.update_security_marks.timeout,
|
2262
|
+
metadata: call_metadata,
|
2263
|
+
retry_policy: @config.rpcs.update_security_marks.retry_policy
|
2264
|
+
|
2265
|
+
options.apply_defaults timeout: @config.timeout,
|
2266
|
+
metadata: @config.metadata,
|
2267
|
+
retry_policy: @config.retry_policy
|
2268
|
+
|
2269
|
+
@security_center_stub.update_security_marks request, options do |result, operation|
|
2270
|
+
yield result, operation if block_given?
|
2271
|
+
return result
|
2272
|
+
end
|
2273
|
+
rescue ::Gapic::Rest::Error => e
|
2274
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2275
|
+
end
|
2276
|
+
|
2277
|
+
##
|
2278
|
+
# Configuration class for the SecurityCenter REST API.
|
2279
|
+
#
|
2280
|
+
# This class represents the configuration for SecurityCenter REST,
|
2281
|
+
# providing control over timeouts, retry behavior, logging, transport
|
2282
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
2283
|
+
# applied individually to specific RPCs. See
|
2284
|
+
# {::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client::Configuration::Rpcs}
|
2285
|
+
# for a list of RPCs that can be configured independently.
|
2286
|
+
#
|
2287
|
+
# Configuration can be applied globally to all clients, or to a single client
|
2288
|
+
# on construction.
|
2289
|
+
#
|
2290
|
+
# @example
|
2291
|
+
#
|
2292
|
+
# # Modify the global config, setting the timeout for
|
2293
|
+
# # create_source to 20 seconds,
|
2294
|
+
# # and all remaining timeouts to 10 seconds.
|
2295
|
+
# ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.configure do |config|
|
2296
|
+
# config.timeout = 10.0
|
2297
|
+
# config.rpcs.create_source.timeout = 20.0
|
2298
|
+
# end
|
2299
|
+
#
|
2300
|
+
# # Apply the above configuration only to a new client.
|
2301
|
+
# client = ::Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Rest::Client.new do |config|
|
2302
|
+
# config.timeout = 10.0
|
2303
|
+
# config.rpcs.create_source.timeout = 20.0
|
2304
|
+
# end
|
2305
|
+
#
|
2306
|
+
# @!attribute [rw] endpoint
|
2307
|
+
# The hostname or hostname:port of the service endpoint.
|
2308
|
+
# Defaults to `"securitycenter.googleapis.com"`.
|
2309
|
+
# @return [::String]
|
2310
|
+
# @!attribute [rw] credentials
|
2311
|
+
# Credentials to send with calls. You may provide any of the following types:
|
2312
|
+
# * (`String`) The path to a service account key file in JSON format
|
2313
|
+
# * (`Hash`) A service account key as a Hash
|
2314
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
2315
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
2316
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
2317
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
2318
|
+
# * (`nil`) indicating no credentials
|
2319
|
+
# @return [::Object]
|
2320
|
+
# @!attribute [rw] scope
|
2321
|
+
# The OAuth scopes
|
2322
|
+
# @return [::Array<::String>]
|
2323
|
+
# @!attribute [rw] lib_name
|
2324
|
+
# The library name as recorded in instrumentation and logging
|
2325
|
+
# @return [::String]
|
2326
|
+
# @!attribute [rw] lib_version
|
2327
|
+
# The library version as recorded in instrumentation and logging
|
2328
|
+
# @return [::String]
|
2329
|
+
# @!attribute [rw] timeout
|
2330
|
+
# The call timeout in seconds.
|
2331
|
+
# @return [::Numeric]
|
2332
|
+
# @!attribute [rw] metadata
|
2333
|
+
# Additional headers to be sent with the call.
|
2334
|
+
# @return [::Hash{::Symbol=>::String}]
|
2335
|
+
# @!attribute [rw] retry_policy
|
2336
|
+
# The retry policy. The value is a hash with the following keys:
|
2337
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
2338
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
2339
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
2340
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
2341
|
+
# trigger a retry.
|
2342
|
+
# @return [::Hash]
|
2343
|
+
# @!attribute [rw] quota_project
|
2344
|
+
# A separate project against which to charge quota.
|
2345
|
+
# @return [::String]
|
2346
|
+
#
|
2347
|
+
class Configuration
|
2348
|
+
extend ::Gapic::Config
|
2349
|
+
|
2350
|
+
config_attr :endpoint, "securitycenter.googleapis.com", ::String
|
2351
|
+
config_attr :credentials, nil do |value|
|
2352
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
2353
|
+
allowed.any? { |klass| klass === value }
|
2354
|
+
end
|
2355
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
2356
|
+
config_attr :lib_name, nil, ::String, nil
|
2357
|
+
config_attr :lib_version, nil, ::String, nil
|
2358
|
+
config_attr :timeout, nil, ::Numeric, nil
|
2359
|
+
config_attr :metadata, nil, ::Hash, nil
|
2360
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
2361
|
+
config_attr :quota_project, nil, ::String, nil
|
2362
|
+
|
2363
|
+
# @private
|
2364
|
+
def initialize parent_config = nil
|
2365
|
+
@parent_config = parent_config unless parent_config.nil?
|
2366
|
+
|
2367
|
+
yield self if block_given?
|
2368
|
+
end
|
2369
|
+
|
2370
|
+
##
|
2371
|
+
# Configurations for individual RPCs
|
2372
|
+
# @return [Rpcs]
|
2373
|
+
#
|
2374
|
+
def rpcs
|
2375
|
+
@rpcs ||= begin
|
2376
|
+
parent_rpcs = nil
|
2377
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
2378
|
+
Rpcs.new parent_rpcs
|
2379
|
+
end
|
2380
|
+
end
|
2381
|
+
|
2382
|
+
##
|
2383
|
+
# Configuration RPC class for the SecurityCenter API.
|
2384
|
+
#
|
2385
|
+
# Includes fields providing the configuration for each RPC in this service.
|
2386
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
2387
|
+
# the following configuration fields:
|
2388
|
+
#
|
2389
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
2390
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
2391
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
2392
|
+
# include the following keys:
|
2393
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
2394
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
2395
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
2396
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
2397
|
+
# trigger a retry.
|
2398
|
+
#
|
2399
|
+
class Rpcs
|
2400
|
+
##
|
2401
|
+
# RPC-specific configuration for `create_source`
|
2402
|
+
# @return [::Gapic::Config::Method]
|
2403
|
+
#
|
2404
|
+
attr_reader :create_source
|
2405
|
+
##
|
2406
|
+
# RPC-specific configuration for `create_finding`
|
2407
|
+
# @return [::Gapic::Config::Method]
|
2408
|
+
#
|
2409
|
+
attr_reader :create_finding
|
2410
|
+
##
|
2411
|
+
# RPC-specific configuration for `create_notification_config`
|
2412
|
+
# @return [::Gapic::Config::Method]
|
2413
|
+
#
|
2414
|
+
attr_reader :create_notification_config
|
2415
|
+
##
|
2416
|
+
# RPC-specific configuration for `delete_notification_config`
|
2417
|
+
# @return [::Gapic::Config::Method]
|
2418
|
+
#
|
2419
|
+
attr_reader :delete_notification_config
|
2420
|
+
##
|
2421
|
+
# RPC-specific configuration for `get_iam_policy`
|
2422
|
+
# @return [::Gapic::Config::Method]
|
2423
|
+
#
|
2424
|
+
attr_reader :get_iam_policy
|
2425
|
+
##
|
2426
|
+
# RPC-specific configuration for `get_notification_config`
|
2427
|
+
# @return [::Gapic::Config::Method]
|
2428
|
+
#
|
2429
|
+
attr_reader :get_notification_config
|
2430
|
+
##
|
2431
|
+
# RPC-specific configuration for `get_organization_settings`
|
2432
|
+
# @return [::Gapic::Config::Method]
|
2433
|
+
#
|
2434
|
+
attr_reader :get_organization_settings
|
2435
|
+
##
|
2436
|
+
# RPC-specific configuration for `get_source`
|
2437
|
+
# @return [::Gapic::Config::Method]
|
2438
|
+
#
|
2439
|
+
attr_reader :get_source
|
2440
|
+
##
|
2441
|
+
# RPC-specific configuration for `group_assets`
|
2442
|
+
# @return [::Gapic::Config::Method]
|
2443
|
+
#
|
2444
|
+
attr_reader :group_assets
|
2445
|
+
##
|
2446
|
+
# RPC-specific configuration for `group_findings`
|
2447
|
+
# @return [::Gapic::Config::Method]
|
2448
|
+
#
|
2449
|
+
attr_reader :group_findings
|
2450
|
+
##
|
2451
|
+
# RPC-specific configuration for `list_assets`
|
2452
|
+
# @return [::Gapic::Config::Method]
|
2453
|
+
#
|
2454
|
+
attr_reader :list_assets
|
2455
|
+
##
|
2456
|
+
# RPC-specific configuration for `list_findings`
|
2457
|
+
# @return [::Gapic::Config::Method]
|
2458
|
+
#
|
2459
|
+
attr_reader :list_findings
|
2460
|
+
##
|
2461
|
+
# RPC-specific configuration for `list_notification_configs`
|
2462
|
+
# @return [::Gapic::Config::Method]
|
2463
|
+
#
|
2464
|
+
attr_reader :list_notification_configs
|
2465
|
+
##
|
2466
|
+
# RPC-specific configuration for `list_sources`
|
2467
|
+
# @return [::Gapic::Config::Method]
|
2468
|
+
#
|
2469
|
+
attr_reader :list_sources
|
2470
|
+
##
|
2471
|
+
# RPC-specific configuration for `run_asset_discovery`
|
2472
|
+
# @return [::Gapic::Config::Method]
|
2473
|
+
#
|
2474
|
+
attr_reader :run_asset_discovery
|
2475
|
+
##
|
2476
|
+
# RPC-specific configuration for `set_finding_state`
|
2477
|
+
# @return [::Gapic::Config::Method]
|
2478
|
+
#
|
2479
|
+
attr_reader :set_finding_state
|
2480
|
+
##
|
2481
|
+
# RPC-specific configuration for `set_iam_policy`
|
2482
|
+
# @return [::Gapic::Config::Method]
|
2483
|
+
#
|
2484
|
+
attr_reader :set_iam_policy
|
2485
|
+
##
|
2486
|
+
# RPC-specific configuration for `test_iam_permissions`
|
2487
|
+
# @return [::Gapic::Config::Method]
|
2488
|
+
#
|
2489
|
+
attr_reader :test_iam_permissions
|
2490
|
+
##
|
2491
|
+
# RPC-specific configuration for `update_finding`
|
2492
|
+
# @return [::Gapic::Config::Method]
|
2493
|
+
#
|
2494
|
+
attr_reader :update_finding
|
2495
|
+
##
|
2496
|
+
# RPC-specific configuration for `update_notification_config`
|
2497
|
+
# @return [::Gapic::Config::Method]
|
2498
|
+
#
|
2499
|
+
attr_reader :update_notification_config
|
2500
|
+
##
|
2501
|
+
# RPC-specific configuration for `update_organization_settings`
|
2502
|
+
# @return [::Gapic::Config::Method]
|
2503
|
+
#
|
2504
|
+
attr_reader :update_organization_settings
|
2505
|
+
##
|
2506
|
+
# RPC-specific configuration for `update_source`
|
2507
|
+
# @return [::Gapic::Config::Method]
|
2508
|
+
#
|
2509
|
+
attr_reader :update_source
|
2510
|
+
##
|
2511
|
+
# RPC-specific configuration for `update_security_marks`
|
2512
|
+
# @return [::Gapic::Config::Method]
|
2513
|
+
#
|
2514
|
+
attr_reader :update_security_marks
|
2515
|
+
|
2516
|
+
# @private
|
2517
|
+
def initialize parent_rpcs = nil
|
2518
|
+
create_source_config = parent_rpcs.create_source if parent_rpcs.respond_to? :create_source
|
2519
|
+
@create_source = ::Gapic::Config::Method.new create_source_config
|
2520
|
+
create_finding_config = parent_rpcs.create_finding if parent_rpcs.respond_to? :create_finding
|
2521
|
+
@create_finding = ::Gapic::Config::Method.new create_finding_config
|
2522
|
+
create_notification_config_config = parent_rpcs.create_notification_config if parent_rpcs.respond_to? :create_notification_config
|
2523
|
+
@create_notification_config = ::Gapic::Config::Method.new create_notification_config_config
|
2524
|
+
delete_notification_config_config = parent_rpcs.delete_notification_config if parent_rpcs.respond_to? :delete_notification_config
|
2525
|
+
@delete_notification_config = ::Gapic::Config::Method.new delete_notification_config_config
|
2526
|
+
get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
|
2527
|
+
@get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
|
2528
|
+
get_notification_config_config = parent_rpcs.get_notification_config if parent_rpcs.respond_to? :get_notification_config
|
2529
|
+
@get_notification_config = ::Gapic::Config::Method.new get_notification_config_config
|
2530
|
+
get_organization_settings_config = parent_rpcs.get_organization_settings if parent_rpcs.respond_to? :get_organization_settings
|
2531
|
+
@get_organization_settings = ::Gapic::Config::Method.new get_organization_settings_config
|
2532
|
+
get_source_config = parent_rpcs.get_source if parent_rpcs.respond_to? :get_source
|
2533
|
+
@get_source = ::Gapic::Config::Method.new get_source_config
|
2534
|
+
group_assets_config = parent_rpcs.group_assets if parent_rpcs.respond_to? :group_assets
|
2535
|
+
@group_assets = ::Gapic::Config::Method.new group_assets_config
|
2536
|
+
group_findings_config = parent_rpcs.group_findings if parent_rpcs.respond_to? :group_findings
|
2537
|
+
@group_findings = ::Gapic::Config::Method.new group_findings_config
|
2538
|
+
list_assets_config = parent_rpcs.list_assets if parent_rpcs.respond_to? :list_assets
|
2539
|
+
@list_assets = ::Gapic::Config::Method.new list_assets_config
|
2540
|
+
list_findings_config = parent_rpcs.list_findings if parent_rpcs.respond_to? :list_findings
|
2541
|
+
@list_findings = ::Gapic::Config::Method.new list_findings_config
|
2542
|
+
list_notification_configs_config = parent_rpcs.list_notification_configs if parent_rpcs.respond_to? :list_notification_configs
|
2543
|
+
@list_notification_configs = ::Gapic::Config::Method.new list_notification_configs_config
|
2544
|
+
list_sources_config = parent_rpcs.list_sources if parent_rpcs.respond_to? :list_sources
|
2545
|
+
@list_sources = ::Gapic::Config::Method.new list_sources_config
|
2546
|
+
run_asset_discovery_config = parent_rpcs.run_asset_discovery if parent_rpcs.respond_to? :run_asset_discovery
|
2547
|
+
@run_asset_discovery = ::Gapic::Config::Method.new run_asset_discovery_config
|
2548
|
+
set_finding_state_config = parent_rpcs.set_finding_state if parent_rpcs.respond_to? :set_finding_state
|
2549
|
+
@set_finding_state = ::Gapic::Config::Method.new set_finding_state_config
|
2550
|
+
set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
|
2551
|
+
@set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
|
2552
|
+
test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
|
2553
|
+
@test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
|
2554
|
+
update_finding_config = parent_rpcs.update_finding if parent_rpcs.respond_to? :update_finding
|
2555
|
+
@update_finding = ::Gapic::Config::Method.new update_finding_config
|
2556
|
+
update_notification_config_config = parent_rpcs.update_notification_config if parent_rpcs.respond_to? :update_notification_config
|
2557
|
+
@update_notification_config = ::Gapic::Config::Method.new update_notification_config_config
|
2558
|
+
update_organization_settings_config = parent_rpcs.update_organization_settings if parent_rpcs.respond_to? :update_organization_settings
|
2559
|
+
@update_organization_settings = ::Gapic::Config::Method.new update_organization_settings_config
|
2560
|
+
update_source_config = parent_rpcs.update_source if parent_rpcs.respond_to? :update_source
|
2561
|
+
@update_source = ::Gapic::Config::Method.new update_source_config
|
2562
|
+
update_security_marks_config = parent_rpcs.update_security_marks if parent_rpcs.respond_to? :update_security_marks
|
2563
|
+
@update_security_marks = ::Gapic::Config::Method.new update_security_marks_config
|
2564
|
+
|
2565
|
+
yield self if block_given?
|
2566
|
+
end
|
2567
|
+
end
|
2568
|
+
end
|
2569
|
+
end
|
2570
|
+
end
|
2571
|
+
end
|
2572
|
+
end
|
2573
|
+
end
|
2574
|
+
end
|
2575
|
+
end
|