Spaces:
Sleeping
Sleeping
| use chrono::{DateTime, Local}; | |
| use serde::{Deserialize, Serialize}; | |
| pub enum GetUserInfo { | |
| Usage(TokenProfile), | |
| Error { error: String }, | |
| } | |
| pub struct TokenProfile { | |
| pub usage: UsageProfile, | |
| pub user: UserProfile, | |
| pub stripe: StripeProfile, | |
| } | |
| pub enum MembershipType { | |
| Free, | |
| FreeTrial, | |
| Pro, | |
| Enterprise, | |
| } | |
| pub struct StripeProfile { | |
| pub membership_type: MembershipType, | |
| pub payment_id: Option<String>, | |
| pub days_remaining_on_trial: u32, | |
| } | |
| pub struct ModelUsage { | |
| pub num_requests: u32, | |
| pub requests_total: Option<u32>, | |
| pub num_tokens: u32, | |
| pub max_requests: Option<u32>, | |
| pub max_tokens: Option<u32>, | |
| } | |
| pub struct UsageProfile { | |
| pub premium: ModelUsage, | |
| pub standard: ModelUsage, | |
| pub unknown: ModelUsage, | |
| } | |
| pub struct UserProfile { | |
| pub email: String, | |
| // pub email_verified: bool, | |
| pub name: String, | |
| pub sub: String, | |
| pub updated_at: DateTime<Local>, | |
| // Image link, rendered in /logs? | |
| // pub picture: Option<String>, | |
| } | |