Skip to content

Commit

Permalink
chore(python): add .github/CODEOWNERS as a templated file (#252)
Browse files Browse the repository at this point in the history
* 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 <partheniou@google.com>
  • Loading branch information
3 people committed Nov 12, 2021
1 parent 3801f2f commit 5881049
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 25 deletions.
26 changes: 6 additions & 20 deletions securitycenter/snippets/snippets_findings.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,10 @@ def create_finding(source_name):
)

request = CreateFindingRequest(
parent=source_name,
finding_id=finding_id,
finding=finding,
parent=source_name, finding_id=finding_id, finding=finding,
)
# Call The API.
created_finding = client.create_finding(
request=request
)
created_finding = client.create_finding(request=request)
print(created_finding)
# [END securitycenter_create_finding]
return created_finding
Expand Down Expand Up @@ -241,11 +237,7 @@ def create_finding_with_source_properties(source_name):
)

created_finding = client.create_finding(
request={
"parent": source_name,
"finding_id": finding_id,
"finding": finding
}
request={"parent": source_name, "finding_id": finding_id, "finding": finding}
)
print(created_finding)
# [END securitycenter_create_finding_with_source_properties]
Expand Down Expand Up @@ -283,10 +275,7 @@ def update_finding(source_name):
event_time=event_time,
)
updated_finding = client.update_finding(
request={
"finding": finding,
"update_mask": field_mask,
}
request={"finding": finding, "update_mask": field_mask}
)

print(
Expand All @@ -304,6 +293,7 @@ def update_finding_state(source_name):

from google.cloud import securitycenter
from google.cloud.securitycenter_v1 import Finding

# Create a client.
client = securitycenter.SecurityCenterClient()
# source_name is the resource path for a source that has been
Expand Down Expand Up @@ -554,11 +544,7 @@ def group_findings_at_time(source_name):
read_time = datetime.utcnow() - timedelta(days=1)

group_result_iterator = client.group_findings(
request={
"parent": source_name,
"group_by": "category",
"read_time": read_time,
}
request={"parent": source_name, "group_by": "category", "read_time": read_time}
)
for i, group_result in enumerate(group_result_iterator):
print((i + 1), group_result)
Expand Down
6 changes: 1 addition & 5 deletions securitycenter/snippets/snippets_list_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,7 @@ def list_assets_with_filters_and_read_time(organization_id):

# Call the API and print results.
asset_iterator = client.list_assets(
request={
"parent": org_name,
"filter": project_filter,
"read_time": read_time,
}
request={"parent": org_name, "filter": project_filter, "read_time": read_time}
)
for i, asset_result in enumerate(asset_iterator):
print(i, asset_result)
Expand Down

0 comments on commit 5881049

Please sign in to comment.