feat(billing): add usage.get method, update usage.paygo endpoint#2772
Merged
Conversation
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.
Sync billing resource from staging-next
Brings in the previously-deferred
billingresource changes. SDK call site isunchanged for existing callers; the deferred "breaking" label was driven by an
internal endpoint URL change, not by an SDK surface change.
Source:
origin/staging-next(billing-only checkout)Base:
origin/nextLocal Validation (all gates pass)
npx tsc --noEmiteslint ../scripts/detect-breaking-changes origin/nextWhat changed
SDK call site: unchanged.
New (additive):
client.billing.usage.get({ account_id, from?, to?, metric? })-- new endpointGET /accounts/{account_id}/billable/usagereturning a FinOps FOCUS v1.3cost-and-usage dataset (
UsageGetResponse).UsagePaygoResponse.Record.ServiceFamilyName?-- new optional field.Internal:
client.billing.usage.paygo()now callsGET /accounts/{account_id}/paygo-usageinstead ofGET /accounts/{account_id}/billing/usage/paygo. Method signature, params,and return type are unchanged.
Why this is not user-breaking
detect-breaking-changes(which lints the OLD test files against the NEWSDK) passes with exit 0 -- the SDK-level API contract is preserved.
change-analyzer(scripts/common/summarize-diff.ts) flags theendpoint URL change as "breaking" because it tracks underlying API path
changes, but that's a server-side concern (the API team must keep the old
path alive or redirect during transition), not a code change anyone using
the SDK needs to make.
What's still deferred
The other 5 previously-deferred resources still have SDK-surface breaking
changes and remain out of this PR:
addressing,api-gateway,cache,email-security,realtime-kit.