pub struct Client { /* private fields */ }Expand description
The Tango API client. Cheap to clone — all state is behind an Arc.
Construct with Client::builder. Call .api_key(...) on the builder, or
set the TANGO_API_KEY environment variable and call Client::from_env.
Client is Send + Sync + Clone. Share one instance across tasks.
§Example
use tango::Client;
let client = Client::builder()
.api_key("your-api-key")
.build()?;
let _agency = client.get_agency("9700", None).await?;Implementations§
Source§impl Client
impl Client
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Start building a Client.
api_key is required (compile-time check via bon). Everything else
is optional with sensible defaults; see the individual setters.
§Errors
Returns Error::Build if the underlying reqwest::Client fails to
construct (rare; usually means a bad rustls/TLS configuration).
Source§impl Client
impl Client
Sourcepub fn from_env() -> Result<Self>
pub fn from_env() -> Result<Self>
Construct a client from TANGO_API_KEY and (optionally) TANGO_BASE_URL
in the environment, with all other settings at their defaults.
§Errors
Returns Error::Build if the underlying HTTP client fails to construct.
Sourcepub fn rate_limit_info(&self) -> Option<RateLimitInfo>
pub fn rate_limit_info(&self) -> Option<RateLimitInfo>
A snapshot of the rate-limit headers from the most recent response, or
None if no request has completed yet.
Sourcepub fn last_response_headers(&self) -> Option<HeaderMap>
pub fn last_response_headers(&self) -> Option<HeaderMap>
The full response headers from the most recent completed request, or
None if no request has completed yet. Useful for inspecting
X-Request-Id, X-Tango-Trace-Id, etc.
Source§impl Client
impl Client
Sourcepub async fn list_agencies(
&self,
opts: ListAgenciesOptions,
) -> Result<Page<Record>>
pub async fn list_agencies( &self, opts: ListAgenciesOptions, ) -> Result<Page<Record>>
GET /api/agencies/ — list federal agencies.
Sourcepub async fn get_agency(
&self,
code: &str,
opts: Option<GetAgencyOptions>,
) -> Result<AgencyRecord>
pub async fn get_agency( &self, code: &str, opts: Option<GetAgencyOptions>, ) -> Result<AgencyRecord>
GET /api/agencies/{code}/ — fetch a single agency.
code is typically a CGAC code (e.g. "9700" for the Department of
Defense). Returns a typed AgencyRecord; forward-compatible server
fields land in AgencyRecord::extra.
Sourcepub async fn list_agency_awarding_contracts(
&self,
code: &str,
opts: AgencyContractsOptions,
) -> Result<Page<Record>>
pub async fn list_agency_awarding_contracts( &self, code: &str, opts: AgencyContractsOptions, ) -> Result<Page<Record>>
GET /api/agencies/{code}/contracts/awarding/ — contracts where this
agency is the awarding agency.
Sourcepub async fn list_agency_funding_contracts(
&self,
code: &str,
opts: AgencyContractsOptions,
) -> Result<Page<Record>>
pub async fn list_agency_funding_contracts( &self, code: &str, opts: AgencyContractsOptions, ) -> Result<Page<Record>>
GET /api/agencies/{code}/contracts/funding/ — contracts where this
agency is the funding agency.
Sourcepub fn iterate_agency_awarding_contracts(
&self,
code: &str,
opts: AgencyContractsOptions,
) -> PageStream<Record>
pub fn iterate_agency_awarding_contracts( &self, code: &str, opts: AgencyContractsOptions, ) -> PageStream<Record>
Stream every contract where code is the awarding agency.
Sourcepub fn iterate_agency_funding_contracts(
&self,
code: &str,
opts: AgencyContractsOptions,
) -> PageStream<Record>
pub fn iterate_agency_funding_contracts( &self, code: &str, opts: AgencyContractsOptions, ) -> PageStream<Record>
Stream every contract where code is the funding agency.
Source§impl Client
impl Client
Sourcepub async fn list_contracts(
&self,
opts: ListContractsOptions,
) -> Result<Page<Record>>
pub async fn list_contracts( &self, opts: ListContractsOptions, ) -> Result<Page<Record>>
GET /api/contracts/ — one page of federal contract records.
Sourcepub fn iterate_contracts(
&self,
opts: ListContractsOptions,
) -> PageStream<Record>
pub fn iterate_contracts( &self, opts: ListContractsOptions, ) -> PageStream<Record>
Stream every federal contract record matching opts. The stream follows
?cursor= (or ?page= fallback) on the server’s next URL.
let mut s = client.iterate_contracts(
ListContractsOptions::builder().awarding_agency("9700").build(),
);
while let Some(record) = s.try_next().await? {
let _ = record;
}Source§impl Client
impl Client
Sourcepub async fn list_entities(
&self,
opts: ListEntitiesOptions,
) -> Result<Page<Record>>
pub async fn list_entities( &self, opts: ListEntitiesOptions, ) -> Result<Page<Record>>
GET /api/entities/ — one page of entity records.
Sourcepub async fn get_entity(
&self,
uei: &str,
opts: Option<GetEntityOptions>,
) -> Result<Record>
pub async fn get_entity( &self, uei: &str, opts: Option<GetEntityOptions>, ) -> Result<Record>
GET /api/entities/{uei}/ — fetch a single entity by UEI or CAGE code.
Sourcepub fn iterate_entities(&self, opts: ListEntitiesOptions) -> PageStream<Record>
pub fn iterate_entities(&self, opts: ListEntitiesOptions) -> PageStream<Record>
Stream every entity record matching opts.
Source§impl Client
impl Client
Sourcepub async fn list_entity_contracts(
&self,
uei: &str,
opts: EntitySubresourceOptions,
) -> Result<Page<Record>>
pub async fn list_entity_contracts( &self, uei: &str, opts: EntitySubresourceOptions, ) -> Result<Page<Record>>
GET /api/entities/{uei}/contracts/ — contracts awarded to this entity.
Sourcepub fn iterate_entity_contracts(
&self,
uei: &str,
opts: EntitySubresourceOptions,
) -> PageStream<Record>
pub fn iterate_entity_contracts( &self, uei: &str, opts: EntitySubresourceOptions, ) -> PageStream<Record>
Stream every contract awarded to uei.
Sourcepub async fn list_entity_idvs(
&self,
uei: &str,
opts: EntitySubresourceOptions,
) -> Result<Page<Record>>
pub async fn list_entity_idvs( &self, uei: &str, opts: EntitySubresourceOptions, ) -> Result<Page<Record>>
GET /api/entities/{uei}/idvs/ — IDVs held by this entity.
Sourcepub fn iterate_entity_idvs(
&self,
uei: &str,
opts: EntitySubresourceOptions,
) -> PageStream<Record>
pub fn iterate_entity_idvs( &self, uei: &str, opts: EntitySubresourceOptions, ) -> PageStream<Record>
Stream every IDV held by uei.
Sourcepub async fn list_entity_otas(
&self,
uei: &str,
opts: EntitySubresourceOptions,
) -> Result<Page<Record>>
pub async fn list_entity_otas( &self, uei: &str, opts: EntitySubresourceOptions, ) -> Result<Page<Record>>
GET /api/entities/{uei}/otas/ — Other Transaction Awards held by this
entity.
Sourcepub fn iterate_entity_otas(
&self,
uei: &str,
opts: EntitySubresourceOptions,
) -> PageStream<Record>
pub fn iterate_entity_otas( &self, uei: &str, opts: EntitySubresourceOptions, ) -> PageStream<Record>
Stream every OTA held by uei.
Sourcepub async fn list_entity_otidvs(
&self,
uei: &str,
opts: EntitySubresourceOptions,
) -> Result<Page<Record>>
pub async fn list_entity_otidvs( &self, uei: &str, opts: EntitySubresourceOptions, ) -> Result<Page<Record>>
GET /api/entities/{uei}/otidvs/ — Other Transaction IDVs held by this
entity.
Sourcepub fn iterate_entity_otidvs(
&self,
uei: &str,
opts: EntitySubresourceOptions,
) -> PageStream<Record>
pub fn iterate_entity_otidvs( &self, uei: &str, opts: EntitySubresourceOptions, ) -> PageStream<Record>
Stream every OTIDV held by uei.
Sourcepub async fn list_entity_subawards(
&self,
uei: &str,
opts: EntitySubresourceOptions,
) -> Result<Page<Record>>
pub async fn list_entity_subawards( &self, uei: &str, opts: EntitySubresourceOptions, ) -> Result<Page<Record>>
GET /api/entities/{uei}/subawards/ — subawards reported against
contracts held by this entity.
Sourcepub fn iterate_entity_subawards(
&self,
uei: &str,
opts: EntitySubresourceOptions,
) -> PageStream<Record>
pub fn iterate_entity_subawards( &self, uei: &str, opts: EntitySubresourceOptions, ) -> PageStream<Record>
Stream every subaward reported under uei.
Sourcepub async fn list_entity_lcats(
&self,
uei: &str,
opts: EntitySubresourceOptions,
) -> Result<Page<Record>>
pub async fn list_entity_lcats( &self, uei: &str, opts: EntitySubresourceOptions, ) -> Result<Page<Record>>
GET /api/entities/{uei}/lcats/ — Labor Categories advertised by this
entity.
Sourcepub fn iterate_entity_lcats(
&self,
uei: &str,
opts: EntitySubresourceOptions,
) -> PageStream<Record>
pub fn iterate_entity_lcats( &self, uei: &str, opts: EntitySubresourceOptions, ) -> PageStream<Record>
Stream every LCAT advertised by uei.
Sourcepub async fn get_entity_metrics(
&self,
uei: &str,
months: u32,
period_grouping: &str,
) -> Result<Record>
pub async fn get_entity_metrics( &self, uei: &str, months: u32, period_grouping: &str, ) -> Result<Record>
GET /api/entities/{uei}/metrics/{months}/{period_grouping}/ — rolling
windowed metrics for this entity. Mirrors the signature of the sibling
SDKs (Node / Python / Go).
months is the rolling-window length (must be > 0). period_grouping
is typically "month" or "quarter".
Source§impl Client
impl Client
Sourcepub async fn list_gsa_elibrary_contracts(
&self,
opts: ListGsaElibraryContractsOptions,
) -> Result<Page<Record>>
pub async fn list_gsa_elibrary_contracts( &self, opts: ListGsaElibraryContractsOptions, ) -> Result<Page<Record>>
GET /api/gsa_elibrary_contracts/ — one page of GSA eLibrary contracts.
Sourcepub async fn get_gsa_elibrary_contract(
&self,
uuid: &str,
opts: Option<GetGsaElibraryContractOptions>,
) -> Result<Record>
pub async fn get_gsa_elibrary_contract( &self, uuid: &str, opts: Option<GetGsaElibraryContractOptions>, ) -> Result<Record>
GET /api/gsa_elibrary_contracts/{uuid}/ — fetch a single GSA eLibrary
contract by UUID.
Sourcepub fn iterate_gsa_elibrary_contracts(
&self,
opts: ListGsaElibraryContractsOptions,
) -> PageStream<Record>
pub fn iterate_gsa_elibrary_contracts( &self, opts: ListGsaElibraryContractsOptions, ) -> PageStream<Record>
Stream every GSA eLibrary contract matching opts.
Source§impl Client
impl Client
Sourcepub async fn list_idv_awards(
&self,
key: &str,
opts: IdvSubresourceOptions,
) -> Result<Page<Record>>
pub async fn list_idv_awards( &self, key: &str, opts: IdvSubresourceOptions, ) -> Result<Page<Record>>
GET /api/idvs/{key}/awards/ — task-order awards under a parent IDV.
Sourcepub fn iterate_idv_awards(
&self,
key: &str,
opts: IdvSubresourceOptions,
) -> PageStream<Record>
pub fn iterate_idv_awards( &self, key: &str, opts: IdvSubresourceOptions, ) -> PageStream<Record>
Stream every task-order award under key.
Sourcepub async fn list_idv_child_idvs(
&self,
key: &str,
opts: IdvSubresourceOptions,
) -> Result<Page<Record>>
pub async fn list_idv_child_idvs( &self, key: &str, opts: IdvSubresourceOptions, ) -> Result<Page<Record>>
GET /api/idvs/{key}/idvs/ — child IDVs nested under a parent IDV.
Sourcepub fn iterate_idv_child_idvs(
&self,
key: &str,
opts: IdvSubresourceOptions,
) -> PageStream<Record>
pub fn iterate_idv_child_idvs( &self, key: &str, opts: IdvSubresourceOptions, ) -> PageStream<Record>
Stream every child IDV under key.
Sourcepub async fn list_idv_transactions(
&self,
key: &str,
opts: IdvSubresourceOptions,
) -> Result<Page<Record>>
pub async fn list_idv_transactions( &self, key: &str, opts: IdvSubresourceOptions, ) -> Result<Page<Record>>
GET /api/idvs/{key}/transactions/ — raw transaction history backing
an IDV.
Sourcepub fn iterate_idv_transactions(
&self,
key: &str,
opts: IdvSubresourceOptions,
) -> PageStream<Record>
pub fn iterate_idv_transactions( &self, key: &str, opts: IdvSubresourceOptions, ) -> PageStream<Record>
Stream every transaction backing key.
Sourcepub async fn get_idv_summary(&self, key: &str) -> Result<Record>
👎Deprecated: Deprecated upstream; use get_idv with the comprehensive shape
pub async fn get_idv_summary(&self, key: &str) -> Result<Record>
Deprecated upstream; use get_idv with the comprehensive shape
GET /api/idvs/{identifier}/summary/ — summary roll-up for an IDV.
Deprecated: the v1.0.0 server returns 404 for this endpoint. Retained
for parity with the other SDKs; migrate to Client::get_idv with the
comprehensive shape.
Sourcepub async fn list_idv_summary_awards(
&self,
key: &str,
opts: IdvSubresourceOptions,
) -> Result<Page<Record>>
👎Deprecated: Deprecated upstream; use list_idv_awards
pub async fn list_idv_summary_awards( &self, key: &str, opts: IdvSubresourceOptions, ) -> Result<Page<Record>>
Deprecated upstream; use list_idv_awards
GET /api/idvs/{identifier}/summary/awards/ — awards belonging to an
IDV summary.
Deprecated: the v1.0.0 server returns 404 for this endpoint. Retained
for parity with the other SDKs; migrate to Client::list_idv_awards.
Sourcepub async fn list_idv_lcats(
&self,
key: &str,
opts: IdvSubresourceOptions,
) -> Result<Page<Record>>
pub async fn list_idv_lcats( &self, key: &str, opts: IdvSubresourceOptions, ) -> Result<Page<Record>>
GET /api/idvs/{key}/lcats/ — Labor Categories (LCATs) under an IDV.
Sourcepub fn iterate_idv_lcats(
&self,
key: &str,
opts: IdvSubresourceOptions,
) -> PageStream<Record>
pub fn iterate_idv_lcats( &self, key: &str, opts: IdvSubresourceOptions, ) -> PageStream<Record>
Stream every LCAT under key.
Source§impl Client
impl Client
Sourcepub async fn list_idvs(&self, opts: ListIDVsOptions) -> Result<Page<Record>>
pub async fn list_idvs(&self, opts: ListIDVsOptions) -> Result<Page<Record>>
GET /api/idvs/ — one page of Indefinite Delivery Vehicle records.
Sourcepub async fn get_idv(
&self,
key: &str,
opts: Option<GetIDVOptions>,
) -> Result<Record>
pub async fn get_idv( &self, key: &str, opts: Option<GetIDVOptions>, ) -> Result<Record>
GET /api/idvs/{key}/ — fetch a single IDV by key.
Returns a free-form Record; deserialize into your own struct via
serde_json::from_value(Value::Object(record)) if you need typed fields.
Sourcepub fn iterate_idvs(&self, opts: ListIDVsOptions) -> PageStream<Record>
pub fn iterate_idvs(&self, opts: ListIDVsOptions) -> PageStream<Record>
Stream every IDV record matching opts. The stream follows ?cursor=
(or ?page= fallback) on the server’s next URL.
Source§impl Client
impl Client
Sourcepub async fn list_itdashboard(
&self,
opts: ListItdashboardOptions,
) -> Result<Page<Record>>
pub async fn list_itdashboard( &self, opts: ListItdashboardOptions, ) -> Result<Page<Record>>
GET /api/itdashboard/ — one page of federal IT investments.
Sourcepub async fn get_itdashboard(
&self,
uii: &str,
opts: Option<GetItdashboardOptions>,
) -> Result<Record>
pub async fn get_itdashboard( &self, uii: &str, opts: Option<GetItdashboardOptions>, ) -> Result<Record>
GET /api/itdashboard/{uii}/ — fetch a single investment
by Unique Investment Identifier (UII).
Sourcepub fn iterate_itdashboard(
&self,
opts: ListItdashboardOptions,
) -> PageStream<Record>
pub fn iterate_itdashboard( &self, opts: ListItdashboardOptions, ) -> PageStream<Record>
Stream every IT Dashboard investment matching opts.
Source§impl Client
impl Client
Sourcepub async fn list_lcats(&self, opts: ListLcatsOptions) -> Result<Page<Record>>
pub async fn list_lcats(&self, opts: ListLcatsOptions) -> Result<Page<Record>>
Dispatcher: list LCATs for the owner specified by opts.uei or
opts.idv_key.
- When
ueiis set: delegates toClient::list_entity_lcats(GET /api/entities/{uei}/lcats/). - Else when
idv_keyis set: delegates toClient::list_idv_lcats(GET /api/idvs/{key}/lcats/). - Else: returns
Error::Validation.
When both are set, uei wins (mirrors the Go SDK).
Sourcepub fn iterate_lcats(&self, opts: ListLcatsOptions) -> PageStream<Record>
pub fn iterate_lcats(&self, opts: ListLcatsOptions) -> PageStream<Record>
Stream every LCAT for the owner specified by opts. Same dispatch
rules as Client::list_lcats; the validation error surfaces on
the first poll.
Source§impl Client
impl Client
Sourcepub async fn list_organizations(
&self,
opts: ListOrganizationsOptions,
) -> Result<Page<Record>>
pub async fn list_organizations( &self, opts: ListOrganizationsOptions, ) -> Result<Page<Record>>
GET /api/organizations/ — one page of organization records.
Sourcepub fn iterate_organizations(
&self,
opts: ListOrganizationsOptions,
) -> PageStream<Record>
pub fn iterate_organizations( &self, opts: ListOrganizationsOptions, ) -> PageStream<Record>
Stream every organization record matching opts.
Sourcepub async fn get_organization(&self, key: &str) -> Result<Record>
pub async fn get_organization(&self, key: &str) -> Result<Record>
GET /api/organizations/{key}/ — fetch a single organization.
Sourcepub async fn list_naics(&self, opts: ListNaicsOptions) -> Result<Page<Record>>
pub async fn list_naics(&self, opts: ListNaicsOptions) -> Result<Page<Record>>
GET /api/naics/ — one page of NAICS records.
Sourcepub fn iterate_naics(&self, opts: ListNaicsOptions) -> PageStream<Record>
pub fn iterate_naics(&self, opts: ListNaicsOptions) -> PageStream<Record>
Stream every NAICS record matching opts.
Sourcepub async fn get_naics(&self, code: &str) -> Result<Record>
pub async fn get_naics(&self, code: &str) -> Result<Record>
GET /api/naics/{code}/ — fetch a single NAICS record.
Sourcepub async fn list_psc(&self, opts: ListPscOptions) -> Result<Page<Record>>
pub async fn list_psc(&self, opts: ListPscOptions) -> Result<Page<Record>>
GET /api/psc/ — one page of PSC (Product/Service Code) records.
Sourcepub fn iterate_psc(&self, opts: ListPscOptions) -> PageStream<Record>
pub fn iterate_psc(&self, opts: ListPscOptions) -> PageStream<Record>
Stream every PSC record matching opts.
Sourcepub async fn get_psc(&self, code: &str) -> Result<Record>
pub async fn get_psc(&self, code: &str) -> Result<Record>
GET /api/psc/{code}/ — fetch a single PSC record.
Sourcepub async fn list_mas_sins(
&self,
opts: ListMasSinsOptions,
) -> Result<Page<Record>>
pub async fn list_mas_sins( &self, opts: ListMasSinsOptions, ) -> Result<Page<Record>>
GET /api/mas_sins/ — one page of GSA MAS Special Item Number records.
Sourcepub fn iterate_mas_sins(&self, opts: ListMasSinsOptions) -> PageStream<Record>
pub fn iterate_mas_sins(&self, opts: ListMasSinsOptions) -> PageStream<Record>
Stream every MAS SIN record matching opts.
Sourcepub async fn get_mas_sin(&self, sin: &str) -> Result<Record>
pub async fn get_mas_sin(&self, sin: &str) -> Result<Record>
GET /api/mas_sins/{sin}/ — fetch a single MAS SIN record.
Sourcepub async fn list_assistance_listings(
&self,
opts: ListAssistanceListingsOptions,
) -> Result<Page<Record>>
pub async fn list_assistance_listings( &self, opts: ListAssistanceListingsOptions, ) -> Result<Page<Record>>
GET /api/assistance_listings/ — one page of CFDA program records.
Sourcepub fn iterate_assistance_listings(
&self,
opts: ListAssistanceListingsOptions,
) -> PageStream<Record>
pub fn iterate_assistance_listings( &self, opts: ListAssistanceListingsOptions, ) -> PageStream<Record>
Stream every Assistance Listing record matching opts.
Sourcepub async fn get_assistance_listing(&self, number: &str) -> Result<Record>
pub async fn get_assistance_listing(&self, number: &str) -> Result<Record>
GET /api/assistance_listings/{number}/ — fetch a single Assistance
Listing (CFDA program) by its CFDA number (e.g. "10.001").
Sourcepub async fn list_business_types(
&self,
opts: ListBusinessTypesOptions,
) -> Result<Page<Record>>
pub async fn list_business_types( &self, opts: ListBusinessTypesOptions, ) -> Result<Page<Record>>
GET /api/business_types/ — one page of business-type reference
records (SBA / SAM.gov socioeconomic designations).
Sourcepub fn iterate_business_types(
&self,
opts: ListBusinessTypesOptions,
) -> PageStream<Record>
pub fn iterate_business_types( &self, opts: ListBusinessTypesOptions, ) -> PageStream<Record>
Stream every business-type record matching opts.
Sourcepub async fn get_business_type(&self, code: &str) -> Result<Record>
pub async fn get_business_type(&self, code: &str) -> Result<Record>
GET /api/business_types/{code}/ — fetch a single business-type
reference record by its short code.
Sourcepub async fn list_offices(
&self,
opts: ListOfficesOptions,
) -> Result<Page<Record>>
pub async fn list_offices( &self, opts: ListOfficesOptions, ) -> Result<Page<Record>>
GET /api/offices/ — one page of federal contracting office records.
Sourcepub fn iterate_offices(&self, opts: ListOfficesOptions) -> PageStream<Record>
pub fn iterate_offices(&self, opts: ListOfficesOptions) -> PageStream<Record>
Stream every office record matching opts.
Sourcepub async fn get_office(&self, code: &str) -> Result<Record>
pub async fn get_office(&self, code: &str) -> Result<Record>
GET /api/offices/{code}/ — fetch a single office record by its
FPDS-NG office code.
Sourcepub async fn list_departments(
&self,
opts: ListDepartmentsOptions,
) -> Result<Page<Record>>
pub async fn list_departments( &self, opts: ListDepartmentsOptions, ) -> Result<Page<Record>>
GET /api/departments/ — one page of department records.
Prefer Client::list_organizations with level = "1" for new code.
The standalone /api/departments/ endpoint is retained for backward
compatibility.
Sourcepub fn iterate_departments(
&self,
opts: ListDepartmentsOptions,
) -> PageStream<Record>
pub fn iterate_departments( &self, opts: ListDepartmentsOptions, ) -> PageStream<Record>
Stream every department record matching opts.
Sourcepub async fn get_department(&self, code: &str) -> Result<Record>
pub async fn get_department(&self, code: &str) -> Result<Record>
GET /api/departments/{code}/ — fetch a single department by code
(typically the CGAC department code, e.g. "097" for DoD).
Source§impl Client
impl Client
Sourcepub async fn get_version(&self) -> Result<Record>
pub async fn get_version(&self) -> Result<Record>
GET /api/version/ — return the API server’s version metadata
(build commit, deployed-at, etc.).
Single-value endpoint: the server returns a JSON object, not a
paginated envelope, so this returns a Record directly.
Sourcepub async fn list_api_keys(&self, opts: ListApiKeysOptions) -> Result<Record>
pub async fn list_api_keys(&self, opts: ListApiKeysOptions) -> Result<Record>
Source§impl Client
impl Client
Sourcepub async fn get_naics_metrics(
&self,
code: &str,
months: u32,
period_grouping: &str,
) -> Result<Record>
pub async fn get_naics_metrics( &self, code: &str, months: u32, period_grouping: &str, ) -> Result<Record>
GET /api/naics/{code}/metrics/{months}/{period_grouping}/
Rolling-window metrics keyed by NAICS code.
Sourcepub async fn get_psc_metrics(
&self,
code: &str,
months: u32,
period_grouping: &str,
) -> Result<Record>
pub async fn get_psc_metrics( &self, code: &str, months: u32, period_grouping: &str, ) -> Result<Record>
GET /api/psc/{code}/metrics/{months}/{period_grouping}/
Rolling-window metrics keyed by PSC code.
Sourcepub async fn list_metrics(&self, opts: ListMetricsOptions) -> Result<Record>
pub async fn list_metrics(&self, opts: ListMetricsOptions) -> Result<Record>
Convenience dispatcher: route to NAICS / PSC / entity metrics based
on ListMetricsOptions::owner_type.
Returns Error::Validation when:
owner_idis empty,months == 0,period_groupingis empty, orowner_typeisn’t one of the three known discriminants.
The entity flavour fetches /api/entities/{uei}/metrics/{months}/{period_grouping}/
directly here; once Wave A’s entity_subresources lands the typed
Client::get_entity_metrics helper, this dispatcher will collapse to
delegate to it (no public-surface change).
Source§impl Client
impl Client
Sourcepub async fn list_opportunities(
&self,
opts: ListOpportunitiesOptions,
) -> Result<Page<Record>>
pub async fn list_opportunities( &self, opts: ListOpportunitiesOptions, ) -> Result<Page<Record>>
GET /api/opportunities/ — one page of opportunity records.
Sourcepub fn iterate_opportunities(
&self,
opts: ListOpportunitiesOptions,
) -> PageStream<Record>
pub fn iterate_opportunities( &self, opts: ListOpportunitiesOptions, ) -> PageStream<Record>
Stream every opportunity matching opts.
Sourcepub async fn list_notices(
&self,
opts: ListNoticesOptions,
) -> Result<Page<Record>>
pub async fn list_notices( &self, opts: ListNoticesOptions, ) -> Result<Page<Record>>
GET /api/notices/ — one page of notice records.
Sourcepub fn iterate_notices(&self, opts: ListNoticesOptions) -> PageStream<Record>
pub fn iterate_notices(&self, opts: ListNoticesOptions) -> PageStream<Record>
Stream every notice matching opts.
Sourcepub async fn list_forecasts(
&self,
opts: ListForecastsOptions,
) -> Result<Page<Record>>
pub async fn list_forecasts( &self, opts: ListForecastsOptions, ) -> Result<Page<Record>>
GET /api/forecasts/ — one page of forecast records.
Sourcepub fn iterate_forecasts(
&self,
opts: ListForecastsOptions,
) -> PageStream<Record>
pub fn iterate_forecasts( &self, opts: ListForecastsOptions, ) -> PageStream<Record>
Stream every forecast matching opts.
Sourcepub async fn list_grants(&self, opts: ListGrantsOptions) -> Result<Page<Record>>
pub async fn list_grants(&self, opts: ListGrantsOptions) -> Result<Page<Record>>
GET /api/grants/ — one page of grant records.
Sourcepub fn iterate_grants(&self, opts: ListGrantsOptions) -> PageStream<Record>
pub fn iterate_grants(&self, opts: ListGrantsOptions) -> PageStream<Record>
Stream every grant matching opts.
Sourcepub async fn search_opportunity_attachments(
&self,
opts: SearchOpportunityAttachmentsOptions,
) -> Result<Record>
pub async fn search_opportunity_attachments( &self, opts: SearchOpportunityAttachmentsOptions, ) -> Result<Record>
GET /api/opportunities/attachment-search/ — semantic search over
the extracted text of opportunity attachments (SOWs, PWSs, J&As).
Returns Error::Validation when opts.q is missing or empty.
Source§impl Client
impl Client
Sourcepub async fn list_otas(&self, opts: ListOTAsOptions) -> Result<Page<Record>>
pub async fn list_otas(&self, opts: ListOTAsOptions) -> Result<Page<Record>>
GET /api/otas/ — one page of Other Transaction Authority award actions.
Sourcepub async fn get_ota(
&self,
key: &str,
opts: Option<GetOTAOptions>,
) -> Result<Record>
pub async fn get_ota( &self, key: &str, opts: Option<GetOTAOptions>, ) -> Result<Record>
GET /api/otas/{key}/ — fetch a single OTA by key.
Sourcepub fn iterate_otas(&self, opts: ListOTAsOptions) -> PageStream<Record>
pub fn iterate_otas(&self, opts: ListOTAsOptions) -> PageStream<Record>
Stream every OTA matching opts.
Sourcepub async fn list_otidvs(&self, opts: ListOTIDVsOptions) -> Result<Page<Record>>
pub async fn list_otidvs(&self, opts: ListOTIDVsOptions) -> Result<Page<Record>>
GET /api/otidvs/ — one page of Other Transaction IDV parent records.
Sourcepub async fn get_otidv(
&self,
key: &str,
opts: Option<GetOTIDVOptions>,
) -> Result<Record>
pub async fn get_otidv( &self, key: &str, opts: Option<GetOTIDVOptions>, ) -> Result<Record>
GET /api/otidvs/{key}/ — fetch a single OTIDV by key.
Sourcepub fn iterate_otidvs(&self, opts: ListOTIDVsOptions) -> PageStream<Record>
pub fn iterate_otidvs(&self, opts: ListOTIDVsOptions) -> PageStream<Record>
Stream every OTIDV matching opts.
Sourcepub async fn list_otidv_awards(
&self,
key: &str,
opts: ListOTIDVAwardsOptions,
) -> Result<Page<Record>>
pub async fn list_otidv_awards( &self, key: &str, opts: ListOTIDVAwardsOptions, ) -> Result<Page<Record>>
GET /api/otidvs/{key}/awards/ — child awards under an OTIDV parent.
Sourcepub fn iterate_otidv_awards(
&self,
key: &str,
opts: ListOTIDVAwardsOptions,
) -> PageStream<Record>
pub fn iterate_otidv_awards( &self, key: &str, opts: ListOTIDVAwardsOptions, ) -> PageStream<Record>
Stream every child award under the given OTIDV parent.
Source§impl Client
impl Client
Sourcepub async fn list_protests(
&self,
opts: ListProtestsOptions,
) -> Result<Page<Record>>
pub async fn list_protests( &self, opts: ListProtestsOptions, ) -> Result<Page<Record>>
GET /api/protests/ — one page of bid-protest records.
Sourcepub async fn get_protest(
&self,
case_id: &str,
opts: Option<GetProtestOptions>,
) -> Result<ProtestRecord>
pub async fn get_protest( &self, case_id: &str, opts: Option<GetProtestOptions>, ) -> Result<ProtestRecord>
GET /api/protests/{case_id}/ — fetch a single protest by case ID.
Returns a typed ProtestRecord; forward-compatible server fields land
in ProtestRecord::extra.
Sourcepub fn iterate_protests(&self, opts: ListProtestsOptions) -> PageStream<Record>
pub fn iterate_protests(&self, opts: ListProtestsOptions) -> PageStream<Record>
Stream every protest matching opts.
Source§impl Client
impl Client
Sourcepub async fn resolve(&self, input: ResolveInput) -> Result<ResolveResult>
pub async fn resolve(&self, input: ResolveInput) -> Result<ResolveResult>
POST /api/resolve/ — fuzzy-match a name to entity or organization
candidates.
input.target_type is an enum and is therefore always valid;
input.name must be non-empty (validated client-side).
Sourcepub async fn validate(&self, input: ValidateInput) -> Result<ValidateResult>
pub async fn validate(&self, input: ValidateInput) -> Result<ValidateResult>
POST /api/validate/ — check whether an identifier (PIID, solicitation,
or UEI) is well-formed and known.
Source§impl Client
impl Client
Sourcepub async fn list_subawards(
&self,
opts: ListSubawardsOptions,
) -> Result<Page<Record>>
pub async fn list_subawards( &self, opts: ListSubawardsOptions, ) -> Result<Page<Record>>
GET /api/subawards/ — one page of subaward records.
Sourcepub fn iterate_subawards(
&self,
opts: ListSubawardsOptions,
) -> PageStream<Record>
pub fn iterate_subawards( &self, opts: ListSubawardsOptions, ) -> PageStream<Record>
Stream every subaward matching opts.
Source§impl Client
impl Client
Sourcepub async fn list_vehicle_awardees(
&self,
uuid: &str,
opts: ListVehicleAwardeesOptions,
) -> Result<Page<Record>>
pub async fn list_vehicle_awardees( &self, uuid: &str, opts: ListVehicleAwardeesOptions, ) -> Result<Page<Record>>
GET /api/vehicles/{uuid}/awardees/ — entities holding child IDVs
under this contracting vehicle.
Sourcepub async fn list_vehicle_orders(
&self,
uuid: &str,
opts: ListVehicleOrdersOptions,
) -> Result<Page<Record>>
pub async fn list_vehicle_orders( &self, uuid: &str, opts: ListVehicleOrdersOptions, ) -> Result<Page<Record>>
GET /api/vehicles/{uuid}/orders/ — task orders placed under this
vehicle’s child IDVs.
Sourcepub fn iterate_vehicle_awardees(
&self,
uuid: &str,
opts: ListVehicleAwardeesOptions,
) -> PageStream<Record>
pub fn iterate_vehicle_awardees( &self, uuid: &str, opts: ListVehicleAwardeesOptions, ) -> PageStream<Record>
Stream every awardee under this contracting vehicle.
Sourcepub fn iterate_vehicle_orders(
&self,
uuid: &str,
opts: ListVehicleOrdersOptions,
) -> PageStream<Record>
pub fn iterate_vehicle_orders( &self, uuid: &str, opts: ListVehicleOrdersOptions, ) -> PageStream<Record>
Stream every task order placed under this contracting vehicle.
Source§impl Client
impl Client
Sourcepub async fn list_vehicles(
&self,
opts: ListVehiclesOptions,
) -> Result<Page<Record>>
pub async fn list_vehicles( &self, opts: ListVehiclesOptions, ) -> Result<Page<Record>>
GET /api/vehicles/ — one page of contracting-vehicle records.
Sourcepub async fn get_vehicle(
&self,
uuid: &str,
opts: Option<GetVehicleOptions>,
) -> Result<Record>
pub async fn get_vehicle( &self, uuid: &str, opts: Option<GetVehicleOptions>, ) -> Result<Record>
GET /api/vehicles/{uuid}/ — fetch a single contracting vehicle.
Sourcepub fn iterate_vehicles(&self, opts: ListVehiclesOptions) -> PageStream<Record>
pub fn iterate_vehicles(&self, opts: ListVehiclesOptions) -> PageStream<Record>
Stream every contracting-vehicle record matching opts.
Source§impl Client
impl Client
Sourcepub async fn list_webhook_event_types(
&self,
) -> Result<WebhookEventTypesResponse>
pub async fn list_webhook_event_types( &self, ) -> Result<WebhookEventTypesResponse>
GET /api/webhooks/event-types/ — list the event types the server can emit.
Sourcepub async fn list_webhook_endpoints(
&self,
opts: ListOptions,
) -> Result<Page<WebhookEndpoint>>
pub async fn list_webhook_endpoints( &self, opts: ListOptions, ) -> Result<Page<WebhookEndpoint>>
GET /api/webhooks/endpoints/ — list the caller’s configured webhook
endpoints. Pagination only — no resource-specific filters.
Sourcepub async fn get_webhook_endpoint(&self, id: &str) -> Result<WebhookEndpoint>
pub async fn get_webhook_endpoint(&self, id: &str) -> Result<WebhookEndpoint>
GET /api/webhooks/endpoints/{id}/ — fetch a single endpoint.
Sourcepub async fn create_webhook_endpoint(
&self,
input: WebhookEndpointCreateInput,
) -> Result<WebhookEndpoint>
pub async fn create_webhook_endpoint( &self, input: WebhookEndpointCreateInput, ) -> Result<WebhookEndpoint>
POST /api/webhooks/endpoints/ — create a new endpoint.
name and callback_url are required. The Tango API enforces
unique(user, name) on endpoints, so the SDK validates client-side
for a cleaner error than the server’s 400 on duplicates.
Sourcepub async fn update_webhook_endpoint(
&self,
id: &str,
input: WebhookEndpointUpdateInput,
) -> Result<WebhookEndpoint>
pub async fn update_webhook_endpoint( &self, id: &str, input: WebhookEndpointUpdateInput, ) -> Result<WebhookEndpoint>
PATCH /api/webhooks/endpoints/{id}/ — update an existing endpoint.
Only Some fields on the input are sent.
Sourcepub async fn delete_webhook_endpoint(&self, id: &str) -> Result<()>
pub async fn delete_webhook_endpoint(&self, id: &str) -> Result<()>
DELETE /api/webhooks/endpoints/{id}/ — remove an endpoint.
Sourcepub async fn test_webhook_endpoint(
&self,
endpoint_id: &str,
) -> Result<WebhookTestDeliveryResult>
pub async fn test_webhook_endpoint( &self, endpoint_id: &str, ) -> Result<WebhookTestDeliveryResult>
POST /api/webhooks/endpoints/test-delivery/ — trigger a test delivery
for endpoint_id. The request body uses the canonical key endpoint
(per tango#2252); the server still accepts the legacy endpoint_id
alias but the SDK sends the canonical key.
Sourcepub async fn get_webhook_sample_payload(
&self,
event_type: Option<&str>,
) -> Result<WebhookSamplePayloadResponse>
pub async fn get_webhook_sample_payload( &self, event_type: Option<&str>, ) -> Result<WebhookSamplePayloadResponse>
GET /api/webhooks/endpoints/sample-payload/ — fetch a sample delivery
body. When event_type is Some, returns the single-event-type variant;
when None, the server returns samples for every event type.
Sourcepub async fn list_webhook_alerts(
&self,
opts: ListOptions,
) -> Result<Page<WebhookAlert>>
pub async fn list_webhook_alerts( &self, opts: ListOptions, ) -> Result<Page<WebhookAlert>>
GET /api/webhooks/alerts/ — list the caller’s filter-based subscriptions.
Sourcepub async fn get_webhook_alert(&self, id: &str) -> Result<WebhookAlert>
pub async fn get_webhook_alert(&self, id: &str) -> Result<WebhookAlert>
GET /api/webhooks/alerts/{id}/ — fetch a single alert.
Sourcepub async fn create_webhook_alert(
&self,
input: WebhookAlertCreateInput,
) -> Result<WebhookAlert>
pub async fn create_webhook_alert( &self, input: WebhookAlertCreateInput, ) -> Result<WebhookAlert>
POST /api/webhooks/alerts/ — create a filter-based subscription.
name, query_type (singular), and a non-empty filters object are
required. For accounts with multiple webhook endpoints, set
input.endpoint to the destination endpoint UUID; single-endpoint
accounts may omit it.
Sourcepub async fn update_webhook_alert(
&self,
id: &str,
input: WebhookAlertUpdateInput,
) -> Result<WebhookAlert>
pub async fn update_webhook_alert( &self, id: &str, input: WebhookAlertUpdateInput, ) -> Result<WebhookAlert>
PATCH /api/webhooks/alerts/{id}/ — update an existing alert.
Only name, frequency, cron_expression, and is_active are writable.
Sourcepub async fn delete_webhook_alert(&self, id: &str) -> Result<()>
pub async fn delete_webhook_alert(&self, id: &str) -> Result<()>
DELETE /api/webhooks/alerts/{id}/ — remove an alert.