// AUTO-GENERATED by mizan — do not edit use serde::{Deserialize, Serialize}; use serde_json::Value; use mizan_rust::{MizanClient, MizanError}; use crate::types::{UserProfileOutput, UserOrdersOutput}; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct UserContextData { pub user_profile: UserProfileOutput, pub user_orders: UserOrdersOutput, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct UserContextParams { pub user_id: i64, } pub async fn fetch_user_context( client: &MizanClient, params: &UserContextParams, ) -> Result { let params_value = serde_json::to_value(params).unwrap_or(Value::Object(Default::default())); let raw = client.fetch_context("user", ¶ms_value).await?; serde_json::from_value(raw) .map_err(|e| MizanError::transport(format!("decode user context: {e}"))) }