Skip to content

feat(rust): expose quota credits used metadata#2071

Closed
meagancojocar wants to merge 1 commit into
github:mainfrom
meagancojocar:meagancojocar-add-credits-used-field
Closed

feat(rust): expose quota credits used metadata#2071
meagancojocar wants to merge 1 commit into
github:mainfrom
meagancojocar:meagancojocar-add-credits-used-field

Conversation

@meagancojocar

@meagancojocar meagancojocar commented Jul 24, 2026

Copy link
Copy Markdown

Summary

  • augment the Rust API schema input with optional dotcom creditsUsed quota metadata when the bundled CLI schema does not yet advertise it
  • regenerate AccountQuotaSnapshot as credits_used: Option<f64> with camelCase serde behavior
  • cover value round-tripping and backward-compatible omission

Validation

  • cd scripts/codegen && npm run generate:rust
  • cd rust && cargo test --test api_types_test
  • cd rust && cargo clippy --test api_types_test -- --no-deps -D warnings
  • cd rust && PATH="$HOME/.cargo/bin:$PATH" cargo +nightly-2026-04-14 fmt --all -- --config-path .rustfmt.nightly.toml --check

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>
Copilot AI review requested due to automatic review settings July 24, 2026 01:36
@meagancojocar
meagancojocar requested a review from a team as a code owner July 24, 2026 01:36

Copilot AI 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.

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 AccountQuotaSnapshot with credits_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

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