1717from .types import (
1818 DomainStatus ,
1919 EmailStatus ,
20+ ListEmailsRequestOrderBy ,
2021 CreateEmailRequestAddress ,
2122 CreateEmailRequestAttachment ,
2223 CreateEmailResponse ,
@@ -196,28 +197,46 @@ async def list_emails(
196197 project_id : Optional [str ] = None ,
197198 domain_id : Optional [str ] = None ,
198199 message_id : Optional [str ] = None ,
199- subject : Optional [str ] = None ,
200200 since : Optional [datetime ] = None ,
201201 until : Optional [datetime ] = None ,
202202 mail_from : Optional [str ] = None ,
203203 mail_to : Optional [str ] = None ,
204+ mail_rcpt : Optional [str ] = None ,
204205 statuses : Optional [List [EmailStatus ]] = None ,
206+ subject : Optional [str ] = None ,
207+ order_by : ListEmailsRequestOrderBy = ListEmailsRequestOrderBy .CREATED_AT_DESC ,
205208 ) -> ListEmailsResponse :
206209 """
207210 List emails.
208211 Retrieve the list of emails sent from a specific domain or for a specific Project or Organization. You must specify the `region`.
212+ You can filter your emails in ascending or descending order using:
213+ - created_at
214+ - updated_at
215+ - status
216+ - mail_from
217+ - mail_rcpt
218+ - subject
209219 :param region: Region to target. If none is passed will use default region from the config.
210220 :param page:
211221 :param page_size:
212- :param project_id: ID of the Project in which to list the emails (optional).
213- :param domain_id: ID of the domain for which to list the emails (optional).
214- :param message_id: ID of the message for which to list the emails (optional).
215- :param subject: Subject of the email.
216- :param since: List emails created after this date (optional).
217- :param until: List emails created before this date (optional).
218- :param mail_from: List emails sent with this `mail_from` sender's address (optional).
219- :param mail_to: List emails sent with this `mail_to` recipient's address (optional).
220- :param statuses: List emails having any of this status (optional).
222+ :param project_id: (Optional) ID of the Project in which to list the emails.
223+ :param domain_id: (Optional) ID of the domain for which to list the emails.
224+ :param message_id: (Optional) ID of the message for which to list the emails.
225+ :param since: (Optional) List emails created after this date.
226+ :param until: (Optional) List emails created before this date.
227+ :param mail_from: (Optional) List emails sent with this sender's email address.
228+ :param mail_to: (Deprecated) List emails sent to this recipient's email address.
229+ :param mail_rcpt: (Optional) List emails sent to this recipient's email address.
230+ :param statuses: (Optional) List emails with any of these statuses.
231+ :param subject: (Optional) List emails with this subject.
232+ :param order_by: (Optional) List emails corresponding to specific criteria.
233+ You can filter your emails in ascending or descending order using:
234+ - created_at
235+ - updated_at
236+ - status
237+ - mail_from
238+ - mail_rcpt
239+ - subject.
221240 :return: :class:`ListEmailsResponse <ListEmailsResponse>`
222241
223242 Usage:
@@ -236,8 +255,10 @@ async def list_emails(
236255 params = {
237256 "domain_id" : domain_id ,
238257 "mail_from" : mail_from ,
258+ "mail_rcpt" : mail_rcpt ,
239259 "mail_to" : mail_to ,
240260 "message_id" : message_id ,
261+ "order_by" : order_by ,
241262 "page" : page ,
242263 "page_size" : page_size or self .client .default_page_size ,
243264 "project_id" : project_id or self .client .default_project_id ,
@@ -260,28 +281,46 @@ async def list_emails_all(
260281 project_id : Optional [str ] = None ,
261282 domain_id : Optional [str ] = None ,
262283 message_id : Optional [str ] = None ,
263- subject : Optional [str ] = None ,
264284 since : Optional [datetime ] = None ,
265285 until : Optional [datetime ] = None ,
266286 mail_from : Optional [str ] = None ,
267287 mail_to : Optional [str ] = None ,
288+ mail_rcpt : Optional [str ] = None ,
268289 statuses : Optional [List [EmailStatus ]] = None ,
290+ subject : Optional [str ] = None ,
291+ order_by : Optional [ListEmailsRequestOrderBy ] = None ,
269292 ) -> List [Email ]:
270293 """
271294 List emails.
272295 Retrieve the list of emails sent from a specific domain or for a specific Project or Organization. You must specify the `region`.
296+ You can filter your emails in ascending or descending order using:
297+ - created_at
298+ - updated_at
299+ - status
300+ - mail_from
301+ - mail_rcpt
302+ - subject
273303 :param region: Region to target. If none is passed will use default region from the config.
274304 :param page:
275305 :param page_size:
276- :param project_id: ID of the Project in which to list the emails (optional).
277- :param domain_id: ID of the domain for which to list the emails (optional).
278- :param message_id: ID of the message for which to list the emails (optional).
279- :param subject: Subject of the email.
280- :param since: List emails created after this date (optional).
281- :param until: List emails created before this date (optional).
282- :param mail_from: List emails sent with this `mail_from` sender's address (optional).
283- :param mail_to: List emails sent with this `mail_to` recipient's address (optional).
284- :param statuses: List emails having any of this status (optional).
306+ :param project_id: (Optional) ID of the Project in which to list the emails.
307+ :param domain_id: (Optional) ID of the domain for which to list the emails.
308+ :param message_id: (Optional) ID of the message for which to list the emails.
309+ :param since: (Optional) List emails created after this date.
310+ :param until: (Optional) List emails created before this date.
311+ :param mail_from: (Optional) List emails sent with this sender's email address.
312+ :param mail_to: (Deprecated) List emails sent to this recipient's email address.
313+ :param mail_rcpt: (Optional) List emails sent to this recipient's email address.
314+ :param statuses: (Optional) List emails with any of these statuses.
315+ :param subject: (Optional) List emails with this subject.
316+ :param order_by: (Optional) List emails corresponding to specific criteria.
317+ You can filter your emails in ascending or descending order using:
318+ - created_at
319+ - updated_at
320+ - status
321+ - mail_from
322+ - mail_rcpt
323+ - subject.
285324 :return: :class:`List[ListEmailsResponse] <List[ListEmailsResponse]>`
286325
287326 Usage:
@@ -301,12 +340,14 @@ async def list_emails_all(
301340 "project_id" : project_id ,
302341 "domain_id" : domain_id ,
303342 "message_id" : message_id ,
304- "subject" : subject ,
305343 "since" : since ,
306344 "until" : until ,
307345 "mail_from" : mail_from ,
308346 "mail_to" : mail_to ,
347+ "mail_rcpt" : mail_rcpt ,
309348 "statuses" : statuses ,
349+ "subject" : subject ,
350+ "order_by" : order_by ,
310351 },
311352 )
312353
@@ -324,11 +365,11 @@ async def get_statistics(
324365 Email statuses.
325366 Get information on your emails' statuses.
326367 :param region: Region to target. If none is passed will use default region from the config.
327- :param project_id: Number of emails for this Project (optional) .
328- :param domain_id: Number of emails sent from this domain (must be coherent with the `project_id` and the `organization_id`) (optional ).
329- :param since: Number of emails created after this date (optional) .
330- :param until: Number of emails created before this date (optional) .
331- :param mail_from: Number of emails sent with this `mail_from` sender's address (optional) .
368+ :param project_id: (Optional) Number of emails for this Project.
369+ :param domain_id: (Optional) Number of emails sent from this domain (must be coherent with the `project_id` and the `organization_id`).
370+ :param since: (Optional) Number of emails created after this date.
371+ :param until: (Optional) Number of emails created before this date.
372+ :param mail_from: (Optional) Number of emails sent with this sender's email address .
332373 :return: :class:`Statistics <Statistics>`
333374
334375 Usage:
0 commit comments