feat: add ai gateway account endpoint#625
Conversation
✅ Deploy Preview for open-api ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughSummary by CodeRabbit
WalkthroughAn account-scoped AI Gateway token endpoint was added: GET /accounts/{account_id}/ai-gateway/token in swagger.yml with a required path parameter Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@go/plumbing/operations/get_account_a_i_gateway_token_parameters.go`:
- Around line 127-130: The code calls r.SetPathParam("account_id", o.AccountID)
without validating AccountID; add a non-empty guard before building the path (in
the same function where SetPathParam is called) that returns a clear error if
o.AccountID == "" (e.g., "account_id is required"), then only call
r.SetPathParam when non-empty; ideally also add this requirement to the
parameter spec so regen will enforce it.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
go/plumbing/operations/get_account_a_i_gateway_token_parameters.gogo/plumbing/operations/get_account_a_i_gateway_token_responses.gogo/plumbing/operations/operations_client.go
| // path param account_id | ||
| if err := r.SetPathParam("account_id", o.AccountID); err != nil { | ||
| return err | ||
| } |
There was a problem hiding this comment.
Validate required account_id before building the path.
Line 128 writes account_id without checking for empty input. That can emit /accounts//ai-gateway/token and fail late with less actionable errors. Add a non-empty guard (ideally via spec validation + regen) before SetPathParam.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@go/plumbing/operations/get_account_a_i_gateway_token_parameters.go` around
lines 127 - 130, The code calls r.SetPathParam("account_id", o.AccountID)
without validating AccountID; add a non-empty guard before building the path (in
the same function where SetPathParam is called) that returns a clear error if
o.AccountID == "" (e.g., "account_id is required"), then only call
r.SetPathParam when non-empty; ideally also add this requirement to the
parameter spec so regen will enforce it.
🤖 I have created a release *beep* *boop* --- ## [2.50.0](v2.49.2...v2.50.0) (2026-03-02) ### Features * add ai gateway account endpoint ([#625](#625)) ([93c2e07](93c2e07)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: token-generator-app[bot] <82042599+token-generator-app[bot]@users.noreply.github.com> Co-authored-by: token-generator-app[bot] <token-generator-app[bot]@users.noreply.github.com>
Adds account endpoint for ai gateway token