Skip to content

Commit 6c426dd

Browse files
committed
Differentiate between *RecordModel vs *Model
The latter represents an event payload, i.e. a list of records.
1 parent 665a99d commit 6c426dd

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

aws_lambda_powertools/utilities/parser/models/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@
5050
S3Model,
5151
S3RecordModel,
5252
)
53-
from .s3_event_notification import SqsS3EventNotificationModel
53+
from .s3_event_notification import (
54+
SqsS3EventNotificationModel,
55+
SqsS3EventNotificationRecordModel,
56+
)
5457
from .s3_object_event import (
5558
S3ObjectConfiguration,
5659
S3ObjectContext,
@@ -132,6 +135,7 @@
132135
"SqsMsgAttributeModel",
133136
"SqsAttributesModel",
134137
"SqsS3EventNotificationModel",
138+
"SqsS3EventNotificationRecordModel",
135139
"APIGatewayProxyEventModel",
136140
"APIGatewayEventRequestContext",
137141
"APIGatewayEventAuthorizer",
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
from typing import List
2+
13
from pydantic import Json
24

35
from aws_lambda_powertools.utilities.parser.models.s3 import S3Model
4-
from aws_lambda_powertools.utilities.parser.models.sqs import SqsRecordModel
6+
from aws_lambda_powertools.utilities.parser.models.sqs import SqsRecordModel, SqsModel
57

6-
class SqsS3EventNotificationModel(SqsRecordModel):
8+
class SqsS3EventNotificationRecordModel(SqsRecordModel):
79
body: Json[S3Model]
10+
11+
class SqsS3EventNotificationModel(SqsModel):
12+
Records: List[SqsS3EventNotificationRecordModel]

0 commit comments

Comments
 (0)