pub struct Client { /* private fields */ }Expand description
Token-authenticated blocking REST client for CodingPlan endpoints.
Implementations§
Source§impl Client
impl Client
Sourcepub fn from_stored_auth() -> Result<Self>
pub fn from_stored_auth() -> Result<Self>
Build a client using the currently-stored OAuth token. Refreshes the token if expired. Errors with a user-facing message if the user isn’t logged in.
Sourcepub fn claim_v2(&self, plan_type: PlanType) -> Result<ClaimResponse>
pub fn claim_v2(&self, plan_type: PlanType) -> Result<ClaimResponse>
POST /coding-plan/claim-v2 — claim a specific CodingPlan tier.
Server reports duplicate=true when the user already holds the
tier (or a higher one); callers should treat that as success and
stop the cascade rather than retrying lower tiers — those would
either also report duplicate or unnecessarily downgrade.
Body shape: {"plan_type": "Max" | "Pro" | "Lite"}. The user
asked us to start at Max and walk down, so the orchestrator
(step_claim) calls this in PlanType::CASCADE_ORDER.
Sourcepub fn list_models_v2(&self, plan_type: PlanType) -> Result<Vec<ModelEntry>>
pub fn list_models_v2(&self, plan_type: PlanType) -> Result<Vec<ModelEntry>>
GET /coding-plan/models-v2?plan_type=<tier> — model catalogue
from the v2 endpoint. Every entry now carries plan_available
telling the caller whether the user’s tier covers that model;
the renderer uses it to apply strikethrough on locked entries.
Empty list is a legitimate return when the entitlement hasn’t
been provisioned yet.
Sourcepub fn status_v2(&self) -> Result<StatusResponse>
pub fn status_v2(&self) -> Result<StatusResponse>
GET /coding-plan/status-v2 — audit/quota/expiry snapshot. Same
response envelope as v1; only the path changed under the v2
rollout, so the parser type stays put.
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more