feat(sdk): added python support for monthly billing report - #70
Open
bmaydan wants to merge 12 commits into
Open
Conversation
bmaydan
requested review from
ethanwharris,
justusschock and
k223kim
as code owners
July 31, 2026 21:57
bmaydan
enabled auto-merge (squash)
July 31, 2026 22:22
dwnetautomation
approved these changes
Aug 3, 2026
Member
|
@bmaydan needs a pr description (ideally with an example output) :) |
justusschock
reviewed
Aug 4, 2026
…decide whether to use range or pivot
Collaborator
Author
added! |
ethanwharris
reviewed
Aug 5, 2026
ethanwharris
disabled auto-merge
August 7, 2026 08:06
justusschock
requested changes
Aug 7, 2026
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.
What
Adds
Organization.get_monthly_summary()for fetching an organization's monthly billing summary (credits purchased, used, and remaining) from the billing service.Details
OrgApi.get_monthly_summary()wrapsbilling_service_get_monthly_summary, exposing a singlestart/endinterface that implicitly maps onto the API's two mutually exclusive filter modes:startandend: translated to a range filter.start: translated to a pivot filter withpivot=start,pivot_direction="AFTER".end: translated to a pivot filter withpivot=end,pivot_direction="BEFORE".start/endis provided, thatstart <= endwhen both are given, and that the requested span doesn't exceed the API's 2-year limit (also enforced for the implicitAFTERpivot relative to now).Organization.get_monthly_summary()exposes the samestart/endinterface at the SDK's public surface, scoped toself.id.Example output
Testing
python/tests/api/test_org_api.pycovering valid range/pivot usage and invalid-input cases (missing/both filters, inverted range, futureAFTERpivot, >2 year spans).