Skip to content

Commit 8da90c9

Browse files
feat(client): add 30+ missing methods for API parity
Surveyed the OpenAPI schema and added the methods that were missing from the SDK. Existing list_/get_ patterns preserved throughout — shape-aware where the underlying endpoint supports shaping, plain dict-returning where it doesn't. Webhook alerts (convenience layer over filter subscriptions): - list_webhook_alerts / get_webhook_alert / create_webhook_alert / update_webhook_alert / delete_webhook_alert - New WebhookAlert dataclass Resolve / validate (POST-based identity helpers): - resolve(name, target_type, ...) — entity/org name disambiguation - validate(identifier_type, value) — PIID/solicitation/UEI format check - New ResolveCandidate, ResolveResult, ValidateResult dataclasses Reference data: - list_departments, get_department - list_psc, get_psc, get_psc_metrics - get_naics, get_naics_metrics - get_business_type - list_assistance_listings, get_assistance_listing - list_mas_sins, get_mas_sin Entity sub-resources (all under /api/entities/{uei}/...): - list_entity_contracts, list_entity_idvs - list_entity_otas, list_entity_otidvs - list_entity_subawards, list_entity_lcats - get_entity_metrics IDV sub-resources: - list_idv_lcats Agency sub-resources: - list_agency_awarding_contracts - list_agency_funding_contracts Misc: - search_opportunity_attachments(q, top_k, include_extracted_text) - get_version() - list_api_keys() Decisions: - Kept `uuid=` for vehicle methods to match `get_vehicle(uuid)` and the existing list_vehicle_awardees / list_vehicle_orders surface — these match the API path param. IDVs use `key=`, vehicles use `uuid=`, and the SDK stays consistent. - Stayed away from /api/accounts/usage/ admin endpoints, /api/events/, /api/news/, and /api/company/rag/ — niche internal surfaces. Easy to add when there's user demand. - list_entities, list_vehicle_awardees, and list_idv_transactions are not getting `ordering` because their server-side parameters don't advertise it (verified against OpenAPI). Backward compatible — all additions, no existing call sites changed. Existing tests still pass (238/238). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent f3b6255 commit 8da90c9

4 files changed

Lines changed: 871 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
- `create_webhook_subscription` accepts `endpoint=`, `subscription_type=`, `query_type=`, `filter_definition=`, `frequency=`, `cron_expression=`, `is_active=` (keyword-only). Lets callers target a specific endpoint and create filter subscriptions through the canonical API.
1414
- `update_webhook_subscription` accepts `frequency=`, `cron_expression=`, `is_active=` for filter-subscription updates.
1515
- `update_webhook_endpoint` accepts `name=` for renaming an endpoint.
16+
- Webhook alerts (filter subscriptions): `list_webhook_alerts`, `get_webhook_alert`, `create_webhook_alert`, `update_webhook_alert`, `delete_webhook_alert` — the convenience layer over `/api/webhooks/alerts/`. New `WebhookAlert` dataclass exported from the top-level package.
17+
- `resolve(name, target_type, ...)` — POST `/api/resolve/` to rank entity / organization candidates from a free-text name. Returns `ResolveResult` with `ResolveCandidate` entries (both exported).
18+
- `validate(identifier_type, value)` — POST `/api/validate/` to validate the format of a PIID, solicitation number, or UEI. Returns `ValidateResult` (exported).
19+
- Reference data: `list_departments`, `get_department`, `list_psc`, `get_psc`, `get_psc_metrics`, `get_naics`, `get_naics_metrics`, `get_business_type`, `list_assistance_listings`, `get_assistance_listing`, `list_mas_sins`, `get_mas_sin`.
20+
- Entity sub-resources: `list_entity_contracts`, `list_entity_idvs`, `list_entity_otas`, `list_entity_otidvs`, `list_entity_subawards`, `list_entity_lcats`, `get_entity_metrics`. All shape-aware where the underlying endpoint supports shaping.
21+
- IDV sub-resources: `list_idv_lcats`.
22+
- Agency sub-resources: `list_agency_awarding_contracts`, `list_agency_funding_contracts`.
23+
- Misc: `search_opportunity_attachments(q, top_k, include_extracted_text)` for `/api/opportunities/attachment-search/`; `get_version()` for `/api/version/`; `list_api_keys()` for `/api/api-keys/`.
1624

1725
### Fixed
1826
- `TangoClient._post()` and `_patch()` now accept both `json_data=` (positional) and `json=` (keyword) for backward compatibility. Internal callers and docs examples that use `json=` no longer fail with `TypeError`.

tango/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,14 @@
1313
ITDashboardInvestment,
1414
PaginatedResponse,
1515
RateLimitInfo,
16+
ResolveCandidate,
17+
ResolveResult,
1618
SearchFilters,
1719
ShapeConfig,
20+
ValidateResult,
1821
Vehicle,
1922
VehicleMetrics,
23+
WebhookAlert,
2024
WebhookEndpoint,
2125
WebhookEventType,
2226
WebhookEventTypesResponse,
@@ -46,13 +50,17 @@
4650
"TangoValidationError",
4751
"TangoRateLimitError",
4852
"RateLimitInfo",
53+
"ResolveCandidate",
54+
"ResolveResult",
4955
"GsaElibraryContract",
5056
"ITDashboardInvestment",
5157
"PaginatedResponse",
5258
"SearchFilters",
5359
"ShapeConfig",
60+
"ValidateResult",
5461
"Vehicle",
5562
"VehicleMetrics",
63+
"WebhookAlert",
5664
"WebhookEndpoint",
5765
"WebhookEventType",
5866
"WebhookEventTypesResponse",

0 commit comments

Comments
 (0)