Skip to main content

Client

Struct Client 

Source
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

Source

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

Source

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.

Source

pub fn base_url(&self) -> &str

The resolved base URL the client will hit.

Source

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.

Source

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

Source

pub async fn list_agencies( &self, opts: ListAgenciesOptions, ) -> Result<Page<Record>>

GET /api/agencies/ — list federal agencies.

Source

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.

Source

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.

Source

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.

Source

pub fn iterate_agency_awarding_contracts( &self, code: &str, opts: AgencyContractsOptions, ) -> PageStream<Record>

Stream every contract where code is the awarding agency.

Source

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

Source

pub async fn list_contracts( &self, opts: ListContractsOptions, ) -> Result<Page<Record>>

GET /api/contracts/ — one page of federal contract records.

Source

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

Source

pub async fn list_entities( &self, opts: ListEntitiesOptions, ) -> Result<Page<Record>>

GET /api/entities/ — one page of entity records.

Source

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.

Source

pub fn iterate_entities(&self, opts: ListEntitiesOptions) -> PageStream<Record>

Stream every entity record matching opts.

Source§

impl Client

Source

pub async fn list_entity_contracts( &self, uei: &str, opts: EntitySubresourceOptions, ) -> Result<Page<Record>>

GET /api/entities/{uei}/contracts/ — contracts awarded to this entity.

Source

pub fn iterate_entity_contracts( &self, uei: &str, opts: EntitySubresourceOptions, ) -> PageStream<Record>

Stream every contract awarded to uei.

Source

pub async fn list_entity_idvs( &self, uei: &str, opts: EntitySubresourceOptions, ) -> Result<Page<Record>>

GET /api/entities/{uei}/idvs/ — IDVs held by this entity.

Source

pub fn iterate_entity_idvs( &self, uei: &str, opts: EntitySubresourceOptions, ) -> PageStream<Record>

Stream every IDV held by uei.

Source

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.

Source

pub fn iterate_entity_otas( &self, uei: &str, opts: EntitySubresourceOptions, ) -> PageStream<Record>

Stream every OTA held by uei.

Source

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.

Source

pub fn iterate_entity_otidvs( &self, uei: &str, opts: EntitySubresourceOptions, ) -> PageStream<Record>

Stream every OTIDV held by uei.

Source

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.

Source

pub fn iterate_entity_subawards( &self, uei: &str, opts: EntitySubresourceOptions, ) -> PageStream<Record>

Stream every subaward reported under uei.

Source

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.

Source

pub fn iterate_entity_lcats( &self, uei: &str, opts: EntitySubresourceOptions, ) -> PageStream<Record>

Stream every LCAT advertised by uei.

Source

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

Source

pub async fn list_gsa_elibrary_contracts( &self, opts: ListGsaElibraryContractsOptions, ) -> Result<Page<Record>>

GET /api/gsa_elibrary_contracts/ — one page of GSA eLibrary contracts.

Source

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.

Source

pub fn iterate_gsa_elibrary_contracts( &self, opts: ListGsaElibraryContractsOptions, ) -> PageStream<Record>

Stream every GSA eLibrary contract matching opts.

Source§

impl Client

Source

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.

Source

pub fn iterate_idv_awards( &self, key: &str, opts: IdvSubresourceOptions, ) -> PageStream<Record>

Stream every task-order award under key.

Source

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.

Source

pub fn iterate_idv_child_idvs( &self, key: &str, opts: IdvSubresourceOptions, ) -> PageStream<Record>

Stream every child IDV under key.

Source

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.

Source

pub fn iterate_idv_transactions( &self, key: &str, opts: IdvSubresourceOptions, ) -> PageStream<Record>

Stream every transaction backing key.

Source

pub async fn get_idv_summary(&self, key: &str) -> Result<Record>

👎Deprecated:

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.

Source

pub async fn list_idv_summary_awards( &self, key: &str, opts: IdvSubresourceOptions, ) -> Result<Page<Record>>

👎Deprecated:

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.

Source

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.

Source

pub fn iterate_idv_lcats( &self, key: &str, opts: IdvSubresourceOptions, ) -> PageStream<Record>

Stream every LCAT under key.

Source§

impl Client

Source

pub async fn list_idvs(&self, opts: ListIDVsOptions) -> Result<Page<Record>>

GET /api/idvs/ — one page of Indefinite Delivery Vehicle records.

Source

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.

Source

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

Source

pub async fn list_itdashboard( &self, opts: ListItdashboardOptions, ) -> Result<Page<Record>>

