Skip to content

Commit d121a59

Browse files
gcf-owl-bot[bot]parthea
authored andcommitted
chore(python): add .github/CODEOWNERS as a templated file (#252)
* chore(python): add .github/CODEOWNERS as a templated file Source-Link: googleapis/synthtool@c5026b3 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:0e18b9475fbeb12d9ad4302283171edebb6baf2dfca1bd215ee3b34ed79d95d7 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * lint Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <[email protected]>
1 parent 3dd17f3 commit d121a59

File tree

2 files changed

+7
-25
lines changed

2 files changed

+7
-25
lines changed

securitycenter/snippets/snippets_findings.py

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -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)

securitycenter/snippets/snippets_list_assets.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,7 @@ def list_assets_with_filters_and_read_time(organization_id):
8686

8787
# Call the API and print results.
8888
asset_iterator = client.list_assets(
89-
request={
90-
"parent": org_name,
91-
"filter": project_filter,
92-
"read_time": read_time,
93-
}
89+
request={"parent": org_name, "filter": project_filter, "read_time": read_time}
9490
)
9591
for i, asset_result in enumerate(asset_iterator):
9692
print(i, asset_result)

0 commit comments

Comments
 (0)