pub struct SubscriptionResponse {
pub object: Option<String>,
pub has_payment_method: Option<bool>,
pub soft_limit_usd: Option<Cents>,
pub hard_limit_usd: Option<Cents>,
pub system_hard_limit_usd: Option<Cents>,
pub access_until: i64,
}Expand description
GET /v1/dashboard/billing/subscription — the key’s credit limit and
expiry. object, has_payment_method, and access_until are tolerated
absent (access_until: 0 also means “no expiry”).
Fields§
§object: Option<String>§has_payment_method: Option<bool>§soft_limit_usd: Option<Cents>§hard_limit_usd: Option<Cents>§system_hard_limit_usd: Option<Cents>§access_until: i64Implementations§
Source§impl SubscriptionResponse
impl SubscriptionResponse
Sourcepub fn limit_cents(&self) -> Option<i64>
pub fn limit_cents(&self) -> Option<i64>
The total credit limit in exact cents, or None when the key is
unlimited (sentinel) or reported no limit field at all.
The three wire fields are documented to carry the same value, so the
binding one (hard) is preferred and the others are fallbacks rather
than cross-checks — a deployment that disagrees with itself still gets
its most authoritative field, not a schema error.
Sourcepub fn access_until_at(&self) -> Option<DateTime<Utc>>
pub fn access_until_at(&self) -> Option<DateTime<Utc>>
Key expiry as a timestamp; None for 0 (and absent) — no expiry.
Trait Implementations§
Source§impl Clone for SubscriptionResponse
impl Clone for SubscriptionResponse
Source§impl Debug for SubscriptionResponse
impl Debug for SubscriptionResponse
Source§impl<'de> Deserialize<'de> for SubscriptionResponse
impl<'de> Deserialize<'de> for SubscriptionResponse
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SubscriptionResponse
impl RefUnwindSafe for SubscriptionResponse
impl Send for SubscriptionResponse
impl Sync for SubscriptionResponse
impl Unpin for SubscriptionResponse
impl UnsafeUnpin for SubscriptionResponse
impl UnwindSafe for SubscriptionResponse
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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