| |
| |
| |
|
|
| use serde::Deserialize; |
| use serde::Serialize; |
|
|
| #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] |
| pub struct ActiveUsersSummary { |
| pub total_users: i64, |
| pub clients: Vec<ClientActiveUsersCount>, |
| pub models: Option<Vec<ModelActivitySummary>>, |
| } |
|
|
| #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] |
| pub struct ClientActiveUsersCount { |
| pub client_id: String, |
| pub users: i64, |
| } |
|
|
| #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] |
| pub struct ClientWorkspaceUsageCount { |
| pub client_id: String, |
| pub users: i64, |
| pub threads: i64, |
| pub turns: i64, |
| pub credits: f64, |
| pub cost_usd: Option<String>, |
| pub on_demand_credits: Option<f64>, |
| pub uncached_text_input_tokens: Option<i64>, |
| pub cached_text_input_tokens: Option<i64>, |
| pub text_output_tokens: Option<i64>, |
| pub text_total_tokens: Option<i64>, |
| } |
|
|
| #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] |
| pub struct ConsumptionUsageGroup { |
| pub dimensions: std::collections::BTreeMap<String, String>, |
| pub is_other: Option<bool>, |
| pub credits: f64, |
| pub on_demand_credits: Option<f64>, |
| pub uncached_text_input_tokens: Option<i64>, |
| pub cached_text_input_tokens: Option<i64>, |
| pub text_output_tokens: Option<i64>, |
| pub text_total_tokens: Option<i64>, |
| pub total_tokens: Option<i64>, |
| } |
|
|
| #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] |
| pub struct CreditUsageEventBySurface { |
| pub date: String, |
| pub product_surface: String, |
| pub credit_amount: f64, |
| pub usage_id: Option<String>, |
| } |
|
|
| #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] |
| pub struct CreditUsageEventsResponse { |
| pub data: Vec<CreditUsageEventBySurface>, |
| } |
|
|
| #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] |
| pub struct CurrentUserCreditUsageDatum { |
| pub date: String, |
| pub values: std::collections::BTreeMap<String, f64>, |
| } |
|
|
| #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] |
| pub struct CurrentUserCreditUsageResponse { |
| pub breakdown: String, |
| pub data: Vec<CurrentUserCreditUsageDatum>, |
| pub series: Vec<CurrentUserCreditUsageSeries>, |
| pub unit: Option<String>, |
| pub data_freshness_ts: Option<String>, |
| } |
|
|
| #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] |
| pub struct CurrentUserCreditUsageSeries { |
| pub key: String, |
| pub label: String, |
| pub total: f64, |
| } |
|
|
| #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] |
| pub struct DailyProductSurfaceUsage { |
| pub attribution: Option<Vec<PersonalUsageAttribution>>, |
| pub date: String, |
| pub product_surface_usage_values: std::collections::BTreeMap<String, f64>, |
| pub premium_usage_values: Option<ProductSurfacePremiumUsageValues>, |
| pub models: Option<Vec<ModelUsage>>, |
| pub groups: Option<Vec<ConsumptionUsageGroup>>, |
| } |
|
|
| #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] |
| pub struct DailyProductSurfaceUsageResponse { |
| pub data: Vec<DailyProductSurfaceUsage>, |
| pub units: Option<String>, |
| pub data_freshness_ts: Option<String>, |
| pub group_by: Option<String>, |
| pub breakdown_by: Option<Vec<String>>, |
| } |
|
|
| #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] |
| pub struct DailySkillUsageMetricsResponse { |
| pub data: Vec<DailySkillUsageOverview>, |
| pub data_freshness_ts: Option<String>, |
| pub group_by: Option<String>, |
| } |
|
|
| #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] |
| pub struct DailySkillUsageOverview { |
| pub date: String, |
| pub skill_usage_overviews: Vec<SkillUsageOverview>, |
| } |
|
|
| #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] |
| pub struct DailyWorkspaceUsageCount { |
| pub date: String, |
| pub totals: WorkspaceUsageCount, |
| pub clients: Vec<ClientWorkspaceUsageCount>, |
| pub models: Option<Vec<ModelUsage>>, |
| pub groups: Option<Vec<WorkspaceUsageGroup>>, |
| } |
|
|
| #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] |
| pub struct DailyWorkspaceUsageCountResponse { |
| pub data: Vec<DailyWorkspaceUsageCount>, |
| pub balance_unit: Option<String>, |
| pub active_users_summary: Option<ActiveUsersSummary>, |
| pub group_by: Option<String>, |
| pub breakdown_by: Option<Vec<String>>, |
| } |
|
|
| #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] |
| pub struct ModelActivitySummary { |
| pub model: String, |
| pub users: i64, |
| pub threads: i64, |
| pub turns: i64, |
| } |
|
|
| #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] |
| pub struct ModelUsage { |
| pub model: String, |
| pub speed: Option<String>, |
| pub credits: f64, |
| pub cost_usd: Option<String>, |
| pub users: Option<i64>, |
| pub threads: Option<i64>, |
| pub turns: Option<i64>, |
| pub on_demand_credits: Option<f64>, |
| pub uncached_text_input_tokens: Option<i64>, |
| pub cached_text_input_tokens: Option<i64>, |
| pub text_output_tokens: Option<i64>, |
| pub text_total_tokens: Option<i64>, |
| pub total_tokens: Option<i64>, |
| } |
|
|
| #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] |
| pub struct PersonalUsageAttribution { |
| pub thread_source: String, |
| pub turn_trigger: String, |
| pub model: String, |
| pub surface: String, |
| pub value: f64, |
| } |
|
|
| #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] |
| pub struct PluginUsageBucket { |
| pub date: String, |
| pub plugin_usage_overviews: Vec<PluginUsageOverview>, |
| } |
|
|
| #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] |
| pub struct PluginUsageMetricsResponse { |
| pub data: Vec<PluginUsageBucket>, |
| pub data_freshness_ts: Option<String>, |
| pub group_by: Option<String>, |
| } |
|
|
| #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] |
| pub struct PluginUsageOverview { |
| pub plugin_id: Option<String>, |
| pub plugin_name: String, |
| pub display_name: String, |
| pub marketplace: Option<String>, |
| pub invocation_counts: i64, |
| } |
|
|
| #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] |
| pub struct ProductSurfacePremiumUsageValues { |
| pub total_usage_credits: std::collections::BTreeMap<String, f64>, |
| pub credit_usage_credits: std::collections::BTreeMap<String, f64>, |
| pub uncached_text_input_tokens_by_surface: std::collections::BTreeMap<String, i64>, |
| pub cached_text_input_tokens_by_surface: std::collections::BTreeMap<String, i64>, |
| pub text_output_tokens_by_surface: std::collections::BTreeMap<String, i64>, |
| pub text_total_tokens_by_surface: std::collections::BTreeMap<String, i64>, |
| pub total_tokens_by_surface: Option<std::collections::BTreeMap<String, i64>>, |
| } |
|
|
| #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] |
| pub struct SkillUsageOverview { |
| pub skill_name: String, |
| pub display_name: String, |
| pub skill_ids: Vec<String>, |
| pub invocation_counts: i64, |
| } |
|
|
| #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] |
| pub struct WorkspaceUsageCount { |
| pub users: i64, |
| pub threads: i64, |
| pub turns: i64, |
| pub credits: f64, |
| pub cost_usd: Option<String>, |
| pub on_demand_credits: Option<f64>, |
| pub uncached_text_input_tokens: Option<i64>, |
| pub cached_text_input_tokens: Option<i64>, |
| pub text_output_tokens: Option<i64>, |
| pub text_total_tokens: Option<i64>, |
| } |
|
|
| #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] |
| pub struct WorkspaceUsageGroup { |
| pub dimensions: std::collections::BTreeMap<String, String>, |
| pub is_other: Option<bool>, |
| pub users: i64, |
| pub turns: i64, |
| pub cost_usd: Option<String>, |
| } |
|
|