feat(sdk): added python support for monthly billing report - #70
Merged
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
Collaborator
Author
added! |
ethanwharris
reviewed
Aug 5, 2026
justusschock
requested changes
Aug 7, 2026
robTheBuildr
self-requested a review
August 17, 2026 15:49
robTheBuildr
left a comment
Contributor
There was a problem hiding this comment.
@ethanwharris @justusschock looks good to me, not approving until you can validate as you previously blocked
ethanwharris
approved these changes
Aug 17, 2026
justusschock
approved these changes
Aug 17, 2026
bmaydan
force-pushed
the
ben/monthly-billing-report
branch
from
August 17, 2026 18:00
553369b to
7b4dce2
Compare
bmaydan
enabled auto-merge (squash)
August 17, 2026 18:00
bmaydan
force-pushed
the
ben/monthly-billing-report
branch
2 times, most recently
from
August 17, 2026 18:29
35141d3 to
9c10100
Compare
bmaydan
force-pushed
the
ben/monthly-billing-report
branch
from
August 17, 2026 18:34
9c10100 to
5698c75
Compare
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).