Skip to content

feat: add GSA eBuy requests, attachment URL and access check - #7

Draft
makegov-mark[bot] wants to merge 1 commit into
mainfrom
feat/ebuy
Draft

makegov-mark[bot] wants to merge 1 commit into
mainfrom
feat/ebuy

Conversation

@makegov-mark

@makegov-mark makegov-mark Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

What

Adds the GSA eBuy endpoints from Tango API 5.1.0.

Method Endpoint Returns
list_ebuy_requests(opts) / iterate_ebuy_requests(opts) GET /api/ebuy/requests/ Page<Record> / PageStream<Record>
get_ebuy_request(rfq_id, opts) GET /api/ebuy/requests/{rfq_id}/ Record
get_ebuy_attachment_url(rfq_id, doc_seq_num) GET /api/ebuy/requests/{rfq_id}/attachments/{doc_seq_num}/download/ String
get_ebuy_access() GET /api/ebuy/access/ EbuyAccess (typed)
  • ListEbuyRequestsOptions names every filter the endpoint accepts (search, rfq_id, reference_number, request_type, status, sin, schedule, buyer_agency, agency, contract_number, issue/close date bounds) plus ordering.
  • SHAPE_EBUY_REQUESTS_MINIMAL mirrors the API's default list shape.
  • get_ebuy_attachment_url reads the 302 with redirects disabled and returns the Location (resolved against the request URL) instead of following it. Following it would download the document and send the API key to the download host.
  • An attachment that is an outbound link (400 with url) surfaces as the new Error::ExternalLink { url, .. } variant; Error is #[non_exhaustive], so this is additive.
  • New builder option no_redirect_http_client overrides the dedicated no-redirect client, for callers whose proxy/TLS setup must apply to that call too.
  • The transport retry loop is factored into a shared helper so the redirect-reading call retries 429/5xx/transport errors under the same policy.

Behavior documented in rustdoc, docs/API_REFERENCE.md and the CHANGELOG: Pro plan required; the list is scoped to the caller's linked schedule contracts and is empty (not an error) without one, which get_ebuy_access disambiguates; status is frozen at last-seen state.

Testing

  • cargo fmt --all -- --check, cargo clippy --workspace --all-features --all-targets -- -D warnings, cargo test --workspace all green.
  • Unit tests for query emission, the empty-id guard and EbuyAccess decoding.
  • httpmock wire tests: list/get/access routes; the attachment URL is returned and the redirect target is never requested (verified the test fails when the call uses the redirect-following client); relative Location resolution; the link-entry 400 maps to ExternalLink with its url; an uncaptured document maps to NotFound.
  • No live integration test: exercising these endpoints needs a key on an account with a linked schedule contract.

🤖 Generated with Claude Code

Adds the GSA eBuy endpoints from Tango API 5.1.0: `list_ebuy_requests` / `iterate_ebuy_requests`, `get_ebuy_request`, `get_ebuy_attachment_url` and `get_ebuy_access`, with `ListEbuyRequestsOptions`, `GetEbuyRequestOptions`, the typed `EbuyAccess` model and `SHAPE_EBUY_REQUESTS_MINIMAL`.
`get_ebuy_attachment_url` reads the download route's redirect with redirects disabled and returns the presigned URL instead of following it, on a dedicated no-redirect client (overridable via the new `no_redirect_http_client` builder option).
An attachment that is an outbound link surfaces as the new `Error::ExternalLink { url, .. }` variant.
The retry loop is factored so the redirect-reading call shares the same retry policy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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