Skip to content

feat: add --schema and --data options for email and phone provider commands - #1705

Open
ramya18101 wants to merge 7 commits into
mainfrom
DXCDT-2372/agent-ergonomics-email-phone-providers
Open

ramya18101 wants to merge 7 commits into
mainfrom
DXCDT-2372/agent-ergonomics-email-phone-providers

Conversation

@ramya18101

Copy link
Copy Markdown
Contributor

🔧 Changes

Extends the JSON-input / schema-discovery flag surface (already on actions, roles, users, apis, apps, connections, logs, domains, email templates, universal-login, and acul config) to the email and phone provider commands, so agents and automation get the same whole-payload and schema-discovery interface. All flags reuse the existing shared helpers (internal/cli/schema.go, data_json.go, query_json.go); no new flag machinery was introduced.

The flags

  • --schema: prints the OpenAPI request/query schema for the operation and exits (combine with --json/--json-compact for machine-readable output).
  • --data: whole-payload JSON for create/update: inline JSON, @file.json, or piped stdin; validated against the OpenAPI schema before the API is called.
  • --query/-q: JSON object of query parameters for list commands.

Per command

Command Added
email provider create --data + --schema (POST /emails/provider)
email provider update --data + --schema (PATCH /emails/provider)
phone provider list --schema + --query (GET /branding/phone/providers)
phone provider create --data + --schema (POST /branding/phone/providers)
phone provider update --data + --schema (PATCH /branding/phone/providers/{id})

Notable decisions

  • --data is mutually exclusive with every granular input flag via markDataExclusive, matching the other groups.
  • With --data, email provider update and phone provider update skip the pre-read and the interactive prompts and send the payload verbatim.
  • --schema returns before the provider ID is resolved, so phone provider update --schema needs no ID.

📚 References

🔬 Testing

Manual smoke (against a tenant, non-mutating):

auth0 email provider create --schema                      # POST /emails/provider
auth0 email provider update --schema                      # PATCH /emails/provider
auth0 phone provider list --schema                        # GET /branding/phone/providers
auth0 phone provider create --schema                      # POST /branding/phone/providers
auth0 phone provider update --schema                      # PATCH /branding/phone/providers/{id}
auth0 phone provider list --query '{"disabled":false}' --json

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

🤖 Generated with Claude Code

@ramya18101
ramya18101 marked this pull request as ready for review October 12, 2026 05:33
@ramya18101
ramya18101 requested a review from a team as a code owner October 12, 2026 05:33

@developerkunal developerkunal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for this. The five commands follow the same pattern as the other groups, and build, unit tests, lint and the docs check all pass. I also ran every command live against a dev tenant, and --schema, --query and --data behaved as expected. There are two things to fix before this can merge, and one question. Details are in the inline comments.

Comment thread CHANGELOG.md Outdated
Comment thread internal/cli/phone_provider.go Outdated
return err
}
if provided {
return createEmailProviderFromJSON(cli, cmd, payload)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Question, not blocking. For a custom email provider, creating it with flags works without credentials (the help example does exactly that, and the API accepts it). Creating the same thing with --data is rejected locally with schema validation failed: property "credentials" is missing, because the OpenAPI schema marks credentials as required. Is that gap intended? If not, it may be worth a follow-up so an agent can reproduce the custom example through --data.

This branch has not been deployed

No deployments
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