pub struct BillingInfo {Show 16 fields
pub total_credits_left: Option<i64>,
pub monthly_limit: Option<i64>,
pub monthly_usage: Option<i64>,
pub credits: Option<i64>,
pub period: Option<String>,
pub period_end: Option<String>,
pub renews_on: Option<String>,
pub is_active: Option<bool>,
pub is_paused: Option<bool>,
pub is_past_due: Option<bool>,
pub is_gifted: Option<bool>,
pub subscription_platform: Option<String>,
pub plan_key: Option<String>,
pub plan_name: Option<String>,
pub plan_level: Option<i64>,
pub features: BTreeSet<String>,
}Expand description
The authenticated account’s billing snapshot: credits, quota, account status, plan identity, and entitlements.
Every field is optional so a drifting payload never fails the parse; an
absent field reads as “unknown”, not zero. Numbers are signed because the
API returns negatives (e.g. the -1 sentinel), and features is a plain
string set rather than an enum so new entitlement flags surface without a
code change.
Fields§
§total_credits_left: Option<i64>Credits remaining in the current billing state.
monthly_limit: Option<i64>Monthly credit allotment (the quota denominator).
monthly_usage: Option<i64>Credits consumed this period (the quota numerator).
credits: Option<i64>Add-on, non-monthly credit balance.
period: Option<String>Billing period unit, e.g. "month".
period_end: Option<String>Current period end (ISO8601), when usage resets.
renews_on: Option<String>Next renewal (ISO8601).
is_active: Option<bool>Whether the subscription is active.
is_paused: Option<bool>Whether the subscription is paused (paused subs stop refreshing credits).
is_past_due: Option<bool>Whether payment is failing (credits may stop refreshing).
is_gifted: Option<bool>Whether the subscription is gifted.
subscription_platform: Option<String>Subscription platform, e.g. "stripe".
plan_key: Option<String>Stable machine key for the plan tier, e.g. "pro".
plan_name: Option<String>Human plan label, e.g. "Pro Plan".
plan_level: Option<i64>Plan tier rank (free 0, pro 10, premier 30).
features: BTreeSet<String>Entitlement flags, the union of accessible_features[].name and
plan.usage_plan_features[].name.
Implementations§
Source§impl BillingInfo
impl BillingInfo
Sourcepub fn has_feature(&self, name: &str) -> bool
pub fn has_feature(&self, name: &str) -> bool
Whether the account is entitled to the named feature.
Sourcepub fn can_get_stems(&self) -> bool
pub fn can_get_stems(&self) -> bool
Whether the account may separate stems.
Sourcepub fn can_convert_audio(&self) -> bool
pub fn can_convert_audio(&self) -> bool
Whether the account may convert audio to lossless.
Trait Implementations§
Source§impl Clone for BillingInfo
impl Clone for BillingInfo
Source§fn clone(&self) -> BillingInfo
fn clone(&self) -> BillingInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BillingInfo
impl Debug for BillingInfo
Source§impl Default for BillingInfo
impl Default for BillingInfo
Source§fn default() -> BillingInfo
fn default() -> BillingInfo
impl Eq for BillingInfo
Source§impl PartialEq for BillingInfo
impl PartialEq for BillingInfo
Source§fn eq(&self, other: &BillingInfo) -> bool
fn eq(&self, other: &BillingInfo) -> bool
self and other values to be equal, and is used by ==.