Skip to content

Add report bundle download URL endpoint to ledger client#125

Merged
jfrench9 merged 1 commit into
mainfrom
feature/report-bundle
May 29, 2026
Merged

Add report bundle download URL endpoint to ledger client#125
jfrench9 merged 1 commit into
mainfrom
feature/report-bundle

Conversation

@jfrench9
Copy link
Copy Markdown
Member

Summary

Adds support for downloading report bundles from the Robo Ledger service by introducing a new API endpoint, response model, and client method for retrieving report bundle download URLs.

Key Accomplishments

  • New API endpoint: Added get_report_bundle_download_url module under api/extensions_robo_ledger/ that handles HTTP requests to fetch presigned download URLs for report bundles
  • New response model: Introduced GetReportBundleDownloadUrlReportBundleDownloadResponse model to deserialize and validate the download URL response payload
  • Ledger client integration: Extended LedgerClient with a method to conveniently call the new report bundle download endpoint, providing a clean interface for consumers
  • Module exports: Updated clients/__init__.py and models/__init__.py to properly export the new classes and make them accessible as part of the public API

Changes Breakdown

Area Change
API layer New get_report_bundle_download_url endpoint module with sync/async support
Models New response model for report bundle download URL data
Client New convenience method on LedgerClient for report bundle downloads
Exports Updated __init__.py files to expose new components

Breaking Changes

None. This is a purely additive change that introduces new functionality without modifying existing interfaces.

Testing Notes

  • Verify the new get_report_bundle_download_url endpoint correctly constructs requests and parses responses
  • Test both success and error scenarios for the download URL retrieval
  • Confirm the new response model handles all expected fields, including optional/nullable attributes
  • Validate that the LedgerClient method properly delegates to the underlying API module
  • Ensure existing client functionality remains unaffected

Infrastructure Considerations

  • This feature depends on a corresponding report bundle download endpoint being available in the Robo Ledger backend service
  • Consumers should ensure their Ledger service version supports the report bundle download URL endpoint before calling the new client method
  • The generated API client code follows the existing patterns established by the OpenAPI code generator used in this project

🤖 Generated with Claude Code

Branch Info:

  • Source: feature/report-bundle
  • Target: main
  • Type: feature

Co-Authored-By: Claude noreply@anthropic.com

Pre-ship cleanup of the new ``download_report_bundle`` method and
the regen output around it.

* Export ``ReportBundleDownload`` from
  ``clients/__init__.py`` so external consumers can type-hint the
  return value or import the dataclass directly without spelunking
  ``ledger_client``. Adds the symbol to ``__all__``.
* Document ``httpx.TimeoutException`` and ``httpx.RequestError`` in
  the method's Raises clause — both pass through unwrapped so
  callers with their own retry / backoff strategy can distinguish
  a timeout from a generic failure without parsing
  ``RuntimeError`` messages.
* Pulls in the regen output for the new endpoint:
  ``api/extensions_robo_ledger/get_report_bundle_download_url.py``
  (typed op for the JSON-LD flavor — the XBRL binary path still
  needs the hand-rolled ``download_report_bundle`` since OpenAPI
  multi-content-type responses don't auto-generate cleanly), plus
  the matching ``GetReportBundleDownloadUrlReportBundleDownloadResponse``
  model under ``models/`` (auto-exported via the regen's
  ``__init__.py`` patch).

All 88 ledger-client tests still pass; ruff + basedpyright clean.
@jfrench9 jfrench9 merged commit da5228c into main May 29, 2026
1 check passed
@jfrench9 jfrench9 deleted the feature/report-bundle branch May 29, 2026 00:52
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.

1 participant