Skip to content

Commit aeacae8

Browse files
cursoragentcpenned
andcommitted
fix: satisfy flake8 N815 for API camelCase webhook fields
Co-authored-by: cpenned <cpenned@users.noreply.github.com>
1 parent a6f1cc1 commit aeacae8

1 file changed

Lines changed: 19 additions & 50 deletions

File tree

resend/webhooks/_webhook_event.py

Lines changed: 19 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -62,57 +62,26 @@ class BaseEmailEventData(_BaseEmailEventDataFromParam):
6262
"""
6363

6464

65-
class EmailBounce(TypedDict):
66-
"""
67-
Bounce details from the receiving server.
68-
69-
Attributes:
70-
message (str): Detailed bounce message from the receiving server.
71-
subType (str): Bounce sub-type (e.g., Suppressed, MessageRejected).
72-
type (str): Bounce type (e.g., Permanent, Temporary).
73-
"""
74-
75-
message: str
76-
"""
77-
Detailed bounce message from the receiving server.
78-
"""
79-
subType: str
80-
"""
81-
Bounce sub-type (e.g., Suppressed, MessageRejected).
82-
"""
83-
type: str
84-
"""
85-
Bounce type (e.g., Permanent, Temporary).
86-
"""
87-
88-
89-
class EmailClick(TypedDict):
90-
"""
91-
Click tracking details.
92-
93-
Attributes:
94-
ipAddress (str): IP address of the user who clicked the link.
95-
link (str): The URL that was clicked.
96-
timestamp (str): ISO 8601 timestamp when the click occurred.
97-
userAgent (str): User agent string of the browser that clicked the link.
98-
"""
65+
# API fields use camelCase (subType) to match webhook JSON payloads.
66+
EmailBounce = TypedDict(
67+
"EmailBounce",
68+
{
69+
"message": str,
70+
"subType": str,
71+
"type": str,
72+
},
73+
)
9974

100-
ipAddress: str
101-
"""
102-
IP address of the user who clicked the link.
103-
"""
104-
link: str
105-
"""
106-
The URL that was clicked.
107-
"""
108-
timestamp: str
109-
"""
110-
ISO 8601 timestamp when the click occurred.
111-
"""
112-
userAgent: str
113-
"""
114-
User agent string of the browser that clicked the link.
115-
"""
75+
# API fields use camelCase (ipAddress, userAgent) to match webhook JSON payloads.
76+
EmailClick = TypedDict(
77+
"EmailClick",
78+
{
79+
"ipAddress": str,
80+
"link": str,
81+
"timestamp": str,
82+
"userAgent": str,
83+
},
84+
)
11685

11786

11887
class EmailFailed(TypedDict):

0 commit comments

Comments
 (0)