feat(rust): expose quota credits used metadata#2071
Closed
meagancojocar wants to merge 1 commit into
Closed
Conversation
Teach Rust codegen about the optional dotcom creditsUsed quota field and cover camelCase round-tripping plus backward-compatible omission. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Rust support for optional creditsUsed quota metadata before the bundled CLI schema exposes it.
Changes:
- Augments the Rust code-generation schema.
- Regenerates
AccountQuotaSnapshotwithcredits_used: Option<f64>. - Tests camelCase round-tripping and omission compatibility.
Show a summary per file
| File | Description |
|---|---|
scripts/codegen/rust.ts |
Injects optional creditsUsed schema metadata. |
rust/src/generated/api_types.rs |
Exposes the generated Rust field with serde behavior. |
rust/tests/api_types_test.rs |
Covers presence, omission, and serialization naming. |
Review details
- Files reviewed: 2/3 changed files
- Comments generated: 0
- Review effort level: Medium
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
creditsUsedquota metadata when the bundled CLI schema does not yet advertise itAccountQuotaSnapshotascredits_used: Option<f64>with camelCase serde behaviorValidation
cd scripts/codegen && npm run generate:rustcd rust && cargo test --test api_types_testcd rust && cargo clippy --test api_types_test -- --no-deps -D warningscd rust && PATH="$HOME/.cargo/bin:$PATH" cargo +nightly-2026-04-14 fmt --all -- --config-path .rustfmt.nightly.toml --check