Repository navigation
Conversation
Adds `list_ebuy_requests()`, `get_ebuy_request()`, `get_ebuy_attachment_url()` and `get_ebuy_access()` over the `/api/ebuy/` resource (Tango API 5.1.0), with `EbuyRequest` / `EbuyAttachment` schemas, an `EbuyAccess` result type and the `EBUY_REQUESTS_MINIMAL` / `EBUY_REQUESTS_COMPREHENSIVE` default shapes. All fourteen of the API's list filters are explicit named parameters. `get_ebuy_attachment_url()` reads the download redirect without following it and returns the short-lived signed URL; a link entry raises `TangoValidationError` carrying the link. The response-status handling in `_request()` moves into `_raise_for_status()` so the attachment method can share it. `ebuy/requests` is now mapped in both conformance gates, and its unmapped-resource shape-coverage baseline entry is removed. `ebuy_request` is documented as an alert query type. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`get_ebuy_attachment_url()` now raises `TangoAttachmentLinkError`, a `TangoValidationError` subclass exposing the link as `.url`, when the entry is an external link rather than a stored document. The `agency` filter on `list_ebuy_requests()` documents that it requires Tango API 5.3.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 the GSA eBuy requests resource (Tango API 5.1.0):
list_ebuy_requests(page, limit, shape, flat, flat_lists, search, rfq_id, reference_number, request_type, status, sin, schedule, buyer_agency, agency, contract_number, issue_date_after, issue_date_before, close_date_after, close_date_before, ordering)GET /api/ebuy/requests/PaginatedResponseof shaped dictsget_ebuy_request(rfq_id, shape=None, flat=False, flat_lists=False)GET /api/ebuy/requests/{rfq_id}/get_ebuy_attachment_url(rfq_id, doc_seq_num) -> strGET /api/ebuy/requests/{rfq_id}/attachments/{doc_seq_num}/download/get_ebuy_access() -> EbuyAccessGET /api/ebuy/access/EbuyAccess(enabled, reason, contracts)Plus
EbuyRequest/EbuyAttachmentshape schemas, theEBUY_REQUESTS_MINIMAL/EBUY_REQUESTS_COMPREHENSIVEdefaults (mirroring the API's list and retrieve defaults), andebuy_requestdocumented as an alert query type.Behavior worth knowing
get_ebuy_access()tells "no access" from "no matches".statusis frozen at the last state a request was seen in. The docstrings, model and API reference say so and point atlast_seen.get_ebuy_attachment_url()requests with redirects disabled and returns theLocationtarget, so no document is downloaded. A link entry (is_link) raises the newTangoAttachmentLinkError, aTangoValidationErrorsubclass exposing the link as.url; an uncaptured document raisesTangoNotFoundErrorwith the API's detail.agencyfilter requires Tango API 5.3.0 and says so; the others work from 5.1.0.shapesends theShapeConfigdefault, which mirrors the API's own default so the response is the same while fields parse to typed values.attachments(*), because the SDK does not type-parse wildcard expands anddoc_session_datewould otherwise stay a string._request()'s status-to-exception mapping moved into_raise_for_status()unchanged, so the attachment method can reuse it.Conformance
ebuy/requestsis mapped incheck_filter_shape_conformance.pyandcheck_shape_coverage.py; itsunmapped_resourceentry is removed fromcontracts/shape_coverage_baseline.json. The vendored contract already covered the resource, so it is not refreshed.generated_overlay.pywas regenerated: now that the explicit schema covers eBuy attachments, the generator drops an orphan nested schema and renumbers the rest. No overlay-backed field changes type.Testing
uv run pytest: 573 passed, 31 skipped (newtests/test_ebuy.py, 19 tests, mocked transport)uv run ruff format --check tango/,uv run ruff check tango/,uv run mypy tango/: cleanscripts/check_filter_shape_conformance.py: no errors, no eBuy warningsscripts/check_shape_coverage.py: no driftNo cassette-backed integration test, deliberately: a recorded eBuy response would publish buyer names, emails and contract details into this public repo, so the new tests mock the transport.
🤖 Generated with Claude Code