Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SES exception for boto MatchingEventTypes #3843

Merged
merged 3 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions scripts/boto/_automated_patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from _types import AllPatches, Patch, ResourcePatches

from cfnlint.schema.resolver import RefResolver
from cfnlint.schema.resolver import RefResolutionError, RefResolver

skip = [
"account",
Expand Down Expand Up @@ -144,7 +144,7 @@ def _nested_objects(
start_path: str,
source: list[str],
):
results = {}
results: dict[str, Patch] = {}
for member, member_data in shape_data.get("members", {}).items():
for p_name, p_data in schema_data.get("properties", {}).items():
if p_name in skip_property_names:
Expand All @@ -162,7 +162,10 @@ def _nested_objects(
if "$ref" not in p_data:
break
path = p_data["$ref"][1:]
p_data = resolver.resolve_from_url(p_data["$ref"])
try:
p_data = resolver.resolve_from_url(p_data["$ref"])
except RefResolutionError:
return results

# skip if we already have an enum or pattern
if any([p_data.get(field) for field in _fields]):
Expand Down
7 changes: 7 additions & 0 deletions scripts/boto/update_schemas_from_boto.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
"batch",
]

exceptions = {
"ses": ["/definitions/EventDestination/properties/MatchingEventTypes/items"]
}


def configure_logging():
"""Setup Logging"""
Expand Down Expand Up @@ -88,6 +92,9 @@ def build_resource_type_patches(
)
continue
if value:
if patch.source[0] in exceptions:
if path in exceptions[patch.source[0]]:
continue
if patch.source[0] in case_insensitive_services and field == "enum":
field = "enumCaseInsensitive"
value = [v.lower() for v in value]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
[
{
"op": "add",
"path": "/definitions/EventDestination/properties/MatchingEventTypes/items/enum",
"value": [
"bounce",
"click",
"complaint",
"delivery",
"open",
"reject",
"renderingFailure",
"send"
]
},
{
"op": "add",
"path": "/definitions/DimensionConfiguration/properties/DimensionValueSource/enum",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,6 @@
"MatchingEventTypes": {
"insertionOrder": false,
"items": {
"enum": [
"bounce",
"click",
"complaint",
"delivery",
"open",
"reject",
"renderingFailure",
"send"
],
"type": "string"
},
"type": "array",
Expand Down
Loading