GET /api/itdashboard/ — one page of federal IT investments.

Source

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).

Source

pub fn iterate_itdashboard( &self, opts: ListItdashboardOptions, ) -> PageStream<Record>

Stream every IT Dashboard investment matching opts.

Source§

impl Client

Source

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 both are set, uei wins (mirrors the Go SDK).

Source

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

Source

pub async fn list_organizations( &self, opts: ListOrganizationsOptions, ) -> Result<Page<Record>>

GET /api/organizations/ — one page of organization records.

Source

pub fn iterate_organizations( &self, opts: ListOrganizationsOptions, ) -> PageStream<Record>

Stream every organization record matching opts.

Source

pub async fn get_organization(&self, key: &str) -> Result<Record>

GET /api/organizations/{key}/ — fetch a single organization.

Source

pub async fn list_naics(&self, opts: ListNaicsOptions) -> Result<Page<Record>>

GET /api/naics/ — one page of NAICS records.

Source

pub fn iterate_naics(&self, opts: ListNaicsOptions) -> PageStream<Record>

Stream every NAICS record matching opts.

Source

pub async fn get_naics(&self, code: &str) -> Result<Record>

GET /api/naics/{code}/ — fetch a single NAICS record.

Source

pub async fn list_psc(&self, opts: ListPscOptions) -> Result<Page<Record>>

GET /api/psc/ — one page of PSC (Product/Service Code) records.

Source

pub fn iterate_psc(&self, opts: ListPscOptions) -> PageStream<Record>

Stream every PSC record matching opts.

Source

pub async fn get_psc(&self, code: &str) -> Result<Record>

GET /api/psc/{code}/ — fetch a single PSC record.

Source

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.

Source

pub fn iterate_mas_sins(&self, opts: ListMasSinsOptions) -> PageStream<Record>

Stream every MAS SIN record matching opts.

Source

pub async fn get_mas_sin(&self, sin: &str) -> Result<Record>

GET /api/mas_sins/{sin}/ — fetch a single MAS SIN record.

Source

pub async fn list_assistance_listings( &self, opts: ListAssistanceListingsOptions, ) -> Result<Page<Record>>

GET /api/assistance_listings/ — one page of CFDA program records.

Source

pub fn iterate_assistance_listings( &self, opts: ListAssistanceListingsOptions, ) -> PageStream<Record>

Stream every Assistance Listing record matching opts.

Source

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").

Source

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).

Source

pub fn iterate_business_types( &self, opts: ListBusinessTypesOptions, ) -> PageStream<Record>

Stream every business-type record matching opts.

Source

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.

Source

pub async fn list_offices( &self, opts: ListOfficesOptions, ) -> Result<Page<Record>>

GET /api/offices/ — one page of federal contracting office records.

Source

pub fn iterate_offices(&self, opts: ListOfficesOptions) -> PageStream<Record>

Stream every office record matching opts.

Source

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.

Source

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.

Source

pub fn iterate_departments( &self, opts: ListDepartmentsOptions, ) -> PageStream<Record>

Stream every department record matching opts.

Source

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

Source

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.

Source

pub async fn list_api_keys(&self, opts: ListApiKeysOptions) -> Result<Record>

GET /api/api-keys/ — return the authenticated caller’s API keys and associated metadata.

The server returns a single structured object today (no count / results envelope), so this returns a Record rather than a Page. Mirrors the Go SDK’s ListAPIKeys shape.

Source§

impl Client

Source

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.

Source

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.

Source

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_id is empty,
  • months == 0,
  • period_grouping is empty, or
  • owner_type isn’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

Source

pub async fn list_opportunities( &self, opts: ListOpportunitiesOptions, ) -> Result<Page<Record>>

GET /api/opportunities/ — one page of opportunity records.

Source

pub fn iterate_opportunities( &self, opts: ListOpportunitiesOptions, ) -> PageStream<Record>

Stream every opportunity matching opts.

Source

pub async fn list_notices( &self, opts: ListNoticesOptions, ) -> Result<Page<Record>>

GET /api/notices/ — one page of notice records.

Source

pub fn iterate_notices(&self, opts: ListNoticesOptions) -> PageStream<Record>

Stream every notice matching opts.

Source

pub async fn list_forecasts( &self, opts: ListForecastsOptions, ) -> Result<Page<Record>>

GET /api/forecasts/ — one page of forecast records.

Source

pub fn iterate_forecasts( &self, opts: ListForecastsOptions, ) -> PageStream<Record>

Stream every forecast matching opts.

Source

