Skip to content

Commit 301204b

Browse files
Ihor BilousIhor Bilous
authored andcommitted
Fix issue #23: Improve tests and examples files structure
1 parent f837f7f commit 301204b

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed
File renamed without changes.

mailtrap/api/resources/suppressions.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,19 @@ def __init__(self, client: HttpClient, account_id: str) -> None:
1010
self._client = client
1111

1212
def get_list(self, email: Optional[str] = None) -> list[Suppression]:
13+
"""
14+
List and search suppressions by email.
15+
The endpoint returns up to 1000 suppressions per request.
16+
"""
1317
params = {"email": email} if email is not None else None
1418
response = self._client.get(self._api_path(), params=params)
1519
return [Suppression(**suppression) for suppression in response]
1620

1721
def delete(self, suppression_id: str) -> Suppression:
22+
"""
23+
Delete a suppression by ID. Mailtrap will no longer prevent
24+
sending to this email unless it's recorded in suppressions again.
25+
"""
1826
response = self._client.delete(self._api_path(suppression_id))
1927
return Suppression(**response)
2028

tests/unit/api/suppressions/__init__.py

Whitespace-only changes.
File renamed without changes.

0 commit comments

Comments
 (0)