Skip to content

WPA-14407: Added CLI support for panel based email services - #212

Draft
sgimpel-godaddy wants to merge 1 commit into
mainfrom
WPA-14407
Draft

WPA-14407: Added CLI support for panel based email services#212
sgimpel-godaddy wants to merge 1 commit into
mainfrom
WPA-14407

Conversation

@sgimpel-godaddy

Copy link
Copy Markdown
Collaborator

No description provided.


| | |
|---|---|
| Flags | `--email <email>` (required), `--account-id`, `--first-name`, `--last-name`, repeatable `--consent <agreementType>` |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is account ID?


**Recommendation: native `--page`/`--page-size` flags, forwarded 1:1 to the
API's query params**, rather than adopting `--limit`/`--offset` via
`PaginationConfig`. Translating page-based server pagination into offset math

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty hesitant to have mismatching pagination styles. I think that --limit maps pretty cleanly to --page-size, and if --offset is a multiple of --page-size, then it should typically work the same (worst case scenario is that you have to fetch two pages and then slice them up to fit the provided offset/limit). We can specify default limits now, so the assertion that the handler must return the entire list isn't accurate (maybe that was based on an older version of the engine since enhanced pagination functionality is now available). We should be able to, for this list command have a default page size/limit, and if we wanted to add additional constraints around --limit and --offset (like forcing them to be page-aligned), that'd be better than having completely different pagination flags.

Worth discussing with the others.

}

fn first_eligible_account_id(data: &Value) -> Option<String> {
data.get("eligibleAccounts")?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not blocking, but I think a good backlog enhancement would be to switch this client to being spec-generated so that we have strongly-typed structures and avoid accidental data shape mismatches.

Comment thread rust/src/email/create.rs
struct CreateArgs {
#[arg(long, value_name = "EMAIL")]
email: String,
#[arg(long = "account-id", value_name = "ACCOUNT_ID")]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have the /// comments over all these arg so we can have better help text. I think --account-id especially needs an explanation.

@jpage-godaddy

Copy link
Copy Markdown
Collaborator

I'd recommend attaching a markdown guide to the command module as well, just to explain the email system, things like what is an account ID, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants