Skip to content

Commit aef35d9

Browse files
authored
feat(tem): list emails by searching all fields (#201)
1 parent f1aa389 commit aef35d9

File tree

4 files changed

+34
-82
lines changed

4 files changed

+34
-82
lines changed

scaleway-async/scaleway_async/tem/v1alpha1/api.py

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ async def create_email(
7272
You must specify the `region`, the sender and the recipient's information and the `project_id` to send an email from a checked domain. The subject of the email must contain at least 6 characters.
7373
:param region: Region to target. If none is passed will use default region from the config.
7474
:param from_: Sender information. Must be from a checked domain declared in the Project.
75-
:param to: Array of recipient information (limited to 1 recipient).
76-
:param cc: Array of recipient information (unimplemented).
77-
:param bcc: Array of recipient information (unimplemented).
75+
:param to: An array of the primary recipient's information.
76+
:param cc: An array of the carbon copy recipient's information.
77+
:param bcc: An array of the blind carbon copy recipient's information.
7878
:param subject: Subject of the email.
7979
:param text: Text content.
8080
:param html: HTML content.
@@ -204,18 +204,12 @@ async def list_emails(
204204
mail_rcpt: Optional[str] = None,
205205
statuses: Optional[List[EmailStatus]] = None,
206206
subject: Optional[str] = None,
207+
search: Optional[str] = None,
207208
order_by: ListEmailsRequestOrderBy = ListEmailsRequestOrderBy.CREATED_AT_DESC,
208209
) -> ListEmailsResponse:
209210
"""
210211
List emails.
211212
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
219213
:param region: Region to target. If none is passed will use default region from the config.
220214
:param page:
221215
:param page_size:
@@ -229,14 +223,8 @@ async def list_emails(
229223
:param mail_rcpt: (Optional) List emails sent to this recipient's email address.
230224
:param statuses: (Optional) List emails with any of these statuses.
231225
:param subject: (Optional) List emails with this subject.
226+
:param search: (Optional) List emails by searching to all fields.
232227
: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.
240228
:return: :class:`ListEmailsResponse <ListEmailsResponse>`
241229
242230
Usage:
@@ -262,6 +250,7 @@ async def list_emails(
262250
"page": page,
263251
"page_size": page_size or self.client.default_page_size,
264252
"project_id": project_id or self.client.default_project_id,
253+
"search": search,
265254
"since": since,
266255
"statuses": statuses,
267256
"subject": subject,
@@ -288,18 +277,12 @@ async def list_emails_all(
288277
mail_rcpt: Optional[str] = None,
289278
statuses: Optional[List[EmailStatus]] = None,
290279
subject: Optional[str] = None,
280+
search: Optional[str] = None,
291281
order_by: Optional[ListEmailsRequestOrderBy] = None,
292282
) -> List[Email]:
293283
"""
294284
List emails.
295285
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
303286
:param region: Region to target. If none is passed will use default region from the config.
304287
:param page:
305288
:param page_size:
@@ -313,14 +296,8 @@ async def list_emails_all(
313296
:param mail_rcpt: (Optional) List emails sent to this recipient's email address.
314297
:param statuses: (Optional) List emails with any of these statuses.
315298
:param subject: (Optional) List emails with this subject.
299+
:param search: (Optional) List emails by searching to all fields.
316300
: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.
324301
:return: :class:`List[ListEmailsResponse] <List[ListEmailsResponse]>`
325302
326303
Usage:
@@ -347,6 +324,7 @@ async def list_emails_all(
347324
"mail_rcpt": mail_rcpt,
348325
"statuses": statuses,
349326
"subject": subject,
327+
"search": search,
350328
"order_by": order_by,
351329
},
352330
)

scaleway-async/scaleway_async/tem/v1alpha1/types.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -388,17 +388,17 @@ class CreateEmailRequest:
388388

389389
to: Optional[List[CreateEmailRequestAddress]]
390390
"""
391-
Array of recipient information (limited to 1 recipient).
391+
An array of the primary recipient's information.
392392
"""
393393

394394
cc: Optional[List[CreateEmailRequestAddress]]
395395
"""
396-
Array of recipient information (unimplemented).
396+
An array of the carbon copy recipient's information.
397397
"""
398398

399399
bcc: Optional[List[CreateEmailRequestAddress]]
400400
"""
401-
Array of recipient information (unimplemented).
401+
An array of the blind carbon copy recipient's information.
402402
"""
403403

404404
subject: str
@@ -507,16 +507,14 @@ class ListEmailsRequest:
507507
(Optional) List emails with this subject.
508508
"""
509509

510+
search: Optional[str]
511+
"""
512+
(Optional) List emails by searching to all fields.
513+
"""
514+
510515
order_by: Optional[ListEmailsRequestOrderBy]
511516
"""
512517
(Optional) List emails corresponding to specific criteria.
513-
You can filter your emails in ascending or descending order using:
514-
- created_at
515-
- updated_at
516-
- status
517-
- mail_from
518-
- mail_rcpt
519-
- subject.
520518
"""
521519

522520

scaleway/scaleway/tem/v1alpha1/api.py

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ def create_email(
7272
You must specify the `region`, the sender and the recipient's information and the `project_id` to send an email from a checked domain. The subject of the email must contain at least 6 characters.
7373
:param region: Region to target. If none is passed will use default region from the config.
7474
:param from_: Sender information. Must be from a checked domain declared in the Project.
75-
:param to: Array of recipient information (limited to 1 recipient).
76-
:param cc: Array of recipient information (unimplemented).
77-
:param bcc: Array of recipient information (unimplemented).
75+
:param to: An array of the primary recipient's information.
76+
:param cc: An array of the carbon copy recipient's information.
77+
:param bcc: An array of the blind carbon copy recipient's information.
7878
:param subject: Subject of the email.
7979
:param text: Text content.
8080
:param html: HTML content.
@@ -204,18 +204,12 @@ def list_emails(
204204
mail_rcpt: Optional[str] = None,
205205
statuses: Optional[List[EmailStatus]] = None,
206206
subject: Optional[str] = None,
207+
search: Optional[str] = None,
207208
order_by: ListEmailsRequestOrderBy = ListEmailsRequestOrderBy.CREATED_AT_DESC,
208209
) -> ListEmailsResponse:
209210
"""
210211
List emails.
211212
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
219213
:param region: Region to target. If none is passed will use default region from the config.
220214
:param page:
221215
:param page_size:
@@ -229,14 +223,8 @@ def list_emails(
229223
:param mail_rcpt: (Optional) List emails sent to this recipient's email address.
230224
:param statuses: (Optional) List emails with any of these statuses.
231225
:param subject: (Optional) List emails with this subject.
226+
:param search: (Optional) List emails by searching to all fields.
232227
: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.
240228
:return: :class:`ListEmailsResponse <ListEmailsResponse>`
241229
242230
Usage:
@@ -262,6 +250,7 @@ def list_emails(
262250
"page": page,
263251
"page_size": page_size or self.client.default_page_size,
264252
"project_id": project_id or self.client.default_project_id,
253+
"search": search,
265254
"since": since,
266255
"statuses": statuses,
267256
"subject": subject,
@@ -288,18 +277,12 @@ def list_emails_all(
288277
mail_rcpt: Optional[str] = None,
289278
statuses: Optional[List[EmailStatus]] = None,
290279
subject: Optional[str] = None,
280+
search: Optional[str] = None,
291281
order_by: Optional[ListEmailsRequestOrderBy] = None,
292282
) -> List[Email]:
293283
"""
294284
List emails.
295285
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
303286
:param region: Region to target. If none is passed will use default region from the config.
304287
:param page:
305288
:param page_size:
@@ -313,14 +296,8 @@ def list_emails_all(
313296
:param mail_rcpt: (Optional) List emails sent to this recipient's email address.
314297
:param statuses: (Optional) List emails with any of these statuses.
315298
:param subject: (Optional) List emails with this subject.
299+
:param search: (Optional) List emails by searching to all fields.
316300
: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.
324301
:return: :class:`List[ListEmailsResponse] <List[ListEmailsResponse]>`
325302
326303
Usage:
@@ -347,6 +324,7 @@ def list_emails_all(
347324
"mail_rcpt": mail_rcpt,
348325
"statuses": statuses,
349326
"subject": subject,
327+
"search": search,
350328
"order_by": order_by,
351329
},
352330
)

scaleway/scaleway/tem/v1alpha1/types.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -388,17 +388,17 @@ class CreateEmailRequest:
388388

389389
to: Optional[List[CreateEmailRequestAddress]]
390390
"""
391-
Array of recipient information (limited to 1 recipient).
391+
An array of the primary recipient's information.
392392
"""
393393

394394
cc: Optional[List[CreateEmailRequestAddress]]
395395
"""
396-
Array of recipient information (unimplemented).
396+
An array of the carbon copy recipient's information.
397397
"""
398398

399399
bcc: Optional[List[CreateEmailRequestAddress]]
400400
"""
401-
Array of recipient information (unimplemented).
401+
An array of the blind carbon copy recipient's information.
402402
"""
403403

404404
subject: str
@@ -507,16 +507,14 @@ class ListEmailsRequest:
507507
(Optional) List emails with this subject.
508508
"""
509509

510+
search: Optional[str]
511+
"""
512+
(Optional) List emails by searching to all fields.
513+
"""
514+
510515
order_by: Optional[ListEmailsRequestOrderBy]
511516
"""
512517
(Optional) List emails corresponding to specific criteria.
513-
You can filter your emails in ascending or descending order using:
514-
- created_at
515-
- updated_at
516-
- status
517-
- mail_from
518-
- mail_rcpt
519-
- subject.
520518
"""
521519

522520

0 commit comments

Comments
 (0)