pub struct BusinessUpgradeResource<'a> { /* private fields */ }Expand description
Business-upgrade (“fork-with-new-number”) resource.
§Example
use sendly::{Sendly, business_upgrade::{PreflightCandidate, BrnType, EntityType}};
let client = Sendly::new("sk_live_v1_xxx");
let report = client.business_upgrade().preflight(PreflightCandidate {
business_name: "Acme Holdings LLC".to_string(),
brn: "12-3456789".to_string(),
brn_type: BrnType::Ein,
brn_country: "US".to_string(),
entity_type: EntityType::PrivateProfit,
..Default::default()
}).await?;
println!("Verdict: {:?}", report.verdict);Implementations§
Source§impl<'a> BusinessUpgradeResource<'a>
impl<'a> BusinessUpgradeResource<'a>
pub fn new(client: &'a Sendly) -> Self
Sourcepub async fn preflight(
&self,
candidate: PreflightCandidate,
) -> Result<PreflightReport>
pub async fn preflight( &self, candidate: PreflightCandidate, ) -> Result<PreflightReport>
Validate a candidate entity-upgrade payload before submission. Returns issues + proposed auto-fixes — purely advisory, no writes.
Sourcepub async fn best_prefill(&self) -> Result<BestPrefillResponse>
pub async fn best_prefill(&self) -> Result<BestPrefillResponse>
Best-of prefill across all the caller’s verified workspaces. Returns the most-recent non-empty value per messaging field — useful for pre-populating the upgrade form.
Sourcepub async fn start(
&self,
workspace_id: &str,
request: StartUpgradeRequest,
ein_doc: Option<EinDocument>,
) -> Result<StartUpgradeResponse>
pub async fn start( &self, workspace_id: &str, request: StartUpgradeRequest, ein_doc: Option<EinDocument>, ) -> Result<StartUpgradeResponse>
Start an entity upgrade for the given workspace. Auto-provisions a new toll-free number + messaging profile and submits to the carrier. The current number keeps sending during the 1-2 week review; on approval the new number is promoted atomically.
Sourcepub async fn status(&self, workspace_id: &str) -> Result<UpgradeStatusResponse>
pub async fn status(&self, workspace_id: &str) -> Result<UpgradeStatusResponse>
Whether the given workspace has a pending entity upgrade. Returns
{ pending: None } when no upgrade is in flight.
Sourcepub async fn cancel(&self, workspace_id: &str) -> Result<CancelUpgradeResponse>
pub async fn cancel(&self, workspace_id: &str) -> Result<CancelUpgradeResponse>
Cancel a pending entity upgrade — releases the reserved number, deletes the new messaging profile, removes the stored EIN doc. Idempotent.
Sourcepub async fn resubmit(
&self,
workspace_id: &str,
request: ResubmitUpgradeRequest,
ein_doc: Option<EinDocument>,
) -> Result<ResubmitUpgradeResponse>
pub async fn resubmit( &self, workspace_id: &str, request: ResubmitUpgradeRequest, ein_doc: Option<EinDocument>, ) -> Result<ResubmitUpgradeResponse>
Resubmit a rejected (or waiting-for-customer) entity upgrade with updated fields and optionally a new EIN document.
Sourcepub async fn set_disposition(
&self,
workspace_id: &str,
request: SetDispositionRequest,
) -> Result<DispositionResponse>
pub async fn set_disposition( &self, workspace_id: &str, request: SetDispositionRequest, ) -> Result<DispositionResponse>
After approval, choose what happens to the old number — Moved to
another workspace owned by the same user, or Released back to the
carrier pool.