@@ -183,14 +183,10 @@ def create_finding(source_name):
183
183
)
184
184
185
185
request = CreateFindingRequest (
186
- parent = source_name ,
187
- finding_id = finding_id ,
188
- finding = finding ,
186
+ parent = source_name , finding_id = finding_id , finding = finding ,
189
187
)
190
188
# Call The API.
191
- created_finding = client .create_finding (
192
- request = request
193
- )
189
+ created_finding = client .create_finding (request = request )
194
190
print (created_finding )
195
191
# [END securitycenter_create_finding]
196
192
return created_finding
@@ -241,11 +237,7 @@ def create_finding_with_source_properties(source_name):
241
237
)
242
238
243
239
created_finding = client .create_finding (
244
- request = {
245
- "parent" : source_name ,
246
- "finding_id" : finding_id ,
247
- "finding" : finding
248
- }
240
+ request = {"parent" : source_name , "finding_id" : finding_id , "finding" : finding }
249
241
)
250
242
print (created_finding )
251
243
# [END securitycenter_create_finding_with_source_properties]
@@ -283,10 +275,7 @@ def update_finding(source_name):
283
275
event_time = event_time ,
284
276
)
285
277
updated_finding = client .update_finding (
286
- request = {
287
- "finding" : finding ,
288
- "update_mask" : field_mask ,
289
- }
278
+ request = {"finding" : finding , "update_mask" : field_mask }
290
279
)
291
280
292
281
print (
@@ -304,6 +293,7 @@ def update_finding_state(source_name):
304
293
305
294
from google .cloud import securitycenter
306
295
from google .cloud .securitycenter_v1 import Finding
296
+
307
297
# Create a client.
308
298
client = securitycenter .SecurityCenterClient ()
309
299
# source_name is the resource path for a source that has been
@@ -554,11 +544,7 @@ def group_findings_at_time(source_name):
554
544
read_time = datetime .utcnow () - timedelta (days = 1 )
555
545
556
546
group_result_iterator = client .group_findings (
557
- request = {
558
- "parent" : source_name ,
559
- "group_by" : "category" ,
560
- "read_time" : read_time ,
561
- }
547
+ request = {"parent" : source_name , "group_by" : "category" , "read_time" : read_time }
562
548
)
563
549
for i , group_result in enumerate (group_result_iterator ):
564
550
print ((i + 1 ), group_result )
0 commit comments