WPA-14526: aligning CLI with final panel api schema - #245
WPA-14526: aligning CLI with final panel api schema#245sgimpel-godaddy wants to merge 3 commits into
Conversation
| .bearer_auth(&self.token) | ||
| .header("x-request-id", Self::new_request_id()); | ||
| for (key, value) in extra_headers { | ||
| req = req.header(*key, value); |
There was a problem hiding this comment.
@sgimpel-godaddy what is extra_headers?
| assert_eq!(actions.len(), 2); | ||
| assert_eq!(actions[0].command, "gddy email create"); | ||
| assert_eq!(actions[1].command, "gddy guide email-mailboxes"); | ||
| assert_eq!(actions[1].command, "gddy guide email"); |
There was a problem hiding this comment.
@sgimpel-godaddy here does it only say gddy email create or should it say gddy email create <args> and the args here is the email address
| RuntimeGroupSpec::new( | ||
| GroupSpec::new("email", "Create, list, and inspect GoDaddy Email mailboxes").with_long( | ||
| "Manage GoDaddy Email mailboxes over panel-v3.\n\ | ||
| "Manage GoDaddy Email mailboxes.\n\ |
There was a problem hiding this comment.
@sgimpel-godaddy can you name it Manage GoDaddy Business Emails
| let mut create = next_action("email create", "Create a mailbox for this address") | ||
| let account_id = first_eligible_account_id(data); | ||
| let command = if account_id.is_some() { | ||
| "email create --email <email> --account-id <account-id>" |
There was a problem hiding this comment.
@sgimpel-godaddy for eligibility next best action, if requirementAgreements in returns from the eligibillity, then consents array must be passed for create. Else the api will fail
| }; | ||
| let body = request_body(&args); | ||
| assert_eq!(body["email"], "someone@example.com"); | ||
| assert_eq!(body["emailAddress"], "someone@example.com"); |
There was a problem hiding this comment.
@sgimpel-godaddy you need to send the idempotency_key in the header because create endpoint needs it
| let command = if account_id.is_some() { | ||
| "email create --email <email> --account-id <account-id>" | ||
| } else { | ||
| "email create --email <email>" |
There was a problem hiding this comment.
@sgimpel-godaddy this should not be in if;else because if there is no eligible account then they cannot create email. I am changing the api to return a 422 if ineligible instead of 200
| /// ID of an existing eligible account to provision this mailbox under, | ||
| /// from `check-eligibility`'s `eligibleAccounts[].accountId` (see | ||
| /// `gddy guide email-mailboxes`). Not a shopper/customer ID. | ||
| /// `gddy guide email`). Not a shopper/customer ID. |
There was a problem hiding this comment.
@sgimpel-godaddy we should have a eligibility_next_actions to call the GET by the id because after create they have to poll until the status is COMPLETED
No description provided.