google-apis-securitycenter_v1 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2281 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module SecuritycenterV1
23
+ # Security Command Center API
24
+ #
25
+ # Security Command Center API provides access to temporal views of assets and
26
+ # findings within an organization.
27
+ #
28
+ # @example
29
+ # require 'google/apis/securitycenter_v1'
30
+ #
31
+ # Securitycenter = Google::Apis::SecuritycenterV1 # Alias the module
32
+ # service = Securitycenter::SecurityCommandCenterService.new
33
+ #
34
+ # @see https://cloud.google.com/security-command-center
35
+ class SecurityCommandCenterService < Google::Apis::Core::BaseService
36
+ # @return [String]
37
+ # API key. Your API key identifies your project and provides you with API access,
38
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
39
+ attr_accessor :key
40
+
41
+ # @return [String]
42
+ # Available to use for quota purposes for server-side applications. Can be any
43
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
44
+ attr_accessor :quota_user
45
+
46
+ def initialize
47
+ super('https://securitycenter.googleapis.com/', '',
48
+ client_name: 'google-apis-securitycenter_v1',
49
+ client_version: Google::Apis::SecuritycenterV1::GEM_VERSION)
50
+ @batch_path = 'batch'
51
+ end
52
+
53
+ # Filters an organization's assets and groups them by their specified properties.
54
+ # @param [String] parent
55
+ # Required. Name of the organization to groupBy. Its format is "organizations/[
56
+ # organization_id], folders/[folder_id], or projects/[project_id]".
57
+ # @param [Google::Apis::SecuritycenterV1::GroupAssetsRequest] group_assets_request_object
58
+ # @param [String] fields
59
+ # Selector specifying which fields to include in a partial response.
60
+ # @param [String] quota_user
61
+ # Available to use for quota purposes for server-side applications. Can be any
62
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
63
+ # @param [Google::Apis::RequestOptions] options
64
+ # Request-specific options
65
+ #
66
+ # @yield [result, err] Result & error if block supplied
67
+ # @yieldparam result [Google::Apis::SecuritycenterV1::GroupAssetsResponse] parsed result object
68
+ # @yieldparam err [StandardError] error object if request failed
69
+ #
70
+ # @return [Google::Apis::SecuritycenterV1::GroupAssetsResponse]
71
+ #
72
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
73
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
74
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
75
+ def group_folder_asset(parent, group_assets_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
76
+ command = make_simple_command(:post, 'v1/{+parent}/assets:group', options)
77
+ command.request_representation = Google::Apis::SecuritycenterV1::GroupAssetsRequest::Representation
78
+ command.request_object = group_assets_request_object
79
+ command.response_representation = Google::Apis::SecuritycenterV1::GroupAssetsResponse::Representation
80
+ command.response_class = Google::Apis::SecuritycenterV1::GroupAssetsResponse
81
+ command.params['parent'] = parent unless parent.nil?
82
+ command.query['fields'] = fields unless fields.nil?
83
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
84
+ execute_or_queue_command(command, &block)
85
+ end
86
+
87
+ # Lists an organization's assets.
88
+ # @param [String] parent
89
+ # Required. Name of the organization assets should belong to. Its format is "
90
+ # organizations/[organization_id], folders/[folder_id], or projects/[project_id]"
91
+ # .
92
+ # @param [String] compare_duration
93
+ # When compare_duration is set, the ListAssetsResult's "state_change" attribute
94
+ # is updated to indicate whether the asset was added, removed, or remained
95
+ # present during the compare_duration period of time that precedes the read_time.
96
+ # This is the time between (read_time - compare_duration) and read_time. The
97
+ # state_change value is derived based on the presence of the asset at the two
98
+ # points in time. Intermediate state changes between the two times don't affect
99
+ # the result. For example, the results aren't affected if the asset is removed
100
+ # and re-created again. Possible "state_change" values when compare_duration is
101
+ # specified: * "ADDED": indicates that the asset was not present at the start of
102
+ # compare_duration, but present at read_time. * "REMOVED": indicates that the
103
+ # asset was present at the start of compare_duration, but not present at
104
+ # read_time. * "ACTIVE": indicates that the asset was present at both the start
105
+ # and the end of the time period defined by compare_duration and read_time. If
106
+ # compare_duration is not specified, then the only possible state_change is "
107
+ # UNUSED", which will be the state_change set for all assets present at
108
+ # read_time.
109
+ # @param [String] field_mask
110
+ # A field mask to specify the ListAssetsResult fields to be listed in the
111
+ # response. An empty field mask will list all fields.
112
+ # @param [String] filter
113
+ # Expression that defines the filter to apply across assets. The expression is a
114
+ # list of zero or more restrictions combined via logical operators `AND` and `OR`
115
+ # . Parentheses are supported, and `OR` has higher precedence than `AND`.
116
+ # Restrictions have the form ` ` and may have a `-` character in front of them
117
+ # to indicate negation. The fields map to those defined in the Asset resource.
118
+ # Examples include: * name * security_center_properties.resource_name *
119
+ # resource_properties.a_property * security_marks.marks.marka The supported
120
+ # operators are: * `=` for all value types. * `>`, `<`, `>=`, `<=` for integer
121
+ # values. * `:`, meaning substring matching, for strings. The supported value
122
+ # types are: * string literals in quotes. * integer literals without quotes. *
123
+ # boolean literals `true` and `false` without quotes. The following are the
124
+ # allowed field and operator combinations: * name: `=` * update_time: `=`, `>`, `
125
+ # <`, `>=`, `<=` Usage: This should be milliseconds since epoch or an RFC3339
126
+ # string. Examples: `update_time = "2019-06-10T16:07:18-07:00"` `update_time =
127
+ # 1560208038000` * create_time: `=`, `>`, `<`, `>=`, `<=` Usage: This should be
128
+ # milliseconds since epoch or an RFC3339 string. Examples: `create_time = "2019-
129
+ # 06-10T16:07:18-07:00"` `create_time = 1560208038000` * iam_policy.policy_blob:
130
+ # `=`, `:` * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` *
131
+ # security_marks.marks: `=`, `:` * security_center_properties.resource_name: `=`,
132
+ # `:` * security_center_properties.resource_display_name: `=`, `:` *
133
+ # security_center_properties.resource_type: `=`, `:` *
134
+ # security_center_properties.resource_parent: `=`, `:` *
135
+ # security_center_properties.resource_parent_display_name: `=`, `:` *
136
+ # security_center_properties.resource_project: `=`, `:` *
137
+ # security_center_properties.resource_project_display_name: `=`, `:` *
138
+ # security_center_properties.resource_owners: `=`, `:` For example, `
139
+ # resource_properties.size = 100` is a valid filter string. Use a partial match
140
+ # on the empty string to filter based on a property existing: `
141
+ # resource_properties.my_property : ""` Use a negated partial match on the empty
142
+ # string to filter based on a property not existing: `-resource_properties.
143
+ # my_property : ""`
144
+ # @param [String] order_by
145
+ # Expression that defines what fields and order to use for sorting. The string
146
+ # value should follow SQL syntax: comma separated list of fields. For example: "
147
+ # name,resource_properties.a_property". The default sorting order is ascending.
148
+ # To specify descending order for a field, a suffix " desc" should be appended
149
+ # to the field name. For example: "name desc,resource_properties.a_property".
150
+ # Redundant space characters in the syntax are insignificant. "name desc,
151
+ # resource_properties.a_property" and " name desc , resource_properties.
152
+ # a_property " are equivalent. The following fields are supported: name
153
+ # update_time resource_properties security_marks.marks
154
+ # security_center_properties.resource_name security_center_properties.
155
+ # resource_display_name security_center_properties.resource_parent
156
+ # security_center_properties.resource_parent_display_name
157
+ # security_center_properties.resource_project security_center_properties.
158
+ # resource_project_display_name security_center_properties.resource_type
159
+ # @param [Fixnum] page_size
160
+ # The maximum number of results to return in a single response. Default is 10,
161
+ # minimum is 1, maximum is 1000.
162
+ # @param [String] page_token
163
+ # The value returned by the last `ListAssetsResponse`; indicates that this is a
164
+ # continuation of a prior `ListAssets` call, and that the system should return
165
+ # the next page of data.
166
+ # @param [String] read_time
167
+ # Time used as a reference point when filtering assets. The filter is limited to
168
+ # assets existing at the supplied time and their values are those at that
169
+ # specific time. Absence of this field will default to the API's version of NOW.
170
+ # @param [String] fields
171
+ # Selector specifying which fields to include in a partial response.
172
+ # @param [String] quota_user
173
+ # Available to use for quota purposes for server-side applications. Can be any
174
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
175
+ # @param [Google::Apis::RequestOptions] options
176
+ # Request-specific options
177
+ #
178
+ # @yield [result, err] Result & error if block supplied
179
+ # @yieldparam result [Google::Apis::SecuritycenterV1::ListAssetsResponse] parsed result object
180
+ # @yieldparam err [StandardError] error object if request failed
181
+ #
182
+ # @return [Google::Apis::SecuritycenterV1::ListAssetsResponse]
183
+ #
184
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
185
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
186
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
187
+ def list_folder_assets(parent, compare_duration: nil, field_mask: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil, read_time: nil, fields: nil, quota_user: nil, options: nil, &block)
188
+ command = make_simple_command(:get, 'v1/{+parent}/assets', options)
189
+ command.response_representation = Google::Apis::SecuritycenterV1::ListAssetsResponse::Representation
190
+ command.response_class = Google::Apis::SecuritycenterV1::ListAssetsResponse
191
+ command.params['parent'] = parent unless parent.nil?
192
+ command.query['compareDuration'] = compare_duration unless compare_duration.nil?
193
+ command.query['fieldMask'] = field_mask unless field_mask.nil?
194
+ command.query['filter'] = filter unless filter.nil?
195
+ command.query['orderBy'] = order_by unless order_by.nil?
196
+ command.query['pageSize'] = page_size unless page_size.nil?
197
+ command.query['pageToken'] = page_token unless page_token.nil?
198
+ command.query['readTime'] = read_time unless read_time.nil?
199
+ command.query['fields'] = fields unless fields.nil?
200
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
201
+ execute_or_queue_command(command, &block)
202
+ end
203
+
204
+ # Updates security marks.
205
+ # @param [String] name
206
+ # The relative resource name of the SecurityMarks. See: https://cloud.google.com/
207
+ # apis/design/resource_names#relative_resource_name Examples: "organizations/`
208
+ # organization_id`/assets/`asset_id`/securityMarks" "organizations/`
209
+ # organization_id`/sources/`source_id`/findings/`finding_id`/securityMarks".
210
+ # @param [Google::Apis::SecuritycenterV1::SecurityMarks] security_marks_object
211
+ # @param [String] start_time
212
+ # The time at which the updated SecurityMarks take effect. If not set uses
213
+ # current server time. Updates will be applied to the SecurityMarks that are
214
+ # active immediately preceding this time.
215
+ # @param [String] update_mask
216
+ # The FieldMask to use when updating the security marks resource. The field mask
217
+ # must not contain duplicate fields. If empty or set to "marks", all marks will
218
+ # be replaced. Individual marks can be updated using "marks.".
219
+ # @param [String] fields
220
+ # Selector specifying which fields to include in a partial response.
221
+ # @param [String] quota_user
222
+ # Available to use for quota purposes for server-side applications. Can be any
223
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
224
+ # @param [Google::Apis::RequestOptions] options
225
+ # Request-specific options
226
+ #
227
+ # @yield [result, err] Result & error if block supplied
228
+ # @yieldparam result [Google::Apis::SecuritycenterV1::SecurityMarks] parsed result object
229
+ # @yieldparam err [StandardError] error object if request failed
230
+ #
231
+ # @return [Google::Apis::SecuritycenterV1::SecurityMarks]
232
+ #
233
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
234
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
235
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
236
+ def update_folder_asset_security_marks(name, security_marks_object = nil, start_time: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
237
+ command = make_simple_command(:patch, 'v1/{+name}', options)
238
+ command.request_representation = Google::Apis::SecuritycenterV1::SecurityMarks::Representation
239
+ command.request_object = security_marks_object
240
+ command.response_representation = Google::Apis::SecuritycenterV1::SecurityMarks::Representation
241
+ command.response_class = Google::Apis::SecuritycenterV1::SecurityMarks
242
+ command.params['name'] = name unless name.nil?
243
+ command.query['startTime'] = start_time unless start_time.nil?
244
+ command.query['updateMask'] = update_mask unless update_mask.nil?
245
+ command.query['fields'] = fields unless fields.nil?
246
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
247
+ execute_or_queue_command(command, &block)
248
+ end
249
+
250
+ # Lists all sources belonging to an organization.
251
+ # @param [String] parent
252
+ # Required. Resource name of the parent of sources to list. Its format should be
253
+ # "organizations/[organization_id], folders/[folder_id], or projects/[project_id]
254
+ # ".
255
+ # @param [Fixnum] page_size
256
+ # The maximum number of results to return in a single response. Default is 10,
257
+ # minimum is 1, maximum is 1000.
258
+ # @param [String] page_token
259
+ # The value returned by the last `ListSourcesResponse`; indicates that this is a
260
+ # continuation of a prior `ListSources` call, and that the system should return
261
+ # the next page of data.
262
+ # @param [String] fields
263
+ # Selector specifying which fields to include in a partial response.
264
+ # @param [String] quota_user
265
+ # Available to use for quota purposes for server-side applications. Can be any
266
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
267
+ # @param [Google::Apis::RequestOptions] options
268
+ # Request-specific options
269
+ #
270
+ # @yield [result, err] Result & error if block supplied
271
+ # @yieldparam result [Google::Apis::SecuritycenterV1::ListSourcesResponse] parsed result object
272
+ # @yieldparam err [StandardError] error object if request failed
273
+ #
274
+ # @return [Google::Apis::SecuritycenterV1::ListSourcesResponse]
275
+ #
276
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
277
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
278
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
279
+ def list_folder_sources(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
280
+ command = make_simple_command(:get, 'v1/{+parent}/sources', options)
281
+ command.response_representation = Google::Apis::SecuritycenterV1::ListSourcesResponse::Representation
282
+ command.response_class = Google::Apis::SecuritycenterV1::ListSourcesResponse
283
+ command.params['parent'] = parent unless parent.nil?
284
+ command.query['pageSize'] = page_size unless page_size.nil?
285
+ command.query['pageToken'] = page_token unless page_token.nil?
286
+ command.query['fields'] = fields unless fields.nil?
287
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
288
+ execute_or_queue_command(command, &block)
289
+ end
290
+
291
+ # Filters an organization or source's findings and groups them by their
292
+ # specified properties. To group across all sources provide a `-` as the source
293
+ # id. Example: /v1/organizations/`organization_id`/sources/-/findings, /v1/
294
+ # folders/`folder_id`/sources/-/findings, /v1/projects/`project_id`/sources/-/
295
+ # findings
296
+ # @param [String] parent
297
+ # Required. Name of the source to groupBy. Its format is "organizations/[
298
+ # organization_id]/sources/[source_id]", folders/[folder_id]/sources/[source_id],
299
+ # or projects/[project_id]/sources/[source_id]. To groupBy across all sources
300
+ # provide a source_id of `-`. For example: organizations/`organization_id`/
301
+ # sources/-, folders/`folder_id`/sources/-, or projects/`project_id`/sources/-
302
+ # @param [Google::Apis::SecuritycenterV1::GroupFindingsRequest] group_findings_request_object
303
+ # @param [String] fields
304
+ # Selector specifying which fields to include in a partial response.
305
+ # @param [String] quota_user
306
+ # Available to use for quota purposes for server-side applications. Can be any
307
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
308
+ # @param [Google::Apis::RequestOptions] options
309
+ # Request-specific options
310
+ #
311
+ # @yield [result, err] Result & error if block supplied
312
+ # @yieldparam result [Google::Apis::SecuritycenterV1::GroupFindingsResponse] parsed result object
313
+ # @yieldparam err [StandardError] error object if request failed
314
+ #
315
+ # @return [Google::Apis::SecuritycenterV1::GroupFindingsResponse]
316
+ #
317
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
318
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
319
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
320
+ def group_folder_source_finding(parent, group_findings_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
321
+ command = make_simple_command(:post, 'v1/{+parent}/findings:group', options)
322
+ command.request_representation = Google::Apis::SecuritycenterV1::GroupFindingsRequest::Representation
323
+ command.request_object = group_findings_request_object
324
+ command.response_representation = Google::Apis::SecuritycenterV1::GroupFindingsResponse::Representation
325
+ command.response_class = Google::Apis::SecuritycenterV1::GroupFindingsResponse
326
+ command.params['parent'] = parent unless parent.nil?
327
+ command.query['fields'] = fields unless fields.nil?
328
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
329
+ execute_or_queue_command(command, &block)
330
+ end
331
+
332
+ # Lists an organization or source's findings. To list across all sources provide
333
+ # a `-` as the source id. Example: /v1/organizations/`organization_id`/sources/-/
334
+ # findings
335
+ # @param [String] parent
336
+ # Required. Name of the source the findings belong to. Its format is "
337
+ # organizations/[organization_id]/sources/[source_id], folders/[folder_id]/
338
+ # sources/[source_id], or projects/[project_id]/sources/[source_id]". To list
339
+ # across all sources provide a source_id of `-`. For example: organizations/`
340
+ # organization_id`/sources/-, folders/`folder_id`/sources/- or projects/`
341
+ # projects_id`/sources/-
342
+ # @param [String] compare_duration
343
+ # When compare_duration is set, the ListFindingsResult's "state_change"
344
+ # attribute is updated to indicate whether the finding had its state changed,
345
+ # the finding's state remained unchanged, or if the finding was added in any
346
+ # state during the compare_duration period of time that precedes the read_time.
347
+ # This is the time between (read_time - compare_duration) and read_time. The
348
+ # state_change value is derived based on the presence and state of the finding
349
+ # at the two points in time. Intermediate state changes between the two times
350
+ # don't affect the result. For example, the results aren't affected if the
351
+ # finding is made inactive and then active again. Possible "state_change" values
352
+ # when compare_duration is specified: * "CHANGED": indicates that the finding
353
+ # was present and matched the given filter at the start of compare_duration, but
354
+ # changed its state at read_time. * "UNCHANGED": indicates that the finding was
355
+ # present and matched the given filter at the start of compare_duration and did
356
+ # not change state at read_time. * "ADDED": indicates that the finding did not
357
+ # match the given filter or was not present at the start of compare_duration,
358
+ # but was present at read_time. * "REMOVED": indicates that the finding was
359
+ # present and matched the filter at the start of compare_duration, but did not
360
+ # match the filter at read_time. If compare_duration is not specified, then the
361
+ # only possible state_change is "UNUSED", which will be the state_change set for
362
+ # all findings present at read_time.
363
+ # @param [String] field_mask
364
+ # A field mask to specify the Finding fields to be listed in the response. An
365
+ # empty field mask will list all fields.
366
+ # @param [String] filter
367
+ # Expression that defines the filter to apply across findings. The expression is
368
+ # a list of one or more restrictions combined via logical operators `AND` and `
369
+ # OR`. Parentheses are supported, and `OR` has higher precedence than `AND`.
370
+ # Restrictions have the form ` ` and may have a `-` character in front of them
371
+ # to indicate negation. Examples include: * name * source_properties.a_property *
372
+ # security_marks.marks.marka The supported operators are: * `=` for all value
373
+ # types. * `>`, `<`, `>=`, `<=` for integer values. * `:`, meaning substring
374
+ # matching, for strings. The supported value types are: * string literals in
375
+ # quotes. * integer literals without quotes. * boolean literals `true` and `
376
+ # false` without quotes. The following field and operator combinations are
377
+ # supported: * name: `=` * parent: `=`, `:` * resource_name: `=`, `:` * state: `=
378
+ # `, `:` * category: `=`, `:` * external_uri: `=`, `:` * event_time: `=`, `>`, `<
379
+ # `, `>=`, `<=` * severity: `=`, `:` Usage: This should be milliseconds since
380
+ # epoch or an RFC3339 string. Examples: `event_time = "2019-06-10T16:07:18-07:00"
381
+ # ` `event_time = 1560208038000` security_marks.marks: `=`, `:`
382
+ # source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` For example, `
383
+ # source_properties.size = 100` is a valid filter string. Use a partial match on
384
+ # the empty string to filter based on a property existing: `source_properties.
385
+ # my_property : ""` Use a negated partial match on the empty string to filter
386
+ # based on a property not existing: `-source_properties.my_property : ""`
387
+ # @param [String] order_by
388
+ # Expression that defines what fields and order to use for sorting. The string
389
+ # value should follow SQL syntax: comma separated list of fields. For example: "
390
+ # name,resource_properties.a_property". The default sorting order is ascending.
391
+ # To specify descending order for a field, a suffix " desc" should be appended
392
+ # to the field name. For example: "name desc,source_properties.a_property".
393
+ # Redundant space characters in the syntax are insignificant. "name desc,
394
+ # source_properties.a_property" and " name desc , source_properties.a_property "
395
+ # are equivalent. The following fields are supported: name parent state category
396
+ # resource_name event_time source_properties security_marks.marks
397
+ # @param [Fixnum] page_size
398
+ # The maximum number of results to return in a single response. Default is 10,
399
+ # minimum is 1, maximum is 1000.
400
+ # @param [String] page_token
401
+ # The value returned by the last `ListFindingsResponse`; indicates that this is
402
+ # a continuation of a prior `ListFindings` call, and that the system should
403
+ # return the next page of data.
404
+ # @param [String] read_time
405
+ # Time used as a reference point when filtering findings. The filter is limited
406
+ # to findings existing at the supplied time and their values are those at that
407
+ # specific time. Absence of this field will default to the API's version of NOW.
408
+ # @param [String] fields
409
+ # Selector specifying which fields to include in a partial response.
410
+ # @param [String] quota_user
411
+ # Available to use for quota purposes for server-side applications. Can be any
412
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
413
+ # @param [Google::Apis::RequestOptions] options
414
+ # Request-specific options
415
+ #
416
+ # @yield [result, err] Result & error if block supplied
417
+ # @yieldparam result [Google::Apis::SecuritycenterV1::ListFindingsResponse] parsed result object
418
+ # @yieldparam err [StandardError] error object if request failed
419
+ #
420
+ # @return [Google::Apis::SecuritycenterV1::ListFindingsResponse]
421
+ #
422
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
423
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
424
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
425
+ def list_folder_source_findings(parent, compare_duration: nil, field_mask: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil, read_time: nil, fields: nil, quota_user: nil, options: nil, &block)
426
+ command = make_simple_command(:get, 'v1/{+parent}/findings', options)
427
+ command.response_representation = Google::Apis::SecuritycenterV1::ListFindingsResponse::Representation
428
+ command.response_class = Google::Apis::SecuritycenterV1::ListFindingsResponse
429
+ command.params['parent'] = parent unless parent.nil?
430
+ command.query['compareDuration'] = compare_duration unless compare_duration.nil?
431
+ command.query['fieldMask'] = field_mask unless field_mask.nil?
432
+ command.query['filter'] = filter unless filter.nil?
433
+ command.query['orderBy'] = order_by unless order_by.nil?
434
+ command.query['pageSize'] = page_size unless page_size.nil?
435
+ command.query['pageToken'] = page_token unless page_token.nil?
436
+ command.query['readTime'] = read_time unless read_time.nil?
437
+ command.query['fields'] = fields unless fields.nil?
438
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
439
+ execute_or_queue_command(command, &block)
440
+ end
441
+
442
+ # Creates or updates a finding. The corresponding source must exist for a
443
+ # finding creation to succeed.
444
+ # @param [String] name
445
+ # The relative resource name of this finding. See: https://cloud.google.com/apis/
446
+ # design/resource_names#relative_resource_name Example: "organizations/`
447
+ # organization_id`/sources/`source_id`/findings/`finding_id`"
448
+ # @param [Google::Apis::SecuritycenterV1::Finding] finding_object
449
+ # @param [String] update_mask
450
+ # The FieldMask to use when updating the finding resource. This field should not
451
+ # be specified when creating a finding. When updating a finding, an empty mask
452
+ # is treated as updating all mutable fields and replacing source_properties.
453
+ # Individual source_properties can be added/updated by using "source_properties."
454
+ # in the field mask.
455
+ # @param [String] fields
456
+ # Selector specifying which fields to include in a partial response.
457
+ # @param [String] quota_user
458
+ # Available to use for quota purposes for server-side applications. Can be any
459
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
460
+ # @param [Google::Apis::RequestOptions] options
461
+ # Request-specific options
462
+ #
463
+ # @yield [result, err] Result & error if block supplied
464
+ # @yieldparam result [Google::Apis::SecuritycenterV1::Finding] parsed result object
465
+ # @yieldparam err [StandardError] error object if request failed
466
+ #
467
+ # @return [Google::Apis::SecuritycenterV1::Finding]
468
+ #
469
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
470
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
471
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
472
+ def patch_folder_source_finding(name, finding_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
473
+ command = make_simple_command(:patch, 'v1/{+name}', options)
474
+ command.request_representation = Google::Apis::SecuritycenterV1::Finding::Representation
475
+ command.request_object = finding_object
476
+ command.response_representation = Google::Apis::SecuritycenterV1::Finding::Representation
477
+ command.response_class = Google::Apis::SecuritycenterV1::Finding
478
+ command.params['name'] = name unless name.nil?
479
+ command.query['updateMask'] = update_mask unless update_mask.nil?
480
+ command.query['fields'] = fields unless fields.nil?
481
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
482
+ execute_or_queue_command(command, &block)
483
+ end
484
+
485
+ # Updates the state of a finding.
486
+ # @param [String] name
487
+ # Required. The relative resource name of the finding. See: https://cloud.google.
488
+ # com/apis/design/resource_names#relative_resource_name Example: "organizations/`
489
+ # organization_id`/sources/`source_id`/finding/`finding_id`".
490
+ # @param [Google::Apis::SecuritycenterV1::SetFindingStateRequest] set_finding_state_request_object
491
+ # @param [String] fields
492
+ # Selector specifying which fields to include in a partial response.
493
+ # @param [String] quota_user
494
+ # Available to use for quota purposes for server-side applications. Can be any
495
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
496
+ # @param [Google::Apis::RequestOptions] options
497
+ # Request-specific options
498
+ #
499
+ # @yield [result, err] Result & error if block supplied
500
+ # @yieldparam result [Google::Apis::SecuritycenterV1::Finding] parsed result object
501
+ # @yieldparam err [StandardError] error object if request failed
502
+ #
503
+ # @return [Google::Apis::SecuritycenterV1::Finding]
504
+ #
505
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
506
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
507
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
508
+ def set_folder_source_finding_state(name, set_finding_state_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
509
+ command = make_simple_command(:post, 'v1/{+name}:setState', options)
510
+ command.request_representation = Google::Apis::SecuritycenterV1::SetFindingStateRequest::Representation
511
+ command.request_object = set_finding_state_request_object
512
+ command.response_representation = Google::Apis::SecuritycenterV1::Finding::Representation
513
+ command.response_class = Google::Apis::SecuritycenterV1::Finding
514
+ command.params['name'] = name unless name.nil?
515
+ command.query['fields'] = fields unless fields.nil?
516
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
517
+ execute_or_queue_command(command, &block)
518
+ end
519
+
520
+ # Updates security marks.
521
+ # @param [String] name
522
+ # The relative resource name of the SecurityMarks. See: https://cloud.google.com/
523
+ # apis/design/resource_names#relative_resource_name Examples: "organizations/`
524
+ # organization_id`/assets/`asset_id`/securityMarks" "organizations/`
525
+ # organization_id`/sources/`source_id`/findings/`finding_id`/securityMarks".
526
+ # @param [Google::Apis::SecuritycenterV1::SecurityMarks] security_marks_object
527
+ # @param [String] start_time
528
+ # The time at which the updated SecurityMarks take effect. If not set uses
529
+ # current server time. Updates will be applied to the SecurityMarks that are
530
+ # active immediately preceding this time.
531
+ # @param [String] update_mask
532
+ # The FieldMask to use when updating the security marks resource. The field mask
533
+ # must not contain duplicate fields. If empty or set to "marks", all marks will
534
+ # be replaced. Individual marks can be updated using "marks.".
535
+ # @param [String] fields
536
+ # Selector specifying which fields to include in a partial response.
537
+ # @param [String] quota_user
538
+ # Available to use for quota purposes for server-side applications. Can be any
539
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
540
+ # @param [Google::Apis::RequestOptions] options
541
+ # Request-specific options
542
+ #
543
+ # @yield [result, err] Result & error if block supplied
544
+ # @yieldparam result [Google::Apis::SecuritycenterV1::SecurityMarks] parsed result object
545
+ # @yieldparam err [StandardError] error object if request failed
546
+ #
547
+ # @return [Google::Apis::SecuritycenterV1::SecurityMarks]
548
+ #
549
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
550
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
551
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
552
+ def update_folder_source_finding_security_marks(name, security_marks_object = nil, start_time: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
553
+ command = make_simple_command(:patch, 'v1/{+name}', options)
554
+ command.request_representation = Google::Apis::SecuritycenterV1::SecurityMarks::Representation
555
+ command.request_object = security_marks_object
556
+ command.response_representation = Google::Apis::SecuritycenterV1::SecurityMarks::Representation
557
+ command.response_class = Google::Apis::SecuritycenterV1::SecurityMarks
558
+ command.params['name'] = name unless name.nil?
559
+ command.query['startTime'] = start_time unless start_time.nil?
560
+ command.query['updateMask'] = update_mask unless update_mask.nil?
561
+ command.query['fields'] = fields unless fields.nil?
562
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
563
+ execute_or_queue_command(command, &block)
564
+ end
565
+
566
+ # Gets the settings for an organization.
567
+ # @param [String] name
568
+ # Required. Name of the organization to get organization settings for. Its
569
+ # format is "organizations/[organization_id]/organizationSettings".
570
+ # @param [String] fields
571
+ # Selector specifying which fields to include in a partial response.
572
+ # @param [String] quota_user
573
+ # Available to use for quota purposes for server-side applications. Can be any
574
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
575
+ # @param [Google::Apis::RequestOptions] options
576
+ # Request-specific options
577
+ #
578
+ # @yield [result, err] Result & error if block supplied
579
+ # @yieldparam result [Google::Apis::SecuritycenterV1::OrganizationSettings] parsed result object
580
+ # @yieldparam err [StandardError] error object if request failed
581
+ #
582
+ # @return [Google::Apis::SecuritycenterV1::OrganizationSettings]
583
+ #
584
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
585
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
586
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
587
+ def get_organization_organization_settings(name, fields: nil, quota_user: nil, options: nil, &block)
588
+ command = make_simple_command(:get, 'v1/{+name}', options)
589
+ command.response_representation = Google::Apis::SecuritycenterV1::OrganizationSettings::Representation
590
+ command.response_class = Google::Apis::SecuritycenterV1::OrganizationSettings
591
+ command.params['name'] = name unless name.nil?
592
+ command.query['fields'] = fields unless fields.nil?
593
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
594
+ execute_or_queue_command(command, &block)
595
+ end
596
+
597
+ # Updates an organization's settings.
598
+ # @param [String] name
599
+ # The relative resource name of the settings. See: https://cloud.google.com/apis/
600
+ # design/resource_names#relative_resource_name Example: "organizations/`
601
+ # organization_id`/organizationSettings".
602
+ # @param [Google::Apis::SecuritycenterV1::OrganizationSettings] organization_settings_object
603
+ # @param [String] update_mask
604
+ # The FieldMask to use when updating the settings resource. If empty all mutable
605
+ # fields will be updated.
606
+ # @param [String] fields
607
+ # Selector specifying which fields to include in a partial response.
608
+ # @param [String] quota_user
609
+ # Available to use for quota purposes for server-side applications. Can be any
610
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
611
+ # @param [Google::Apis::RequestOptions] options
612
+ # Request-specific options
613
+ #
614
+ # @yield [result, err] Result & error if block supplied
615
+ # @yieldparam result [Google::Apis::SecuritycenterV1::OrganizationSettings] parsed result object
616
+ # @yieldparam err [StandardError] error object if request failed
617
+ #
618
+ # @return [Google::Apis::SecuritycenterV1::OrganizationSettings]
619
+ #
620
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
621
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
622
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
623
+ def update_organization_organization_settings(name, organization_settings_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
624
+ command = make_simple_command(:patch, 'v1/{+name}', options)
625
+ command.request_representation = Google::Apis::SecuritycenterV1::OrganizationSettings::Representation
626
+ command.request_object = organization_settings_object
627
+ command.response_representation = Google::Apis::SecuritycenterV1::OrganizationSettings::Representation
628
+ command.response_class = Google::Apis::SecuritycenterV1::OrganizationSettings
629
+ command.params['name'] = name unless name.nil?
630
+ command.query['updateMask'] = update_mask unless update_mask.nil?
631
+ command.query['fields'] = fields unless fields.nil?
632
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
633
+ execute_or_queue_command(command, &block)
634
+ end
635
+
636
+ # Filters an organization's assets and groups them by their specified properties.
637
+ # @param [String] parent
638
+ # Required. Name of the organization to groupBy. Its format is "organizations/[
639
+ # organization_id], folders/[folder_id], or projects/[project_id]".
640
+ # @param [Google::Apis::SecuritycenterV1::GroupAssetsRequest] group_assets_request_object
641
+ # @param [String] fields
642
+ # Selector specifying which fields to include in a partial response.
643
+ # @param [String] quota_user
644
+ # Available to use for quota purposes for server-side applications. Can be any
645
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
646
+ # @param [Google::Apis::RequestOptions] options
647
+ # Request-specific options
648
+ #
649
+ # @yield [result, err] Result & error if block supplied
650
+ # @yieldparam result [Google::Apis::SecuritycenterV1::GroupAssetsResponse] parsed result object
651
+ # @yieldparam err [StandardError] error object if request failed
652
+ #
653
+ # @return [Google::Apis::SecuritycenterV1::GroupAssetsResponse]
654
+ #
655
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
656
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
657
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
658
+ def group_assets(parent, group_assets_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
659
+ command = make_simple_command(:post, 'v1/{+parent}/assets:group', options)
660
+ command.request_representation = Google::Apis::SecuritycenterV1::GroupAssetsRequest::Representation
661
+ command.request_object = group_assets_request_object
662
+ command.response_representation = Google::Apis::SecuritycenterV1::GroupAssetsResponse::Representation
663
+ command.response_class = Google::Apis::SecuritycenterV1::GroupAssetsResponse
664
+ command.params['parent'] = parent unless parent.nil?
665
+ command.query['fields'] = fields unless fields.nil?
666
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
667
+ execute_or_queue_command(command, &block)
668
+ end
669
+
670
+ # Lists an organization's assets.
671
+ # @param [String] parent
672
+ # Required. Name of the organization assets should belong to. Its format is "
673
+ # organizations/[organization_id], folders/[folder_id], or projects/[project_id]"
674
+ # .
675
+ # @param [String] compare_duration
676
+ # When compare_duration is set, the ListAssetsResult's "state_change" attribute
677
+ # is updated to indicate whether the asset was added, removed, or remained
678
+ # present during the compare_duration period of time that precedes the read_time.
679
+ # This is the time between (read_time - compare_duration) and read_time. The
680
+ # state_change value is derived based on the presence of the asset at the two
681
+ # points in time. Intermediate state changes between the two times don't affect
682
+ # the result. For example, the results aren't affected if the asset is removed
683
+ # and re-created again. Possible "state_change" values when compare_duration is
684
+ # specified: * "ADDED": indicates that the asset was not present at the start of
685
+ # compare_duration, but present at read_time. * "REMOVED": indicates that the
686
+ # asset was present at the start of compare_duration, but not present at
687
+ # read_time. * "ACTIVE": indicates that the asset was present at both the start
688
+ # and the end of the time period defined by compare_duration and read_time. If
689
+ # compare_duration is not specified, then the only possible state_change is "
690
+ # UNUSED", which will be the state_change set for all assets present at
691
+ # read_time.
692
+ # @param [String] field_mask
693
+ # A field mask to specify the ListAssetsResult fields to be listed in the
694
+ # response. An empty field mask will list all fields.
695
+ # @param [String] filter
696
+ # Expression that defines the filter to apply across assets. The expression is a
697
+ # list of zero or more restrictions combined via logical operators `AND` and `OR`
698
+ # . Parentheses are supported, and `OR` has higher precedence than `AND`.
699
+ # Restrictions have the form ` ` and may have a `-` character in front of them
700
+ # to indicate negation. The fields map to those defined in the Asset resource.
701
+ # Examples include: * name * security_center_properties.resource_name *
702
+ # resource_properties.a_property * security_marks.marks.marka The supported
703
+ # operators are: * `=` for all value types. * `>`, `<`, `>=`, `<=` for integer
704
+ # values. * `:`, meaning substring matching, for strings. The supported value
705
+ # types are: * string literals in quotes. * integer literals without quotes. *
706
+ # boolean literals `true` and `false` without quotes. The following are the
707
+ # allowed field and operator combinations: * name: `=` * update_time: `=`, `>`, `
708
+ # <`, `>=`, `<=` Usage: This should be milliseconds since epoch or an RFC3339
709
+ # string. Examples: `update_time = "2019-06-10T16:07:18-07:00"` `update_time =
710
+ # 1560208038000` * create_time: `=`, `>`, `<`, `>=`, `<=` Usage: This should be
711
+ # milliseconds since epoch or an RFC3339 string. Examples: `create_time = "2019-
712
+ # 06-10T16:07:18-07:00"` `create_time = 1560208038000` * iam_policy.policy_blob:
713
+ # `=`, `:` * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` *
714
+ # security_marks.marks: `=`, `:` * security_center_properties.resource_name: `=`,
715
+ # `:` * security_center_properties.resource_display_name: `=`, `:` *
716
+ # security_center_properties.resource_type: `=`, `:` *
717
+ # security_center_properties.resource_parent: `=`, `:` *
718
+ # security_center_properties.resource_parent_display_name: `=`, `:` *
719
+ # security_center_properties.resource_project: `=`, `:` *
720
+ # security_center_properties.resource_project_display_name: `=`, `:` *
721
+ # security_center_properties.resource_owners: `=`, `:` For example, `
722
+ # resource_properties.size = 100` is a valid filter string. Use a partial match
723
+ # on the empty string to filter based on a property existing: `
724
+ # resource_properties.my_property : ""` Use a negated partial match on the empty
725
+ # string to filter based on a property not existing: `-resource_properties.
726
+ # my_property : ""`
727
+ # @param [String] order_by
728
+ # Expression that defines what fields and order to use for sorting. The string
729
+ # value should follow SQL syntax: comma separated list of fields. For example: "
730
+ # name,resource_properties.a_property". The default sorting order is ascending.
731
+ # To specify descending order for a field, a suffix " desc" should be appended
732
+ # to the field name. For example: "name desc,resource_properties.a_property".
733
+ # Redundant space characters in the syntax are insignificant. "name desc,
734
+ # resource_properties.a_property" and " name desc , resource_properties.
735
+ # a_property " are equivalent. The following fields are supported: name
736
+ # update_time resource_properties security_marks.marks
737
+ # security_center_properties.resource_name security_center_properties.
738
+ # resource_display_name security_center_properties.resource_parent
739
+ # security_center_properties.resource_parent_display_name
740
+ # security_center_properties.resource_project security_center_properties.
741
+ # resource_project_display_name security_center_properties.resource_type
742
+ # @param [Fixnum] page_size
743
+ # The maximum number of results to return in a single response. Default is 10,
744
+ # minimum is 1, maximum is 1000.
745
+ # @param [String] page_token
746
+ # The value returned by the last `ListAssetsResponse`; indicates that this is a
747
+ # continuation of a prior `ListAssets` call, and that the system should return
748
+ # the next page of data.
749
+ # @param [String] read_time
750
+ # Time used as a reference point when filtering assets. The filter is limited to
751
+ # assets existing at the supplied time and their values are those at that
752
+ # specific time. Absence of this field will default to the API's version of NOW.
753
+ # @param [String] fields
754
+ # Selector specifying which fields to include in a partial response.
755
+ # @param [String] quota_user
756
+ # Available to use for quota purposes for server-side applications. Can be any
757
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
758
+ # @param [Google::Apis::RequestOptions] options
759
+ # Request-specific options
760
+ #
761
+ # @yield [result, err] Result & error if block supplied
762
+ # @yieldparam result [Google::Apis::SecuritycenterV1::ListAssetsResponse] parsed result object
763
+ # @yieldparam err [StandardError] error object if request failed
764
+ #
765
+ # @return [Google::Apis::SecuritycenterV1::ListAssetsResponse]
766
+ #
767
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
768
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
769
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
770
+ def list_organization_assets(parent, compare_duration: nil, field_mask: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil, read_time: nil, fields: nil, quota_user: nil, options: nil, &block)
771
+ command = make_simple_command(:get, 'v1/{+parent}/assets', options)
772
+ command.response_representation = Google::Apis::SecuritycenterV1::ListAssetsResponse::Representation
773
+ command.response_class = Google::Apis::SecuritycenterV1::ListAssetsResponse
774
+ command.params['parent'] = parent unless parent.nil?
775
+ command.query['compareDuration'] = compare_duration unless compare_duration.nil?
776
+ command.query['fieldMask'] = field_mask unless field_mask.nil?
777
+ command.query['filter'] = filter unless filter.nil?
778
+ command.query['orderBy'] = order_by unless order_by.nil?
779
+ command.query['pageSize'] = page_size unless page_size.nil?
780
+ command.query['pageToken'] = page_token unless page_token.nil?
781
+ command.query['readTime'] = read_time unless read_time.nil?
782
+ command.query['fields'] = fields unless fields.nil?
783
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
784
+ execute_or_queue_command(command, &block)
785
+ end
786
+
787
+ # Runs asset discovery. The discovery is tracked with a long-running operation.
788
+ # This API can only be called with limited frequency for an organization. If it
789
+ # is called too frequently the caller will receive a TOO_MANY_REQUESTS error.
790
+ # @param [String] parent
791
+ # Required. Name of the organization to run asset discovery for. Its format is "
792
+ # organizations/[organization_id]".
793
+ # @param [Google::Apis::SecuritycenterV1::RunAssetDiscoveryRequest] run_asset_discovery_request_object
794
+ # @param [String] fields
795
+ # Selector specifying which fields to include in a partial response.
796
+ # @param [String] quota_user
797
+ # Available to use for quota purposes for server-side applications. Can be any
798
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
799
+ # @param [Google::Apis::RequestOptions] options
800
+ # Request-specific options
801
+ #
802
+ # @yield [result, err] Result & error if block supplied
803
+ # @yieldparam result [Google::Apis::SecuritycenterV1::Operation] parsed result object
804
+ # @yieldparam err [StandardError] error object if request failed
805
+ #
806
+ # @return [Google::Apis::SecuritycenterV1::Operation]
807
+ #
808
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
809
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
810
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
811
+ def run_organization_asset_discovery(parent, run_asset_discovery_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
812
+ command = make_simple_command(:post, 'v1/{+parent}/assets:runDiscovery', options)
813
+ command.request_representation = Google::Apis::SecuritycenterV1::RunAssetDiscoveryRequest::Representation
814
+ command.request_object = run_asset_discovery_request_object
815
+ command.response_representation = Google::Apis::SecuritycenterV1::Operation::Representation
816
+ command.response_class = Google::Apis::SecuritycenterV1::Operation
817
+ command.params['parent'] = parent unless parent.nil?
818
+ command.query['fields'] = fields unless fields.nil?
819
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
820
+ execute_or_queue_command(command, &block)
821
+ end
822
+
823
+ # Updates security marks.
824
+ # @param [String] name
825
+ # The relative resource name of the SecurityMarks. See: https://cloud.google.com/
826
+ # apis/design/resource_names#relative_resource_name Examples: "organizations/`
827
+ # organization_id`/assets/`asset_id`/securityMarks" "organizations/`
828
+ # organization_id`/sources/`source_id`/findings/`finding_id`/securityMarks".
829
+ # @param [Google::Apis::SecuritycenterV1::SecurityMarks] security_marks_object
830
+ # @param [String] start_time
831
+ # The time at which the updated SecurityMarks take effect. If not set uses
832
+ # current server time. Updates will be applied to the SecurityMarks that are
833
+ # active immediately preceding this time.
834
+ # @param [String] update_mask
835
+ # The FieldMask to use when updating the security marks resource. The field mask
836
+ # must not contain duplicate fields. If empty or set to "marks", all marks will
837
+ # be replaced. Individual marks can be updated using "marks.".
838
+ # @param [String] fields
839
+ # Selector specifying which fields to include in a partial response.
840
+ # @param [String] quota_user
841
+ # Available to use for quota purposes for server-side applications. Can be any
842
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
843
+ # @param [Google::Apis::RequestOptions] options
844
+ # Request-specific options
845
+ #
846
+ # @yield [result, err] Result & error if block supplied
847
+ # @yieldparam result [Google::Apis::SecuritycenterV1::SecurityMarks] parsed result object
848
+ # @yieldparam err [StandardError] error object if request failed
849
+ #
850
+ # @return [Google::Apis::SecuritycenterV1::SecurityMarks]
851
+ #
852
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
853
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
854
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
855
+ def update_organization_asset_security_marks(name, security_marks_object = nil, start_time: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
856
+ command = make_simple_command(:patch, 'v1/{+name}', options)
857
+ command.request_representation = Google::Apis::SecuritycenterV1::SecurityMarks::Representation
858
+ command.request_object = security_marks_object
859
+ command.response_representation = Google::Apis::SecuritycenterV1::SecurityMarks::Representation
860
+ command.response_class = Google::Apis::SecuritycenterV1::SecurityMarks
861
+ command.params['name'] = name unless name.nil?
862
+ command.query['startTime'] = start_time unless start_time.nil?
863
+ command.query['updateMask'] = update_mask unless update_mask.nil?
864
+ command.query['fields'] = fields unless fields.nil?
865
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
866
+ execute_or_queue_command(command, &block)
867
+ end
868
+
869
+ # Creates a notification config.
870
+ # @param [String] parent
871
+ # Required. Resource name of the new notification config's parent. Its format is
872
+ # "organizations/[organization_id]".
873
+ # @param [Google::Apis::SecuritycenterV1::NotificationConfig] notification_config_object
874
+ # @param [String] config_id
875
+ # Required. Unique identifier provided by the client within the parent scope. It
876
+ # must be between 1 and 128 characters, and contains alphanumeric characters,
877
+ # underscores or hyphens only.
878
+ # @param [String] fields
879
+ # Selector specifying which fields to include in a partial response.
880
+ # @param [String] quota_user
881
+ # Available to use for quota purposes for server-side applications. Can be any
882
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
883
+ # @param [Google::Apis::RequestOptions] options
884
+ # Request-specific options
885
+ #
886
+ # @yield [result, err] Result & error if block supplied
887
+ # @yieldparam result [Google::Apis::SecuritycenterV1::NotificationConfig] parsed result object
888
+ # @yieldparam err [StandardError] error object if request failed
889
+ #
890
+ # @return [Google::Apis::SecuritycenterV1::NotificationConfig]
891
+ #
892
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
893
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
894
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
895
+ def create_organization_notification_config(parent, notification_config_object = nil, config_id: nil, fields: nil, quota_user: nil, options: nil, &block)
896
+ command = make_simple_command(:post, 'v1/{+parent}/notificationConfigs', options)
897
+ command.request_representation = Google::Apis::SecuritycenterV1::NotificationConfig::Representation
898
+ command.request_object = notification_config_object
899
+ command.response_representation = Google::Apis::SecuritycenterV1::NotificationConfig::Representation
900
+ command.response_class = Google::Apis::SecuritycenterV1::NotificationConfig
901
+ command.params['parent'] = parent unless parent.nil?
902
+ command.query['configId'] = config_id unless config_id.nil?
903
+ command.query['fields'] = fields unless fields.nil?
904
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
905
+ execute_or_queue_command(command, &block)
906
+ end
907
+
908
+ # Deletes a notification config.
909
+ # @param [String] name
910
+ # Required. Name of the notification config to delete. Its format is "
911
+ # organizations/[organization_id]/notificationConfigs/[config_id]".
912
+ # @param [String] fields
913
+ # Selector specifying which fields to include in a partial response.
914
+ # @param [String] quota_user
915
+ # Available to use for quota purposes for server-side applications. Can be any
916
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
917
+ # @param [Google::Apis::RequestOptions] options
918
+ # Request-specific options
919
+ #
920
+ # @yield [result, err] Result & error if block supplied
921
+ # @yieldparam result [Google::Apis::SecuritycenterV1::Empty] parsed result object
922
+ # @yieldparam err [StandardError] error object if request failed
923
+ #
924
+ # @return [Google::Apis::SecuritycenterV1::Empty]
925
+ #
926
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
927
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
928
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
929
+ def delete_organization_notification_config(name, fields: nil, quota_user: nil, options: nil, &block)
930
+ command = make_simple_command(:delete, 'v1/{+name}', options)
931
+ command.response_representation = Google::Apis::SecuritycenterV1::Empty::Representation
932
+ command.response_class = Google::Apis::SecuritycenterV1::Empty
933
+ command.params['name'] = name unless name.nil?
934
+ command.query['fields'] = fields unless fields.nil?
935
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
936
+ execute_or_queue_command(command, &block)
937
+ end
938
+
939
+ # Gets a notification config.
940
+ # @param [String] name
941
+ # Required. Name of the notification config to get. Its format is "organizations/
942
+ # [organization_id]/notificationConfigs/[config_id]".
943
+ # @param [String] fields
944
+ # Selector specifying which fields to include in a partial response.
945
+ # @param [String] quota_user
946
+ # Available to use for quota purposes for server-side applications. Can be any
947
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
948
+ # @param [Google::Apis::RequestOptions] options
949
+ # Request-specific options
950
+ #
951
+ # @yield [result, err] Result & error if block supplied
952
+ # @yieldparam result [Google::Apis::SecuritycenterV1::NotificationConfig] parsed result object
953
+ # @yieldparam err [StandardError] error object if request failed
954
+ #
955
+ # @return [Google::Apis::SecuritycenterV1::NotificationConfig]
956
+ #
957
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
958
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
959
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
960
+ def get_organization_notification_config(name, fields: nil, quota_user: nil, options: nil, &block)
961
+ command = make_simple_command(:get, 'v1/{+name}', options)
962
+ command.response_representation = Google::Apis::SecuritycenterV1::NotificationConfig::Representation
963
+ command.response_class = Google::Apis::SecuritycenterV1::NotificationConfig
964
+ command.params['name'] = name unless name.nil?
965
+ command.query['fields'] = fields unless fields.nil?
966
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
967
+ execute_or_queue_command(command, &block)
968
+ end
969
+
970
+ # Lists notification configs.
971
+ # @param [String] parent
972
+ # Required. Name of the organization to list notification configs. Its format is
973
+ # "organizations/[organization_id]".
974
+ # @param [Fixnum] page_size
975
+ # The maximum number of results to return in a single response. Default is 10,
976
+ # minimum is 1, maximum is 1000.
977
+ # @param [String] page_token
978
+ # The value returned by the last `ListNotificationConfigsResponse`; indicates
979
+ # that this is a continuation of a prior `ListNotificationConfigs` call, and
980
+ # that the system should return the next page of data.
981
+ # @param [String] fields
982
+ # Selector specifying which fields to include in a partial response.
983
+ # @param [String] quota_user
984
+ # Available to use for quota purposes for server-side applications. Can be any
985
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
986
+ # @param [Google::Apis::RequestOptions] options
987
+ # Request-specific options
988
+ #
989
+ # @yield [result, err] Result & error if block supplied
990
+ # @yieldparam result [Google::Apis::SecuritycenterV1::ListNotificationConfigsResponse] parsed result object
991
+ # @yieldparam err [StandardError] error object if request failed
992
+ #
993
+ # @return [Google::Apis::SecuritycenterV1::ListNotificationConfigsResponse]
994
+ #
995
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
996
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
997
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
998
+ def list_organization_notification_configs(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
999
+ command = make_simple_command(:get, 'v1/{+parent}/notificationConfigs', options)
1000
+ command.response_representation = Google::Apis::SecuritycenterV1::ListNotificationConfigsResponse::Representation
1001
+ command.response_class = Google::Apis::SecuritycenterV1::ListNotificationConfigsResponse
1002
+ command.params['parent'] = parent unless parent.nil?
1003
+ command.query['pageSize'] = page_size unless page_size.nil?
1004
+ command.query['pageToken'] = page_token unless page_token.nil?
1005
+ command.query['fields'] = fields unless fields.nil?
1006
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1007
+ execute_or_queue_command(command, &block)
1008
+ end
1009
+
1010
+ # Updates a notification config. The following update fields are allowed:
1011
+ # description, pubsub_topic, streaming_config.filter
1012
+ # @param [String] name
1013
+ # The relative resource name of this notification config. See: https://cloud.
1014
+ # google.com/apis/design/resource_names#relative_resource_name Example: "
1015
+ # organizations/`organization_id`/notificationConfigs/notify_public_bucket".
1016
+ # @param [Google::Apis::SecuritycenterV1::NotificationConfig] notification_config_object
1017
+ # @param [String] update_mask
1018
+ # The FieldMask to use when updating the notification config. If empty all
1019
+ # mutable fields will be updated.
1020
+ # @param [String] fields
1021
+ # Selector specifying which fields to include in a partial response.
1022
+ # @param [String] quota_user
1023
+ # Available to use for quota purposes for server-side applications. Can be any
1024
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1025
+ # @param [Google::Apis::RequestOptions] options
1026
+ # Request-specific options
1027
+ #
1028
+ # @yield [result, err] Result & error if block supplied
1029
+ # @yieldparam result [Google::Apis::SecuritycenterV1::NotificationConfig] parsed result object
1030
+ # @yieldparam err [StandardError] error object if request failed
1031
+ #
1032
+ # @return [Google::Apis::SecuritycenterV1::NotificationConfig]
1033
+ #
1034
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1035
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1036
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1037
+ def patch_organization_notification_config(name, notification_config_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
1038
+ command = make_simple_command(:patch, 'v1/{+name}', options)
1039
+ command.request_representation = Google::Apis::SecuritycenterV1::NotificationConfig::Representation
1040
+ command.request_object = notification_config_object
1041
+ command.response_representation = Google::Apis::SecuritycenterV1::NotificationConfig::Representation
1042
+ command.response_class = Google::Apis::SecuritycenterV1::NotificationConfig
1043
+ command.params['name'] = name unless name.nil?
1044
+ command.query['updateMask'] = update_mask unless update_mask.nil?
1045
+ command.query['fields'] = fields unless fields.nil?
1046
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1047
+ execute_or_queue_command(command, &block)
1048
+ end
1049
+
1050
+ # Starts asynchronous cancellation on a long-running operation. The server makes
1051
+ # a best effort to cancel the operation, but success is not guaranteed. If the
1052
+ # server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
1053
+ # Clients can use Operations.GetOperation or other methods to check whether the
1054
+ # cancellation succeeded or whether the operation completed despite cancellation.
1055
+ # On successful cancellation, the operation is not deleted; instead, it becomes
1056
+ # an operation with an Operation.error value with a google.rpc.Status.code of 1,
1057
+ # corresponding to `Code.CANCELLED`.
1058
+ # @param [String] name
1059
+ # The name of the operation resource to be cancelled.
1060
+ # @param [String] fields
1061
+ # Selector specifying which fields to include in a partial response.
1062
+ # @param [String] quota_user
1063
+ # Available to use for quota purposes for server-side applications. Can be any
1064
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1065
+ # @param [Google::Apis::RequestOptions] options
1066
+ # Request-specific options
1067
+ #
1068
+ # @yield [result, err] Result & error if block supplied
1069
+ # @yieldparam result [Google::Apis::SecuritycenterV1::Empty] parsed result object
1070
+ # @yieldparam err [StandardError] error object if request failed
1071
+ #
1072
+ # @return [Google::Apis::SecuritycenterV1::Empty]
1073
+ #
1074
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1075
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1076
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1077
+ def cancel_organization_operation(name, fields: nil, quota_user: nil, options: nil, &block)
1078
+ command = make_simple_command(:post, 'v1/{+name}:cancel', options)
1079
+ command.response_representation = Google::Apis::SecuritycenterV1::Empty::Representation
1080
+ command.response_class = Google::Apis::SecuritycenterV1::Empty
1081
+ command.params['name'] = name unless name.nil?
1082
+ command.query['fields'] = fields unless fields.nil?
1083
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1084
+ execute_or_queue_command(command, &block)
1085
+ end
1086
+
1087
+ # Deletes a long-running operation. This method indicates that the client is no
1088
+ # longer interested in the operation result. It does not cancel the operation.
1089
+ # If the server doesn't support this method, it returns `google.rpc.Code.
1090
+ # UNIMPLEMENTED`.
1091
+ # @param [String] name
1092
+ # The name of the operation resource to be deleted.
1093
+ # @param [String] fields
1094
+ # Selector specifying which fields to include in a partial response.
1095
+ # @param [String] quota_user
1096
+ # Available to use for quota purposes for server-side applications. Can be any
1097
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1098
+ # @param [Google::Apis::RequestOptions] options
1099
+ # Request-specific options
1100
+ #
1101
+ # @yield [result, err] Result & error if block supplied
1102
+ # @yieldparam result [Google::Apis::SecuritycenterV1::Empty] parsed result object
1103
+ # @yieldparam err [StandardError] error object if request failed
1104
+ #
1105
+ # @return [Google::Apis::SecuritycenterV1::Empty]
1106
+ #
1107
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1108
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1109
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1110
+ def delete_organization_operation(name, fields: nil, quota_user: nil, options: nil, &block)
1111
+ command = make_simple_command(:delete, 'v1/{+name}', options)
1112
+ command.response_representation = Google::Apis::SecuritycenterV1::Empty::Representation
1113
+ command.response_class = Google::Apis::SecuritycenterV1::Empty
1114
+ command.params['name'] = name unless name.nil?
1115
+ command.query['fields'] = fields unless fields.nil?
1116
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1117
+ execute_or_queue_command(command, &block)
1118
+ end
1119
+
1120
+ # Gets the latest state of a long-running operation. Clients can use this method
1121
+ # to poll the operation result at intervals as recommended by the API service.
1122
+ # @param [String] name
1123
+ # The name of the operation resource.
1124
+ # @param [String] fields
1125
+ # Selector specifying which fields to include in a partial response.
1126
+ # @param [String] quota_user
1127
+ # Available to use for quota purposes for server-side applications. Can be any
1128
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1129
+ # @param [Google::Apis::RequestOptions] options
1130
+ # Request-specific options
1131
+ #
1132
+ # @yield [result, err] Result & error if block supplied
1133
+ # @yieldparam result [Google::Apis::SecuritycenterV1::Operation] parsed result object
1134
+ # @yieldparam err [StandardError] error object if request failed
1135
+ #
1136
+ # @return [Google::Apis::SecuritycenterV1::Operation]
1137
+ #
1138
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1139
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1140
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1141
+ def get_organization_operation(name, fields: nil, quota_user: nil, options: nil, &block)
1142
+ command = make_simple_command(:get, 'v1/{+name}', options)
1143
+ command.response_representation = Google::Apis::SecuritycenterV1::Operation::Representation
1144
+ command.response_class = Google::Apis::SecuritycenterV1::Operation
1145
+ command.params['name'] = name unless name.nil?
1146
+ command.query['fields'] = fields unless fields.nil?
1147
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1148
+ execute_or_queue_command(command, &block)
1149
+ end
1150
+
1151
+ # Lists operations that match the specified filter in the request. If the server
1152
+ # doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name`
1153
+ # binding allows API services to override the binding to use different resource
1154
+ # name schemes, such as `users/*/operations`. To override the binding, API
1155
+ # services can add a binding such as `"/v1/`name=users/*`/operations"` to their
1156
+ # service configuration. For backwards compatibility, the default name includes
1157
+ # the operations collection id, however overriding users must ensure the name
1158
+ # binding is the parent resource, without the operations collection id.
1159
+ # @param [String] name
1160
+ # The name of the operation's parent resource.
1161
+ # @param [String] filter
1162
+ # The standard list filter.
1163
+ # @param [Fixnum] page_size
1164
+ # The standard list page size.
1165
+ # @param [String] page_token
1166
+ # The standard list page token.
1167
+ # @param [String] fields
1168
+ # Selector specifying which fields to include in a partial response.
1169
+ # @param [String] quota_user
1170
+ # Available to use for quota purposes for server-side applications. Can be any
1171
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1172
+ # @param [Google::Apis::RequestOptions] options
1173
+ # Request-specific options
1174
+ #
1175
+ # @yield [result, err] Result & error if block supplied
1176
+ # @yieldparam result [Google::Apis::SecuritycenterV1::ListOperationsResponse] parsed result object
1177
+ # @yieldparam err [StandardError] error object if request failed
1178
+ #
1179
+ # @return [Google::Apis::SecuritycenterV1::ListOperationsResponse]
1180
+ #
1181
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1182
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1183
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1184
+ def list_organization_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
1185
+ command = make_simple_command(:get, 'v1/{+name}', options)
1186
+ command.response_representation = Google::Apis::SecuritycenterV1::ListOperationsResponse::Representation
1187
+ command.response_class = Google::Apis::SecuritycenterV1::ListOperationsResponse
1188
+ command.params['name'] = name unless name.nil?
1189
+ command.query['filter'] = filter unless filter.nil?
1190
+ command.query['pageSize'] = page_size unless page_size.nil?
1191
+ command.query['pageToken'] = page_token unless page_token.nil?
1192
+ command.query['fields'] = fields unless fields.nil?
1193
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1194
+ execute_or_queue_command(command, &block)
1195
+ end
1196
+
1197
+ # Creates a source.
1198
+ # @param [String] parent
1199
+ # Required. Resource name of the new source's parent. Its format should be "
1200
+ # organizations/[organization_id]".
1201
+ # @param [Google::Apis::SecuritycenterV1::Source] source_object
1202
+ # @param [String] fields
1203
+ # Selector specifying which fields to include in a partial response.
1204
+ # @param [String] quota_user
1205
+ # Available to use for quota purposes for server-side applications. Can be any
1206
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1207
+ # @param [Google::Apis::RequestOptions] options
1208
+ # Request-specific options
1209
+ #
1210
+ # @yield [result, err] Result & error if block supplied
1211
+ # @yieldparam result [Google::Apis::SecuritycenterV1::Source] parsed result object
1212
+ # @yieldparam err [StandardError] error object if request failed
1213
+ #
1214
+ # @return [Google::Apis::SecuritycenterV1::Source]
1215
+ #
1216
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1217
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1218
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1219
+ def create_organization_source(parent, source_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1220
+ command = make_simple_command(:post, 'v1/{+parent}/sources', options)
1221
+ command.request_representation = Google::Apis::SecuritycenterV1::Source::Representation
1222
+ command.request_object = source_object
1223
+ command.response_representation = Google::Apis::SecuritycenterV1::Source::Representation
1224
+ command.response_class = Google::Apis::SecuritycenterV1::Source
1225
+ command.params['parent'] = parent unless parent.nil?
1226
+ command.query['fields'] = fields unless fields.nil?
1227
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1228
+ execute_or_queue_command(command, &block)
1229
+ end
1230
+
1231
+ # Gets a source.
1232
+ # @param [String] name
1233
+ # Required. Relative resource name of the source. Its format is "organizations/[
1234
+ # organization_id]/source/[source_id]".
1235
+ # @param [String] fields
1236
+ # Selector specifying which fields to include in a partial response.
1237
+ # @param [String] quota_user
1238
+ # Available to use for quota purposes for server-side applications. Can be any
1239
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1240
+ # @param [Google::Apis::RequestOptions] options
1241
+ # Request-specific options
1242
+ #
1243
+ # @yield [result, err] Result & error if block supplied
1244
+ # @yieldparam result [Google::Apis::SecuritycenterV1::Source] parsed result object
1245
+ # @yieldparam err [StandardError] error object if request failed
1246
+ #
1247
+ # @return [Google::Apis::SecuritycenterV1::Source]
1248
+ #
1249
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1250
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1251
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1252
+ def get_organization_source(name, fields: nil, quota_user: nil, options: nil, &block)
1253
+ command = make_simple_command(:get, 'v1/{+name}', options)
1254
+ command.response_representation = Google::Apis::SecuritycenterV1::Source::Representation
1255
+ command.response_class = Google::Apis::SecuritycenterV1::Source
1256
+ command.params['name'] = name unless name.nil?
1257
+ command.query['fields'] = fields unless fields.nil?
1258
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1259
+ execute_or_queue_command(command, &block)
1260
+ end
1261
+
1262
+ # Gets the access control policy on the specified Source.
1263
+ # @param [String] resource
1264
+ # REQUIRED: The resource for which the policy is being requested. See the
1265
+ # operation documentation for the appropriate value for this field.
1266
+ # @param [Google::Apis::SecuritycenterV1::GetIamPolicyRequest] get_iam_policy_request_object
1267
+ # @param [String] fields
1268
+ # Selector specifying which fields to include in a partial response.
1269
+ # @param [String] quota_user
1270
+ # Available to use for quota purposes for server-side applications. Can be any
1271
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1272
+ # @param [Google::Apis::RequestOptions] options
1273
+ # Request-specific options
1274
+ #
1275
+ # @yield [result, err] Result & error if block supplied
1276
+ # @yieldparam result [Google::Apis::SecuritycenterV1::Policy] parsed result object
1277
+ # @yieldparam err [StandardError] error object if request failed
1278
+ #
1279
+ # @return [Google::Apis::SecuritycenterV1::Policy]
1280
+ #
1281
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1282
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1283
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1284
+ def get_source_iam_policy(resource, get_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1285
+ command = make_simple_command(:post, 'v1/{+resource}:getIamPolicy', options)
1286
+ command.request_representation = Google::Apis::SecuritycenterV1::GetIamPolicyRequest::Representation
1287
+ command.request_object = get_iam_policy_request_object
1288
+ command.response_representation = Google::Apis::SecuritycenterV1::Policy::Representation
1289
+ command.response_class = Google::Apis::SecuritycenterV1::Policy
1290
+ command.params['resource'] = resource unless resource.nil?
1291
+ command.query['fields'] = fields unless fields.nil?
1292
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1293
+ execute_or_queue_command(command, &block)
1294
+ end
1295
+
1296
+ # Lists all sources belonging to an organization.
1297
+ # @param [String] parent
1298
+ # Required. Resource name of the parent of sources to list. Its format should be
1299
+ # "organizations/[organization_id], folders/[folder_id], or projects/[project_id]
1300
+ # ".
1301
+ # @param [Fixnum] page_size
1302
+ # The maximum number of results to return in a single response. Default is 10,
1303
+ # minimum is 1, maximum is 1000.
1304
+ # @param [String] page_token
1305
+ # The value returned by the last `ListSourcesResponse`; indicates that this is a
1306
+ # continuation of a prior `ListSources` call, and that the system should return
1307
+ # the next page of data.
1308
+ # @param [String] fields
1309
+ # Selector specifying which fields to include in a partial response.
1310
+ # @param [String] quota_user
1311
+ # Available to use for quota purposes for server-side applications. Can be any
1312
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1313
+ # @param [Google::Apis::RequestOptions] options
1314
+ # Request-specific options
1315
+ #
1316
+ # @yield [result, err] Result & error if block supplied
1317
+ # @yieldparam result [Google::Apis::SecuritycenterV1::ListSourcesResponse] parsed result object
1318
+ # @yieldparam err [StandardError] error object if request failed
1319
+ #
1320
+ # @return [Google::Apis::SecuritycenterV1::ListSourcesResponse]
1321
+ #
1322
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1323
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1324
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1325
+ def list_organization_sources(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
1326
+ command = make_simple_command(:get, 'v1/{+parent}/sources', options)
1327
+ command.response_representation = Google::Apis::SecuritycenterV1::ListSourcesResponse::Representation
1328
+ command.response_class = Google::Apis::SecuritycenterV1::ListSourcesResponse
1329
+ command.params['parent'] = parent unless parent.nil?
1330
+ command.query['pageSize'] = page_size unless page_size.nil?
1331
+ command.query['pageToken'] = page_token unless page_token.nil?
1332
+ command.query['fields'] = fields unless fields.nil?
1333
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1334
+ execute_or_queue_command(command, &block)
1335
+ end
1336
+
1337
+ # Updates a source.
1338
+ # @param [String] name
1339
+ # The relative resource name of this source. See: https://cloud.google.com/apis/
1340
+ # design/resource_names#relative_resource_name Example: "organizations/`
1341
+ # organization_id`/sources/`source_id`"
1342
+ # @param [Google::Apis::SecuritycenterV1::Source] source_object
1343
+ # @param [String] update_mask
1344
+ # The FieldMask to use when updating the source resource. If empty all mutable
1345
+ # fields will be updated.
1346
+ # @param [String] fields
1347
+ # Selector specifying which fields to include in a partial response.
1348
+ # @param [String] quota_user
1349
+ # Available to use for quota purposes for server-side applications. Can be any
1350
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1351
+ # @param [Google::Apis::RequestOptions] options
1352
+ # Request-specific options
1353
+ #
1354
+ # @yield [result, err] Result & error if block supplied
1355
+ # @yieldparam result [Google::Apis::SecuritycenterV1::Source] parsed result object
1356
+ # @yieldparam err [StandardError] error object if request failed
1357
+ #
1358
+ # @return [Google::Apis::SecuritycenterV1::Source]
1359
+ #
1360
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1361
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1362
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1363
+ def patch_organization_source(name, source_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
1364
+ command = make_simple_command(:patch, 'v1/{+name}', options)
1365
+ command.request_representation = Google::Apis::SecuritycenterV1::Source::Representation
1366
+ command.request_object = source_object
1367
+ command.response_representation = Google::Apis::SecuritycenterV1::Source::Representation
1368
+ command.response_class = Google::Apis::SecuritycenterV1::Source
1369
+ command.params['name'] = name unless name.nil?
1370
+ command.query['updateMask'] = update_mask unless update_mask.nil?
1371
+ command.query['fields'] = fields unless fields.nil?
1372
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1373
+ execute_or_queue_command(command, &block)
1374
+ end
1375
+
1376
+ # Sets the access control policy on the specified Source.
1377
+ # @param [String] resource
1378
+ # REQUIRED: The resource for which the policy is being specified. See the
1379
+ # operation documentation for the appropriate value for this field.
1380
+ # @param [Google::Apis::SecuritycenterV1::SetIamPolicyRequest] set_iam_policy_request_object
1381
+ # @param [String] fields
1382
+ # Selector specifying which fields to include in a partial response.
1383
+ # @param [String] quota_user
1384
+ # Available to use for quota purposes for server-side applications. Can be any
1385
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1386
+ # @param [Google::Apis::RequestOptions] options
1387
+ # Request-specific options
1388
+ #
1389
+ # @yield [result, err] Result & error if block supplied
1390
+ # @yieldparam result [Google::Apis::SecuritycenterV1::Policy] parsed result object
1391
+ # @yieldparam err [StandardError] error object if request failed
1392
+ #
1393
+ # @return [Google::Apis::SecuritycenterV1::Policy]
1394
+ #
1395
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1396
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1397
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1398
+ def set_source_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1399
+ command = make_simple_command(:post, 'v1/{+resource}:setIamPolicy', options)
1400
+ command.request_representation = Google::Apis::SecuritycenterV1::SetIamPolicyRequest::Representation
1401
+ command.request_object = set_iam_policy_request_object
1402
+ command.response_representation = Google::Apis::SecuritycenterV1::Policy::Representation
1403
+ command.response_class = Google::Apis::SecuritycenterV1::Policy
1404
+ command.params['resource'] = resource unless resource.nil?
1405
+ command.query['fields'] = fields unless fields.nil?
1406
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1407
+ execute_or_queue_command(command, &block)
1408
+ end
1409
+
1410
+ # Returns the permissions that a caller has on the specified source.
1411
+ # @param [String] resource
1412
+ # REQUIRED: The resource for which the policy detail is being requested. See the
1413
+ # operation documentation for the appropriate value for this field.
1414
+ # @param [Google::Apis::SecuritycenterV1::TestIamPermissionsRequest] test_iam_permissions_request_object
1415
+ # @param [String] fields
1416
+ # Selector specifying which fields to include in a partial response.
1417
+ # @param [String] quota_user
1418
+ # Available to use for quota purposes for server-side applications. Can be any
1419
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1420
+ # @param [Google::Apis::RequestOptions] options
1421
+ # Request-specific options
1422
+ #
1423
+ # @yield [result, err] Result & error if block supplied
1424
+ # @yieldparam result [Google::Apis::SecuritycenterV1::TestIamPermissionsResponse] parsed result object
1425
+ # @yieldparam err [StandardError] error object if request failed
1426
+ #
1427
+ # @return [Google::Apis::SecuritycenterV1::TestIamPermissionsResponse]
1428
+ #
1429
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1430
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1431
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1432
+ def test_source_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1433
+ command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options)
1434
+ command.request_representation = Google::Apis::SecuritycenterV1::TestIamPermissionsRequest::Representation
1435
+ command.request_object = test_iam_permissions_request_object
1436
+ command.response_representation = Google::Apis::SecuritycenterV1::TestIamPermissionsResponse::Representation
1437
+ command.response_class = Google::Apis::SecuritycenterV1::TestIamPermissionsResponse
1438
+ command.params['resource'] = resource unless resource.nil?
1439
+ command.query['fields'] = fields unless fields.nil?
1440
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1441
+ execute_or_queue_command(command, &block)
1442
+ end
1443
+
1444
+ # Creates a finding. The corresponding source must exist for finding creation to
1445
+ # succeed.
1446
+ # @param [String] parent
1447
+ # Required. Resource name of the new finding's parent. Its format should be "
1448
+ # organizations/[organization_id]/sources/[source_id]".
1449
+ # @param [Google::Apis::SecuritycenterV1::Finding] finding_object
1450
+ # @param [String] finding_id
1451
+ # Required. Unique identifier provided by the client within the parent scope. It
1452
+ # must be alphanumeric and less than or equal to 32 characters and greater than
1453
+ # 0 characters in length.
1454
+ # @param [String] fields
1455
+ # Selector specifying which fields to include in a partial response.
1456
+ # @param [String] quota_user
1457
+ # Available to use for quota purposes for server-side applications. Can be any
1458
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1459
+ # @param [Google::Apis::RequestOptions] options
1460
+ # Request-specific options
1461
+ #
1462
+ # @yield [result, err] Result & error if block supplied
1463
+ # @yieldparam result [Google::Apis::SecuritycenterV1::Finding] parsed result object
1464
+ # @yieldparam err [StandardError] error object if request failed
1465
+ #
1466
+ # @return [Google::Apis::SecuritycenterV1::Finding]
1467
+ #
1468
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1469
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1470
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1471
+ def create_organization_source_finding(parent, finding_object = nil, finding_id: nil, fields: nil, quota_user: nil, options: nil, &block)
1472
+ command = make_simple_command(:post, 'v1/{+parent}/findings', options)
1473
+ command.request_representation = Google::Apis::SecuritycenterV1::Finding::Representation
1474
+ command.request_object = finding_object
1475
+ command.response_representation = Google::Apis::SecuritycenterV1::Finding::Representation
1476
+ command.response_class = Google::Apis::SecuritycenterV1::Finding
1477
+ command.params['parent'] = parent unless parent.nil?
1478
+ command.query['findingId'] = finding_id unless finding_id.nil?
1479
+ command.query['fields'] = fields unless fields.nil?
1480
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1481
+ execute_or_queue_command(command, &block)
1482
+ end
1483
+
1484
+ # Filters an organization or source's findings and groups them by their
1485
+ # specified properties. To group across all sources provide a `-` as the source
1486
+ # id. Example: /v1/organizations/`organization_id`/sources/-/findings, /v1/
1487
+ # folders/`folder_id`/sources/-/findings, /v1/projects/`project_id`/sources/-/
1488
+ # findings
1489
+ # @param [String] parent
1490
+ # Required. Name of the source to groupBy. Its format is "organizations/[
1491
+ # organization_id]/sources/[source_id]", folders/[folder_id]/sources/[source_id],
1492
+ # or projects/[project_id]/sources/[source_id]. To groupBy across all sources
1493
+ # provide a source_id of `-`. For example: organizations/`organization_id`/
1494
+ # sources/-, folders/`folder_id`/sources/-, or projects/`project_id`/sources/-
1495
+ # @param [Google::Apis::SecuritycenterV1::GroupFindingsRequest] group_findings_request_object
1496
+ # @param [String] fields
1497
+ # Selector specifying which fields to include in a partial response.
1498
+ # @param [String] quota_user
1499
+ # Available to use for quota purposes for server-side applications. Can be any
1500
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1501
+ # @param [Google::Apis::RequestOptions] options
1502
+ # Request-specific options
1503
+ #
1504
+ # @yield [result, err] Result & error if block supplied
1505
+ # @yieldparam result [Google::Apis::SecuritycenterV1::GroupFindingsResponse] parsed result object
1506
+ # @yieldparam err [StandardError] error object if request failed
1507
+ #
1508
+ # @return [Google::Apis::SecuritycenterV1::GroupFindingsResponse]
1509
+ #
1510
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1511
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1512
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1513
+ def group_findings(parent, group_findings_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1514
+ command = make_simple_command(:post, 'v1/{+parent}/findings:group', options)
1515
+ command.request_representation = Google::Apis::SecuritycenterV1::GroupFindingsRequest::Representation
1516
+ command.request_object = group_findings_request_object
1517
+ command.response_representation = Google::Apis::SecuritycenterV1::GroupFindingsResponse::Representation
1518
+ command.response_class = Google::Apis::SecuritycenterV1::GroupFindingsResponse
1519
+ command.params['parent'] = parent unless parent.nil?
1520
+ command.query['fields'] = fields unless fields.nil?
1521
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1522
+ execute_or_queue_command(command, &block)
1523
+ end
1524
+
1525
+ # Lists an organization or source's findings. To list across all sources provide
1526
+ # a `-` as the source id. Example: /v1/organizations/`organization_id`/sources/-/
1527
+ # findings
1528
+ # @param [String] parent
1529
+ # Required. Name of the source the findings belong to. Its format is "
1530
+ # organizations/[organization_id]/sources/[source_id], folders/[folder_id]/
1531
+ # sources/[source_id], or projects/[project_id]/sources/[source_id]". To list
1532
+ # across all sources provide a source_id of `-`. For example: organizations/`
1533
+ # organization_id`/sources/-, folders/`folder_id`/sources/- or projects/`
1534
+ # projects_id`/sources/-
1535
+ # @param [String] compare_duration
1536
+ # When compare_duration is set, the ListFindingsResult's "state_change"
1537
+ # attribute is updated to indicate whether the finding had its state changed,
1538
+ # the finding's state remained unchanged, or if the finding was added in any
1539
+ # state during the compare_duration period of time that precedes the read_time.
1540
+ # This is the time between (read_time - compare_duration) and read_time. The
1541
+ # state_change value is derived based on the presence and state of the finding
1542
+ # at the two points in time. Intermediate state changes between the two times
1543
+ # don't affect the result. For example, the results aren't affected if the
1544
+ # finding is made inactive and then active again. Possible "state_change" values
1545
+ # when compare_duration is specified: * "CHANGED": indicates that the finding
1546
+ # was present and matched the given filter at the start of compare_duration, but
1547
+ # changed its state at read_time. * "UNCHANGED": indicates that the finding was
1548
+ # present and matched the given filter at the start of compare_duration and did
1549
+ # not change state at read_time. * "ADDED": indicates that the finding did not
1550
+ # match the given filter or was not present at the start of compare_duration,
1551
+ # but was present at read_time. * "REMOVED": indicates that the finding was
1552
+ # present and matched the filter at the start of compare_duration, but did not
1553
+ # match the filter at read_time. If compare_duration is not specified, then the
1554
+ # only possible state_change is "UNUSED", which will be the state_change set for
1555
+ # all findings present at read_time.
1556
+ # @param [String] field_mask
1557
+ # A field mask to specify the Finding fields to be listed in the response. An
1558
+ # empty field mask will list all fields.
1559
+ # @param [String] filter
1560
+ # Expression that defines the filter to apply across findings. The expression is
1561
+ # a list of one or more restrictions combined via logical operators `AND` and `
1562
+ # OR`. Parentheses are supported, and `OR` has higher precedence than `AND`.
1563
+ # Restrictions have the form ` ` and may have a `-` character in front of them
1564
+ # to indicate negation. Examples include: * name * source_properties.a_property *
1565
+ # security_marks.marks.marka The supported operators are: * `=` for all value
1566
+ # types. * `>`, `<`, `>=`, `<=` for integer values. * `:`, meaning substring
1567
+ # matching, for strings. The supported value types are: * string literals in
1568
+ # quotes. * integer literals without quotes. * boolean literals `true` and `
1569
+ # false` without quotes. The following field and operator combinations are
1570
+ # supported: * name: `=` * parent: `=`, `:` * resource_name: `=`, `:` * state: `=
1571
+ # `, `:` * category: `=`, `:` * external_uri: `=`, `:` * event_time: `=`, `>`, `<
1572
+ # `, `>=`, `<=` * severity: `=`, `:` Usage: This should be milliseconds since
1573
+ # epoch or an RFC3339 string. Examples: `event_time = "2019-06-10T16:07:18-07:00"
1574
+ # ` `event_time = 1560208038000` security_marks.marks: `=`, `:`
1575
+ # source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` For example, `
1576
+ # source_properties.size = 100` is a valid filter string. Use a partial match on
1577
+ # the empty string to filter based on a property existing: `source_properties.
1578
+ # my_property : ""` Use a negated partial match on the empty string to filter
1579
+ # based on a property not existing: `-source_properties.my_property : ""`
1580
+ # @param [String] order_by
1581
+ # Expression that defines what fields and order to use for sorting. The string
1582
+ # value should follow SQL syntax: comma separated list of fields. For example: "
1583
+ # name,resource_properties.a_property". The default sorting order is ascending.
1584
+ # To specify descending order for a field, a suffix " desc" should be appended
1585
+ # to the field name. For example: "name desc,source_properties.a_property".
1586
+ # Redundant space characters in the syntax are insignificant. "name desc,
1587
+ # source_properties.a_property" and " name desc , source_properties.a_property "
1588
+ # are equivalent. The following fields are supported: name parent state category
1589
+ # resource_name event_time source_properties security_marks.marks
1590
+ # @param [Fixnum] page_size
1591
+ # The maximum number of results to return in a single response. Default is 10,
1592
+ # minimum is 1, maximum is 1000.
1593
+ # @param [String] page_token
1594
+ # The value returned by the last `ListFindingsResponse`; indicates that this is
1595
+ # a continuation of a prior `ListFindings` call, and that the system should
1596
+ # return the next page of data.
1597
+ # @param [String] read_time
1598
+ # Time used as a reference point when filtering findings. The filter is limited
1599
+ # to findings existing at the supplied time and their values are those at that
1600
+ # specific time. Absence of this field will default to the API's version of NOW.
1601
+ # @param [String] fields
1602
+ # Selector specifying which fields to include in a partial response.
1603
+ # @param [String] quota_user
1604
+ # Available to use for quota purposes for server-side applications. Can be any
1605
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1606
+ # @param [Google::Apis::RequestOptions] options
1607
+ # Request-specific options
1608
+ #
1609
+ # @yield [result, err] Result & error if block supplied
1610
+ # @yieldparam result [Google::Apis::SecuritycenterV1::ListFindingsResponse] parsed result object
1611
+ # @yieldparam err [StandardError] error object if request failed
1612
+ #
1613
+ # @return [Google::Apis::SecuritycenterV1::ListFindingsResponse]
1614
+ #
1615
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1616
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1617
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1618
+ def list_organization_source_findings(parent, compare_duration: nil, field_mask: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil, read_time: nil, fields: nil, quota_user: nil, options: nil, &block)
1619
+ command = make_simple_command(:get, 'v1/{+parent}/findings', options)
1620
+ command.response_representation = Google::Apis::SecuritycenterV1::ListFindingsResponse::Representation
1621
+ command.response_class = Google::Apis::SecuritycenterV1::ListFindingsResponse
1622
+ command.params['parent'] = parent unless parent.nil?
1623
+ command.query['compareDuration'] = compare_duration unless compare_duration.nil?
1624
+ command.query['fieldMask'] = field_mask unless field_mask.nil?
1625
+ command.query['filter'] = filter unless filter.nil?
1626
+ command.query['orderBy'] = order_by unless order_by.nil?
1627
+ command.query['pageSize'] = page_size unless page_size.nil?
1628
+ command.query['pageToken'] = page_token unless page_token.nil?
1629
+ command.query['readTime'] = read_time unless read_time.nil?
1630
+ command.query['fields'] = fields unless fields.nil?
1631
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1632
+ execute_or_queue_command(command, &block)
1633
+ end
1634
+
1635
+ # Creates or updates a finding. The corresponding source must exist for a
1636
+ # finding creation to succeed.
1637
+ # @param [String] name
1638
+ # The relative resource name of this finding. See: https://cloud.google.com/apis/
1639
+ # design/resource_names#relative_resource_name Example: "organizations/`
1640
+ # organization_id`/sources/`source_id`/findings/`finding_id`"
1641
+ # @param [Google::Apis::SecuritycenterV1::Finding] finding_object
1642
+ # @param [String] update_mask
1643
+ # The FieldMask to use when updating the finding resource. This field should not
1644
+ # be specified when creating a finding. When updating a finding, an empty mask
1645
+ # is treated as updating all mutable fields and replacing source_properties.
1646
+ # Individual source_properties can be added/updated by using "source_properties."
1647
+ # in the field mask.
1648
+ # @param [String] fields
1649
+ # Selector specifying which fields to include in a partial response.
1650
+ # @param [String] quota_user
1651
+ # Available to use for quota purposes for server-side applications. Can be any
1652
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1653
+ # @param [Google::Apis::RequestOptions] options
1654
+ # Request-specific options
1655
+ #
1656
+ # @yield [result, err] Result & error if block supplied
1657
+ # @yieldparam result [Google::Apis::SecuritycenterV1::Finding] parsed result object
1658
+ # @yieldparam err [StandardError] error object if request failed
1659
+ #
1660
+ # @return [Google::Apis::SecuritycenterV1::Finding]
1661
+ #
1662
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1663
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1664
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1665
+ def patch_organization_source_finding(name, finding_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
1666
+ command = make_simple_command(:patch, 'v1/{+name}', options)
1667
+ command.request_representation = Google::Apis::SecuritycenterV1::Finding::Representation
1668
+ command.request_object = finding_object
1669
+ command.response_representation = Google::Apis::SecuritycenterV1::Finding::Representation
1670
+ command.response_class = Google::Apis::SecuritycenterV1::Finding
1671
+ command.params['name'] = name unless name.nil?
1672
+ command.query['updateMask'] = update_mask unless update_mask.nil?
1673
+ command.query['fields'] = fields unless fields.nil?
1674
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1675
+ execute_or_queue_command(command, &block)
1676
+ end
1677
+
1678
+ # Updates the state of a finding.
1679
+ # @param [String] name
1680
+ # Required. The relative resource name of the finding. See: https://cloud.google.
1681
+ # com/apis/design/resource_names#relative_resource_name Example: "organizations/`
1682
+ # organization_id`/sources/`source_id`/finding/`finding_id`".
1683
+ # @param [Google::Apis::SecuritycenterV1::SetFindingStateRequest] set_finding_state_request_object
1684
+ # @param [String] fields
1685
+ # Selector specifying which fields to include in a partial response.
1686
+ # @param [String] quota_user
1687
+ # Available to use for quota purposes for server-side applications. Can be any
1688
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1689
+ # @param [Google::Apis::RequestOptions] options
1690
+ # Request-specific options
1691
+ #
1692
+ # @yield [result, err] Result & error if block supplied
1693
+ # @yieldparam result [Google::Apis::SecuritycenterV1::Finding] parsed result object
1694
+ # @yieldparam err [StandardError] error object if request failed
1695
+ #
1696
+ # @return [Google::Apis::SecuritycenterV1::Finding]
1697
+ #
1698
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1699
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1700
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1701
+ def set_organization_source_finding_state(name, set_finding_state_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1702
+ command = make_simple_command(:post, 'v1/{+name}:setState', options)
1703
+ command.request_representation = Google::Apis::SecuritycenterV1::SetFindingStateRequest::Representation
1704
+ command.request_object = set_finding_state_request_object
1705
+ command.response_representation = Google::Apis::SecuritycenterV1::Finding::Representation
1706
+ command.response_class = Google::Apis::SecuritycenterV1::Finding
1707
+ command.params['name'] = name unless name.nil?
1708
+ command.query['fields'] = fields unless fields.nil?
1709
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1710
+ execute_or_queue_command(command, &block)
1711
+ end
1712
+
1713
+ # Updates security marks.
1714
+ # @param [String] name
1715
+ # The relative resource name of the SecurityMarks. See: https://cloud.google.com/
1716
+ # apis/design/resource_names#relative_resource_name Examples: "organizations/`
1717
+ # organization_id`/assets/`asset_id`/securityMarks" "organizations/`
1718
+ # organization_id`/sources/`source_id`/findings/`finding_id`/securityMarks".
1719
+ # @param [Google::Apis::SecuritycenterV1::SecurityMarks] security_marks_object
1720
+ # @param [String] start_time
1721
+ # The time at which the updated SecurityMarks take effect. If not set uses
1722
+ # current server time. Updates will be applied to the SecurityMarks that are
1723
+ # active immediately preceding this time.
1724
+ # @param [String] update_mask
1725
+ # The FieldMask to use when updating the security marks resource. The field mask
1726
+ # must not contain duplicate fields. If empty or set to "marks", all marks will
1727
+ # be replaced. Individual marks can be updated using "marks.".
1728
+ # @param [String] fields
1729
+ # Selector specifying which fields to include in a partial response.
1730
+ # @param [String] quota_user
1731
+ # Available to use for quota purposes for server-side applications. Can be any
1732
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1733
+ # @param [Google::Apis::RequestOptions] options
1734
+ # Request-specific options
1735
+ #
1736
+ # @yield [result, err] Result & error if block supplied
1737
+ # @yieldparam result [Google::Apis::SecuritycenterV1::SecurityMarks] parsed result object
1738
+ # @yieldparam err [StandardError] error object if request failed
1739
+ #
1740
+ # @return [Google::Apis::SecuritycenterV1::SecurityMarks]
1741
+ #
1742
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1743
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1744
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1745
+ def update_organization_source_finding_security_marks(name, security_marks_object = nil, start_time: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
1746
+ command = make_simple_command(:patch, 'v1/{+name}', options)
1747
+ command.request_representation = Google::Apis::SecuritycenterV1::SecurityMarks::Representation
1748
+ command.request_object = security_marks_object
1749
+ command.response_representation = Google::Apis::SecuritycenterV1::SecurityMarks::Representation
1750
+ command.response_class = Google::Apis::SecuritycenterV1::SecurityMarks
1751
+ command.params['name'] = name unless name.nil?
1752
+ command.query['startTime'] = start_time unless start_time.nil?
1753
+ command.query['updateMask'] = update_mask unless update_mask.nil?
1754
+ command.query['fields'] = fields unless fields.nil?
1755
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1756
+ execute_or_queue_command(command, &block)
1757
+ end
1758
+
1759
+ # Filters an organization's assets and groups them by their specified properties.
1760
+ # @param [String] parent
1761
+ # Required. Name of the organization to groupBy. Its format is "organizations/[
1762
+ # organization_id], folders/[folder_id], or projects/[project_id]".
1763
+ # @param [Google::Apis::SecuritycenterV1::GroupAssetsRequest] group_assets_request_object
1764
+ # @param [String] fields
1765
+ # Selector specifying which fields to include in a partial response.
1766
+ # @param [String] quota_user
1767
+ # Available to use for quota purposes for server-side applications. Can be any
1768
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1769
+ # @param [Google::Apis::RequestOptions] options
1770
+ # Request-specific options
1771
+ #
1772
+ # @yield [result, err] Result & error if block supplied
1773
+ # @yieldparam result [Google::Apis::SecuritycenterV1::GroupAssetsResponse] parsed result object
1774
+ # @yieldparam err [StandardError] error object if request failed
1775
+ #
1776
+ # @return [Google::Apis::SecuritycenterV1::GroupAssetsResponse]
1777
+ #
1778
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1779
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1780
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1781
+ def group_project_asset(parent, group_assets_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1782
+ command = make_simple_command(:post, 'v1/{+parent}/assets:group', options)
1783
+ command.request_representation = Google::Apis::SecuritycenterV1::GroupAssetsRequest::Representation
1784
+ command.request_object = group_assets_request_object
1785
+ command.response_representation = Google::Apis::SecuritycenterV1::GroupAssetsResponse::Representation
1786
+ command.response_class = Google::Apis::SecuritycenterV1::GroupAssetsResponse
1787
+ command.params['parent'] = parent unless parent.nil?
1788
+ command.query['fields'] = fields unless fields.nil?
1789
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1790
+ execute_or_queue_command(command, &block)
1791
+ end
1792
+
1793
+ # Lists an organization's assets.
1794
+ # @param [String] parent
1795
+ # Required. Name of the organization assets should belong to. Its format is "
1796
+ # organizations/[organization_id], folders/[folder_id], or projects/[project_id]"
1797
+ # .
1798
+ # @param [String] compare_duration
1799
+ # When compare_duration is set, the ListAssetsResult's "state_change" attribute
1800
+ # is updated to indicate whether the asset was added, removed, or remained
1801
+ # present during the compare_duration period of time that precedes the read_time.
1802
+ # This is the time between (read_time - compare_duration) and read_time. The
1803
+ # state_change value is derived based on the presence of the asset at the two
1804
+ # points in time. Intermediate state changes between the two times don't affect
1805
+ # the result. For example, the results aren't affected if the asset is removed
1806
+ # and re-created again. Possible "state_change" values when compare_duration is
1807
+ # specified: * "ADDED": indicates that the asset was not present at the start of
1808
+ # compare_duration, but present at read_time. * "REMOVED": indicates that the
1809
+ # asset was present at the start of compare_duration, but not present at
1810
+ # read_time. * "ACTIVE": indicates that the asset was present at both the start
1811
+ # and the end of the time period defined by compare_duration and read_time. If
1812
+ # compare_duration is not specified, then the only possible state_change is "
1813
+ # UNUSED", which will be the state_change set for all assets present at
1814
+ # read_time.
1815
+ # @param [String] field_mask
1816
+ # A field mask to specify the ListAssetsResult fields to be listed in the
1817
+ # response. An empty field mask will list all fields.
1818
+ # @param [String] filter
1819
+ # Expression that defines the filter to apply across assets. The expression is a
1820
+ # list of zero or more restrictions combined via logical operators `AND` and `OR`
1821
+ # . Parentheses are supported, and `OR` has higher precedence than `AND`.
1822
+ # Restrictions have the form ` ` and may have a `-` character in front of them
1823
+ # to indicate negation. The fields map to those defined in the Asset resource.
1824
+ # Examples include: * name * security_center_properties.resource_name *
1825
+ # resource_properties.a_property * security_marks.marks.marka The supported
1826
+ # operators are: * `=` for all value types. * `>`, `<`, `>=`, `<=` for integer
1827
+ # values. * `:`, meaning substring matching, for strings. The supported value
1828
+ # types are: * string literals in quotes. * integer literals without quotes. *
1829
+ # boolean literals `true` and `false` without quotes. The following are the
1830
+ # allowed field and operator combinations: * name: `=` * update_time: `=`, `>`, `
1831
+ # <`, `>=`, `<=` Usage: This should be milliseconds since epoch or an RFC3339
1832
+ # string. Examples: `update_time = "2019-06-10T16:07:18-07:00"` `update_time =
1833
+ # 1560208038000` * create_time: `=`, `>`, `<`, `>=`, `<=` Usage: This should be
1834
+ # milliseconds since epoch or an RFC3339 string. Examples: `create_time = "2019-
1835
+ # 06-10T16:07:18-07:00"` `create_time = 1560208038000` * iam_policy.policy_blob:
1836
+ # `=`, `:` * resource_properties: `=`, `:`, `>`, `<`, `>=`, `<=` *
1837
+ # security_marks.marks: `=`, `:` * security_center_properties.resource_name: `=`,
1838
+ # `:` * security_center_properties.resource_display_name: `=`, `:` *
1839
+ # security_center_properties.resource_type: `=`, `:` *
1840
+ # security_center_properties.resource_parent: `=`, `:` *
1841
+ # security_center_properties.resource_parent_display_name: `=`, `:` *
1842
+ # security_center_properties.resource_project: `=`, `:` *
1843
+ # security_center_properties.resource_project_display_name: `=`, `:` *
1844
+ # security_center_properties.resource_owners: `=`, `:` For example, `
1845
+ # resource_properties.size = 100` is a valid filter string. Use a partial match
1846
+ # on the empty string to filter based on a property existing: `
1847
+ # resource_properties.my_property : ""` Use a negated partial match on the empty
1848
+ # string to filter based on a property not existing: `-resource_properties.
1849
+ # my_property : ""`
1850
+ # @param [String] order_by
1851
+ # Expression that defines what fields and order to use for sorting. The string
1852
+ # value should follow SQL syntax: comma separated list of fields. For example: "
1853
+ # name,resource_properties.a_property". The default sorting order is ascending.
1854
+ # To specify descending order for a field, a suffix " desc" should be appended
1855
+ # to the field name. For example: "name desc,resource_properties.a_property".
1856
+ # Redundant space characters in the syntax are insignificant. "name desc,
1857
+ # resource_properties.a_property" and " name desc , resource_properties.
1858
+ # a_property " are equivalent. The following fields are supported: name
1859
+ # update_time resource_properties security_marks.marks
1860
+ # security_center_properties.resource_name security_center_properties.
1861
+ # resource_display_name security_center_properties.resource_parent
1862
+ # security_center_properties.resource_parent_display_name
1863
+ # security_center_properties.resource_project security_center_properties.
1864
+ # resource_project_display_name security_center_properties.resource_type
1865
+ # @param [Fixnum] page_size
1866
+ # The maximum number of results to return in a single response. Default is 10,
1867
+ # minimum is 1, maximum is 1000.
1868
+ # @param [String] page_token
1869
+ # The value returned by the last `ListAssetsResponse`; indicates that this is a
1870
+ # continuation of a prior `ListAssets` call, and that the system should return
1871
+ # the next page of data.
1872
+ # @param [String] read_time
1873
+ # Time used as a reference point when filtering assets. The filter is limited to
1874
+ # assets existing at the supplied time and their values are those at that
1875
+ # specific time. Absence of this field will default to the API's version of NOW.
1876
+ # @param [String] fields
1877
+ # Selector specifying which fields to include in a partial response.
1878
+ # @param [String] quota_user
1879
+ # Available to use for quota purposes for server-side applications. Can be any
1880
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1881
+ # @param [Google::Apis::RequestOptions] options
1882
+ # Request-specific options
1883
+ #
1884
+ # @yield [result, err] Result & error if block supplied
1885
+ # @yieldparam result [Google::Apis::SecuritycenterV1::ListAssetsResponse] parsed result object
1886
+ # @yieldparam err [StandardError] error object if request failed
1887
+ #
1888
+ # @return [Google::Apis::SecuritycenterV1::ListAssetsResponse]
1889
+ #
1890
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1891
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1892
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1893
+ def list_project_assets(parent, compare_duration: nil, field_mask: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil, read_time: nil, fields: nil, quota_user: nil, options: nil, &block)
1894
+ command = make_simple_command(:get, 'v1/{+parent}/assets', options)
1895
+ command.response_representation = Google::Apis::SecuritycenterV1::ListAssetsResponse::Representation
1896
+ command.response_class = Google::Apis::SecuritycenterV1::ListAssetsResponse
1897
+ command.params['parent'] = parent unless parent.nil?
1898
+ command.query['compareDuration'] = compare_duration unless compare_duration.nil?
1899
+ command.query['fieldMask'] = field_mask unless field_mask.nil?
1900
+ command.query['filter'] = filter unless filter.nil?
1901
+ command.query['orderBy'] = order_by unless order_by.nil?
1902
+ command.query['pageSize'] = page_size unless page_size.nil?
1903
+ command.query['pageToken'] = page_token unless page_token.nil?
1904
+ command.query['readTime'] = read_time unless read_time.nil?
1905
+ command.query['fields'] = fields unless fields.nil?
1906
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1907
+ execute_or_queue_command(command, &block)
1908
+ end
1909
+
1910
+ # Updates security marks.
1911
+ # @param [String] name
1912
+ # The relative resource name of the SecurityMarks. See: https://cloud.google.com/
1913
+ # apis/design/resource_names#relative_resource_name Examples: "organizations/`
1914
+ # organization_id`/assets/`asset_id`/securityMarks" "organizations/`
1915
+ # organization_id`/sources/`source_id`/findings/`finding_id`/securityMarks".
1916
+ # @param [Google::Apis::SecuritycenterV1::SecurityMarks] security_marks_object
1917
+ # @param [String] start_time
1918
+ # The time at which the updated SecurityMarks take effect. If not set uses
1919
+ # current server time. Updates will be applied to the SecurityMarks that are
1920
+ # active immediately preceding this time.
1921
+ # @param [String] update_mask
1922
+ # The FieldMask to use when updating the security marks resource. The field mask
1923
+ # must not contain duplicate fields. If empty or set to "marks", all marks will
1924
+ # be replaced. Individual marks can be updated using "marks.".
1925
+ # @param [String] fields
1926
+ # Selector specifying which fields to include in a partial response.
1927
+ # @param [String] quota_user
1928
+ # Available to use for quota purposes for server-side applications. Can be any
1929
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1930
+ # @param [Google::Apis::RequestOptions] options
1931
+ # Request-specific options
1932
+ #
1933
+ # @yield [result, err] Result & error if block supplied
1934
+ # @yieldparam result [Google::Apis::SecuritycenterV1::SecurityMarks] parsed result object
1935
+ # @yieldparam err [StandardError] error object if request failed
1936
+ #
1937
+ # @return [Google::Apis::SecuritycenterV1::SecurityMarks]
1938
+ #
1939
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1940
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1941
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1942
+ def update_project_asset_security_marks(name, security_marks_object = nil, start_time: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
1943
+ command = make_simple_command(:patch, 'v1/{+name}', options)
1944
+ command.request_representation = Google::Apis::SecuritycenterV1::SecurityMarks::Representation
1945
+ command.request_object = security_marks_object
1946
+ command.response_representation = Google::Apis::SecuritycenterV1::SecurityMarks::Representation
1947
+ command.response_class = Google::Apis::SecuritycenterV1::SecurityMarks
1948
+ command.params['name'] = name unless name.nil?
1949
+ command.query['startTime'] = start_time unless start_time.nil?
1950
+ command.query['updateMask'] = update_mask unless update_mask.nil?
1951
+ command.query['fields'] = fields unless fields.nil?
1952
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1953
+ execute_or_queue_command(command, &block)
1954
+ end
1955
+
1956
+ # Lists all sources belonging to an organization.
1957
+ # @param [String] parent
1958
+ # Required. Resource name of the parent of sources to list. Its format should be
1959
+ # "organizations/[organization_id], folders/[folder_id], or projects/[project_id]
1960
+ # ".
1961
+ # @param [Fixnum] page_size
1962
+ # The maximum number of results to return in a single response. Default is 10,
1963
+ # minimum is 1, maximum is 1000.
1964
+ # @param [String] page_token
1965
+ # The value returned by the last `ListSourcesResponse`; indicates that this is a
1966
+ # continuation of a prior `ListSources` call, and that the system should return
1967
+ # the next page of data.
1968
+ # @param [String] fields
1969
+ # Selector specifying which fields to include in a partial response.
1970
+ # @param [String] quota_user
1971
+ # Available to use for quota purposes for server-side applications. Can be any
1972
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1973
+ # @param [Google::Apis::RequestOptions] options
1974
+ # Request-specific options
1975
+ #
1976
+ # @yield [result, err] Result & error if block supplied
1977
+ # @yieldparam result [Google::Apis::SecuritycenterV1::ListSourcesResponse] parsed result object
1978
+ # @yieldparam err [StandardError] error object if request failed
1979
+ #
1980
+ # @return [Google::Apis::SecuritycenterV1::ListSourcesResponse]
1981
+ #
1982
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1983
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1984
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1985
+ def list_project_sources(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
1986
+ command = make_simple_command(:get, 'v1/{+parent}/sources', options)
1987
+ command.response_representation = Google::Apis::SecuritycenterV1::ListSourcesResponse::Representation
1988
+ command.response_class = Google::Apis::SecuritycenterV1::ListSourcesResponse
1989
+ command.params['parent'] = parent unless parent.nil?
1990
+ command.query['pageSize'] = page_size unless page_size.nil?
1991
+ command.query['pageToken'] = page_token unless page_token.nil?
1992
+ command.query['fields'] = fields unless fields.nil?
1993
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1994
+ execute_or_queue_command(command, &block)
1995
+ end
1996
+
1997
+ # Filters an organization or source's findings and groups them by their
1998
+ # specified properties. To group across all sources provide a `-` as the source
1999
+ # id. Example: /v1/organizations/`organization_id`/sources/-/findings, /v1/
2000
+ # folders/`folder_id`/sources/-/findings, /v1/projects/`project_id`/sources/-/
2001
+ # findings
2002
+ # @param [String] parent
2003
+ # Required. Name of the source to groupBy. Its format is "organizations/[
2004
+ # organization_id]/sources/[source_id]", folders/[folder_id]/sources/[source_id],
2005
+ # or projects/[project_id]/sources/[source_id]. To groupBy across all sources
2006
+ # provide a source_id of `-`. For example: organizations/`organization_id`/
2007
+ # sources/-, folders/`folder_id`/sources/-, or projects/`project_id`/sources/-
2008
+ # @param [Google::Apis::SecuritycenterV1::GroupFindingsRequest] group_findings_request_object
2009
+ # @param [String] fields
2010
+ # Selector specifying which fields to include in a partial response.
2011
+ # @param [String] quota_user
2012
+ # Available to use for quota purposes for server-side applications. Can be any
2013
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2014
+ # @param [Google::Apis::RequestOptions] options
2015
+ # Request-specific options
2016
+ #
2017
+ # @yield [result, err] Result & error if block supplied
2018
+ # @yieldparam result [Google::Apis::SecuritycenterV1::GroupFindingsResponse] parsed result object
2019
+ # @yieldparam err [StandardError] error object if request failed
2020
+ #
2021
+ # @return [Google::Apis::SecuritycenterV1::GroupFindingsResponse]
2022
+ #
2023
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2024
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2025
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2026
+ def group_project_source_finding(parent, group_findings_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2027
+ command = make_simple_command(:post, 'v1/{+parent}/findings:group', options)
2028
+ command.request_representation = Google::Apis::SecuritycenterV1::GroupFindingsRequest::Representation
2029
+ command.request_object = group_findings_request_object
2030
+ command.response_representation = Google::Apis::SecuritycenterV1::GroupFindingsResponse::Representation
2031
+ command.response_class = Google::Apis::SecuritycenterV1::GroupFindingsResponse
2032
+ command.params['parent'] = parent unless parent.nil?
2033
+ command.query['fields'] = fields unless fields.nil?
2034
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2035
+ execute_or_queue_command(command, &block)
2036
+ end
2037
+
2038
+ # Lists an organization or source's findings. To list across all sources provide
2039
+ # a `-` as the source id. Example: /v1/organizations/`organization_id`/sources/-/
2040
+ # findings
2041
+ # @param [String] parent
2042
+ # Required. Name of the source the findings belong to. Its format is "
2043
+ # organizations/[organization_id]/sources/[source_id], folders/[folder_id]/
2044
+ # sources/[source_id], or projects/[project_id]/sources/[source_id]". To list
2045
+ # across all sources provide a source_id of `-`. For example: organizations/`
2046
+ # organization_id`/sources/-, folders/`folder_id`/sources/- or projects/`
2047
+ # projects_id`/sources/-
2048
+ # @param [String] compare_duration
2049
+ # When compare_duration is set, the ListFindingsResult's "state_change"
2050
+ # attribute is updated to indicate whether the finding had its state changed,
2051
+ # the finding's state remained unchanged, or if the finding was added in any
2052
+ # state during the compare_duration period of time that precedes the read_time.
2053
+ # This is the time between (read_time - compare_duration) and read_time. The
2054
+ # state_change value is derived based on the presence and state of the finding
2055
+ # at the two points in time. Intermediate state changes between the two times
2056
+ # don't affect the result. For example, the results aren't affected if the
2057
+ # finding is made inactive and then active again. Possible "state_change" values
2058
+ # when compare_duration is specified: * "CHANGED": indicates that the finding
2059
+ # was present and matched the given filter at the start of compare_duration, but
2060
+ # changed its state at read_time. * "UNCHANGED": indicates that the finding was
2061
+ # present and matched the given filter at the start of compare_duration and did
2062
+ # not change state at read_time. * "ADDED": indicates that the finding did not
2063
+ # match the given filter or was not present at the start of compare_duration,
2064
+ # but was present at read_time. * "REMOVED": indicates that the finding was
2065
+ # present and matched the filter at the start of compare_duration, but did not
2066
+ # match the filter at read_time. If compare_duration is not specified, then the
2067
+ # only possible state_change is "UNUSED", which will be the state_change set for
2068
+ # all findings present at read_time.
2069
+ # @param [String] field_mask
2070
+ # A field mask to specify the Finding fields to be listed in the response. An
2071
+ # empty field mask will list all fields.
2072
+ # @param [String] filter
2073
+ # Expression that defines the filter to apply across findings. The expression is
2074
+ # a list of one or more restrictions combined via logical operators `AND` and `
2075
+ # OR`. Parentheses are supported, and `OR` has higher precedence than `AND`.
2076
+ # Restrictions have the form ` ` and may have a `-` character in front of them
2077
+ # to indicate negation. Examples include: * name * source_properties.a_property *
2078
+ # security_marks.marks.marka The supported operators are: * `=` for all value
2079
+ # types. * `>`, `<`, `>=`, `<=` for integer values. * `:`, meaning substring
2080
+ # matching, for strings. The supported value types are: * string literals in
2081
+ # quotes. * integer literals without quotes. * boolean literals `true` and `
2082
+ # false` without quotes. The following field and operator combinations are
2083
+ # supported: * name: `=` * parent: `=`, `:` * resource_name: `=`, `:` * state: `=
2084
+ # `, `:` * category: `=`, `:` * external_uri: `=`, `:` * event_time: `=`, `>`, `<
2085
+ # `, `>=`, `<=` * severity: `=`, `:` Usage: This should be milliseconds since
2086
+ # epoch or an RFC3339 string. Examples: `event_time = "2019-06-10T16:07:18-07:00"
2087
+ # ` `event_time = 1560208038000` security_marks.marks: `=`, `:`
2088
+ # source_properties: `=`, `:`, `>`, `<`, `>=`, `<=` For example, `
2089
+ # source_properties.size = 100` is a valid filter string. Use a partial match on
2090
+ # the empty string to filter based on a property existing: `source_properties.
2091
+ # my_property : ""` Use a negated partial match on the empty string to filter
2092
+ # based on a property not existing: `-source_properties.my_property : ""`
2093
+ # @param [String] order_by
2094
+ # Expression that defines what fields and order to use for sorting. The string
2095
+ # value should follow SQL syntax: comma separated list of fields. For example: "
2096
+ # name,resource_properties.a_property". The default sorting order is ascending.
2097
+ # To specify descending order for a field, a suffix " desc" should be appended
2098
+ # to the field name. For example: "name desc,source_properties.a_property".
2099
+ # Redundant space characters in the syntax are insignificant. "name desc,
2100
+ # source_properties.a_property" and " name desc , source_properties.a_property "
2101
+ # are equivalent. The following fields are supported: name parent state category
2102
+ # resource_name event_time source_properties security_marks.marks
2103
+ # @param [Fixnum] page_size
2104
+ # The maximum number of results to return in a single response. Default is 10,
2105
+ # minimum is 1, maximum is 1000.
2106
+ # @param [String] page_token
2107
+ # The value returned by the last `ListFindingsResponse`; indicates that this is
2108
+ # a continuation of a prior `ListFindings` call, and that the system should
2109
+ # return the next page of data.
2110
+ # @param [String] read_time
2111
+ # Time used as a reference point when filtering findings. The filter is limited
2112
+ # to findings existing at the supplied time and their values are those at that
2113
+ # specific time. Absence of this field will default to the API's version of NOW.
2114
+ # @param [String] fields
2115
+ # Selector specifying which fields to include in a partial response.
2116
+ # @param [String] quota_user
2117
+ # Available to use for quota purposes for server-side applications. Can be any
2118
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2119
+ # @param [Google::Apis::RequestOptions] options
2120
+ # Request-specific options
2121
+ #
2122
+ # @yield [result, err] Result & error if block supplied
2123
+ # @yieldparam result [Google::Apis::SecuritycenterV1::ListFindingsResponse] parsed result object
2124
+ # @yieldparam err [StandardError] error object if request failed
2125
+ #
2126
+ # @return [Google::Apis::SecuritycenterV1::ListFindingsResponse]
2127
+ #
2128
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2129
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2130
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2131
+ def list_project_source_findings(parent, compare_duration: nil, field_mask: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil, read_time: nil, fields: nil, quota_user: nil, options: nil, &block)
2132
+ command = make_simple_command(:get, 'v1/{+parent}/findings', options)
2133
+ command.response_representation = Google::Apis::SecuritycenterV1::ListFindingsResponse::Representation
2134
+ command.response_class = Google::Apis::SecuritycenterV1::ListFindingsResponse
2135
+ command.params['parent'] = parent unless parent.nil?
2136
+ command.query['compareDuration'] = compare_duration unless compare_duration.nil?
2137
+ command.query['fieldMask'] = field_mask unless field_mask.nil?
2138
+ command.query['filter'] = filter unless filter.nil?
2139
+ command.query['orderBy'] = order_by unless order_by.nil?
2140
+ command.query['pageSize'] = page_size unless page_size.nil?
2141
+ command.query['pageToken'] = page_token unless page_token.nil?
2142
+ command.query['readTime'] = read_time unless read_time.nil?
2143
+ command.query['fields'] = fields unless fields.nil?
2144
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2145
+ execute_or_queue_command(command, &block)
2146
+ end
2147
+
2148
+ # Creates or updates a finding. The corresponding source must exist for a
2149
+ # finding creation to succeed.
2150
+ # @param [String] name
2151
+ # The relative resource name of this finding. See: https://cloud.google.com/apis/
2152
+ # design/resource_names#relative_resource_name Example: "organizations/`
2153
+ # organization_id`/sources/`source_id`/findings/`finding_id`"
2154
+ # @param [Google::Apis::SecuritycenterV1::Finding] finding_object
2155
+ # @param [String] update_mask
2156
+ # The FieldMask to use when updating the finding resource. This field should not
2157
+ # be specified when creating a finding. When updating a finding, an empty mask
2158
+ # is treated as updating all mutable fields and replacing source_properties.
2159
+ # Individual source_properties can be added/updated by using "source_properties."
2160
+ # in the field mask.
2161
+ # @param [String] fields
2162
+ # Selector specifying which fields to include in a partial response.
2163
+ # @param [String] quota_user
2164
+ # Available to use for quota purposes for server-side applications. Can be any
2165
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2166
+ # @param [Google::Apis::RequestOptions] options
2167
+ # Request-specific options
2168
+ #
2169
+ # @yield [result, err] Result & error if block supplied
2170
+ # @yieldparam result [Google::Apis::SecuritycenterV1::Finding] parsed result object
2171
+ # @yieldparam err [StandardError] error object if request failed
2172
+ #
2173
+ # @return [Google::Apis::SecuritycenterV1::Finding]
2174
+ #
2175
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2176
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2177
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2178
+ def patch_project_source_finding(name, finding_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
2179
+ command = make_simple_command(:patch, 'v1/{+name}', options)
2180
+ command.request_representation = Google::Apis::SecuritycenterV1::Finding::Representation
2181
+ command.request_object = finding_object
2182
+ command.response_representation = Google::Apis::SecuritycenterV1::Finding::Representation
2183
+ command.response_class = Google::Apis::SecuritycenterV1::Finding
2184
+ command.params['name'] = name unless name.nil?
2185
+ command.query['updateMask'] = update_mask unless update_mask.nil?
2186
+ command.query['fields'] = fields unless fields.nil?
2187
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2188
+ execute_or_queue_command(command, &block)
2189
+ end
2190
+
2191
+ # Updates the state of a finding.
2192
+ # @param [String] name
2193
+ # Required. The relative resource name of the finding. See: https://cloud.google.
2194
+ # com/apis/design/resource_names#relative_resource_name Example: "organizations/`
2195
+ # organization_id`/sources/`source_id`/finding/`finding_id`".
2196
+ # @param [Google::Apis::SecuritycenterV1::SetFindingStateRequest] set_finding_state_request_object
2197
+ # @param [String] fields
2198
+ # Selector specifying which fields to include in a partial response.
2199
+ # @param [String] quota_user
2200
+ # Available to use for quota purposes for server-side applications. Can be any
2201
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2202
+ # @param [Google::Apis::RequestOptions] options
2203
+ # Request-specific options
2204
+ #
2205
+ # @yield [result, err] Result & error if block supplied
2206
+ # @yieldparam result [Google::Apis::SecuritycenterV1::Finding] parsed result object
2207
+ # @yieldparam err [StandardError] error object if request failed
2208
+ #
2209
+ # @return [Google::Apis::SecuritycenterV1::Finding]
2210
+ #
2211
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2212
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2213
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2214
+ def set_project_source_finding_state(name, set_finding_state_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2215
+ command = make_simple_command(:post, 'v1/{+name}:setState', options)
2216
+ command.request_representation = Google::Apis::SecuritycenterV1::SetFindingStateRequest::Representation
2217
+ command.request_object = set_finding_state_request_object
2218
+ command.response_representation = Google::Apis::SecuritycenterV1::Finding::Representation
2219
+ command.response_class = Google::Apis::SecuritycenterV1::Finding
2220
+ command.params['name'] = name unless name.nil?
2221
+ command.query['fields'] = fields unless fields.nil?
2222
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2223
+ execute_or_queue_command(command, &block)
2224
+ end
2225
+
2226
+ # Updates security marks.
2227
+ # @param [String] name
2228
+ # The relative resource name of the SecurityMarks. See: https://cloud.google.com/
2229
+ # apis/design/resource_names#relative_resource_name Examples: "organizations/`
2230
+ # organization_id`/assets/`asset_id`/securityMarks" "organizations/`
2231
+ # organization_id`/sources/`source_id`/findings/`finding_id`/securityMarks".
2232
+ # @param [Google::Apis::SecuritycenterV1::SecurityMarks] security_marks_object
2233
+ # @param [String] start_time
2234
+ # The time at which the updated SecurityMarks take effect. If not set uses
2235
+ # current server time. Updates will be applied to the SecurityMarks that are
2236
+ # active immediately preceding this time.
2237
+ # @param [String] update_mask
2238
+ # The FieldMask to use when updating the security marks resource. The field mask
2239
+ # must not contain duplicate fields. If empty or set to "marks", all marks will
2240
+ # be replaced. Individual marks can be updated using "marks.".
2241
+ # @param [String] fields
2242
+ # Selector specifying which fields to include in a partial response.
2243
+ # @param [String] quota_user
2244
+ # Available to use for quota purposes for server-side applications. Can be any
2245
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2246
+ # @param [Google::Apis::RequestOptions] options
2247
+ # Request-specific options
2248
+ #
2249
+ # @yield [result, err] Result & error if block supplied
2250
+ # @yieldparam result [Google::Apis::SecuritycenterV1::SecurityMarks] parsed result object
2251
+ # @yieldparam err [StandardError] error object if request failed
2252
+ #
2253
+ # @return [Google::Apis::SecuritycenterV1::SecurityMarks]
2254
+ #
2255
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2256
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2257
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2258
+ def update_project_source_finding_security_marks(name, security_marks_object = nil, start_time: nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
2259
+ command = make_simple_command(:patch, 'v1/{+name}', options)
2260
+ command.request_representation = Google::Apis::SecuritycenterV1::SecurityMarks::Representation
2261
+ command.request_object = security_marks_object
2262
+ command.response_representation = Google::Apis::SecuritycenterV1::SecurityMarks::Representation
2263
+ command.response_class = Google::Apis::SecuritycenterV1::SecurityMarks
2264
+ command.params['name'] = name unless name.nil?
2265
+ command.query['startTime'] = start_time unless start_time.nil?
2266
+ command.query['updateMask'] = update_mask unless update_mask.nil?
2267
+ command.query['fields'] = fields unless fields.nil?
2268
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2269
+ execute_or_queue_command(command, &block)
2270
+ end
2271
+
2272
+ protected
2273
+
2274
+ def apply_command_defaults(command)
2275
+ command.query['key'] = key unless key.nil?
2276
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2277
+ end
2278
+ end
2279
+ end
2280
+ end
2281
+ end