pub async fn list_grants(&self, opts: ListGrantsOptions) -> Result<Page<Record>>

GET /api/grants/ — one page of grant records.

Source

pub fn iterate_grants(&self, opts: ListGrantsOptions) -> PageStream<Record>

Stream every grant matching opts.

Source

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

Source

pub async fn list_otas(&self, opts: ListOTAsOptions) -> Result<Page<Record>>

GET /api/otas/ — one page of Other Transaction Authority award actions.

Source

pub async fn get_ota( &self, key: &str, opts: Option<GetOTAOptions>, ) -> Result<Record>

GET /api/otas/{key}/ — fetch a single OTA by key.

Source

pub fn iterate_otas(&self, opts: ListOTAsOptions) -> PageStream<Record>

Stream every OTA matching opts.

Source

pub async fn list_otidvs(&self, opts: ListOTIDVsOptions) -> Result<Page<Record>>

GET /api/otidvs/ — one page of Other Transaction IDV parent records.

Source

pub async fn get_otidv( &self, key: &str, opts: Option<GetOTIDVOptions>, ) -> Result<Record>

GET /api/otidvs/{key}/ — fetch a single OTIDV by key.

Source

pub fn iterate_otidvs(&self, opts: ListOTIDVsOptions) -> PageStream<Record>

Stream every OTIDV matching opts.

Source

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.

Source

pub fn iterate_otidv_awards( &self, key: &str, opts: ListOTIDVAwardsOptions, ) -> PageStream<Record>

Stream every child award under the given OTIDV parent.

Source§

impl Client

Source

pub async fn list_protests( &self, opts: ListProtestsOptions, ) -> Result<Page<Record>>

GET /api/protests/ — one page of bid-protest records.

Source

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.

Source

pub fn iterate_protests(&self, opts: ListProtestsOptions) -> PageStream<Record>

Stream every protest matching opts.

Source§

impl Client

Source

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).

Source

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

Source

pub async fn list_subawards( &self, opts: ListSubawardsOptions, ) -> Result<Page<Record>>

GET /api/subawards/ — one page of subaward records.

Source

pub fn iterate_subawards( &self, opts: ListSubawardsOptions, ) -> PageStream<Record>

Stream every subaward matching opts.

Source§

impl Client

Source

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.

Source

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.

Source

pub fn iterate_vehicle_awardees( &self, uuid: &str, opts: ListVehicleAwardeesOptions, ) -> PageStream<Record>

Stream every awardee under this contracting vehicle.

Source

pub fn iterate_vehicle_orders( &self, uuid: &str, opts: ListVehicleOrdersOptions, ) -> PageStream<Record>

Stream every task order placed under this contracting vehicle.

Source§

impl Client

Source

pub async fn list_vehicles( &self, opts: ListVehiclesOptions, ) -> Result<Page<Record>>

GET /api/vehicles/ — one page of contracting-vehicle records.

Source

pub async fn get_vehicle( &self, uuid: &str, opts: Option<GetVehicleOptions>, ) -> Result<Record>

GET /api/vehicles/{uuid}/ — fetch a single contracting vehicle.

Source

pub fn iterate_vehicles(&self, opts: ListVehiclesOptions) -> PageStream<Record>

Stream every contracting-vehicle record matching opts.

Source§

impl Client

Source

pub async fn list_webhook_event_types( &self, ) -> Result<WebhookEventTypesResponse>

GET /api/webhooks/event-types/ — list the event types the server can emit.

Source

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.

Source

pub async fn get_webhook_endpoint(&self, id: &str) -> Result<WebhookEndpoint>

GET /api/webhooks/endpoints/{id}/ — fetch a single endpoint.

Source

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.

Source

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.

Source

pub async fn delete_webhook_endpoint(&self, id: &str) -> Result<()>

DELETE /api/webhooks/endpoints/{id}/ — remove an endpoint.

Source

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.

Source

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.

Source

pub async fn list_webhook_alerts( &self, opts: ListOptions, ) -> Result<Page<WebhookAlert>>

GET /api/webhooks/alerts/ — list the caller’s filter-based subscriptions.

Source

pub async fn get_webhook_alert(&self, id: &str) -> Result<WebhookAlert>

GET /api/webhooks/alerts/{id}/ — fetch a single alert.

Source

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.

Source

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.

Source

pub async fn delete_webhook_alert(&self, id: &str) -> Result<()>

DELETE /api/webhooks/alerts/{id}/ — remove an alert.

Trait Implementations§

Source§

impl Clone for Client

Source§

fn clone(&self) -> Client

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Client

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more