Skip to content

Commit fe599d4

Browse files
feat(tem): add support for search (#3159)
Co-authored-by: Rémy Léone <[email protected]>
1 parent e8d3cc6 commit fe599d4

File tree

3 files changed

+11
-23
lines changed

3 files changed

+11
-23
lines changed

cmd/scw/testdata/test-all-usage-tem-email-list-usage.golden

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
33
Retrieve the list of emails sent from a specific domain or for a specific Project or Organization. You must specify the `region`.
4-
You can filter your emails in ascending or descending order using:
5-
- created_at
6-
- updated_at
7-
- status
8-
- mail_from
9-
- mail_rcpt
10-
- subject.
114

125
USAGE:
136
scw tem email list [arg=value ...]
@@ -22,6 +15,7 @@ ARGS:
2215
[mail-rcpt] (Optional) List emails sent to this recipient's email address
2316
[statuses.{index}] (Optional) List emails with any of these statuses (unknown | new | sending | sent | failed | canceled)
2417
[subject] (Optional) List emails with this subject
18+
[search] (Optional) List emails by searching to all fields
2519
[order-by] (Optional) List emails corresponding to specific criteria (created_at_desc | created_at_asc | updated_at_desc | updated_at_asc | status_desc | status_asc | mail_from_desc | mail_from_asc | mail_rcpt_desc | mail_rcpt_asc | subject_desc | subject_asc)
2620
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | all)
2721

docs/commands/tem.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,6 @@ scw tem email get-statistics [arg=value ...]
233233
### List emails
234234

235235
Retrieve the list of emails sent from a specific domain or for a specific Project or Organization. You must specify the `region`.
236-
You can filter your emails in ascending or descending order using:
237-
- created_at
238-
- updated_at
239-
- status
240-
- mail_from
241-
- mail_rcpt
242-
- subject.
243236

244237
**Usage:**
245238

@@ -262,6 +255,7 @@ scw tem email list [arg=value ...]
262255
| mail-rcpt | | (Optional) List emails sent to this recipient's email address |
263256
| statuses.{index} | One of: `unknown`, `new`, `sending`, `sent`, `failed`, `canceled` | (Optional) List emails with any of these statuses |
264257
| subject | | (Optional) List emails with this subject |
258+
| search | | (Optional) List emails by searching to all fields |
265259
| order-by | One of: `created_at_desc`, `created_at_asc`, `updated_at_desc`, `updated_at_asc`, `status_desc`, `status_asc`, `mail_from_desc`, `mail_from_asc`, `mail_rcpt_desc`, `mail_rcpt_asc`, `subject_desc`, `subject_asc` | (Optional) List emails corresponding to specific criteria |
266260
| region | Default: `fr-par`<br />One of: `fr-par`, `all` | Region to target. If none is passed will use default region from the config |
267261

internal/namespaces/tem/v1alpha1/tem_cli.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -221,15 +221,8 @@ func temEmailGet() *core.Command {
221221

222222
func temEmailList() *core.Command {
223223
return &core.Command{
224-
Short: `List emails`,
225-
Long: `Retrieve the list of emails sent from a specific domain or for a specific Project or Organization. You must specify the ` + "`" + `region` + "`" + `.
226-
You can filter your emails in ascending or descending order using:
227-
- created_at
228-
- updated_at
229-
- status
230-
- mail_from
231-
- mail_rcpt
232-
- subject.`,
224+
Short: `List emails`,
225+
Long: `Retrieve the list of emails sent from a specific domain or for a specific Project or Organization. You must specify the ` + "`" + `region` + "`" + `.`,
233226
Namespace: "tem",
234227
Resource: "email",
235228
Verb: "list",
@@ -307,6 +300,13 @@ You can filter your emails in ascending or descending order using:
307300
Deprecated: false,
308301
Positional: false,
309302
},
303+
{
304+
Name: "search",
305+
Short: `(Optional) List emails by searching to all fields`,
306+
Required: false,
307+
Deprecated: false,
308+
Positional: false,
309+
},
310310
{
311311
Name: "order-by",
312312
Short: `(Optional) List emails corresponding to specific criteria`,

0 commit comments

Comments
 (0)