Repository navigation
feat: add GSA eBuy requests, attachment URLs and access check - #9
Open
makegov-mark[bot] wants to merge 2 commits into
Open
makegov-mark[bot] wants to merge 2 commits into
makegov-mark[bot] wants to merge 2 commits into
Conversation
Adds ListEbuyRequests, IterateEbuyRequests, GetEbuyRequest, GetEbuyAttachmentURL and GetEbuyAccess for the eBuy endpoints introduced in Tango API 5.1.0. ListEbuyRequestsOptions names every filter the endpoint accepts, and ShapeEbuyRequestsMinimal mirrors the API's default list shape. GetEbuyAttachmentURL stops at the API's redirect and returns the presigned URL from the Location header; a link entry returns EbuyLinkAttachmentError carrying the link. The no-redirect behavior is per request, so the client's shared http.Client is untouched. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`attachments(extracted_text)` on an eBuy request returns the text extracted from an attachment's document. The SDK returns untyped records and passes the shape through unchanged, so this is documentation plus a pass-through test. The leaf is returned only when named: the default shape and `attachments(*)` leave it out, and no preset includes it. The key is absent rather than null for an attachment with no text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vdavez
marked this pull request as ready for review
October 10, 2026 21:42
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 support for the GSA eBuy endpoints introduced in Tango API 5.1.0.
ListEbuyRequests/IterateEbuyRequestsGET /api/ebuy/requests/GetEbuyRequestGET /api/ebuy/requests/{rfq_id}/GetEbuyAttachmentURLGET /api/ebuy/requests/{rfq_id}/attachments/{doc_seq_num}/download/GetEbuyAccess(typed*EbuyAccess)GET /api/ebuy/access/ListEbuyRequestsOptionsnames every filter the endpoint accepts:Search,RfqID,ReferenceNumber,RequestType,Status,Sin,Schedule,BuyerAgency,Agency,ContractNumber,IssueDate[After/Before],CloseDate[After/Before],Ordering.ShapeEbuyRequestsMinimalmirrors the API's default list shape.GetEbuyAttachmentURLdoes not follow the API's redirect. It returns the short-lived presigned URL from theLocationheader, so callers decide when (and with which client) to download. A link entry (is_link: true) returns*EbuyLinkAttachmentError, which carries the link inURLand unwraps to*ValidationError; a document not yet captured returns*NotFoundError.requestSpecgains anoRedirectflag that uses a shallow copy of the configured*http.ClientwithCheckRedirectset, so the shared client and every other call are unchanged.Behavior worth knowing
GetEbuyAccesstells the two apart.*NotFoundError, the same as an unknown id.statusis frozen at the last-seen state; readlast_seenfor staleness.contract_numberis a filter only and never returned.These are documented on the options struct, the methods,
docs/API_REFERENCE.md, and the CHANGELOG.Testing
ebuy_test.go: filter mapping for every option, nil options, iterator paging, detail shaping and 404, the attachment redirect (asserts exactly one request and that the redirect target is never fetched), the shared client still following redirects for other calls, the link-entry 400, uncaptured 404, 3xx withoutLocation, unexpected 2xx, argument validation, and all three access-response shapes.tests/integration/ebuy_test.go: a liveGetEbuyAccesssmoke test (works for any key; no eBuy grant needed).go test -race ./...green on Go 1.23;golangci-lintv1.64.8 (the version CI resolves) clean.Attachment text (Tango API 5.9.1)
attachments(extracted_text)returns the text extracted from an attachment's document.attachments(*)leave it out, and no preset includes it.gofmt,go vetandgo test -race ./...pass.golangci-lintwas not run locally.🤖 Generated with Claude Code