Skip to content

Commit

Permalink
Add SES exception for boto MatchingEventTypes (#3843)
Browse files Browse the repository at this point in the history
* Turn MatchingEventTypes into an exception
  • Loading branch information
kddejong authored Nov 28, 2024
1 parent 6846123 commit a1c8868
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 27 deletions.
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

0 comments on commit a1c8868

Please sign in to comment.