pub struct GrokCreditsConfig {
pub credit_usage_percent: f64,
pub current_period: Option<GrokUsagePeriod>,
pub on_demand_cap: Option<GrokMoney>,
pub on_demand_used: Option<GrokMoney>,
pub prepaid_balance: Option<GrokMoney>,
pub billing_period_end: Option<String>,
}Expand description
The config object of a Grok credits response (subset we read).
This is a proto3 GetGrokCreditsConfig rendered as JSON, so every
zero-valued scalar may be omitted — including the headline
creditUsagePercent. Every field is therefore optional and an absent one
reads as zero, never as an error. The wire response is a superset of the
fields below (a live account also returns topUpMethod), so unknown keys are
ignored rather than rejected.
Fields§
§credit_usage_percent: f64Included-allowance usage (0..100) — what the CLI status bar shows.
current_period: Option<GrokUsagePeriod>The current billing period (weekly or monthly) with its RFC3339 bounds.
on_demand_cap: Option<GrokMoney>Pay-as-you-go cap for this period.
on_demand_used: Option<GrokMoney>Pay-as-you-go spend this period.
prepaid_balance: Option<GrokMoney>Remaining purchased (“bought”) credit balance.
billing_period_end: Option<String>Deprecated legacy period end, still emitted by older servers; the
fallback reset time when current_period is absent.
Trait Implementations§
Source§impl Clone for GrokCreditsConfig
impl Clone for GrokCreditsConfig
Source§fn clone(&self) -> GrokCreditsConfig
fn clone(&self) -> GrokCreditsConfig
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 GrokCreditsConfig
impl Debug for GrokCreditsConfig
Source§impl<'de> Deserialize<'de> for GrokCreditsConfig
impl<'de> Deserialize<'de> for GrokCreditsConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for GrokCreditsConfig
impl RefUnwindSafe for GrokCreditsConfig
impl Send for GrokCreditsConfig
impl Sync for GrokCreditsConfig
impl Unpin for GrokCreditsConfig
impl UnsafeUnpin for GrokCreditsConfig
impl UnwindSafe for GrokCreditsConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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