Skip to content

Commit 497f62d

Browse files
committed
Fixes
1 parent 7f053c9 commit 497f62d

6 files changed

Lines changed: 24 additions & 35 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
77

88
---
99

10-
## [0.0.1] - 2026-01-06
10+
## [0.1.0] - 2026-03-05
1111

1212
### Added
13-
14-
15-
### Changed
16-
17-
18-
### Deprecated
19-
20-
21-
### Fixed
22-
23-
24-
---
25-
26-
## [0.0.1] - 2023-01-10
27-
28-
### Added
29-
- Initial stable release of the SDK.
30-
- Core client with authentication, retries, and logging.
31-
- Pytest tests
13+
- Initial release of the SDK.
14+
- `ServerClient` and `AccountClient` with authentication, configurable retries, timeout, and optional `base_url` override for local mock servers.
15+
- Managers for outbound/inbound messages, bounces, templates, streams, suppressions, webhooks, stats, domains, sender signatures, and data removals.
16+
- Async pagination via `paginate()` utility; `stream()` methods on `OutboundManager` and `BounceManager`.
17+
- Typed request/response models backed by Pydantic v2.
18+
- Pytest test suite.

postmark/clients/__init__.py

Whitespace-only changes.

postmark/models/outbound/enums.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,10 @@ class Platform(str, Enum):
3131
DESKTOP = "Desktop"
3232
MOBILE = "Mobile"
3333
UNKNOWN = "Unknown"
34+
35+
36+
class BulkJobStatus(str, Enum):
37+
ACCEPTED = "Accepted"
38+
PROCESSING = "Processing"
39+
COMPLETED = "Completed"
40+
FAILED = "Failed"

postmark/models/outbound/manager.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -366,12 +366,7 @@ async def list_opens(
366366
async def list_message_opens(
367367
self, message_id: str, count: int = 100, offset: int = 0
368368
) -> Page[OpenEvent]:
369-
"""
370-
List open tracking events for a specific message.
371-
372-
Returns:
373-
A ``(opens, total_count)`` tuple.
374-
"""
369+
"""List open tracking events for a specific message."""
375370
if count > 500:
376371
raise ValueError("Count cannot exceed 500 per request")
377372
if count + offset > 10000:
@@ -460,12 +455,7 @@ async def list_clicks(
460455
async def list_message_clicks(
461456
self, message_id: str, count: int = 100, offset: int = 0
462457
) -> Page[ClickEvent]:
463-
"""
464-
List click tracking events for a specific message.
465-
466-
Returns:
467-
A ``(clicks, total_count)`` tuple.
468-
"""
458+
"""List click tracking events for a specific message."""
469459
if count > 500:
470460
raise ValueError("Count cannot exceed 500 per request")
471461
if count + offset > 10000:

postmark/models/outbound/schemas.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
)
1212

1313
from ...utils.message_utils import validate_email_list, validate_formatted_email
14-
from .enums import MessageEventType, MessageStatus, TrackLinksOption
14+
from .enums import BulkJobStatus, MessageEventType, MessageStatus, TrackLinksOption
1515

1616
logger = logging.getLogger(__name__)
1717

@@ -102,6 +102,11 @@ class SendResponse(BaseModel):
102102

103103
model_config = ConfigDict(populate_by_name=True)
104104

105+
@property
106+
def success(self) -> bool:
107+
"""Return True if the message was accepted (error_code == 0)."""
108+
return self.error_code == 0
109+
105110

106111
class Email(BaseModel):
107112
sender: str = Field(alias="From")
@@ -257,7 +262,7 @@ class BulkSendResponse(BaseModel):
257262
"""
258263

259264
id: str = Field(alias="ID")
260-
status: str = Field(alias="Status") # "Accepted" | "Failed"
265+
status: BulkJobStatus = Field(alias="Status")
261266
submitted_at: datetime = Field(alias="SubmittedAt")
262267

263268
model_config = ConfigDict(populate_by_name=True)
@@ -272,7 +277,7 @@ class BulkSendStatus(BaseModel):
272277
submitted_at: datetime = Field(alias="SubmittedAt")
273278
total_messages: int = Field(alias="TotalMessages")
274279
percentage_completed: float = Field(alias="PercentageCompleted")
275-
status: str = Field(alias="Status") # "Accepted" | "Processing" | "Completed"
280+
status: BulkJobStatus = Field(alias="Status")
276281
subject: Optional[str] = Field(None, alias="Subject")
277282

278283
model_config = ConfigDict(populate_by_name=True)

postmark/utils/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)