pub struct UsageResponse {
pub five_hour: Option<Window>,
pub seven_day: Option<Window>,
pub seven_day_sonnet: Option<Window>,
pub extra_usage: Option<ExtraUsageBlock>,
}Expand description
Top-level response from GET /api/oauth/usage.
Fields§
§five_hour: Option<Window>§seven_day: Option<Window>§seven_day_sonnet: Option<Window>§extra_usage: Option<ExtraUsageBlock>Implementations§
Source§impl UsageResponse
impl UsageResponse
Sourcepub fn into_snapshot(self, plan_label: String) -> AnthropicSnapshot
pub fn into_snapshot(self, plan_label: String) -> AnthropicSnapshot
Lift the wire response into our canonical AnthropicSnapshot.
plan_label is the rendered plan name (“Max 5x” etc.), derived from
the credentials file (since the usage endpoint doesn’t include it).
Trait Implementations§
Source§impl Clone for UsageResponse
impl Clone for UsageResponse
Source§fn clone(&self) -> UsageResponse
fn clone(&self) -> UsageResponse
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UsageResponse
impl Debug for UsageResponse
Source§impl Default for UsageResponse
impl Default for UsageResponse
Source§fn default() -> UsageResponse
fn default() -> UsageResponse
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for UsageResponse
impl<'de> Deserialize<'de> for UsageResponse
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
Source§impl PartialEq for UsageResponse
impl PartialEq for UsageResponse
Source§fn eq(&self, other: &UsageResponse) -> bool
fn eq(&self, other: &UsageResponse) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for UsageResponse
impl Serialize for UsageResponse
impl StructuralPartialEq for UsageResponse
Auto Trait Implementations§
impl Freeze for UsageResponse
impl RefUnwindSafe for UsageResponse
impl Send for UsageResponse
impl Sync for UsageResponse
impl Unpin for UsageResponse
impl UnsafeUnpin for UsageResponse
impl UnwindSafe for UsageResponse
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