Skip to content
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
26 changes: 13 additions & 13 deletions resend/automations/_automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ class AutomationRunStep(TypedDict):
"""
started_at: Union[str, None]
"""
When the step started executing (ISO 8601 format), or None if not started.
When the step started executing, or None if not started.
"""
completed_at: Union[str, None]
"""
When the step completed executing (ISO 8601 format), or None if not completed.
When the step completed executing, or None if not completed.
"""
output: Any
"""
Expand All @@ -134,7 +134,7 @@ class AutomationRunStep(TypedDict):
"""
created_at: str
"""
When the run step was created (ISO 8601 format).
When the run step was created.
"""


Expand Down Expand Up @@ -164,11 +164,11 @@ class AutomationListItem(TypedDict):
"""
created_at: str
"""
When the automation was created (ISO 8601 format).
When the automation was created.
"""
updated_at: str
"""
When the automation was last updated (ISO 8601 format).
When the automation was last updated.
"""


Expand Down Expand Up @@ -205,11 +205,11 @@ class Automation(TypedDict):
"""
created_at: str
"""
When the automation was created (ISO 8601 format).
When the automation was created.
"""
updated_at: str
"""
When the automation was last updated (ISO 8601 format).
When the automation was last updated.
"""
steps: List[AutomationResponseStep]
"""
Expand Down Expand Up @@ -243,15 +243,15 @@ class AutomationRunListItem(TypedDict):
"""
started_at: Union[str, None]
"""
When the run started (ISO 8601 format), or None.
When the run started, or None.
"""
completed_at: Union[str, None]
"""
When the run completed (ISO 8601 format), or None.
When the run completed, or None.
"""
created_at: str
"""
When the run was created (ISO 8601 format).
When the run was created.
"""


Expand Down Expand Up @@ -283,15 +283,15 @@ class AutomationRun(TypedDict):
"""
started_at: Union[str, None]
"""
When the run started (ISO 8601 format), or None.
When the run started, or None.
"""
completed_at: Union[str, None]
"""
When the run completed (ISO 8601 format), or None.
When the run completed, or None.
"""
created_at: str
"""
When the run was created (ISO 8601 format).
When the run was created.
"""
steps: List[AutomationRunStep]
"""
Expand Down
4 changes: 2 additions & 2 deletions resend/contact_properties/_contact_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ContactProperty(TypedDict):
id (str): The unique identifier for the contact property
key (str): The key name of the property
object (str): The object type, always "contact_property"
created_at (str): The ISO 8601 timestamp when the property was created
created_at (str): The timestamp when the property was created
type (str): The data type of the property (e.g., "string", "number")
fallback_value (Union[str, int, float, None]): The default value used when a contact doesn't have this property set
"""
Expand All @@ -30,7 +30,7 @@ class ContactProperty(TypedDict):
"""
created_at: str
"""
The ISO 8601 timestamp when the property was created.
The timestamp when the property was created.
"""
type: str
"""
Expand Down
2 changes: 1 addition & 1 deletion resend/contacts/imports/_contact_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ContactImport(BaseResponse):
object (str): Always 'contact_import'.
id (str): Unique identifier for the contact import.
status (str): 'queued', 'in_progress', 'completed', or 'failed'.
created_at (str): ISO 8601 timestamp of when the import was created.
created_at (str): Timestamp of when the import was created.
counts (ContactImportCounts): Row-level import statistics (present when status is completed or failed).
"""

Expand Down
8 changes: 4 additions & 4 deletions resend/events/_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ class EventListItem(TypedDict):
"""
created_at: str
"""
When the event was created (ISO 8601 format).
When the event was created.
"""
updated_at: Union[str, None]
"""
When the event was last updated (ISO 8601 format), or None.
When the event was last updated, or None.
"""


