Skip to content

Commit

Permalink
feat(tem): add support for list email per flag (#3292)
Browse files Browse the repository at this point in the history
  • Loading branch information
scaleway-bot authored Jul 17, 2023
1 parent 0dacbb8 commit a41675d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ARGS:
[subject] (Optional) List emails with this subject
[search] (Optional) List emails by searching to all fields
[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)
[flags.{index}] (Optional) List emails containing only specific flags (unknown_flag | soft_bounce | hard_bounce)
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | all)

DEPRECATED ARGS:
Expand Down
1 change: 1 addition & 0 deletions docs/commands/tem.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ scw tem email list [arg=value ...]
| subject | | (Optional) List emails with this subject |
| search | | (Optional) List emails by searching to all fields |
| 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 |
| flags.{index} | One of: `unknown_flag`, `soft_bounce`, `hard_bounce` | (Optional) List emails containing only specific flags |
| region | Default: `fr-par`<br />One of: `fr-par`, `all` | Region to target. If none is passed will use default region from the config |


Expand Down
8 changes: 8 additions & 0 deletions internal/namespaces/tem/v1alpha1/tem_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,14 @@ func temEmailList() *core.Command {
Positional: false,
EnumValues: []string{"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"},
},
{
Name: "flags.{index}",
Short: `(Optional) List emails containing only specific flags`,
Required: false,
Deprecated: false,
Positional: false,
EnumValues: []string{"unknown_flag", "soft_bounce", "hard_bounce"},
},
core.RegionArgSpec(scw.RegionFrPar, scw.Region(core.AllLocalities)),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
Expand Down

0 comments on commit a41675d

Please sign in to comment.