@@ -183,14 +183,10 @@ def create_finding(source_name):
183183 )
184184
185185 request = CreateFindingRequest (
186- parent = source_name ,
187- finding_id = finding_id ,
188- finding = finding ,
186+ parent = source_name , finding_id = finding_id , finding = finding ,
189187 )
190188 # Call The API.
191- created_finding = client .create_finding (
192- request = request
193- )
189+ created_finding = client .create_finding (request = request )
194190 print (created_finding )
195191 # [END securitycenter_create_finding]
196192 return created_finding
@@ -241,11 +237,7 @@ def create_finding_with_source_properties(source_name):
241237 )
242238
243239 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 }
249241 )
250242 print (created_finding )
251243 # [END securitycenter_create_finding_with_source_properties]
@@ -283,10 +275,7 @@ def update_finding(source_name):
283275 event_time = event_time ,
284276 )
285277 updated_finding = client .update_finding (
286- request = {
287- "finding" : finding ,
288- "update_mask" : field_mask ,
289- }
278+ request = {"finding" : finding , "update_mask" : field_mask }
290279 )
291280
292281 print (
@@ -304,6 +293,7 @@ def update_finding_state(source_name):
304293
305294 from google .cloud import securitycenter
306295 from google .cloud .securitycenter_v1 import Finding
296+
307297 # Create a client.
308298 client = securitycenter .SecurityCenterClient ()
309299 # source_name is the resource path for a source that has been
@@ -554,11 +544,7 @@ def group_findings_at_time(source_name):
554544 read_time = datetime .utcnow () - timedelta (days = 1 )
555545
556546 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 }
562548 )
563549 for i , group_result in enumerate (group_result_iterator ):
564550 print ((i + 1 ), group_result )
0 commit comments