Expand Down Expand Up @@ -80,9 +80,9 @@ class Event(TypedDict):
"""
created_at: str
"""
When the event was created (ISO 8601 format).
When the event was created.
"""
updated_at: Union[str, None]
"""
When the event was last updated (ISO 8601 format), or None.
When the event was last updated, or None.
"""
2 changes: 1 addition & 1 deletion resend/webhooks/_webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class Webhook(TypedDict):
"""
created_at: str
"""
When the webhook was created (ISO 8601 format)
When the webhook was created
"""
status: WebhookStatus
"""
Expand Down
4 changes: 2 additions & 2 deletions tests/api_keys_async_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async def test_api_keys_list_async(self) -> None:
{
"id": "91f3200a-df72-4654-b0cd-f202395f5354",
"name": "Production",
"created_at": "2023-04-08T00:11:13.110779+00:00",
"created_at": "2023-04-08 00:11:13.110779+00",
}
]
}
Expand All @@ -51,7 +51,7 @@ async def test_api_keys_list_async(self) -> None:
for key in keys["data"]:
assert key["id"] == "91f3200a-df72-4654-b0cd-f202395f5354"
assert key["name"] == "Production"
assert key["created_at"] == "2023-04-08T00:11:13.110779+00:00"
assert key["created_at"] == "2023-04-08 00:11:13.110779+00"

async def test_should_list_api_key_async_raise_exception_when_no_content(
self,
Expand Down
16 changes: 8 additions & 8 deletions tests/api_keys_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ def test_api_keys_list(self) -> None:
{
"id": "91f3200a-df72-4654-b0cd-f202395f5354",
"name": "Production",
"created_at": "2023-04-08T00:11:13.110779+00:00",
"last_used_at": "2023-04-08T12:00:00.000000+00:00",
"created_at": "2023-04-08 00:11:13.110779+00",
"last_used_at": "2023-04-08 12:00:00+00",
}
],
}
Expand All @@ -50,8 +50,8 @@ def test_api_keys_list(self) -> None:
for key in keys["data"]:
assert key["id"] == "91f3200a-df72-4654-b0cd-f202395f5354"
assert key["name"] == "Production"
assert key["created_at"] == "2023-04-08T00:11:13.110779+00:00"
assert key["last_used_at"] == "2023-04-08T12:00:00.000000+00:00"
assert key["created_at"] == "2023-04-08 00:11:13.110779+00"
assert key["last_used_at"] == "2023-04-08 12:00:00+00"

def test_api_keys_list_last_used_at_none(self) -> None:
self.set_mock_json(
Expand All @@ -62,7 +62,7 @@ def test_api_keys_list_last_used_at_none(self) -> None:
{
"id": "91f3200a-df72-4654-b0cd-f202395f5354",
"name": "Production",
"created_at": "2023-04-08T00:11:13.110779+00:00",
"created_at": "2023-04-08 00:11:13.110779+00",
"last_used_at": None,
}
],
Expand All @@ -86,12 +86,12 @@ def test_api_keys_list_with_pagination_params(self) -> None:
{
"id": "test-key-1",
"name": "Test Key 1",
"created_at": "2023-04-08T00:11:13.110779+00:00",
"created_at": "2023-04-08 00:11:13.110779+00",
},
{
"id": "test-key-2",
"name": "Test Key 2",
"created_at": "2023-04-09T00:11:13.110779+00:00",
"created_at": "2023-04-09 00:11:13.110779+00",
},
],
}
Expand All @@ -114,7 +114,7 @@ def test_api_keys_list_with_before_param(self) -> None:
{
"id": "test-key-3",
"name": "Test Key 3",
"created_at": "2023-04-07T00:11:13.110779+00:00",
"created_at": "2023-04-07 00:11:13.110779+00",
}
],
}
Expand Down
2 changes: 1 addition & 1 deletion tests/async_response_headers_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ async def test_received_email_async_headers_not_overwritten_by_http_headers(
mock_client.request.return_value = (
b'{"id": "email_456", "object": "received_email", '
b'"from": "sender@example.com", "to": ["recipient@example.com"], '
b'"subject": "Hello", "created_at": "2024-01-01T00:00:00Z", '
b'"subject": "Hello", "created_at": "2024-01-01 00:00:00+00", '
b'"message_id": "msg_123", "attachments": [], '
b'"headers": {"List-Unsubscribe": "<mailto:unsub@example.com>", '
b'"X-Custom": "value"}}',
Expand Down
4 changes: 2 additions & 2 deletions tests/attachments_async_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async def test_sent_email_attachments_get_async(self) -> None:
"content_disposition": "inline",
"content_id": "img001",
"download_url": "https://cdn.resend.com/emails/test/attachments/test-id",
"expires_at": "2025-10-17T14:29:41.521Z",
"expires_at": "2025-10-17 14:29:41.521+00",
}
)

Expand Down Expand Up @@ -57,7 +57,7 @@ async def test_sent_email_attachments_list_async(self) -> None:
"content_disposition": "inline",
"size": 1024,
"download_url": "https://cdn.resend.com/emails/test/attachments/test-id",
"expires_at": "2025-10-17T14:29:41.521Z",
"expires_at": "2025-10-17 14:29:41.521+00",
}
],
}
Expand Down
14 changes: 7 additions & 7 deletions tests/attachments_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_receiving_get_attachment(self) -> None:
"content_disposition": "inline",
"content_id": "img001",
"download_url": "https://inbound-cdn.resend.com/4ef9a417-02e9-4d39-ad75-9611e0fcc33c/attachments/2a0c9ce0-3112-4728-976e-47ddcd16a318?some-params=example&signature=sig-123",
"expires_at": "2025-10-17T14:29:41.521Z",
"expires_at": "2025-10-17 14:29:41.521+00",
}
)

Expand All @@ -35,7 +35,7 @@ def test_receiving_get_attachment(self) -> None:
assert attachment["content_disposition"] == "inline"
assert attachment["content_id"] == "img001"
assert "https://inbound-cdn.resend.com" in attachment["download_url"]
assert attachment["expires_at"] == "2025-10-17T14:29:41.521Z"
assert attachment["expires_at"] == "2025-10-17 14:29:41.521+00"

def test_receiving_get_attachment_without_content_id(self) -> None:
self.set_mock_json(
Expand All @@ -46,7 +46,7 @@ def test_receiving_get_attachment_without_content_id(self) -> None:
"content_type": "application/pdf",
"content_disposition": "attachment",
"download_url": "https://inbound-cdn.resend.com/test-email/attachments/test-attachment",
"expires_at": "2025-10-18T10:00:00.000Z",
"expires_at": "2025-10-18 10:00:00+00",
}
)

Expand Down Expand Up @@ -87,7 +87,7 @@ def test_receiving_list_attachments(self) -> None:
"content_id": "img001",
"size": 1024,
"download_url": "https://inbound-cdn.resend.com/test/attachments/2a0c9ce0?signature=sig-123",
"expires_at": "2025-10-17T14:29:41.521Z",
"expires_at": "2025-10-17 14:29:41.521+00",
},
{
"id": "3b1d0df1-4223-5839-a87f-58eecd27b429",
Expand All @@ -96,7 +96,7 @@ def test_receiving_list_attachments(self) -> None:
"content_disposition": "attachment",
"size": 2048,
"download_url": "https://inbound-cdn.resend.com/test/attachments/3b1d0df1?signature=sig-456",
"expires_at": "2025-10-17T14:29:41.521Z",
"expires_at": "2025-10-17 14:29:41.521+00",
},
],
}
Expand All @@ -115,7 +115,7 @@ def test_receiving_list_attachments(self) -> None:
assert attachments["data"][0]["filename"] == "avatar.png"
assert attachments["data"][0]["size"] == 1024
assert "https://inbound-cdn.resend.com" in attachments["data"][0]["download_url"]
assert attachments["data"][0]["expires_at"] == "2025-10-17T14:29:41.521Z"
assert attachments["data"][0]["expires_at"] == "2025-10-17 14:29:41.521+00"
assert attachments["data"][1]["id"] == "3b1d0df1-4223-5839-a87f-58eecd27b429"
assert attachments["data"][1]["filename"] == "document.pdf"

Expand All @@ -132,7 +132,7 @@ def test_receiving_list_attachments_with_pagination(self) -> None:
"content_disposition": "inline",
"size": 1024,
"download_url": "https://inbound-cdn.resend.com/test/attachments/2a0c9ce0?signature=sig-123",
"expires_at": "2025-10-17T14:29:41.521Z",
"expires_at": "2025-10-17 14:29:41.521+00",
},
],
}
Expand Down
12 changes: 6 additions & 6 deletions tests/audiences_async_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async def test_segments_get_async(self) -> None:
"object": "audience",
"id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
"name": "Registered Users",
"created_at": "2023-10-06T22:59:55.977Z",
"created_at": "2023-10-06 22:59:55.977+00",
}
)

Expand All @@ -51,7 +51,7 @@ async def test_segments_get_async(self) -> None:
)
assert segment["id"] == "78261eea-8f8b-4381-83c6-79fa7120f1cf"
assert segment["name"] == "Registered Users"
assert segment["created_at"] == "2023-10-06T22:59:55.977Z"
assert segment["created_at"] == "2023-10-06 22:59:55.977+00"

async def test_should_get_segments_async_raise_exception_when_no_content(
self,
Expand Down Expand Up @@ -94,7 +94,7 @@ async def test_segments_list_async(self) -> None:
{
"id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
"name": "Registered Users",
"created_at": "2023-10-06T22:59:55.977Z",
"created_at": "2023-10-06 22:59:55.977+00",
}
],
}
Expand Down Expand Up @@ -147,7 +147,7 @@ async def test_audiences_get_async(self) -> None:
"object": "audience",
"id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
"name": "Registered Users",
"created_at": "2023-10-06T22:59:55.977Z",
"created_at": "2023-10-06 22:59:55.977+00",
}
)

Expand All @@ -157,7 +157,7 @@ async def test_audiences_get_async(self) -> None:
)
assert audience["id"] == "78261eea-8f8b-4381-83c6-79fa7120f1cf"
assert audience["name"] == "Registered Users"
assert audience["created_at"] == "2023-10-06T22:59:55.977Z"
assert audience["created_at"] == "2023-10-06 22:59:55.977+00"

async def test_audiences_get_async_raises_when_no_content(
self,
Expand Down Expand Up @@ -207,7 +207,7 @@ async def test_audiences_list_async(self) -> None:
{
"id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
"name": "Registered Users",
"created_at": "2023-10-06T22:59:55.977Z",
"created_at": "2023-10-06 22:59:55.977+00",
}
],
}
Expand Down
Loading
Loading