Skip to main content

BusinessUpgradeResource

Struct BusinessUpgradeResource 

Source
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>

Source

pub fn new(client: &'a Sendly) -> Self

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

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> 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> Same for T

Source§

type Output = T

Should always be Self
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