Skip to main content

Overview

The UserDetailsResponse struct provides comprehensive user information including their associated organizations and workspaces.

Definition

pub struct UserDetailsResponse {
    pub user: User,
    pub organizations: Vec<serde_json::Value>,
    pub workspaces: Vec<serde_json::Value>,
}

Fields

user
User
required
The complete user object containing all user details.
organizations
Vec<serde_json::Value>
required
A vector of organizations the user belongs to. Each organization is represented as a JSON value.
workspaces
Vec<serde_json::Value>
required
A vector of workspaces the user has access to. Each workspace is represented as a JSON value.

Usage Example

use wacht::api::users::*;

let user_id = "user_123";
let response = fetch_user_details(user_id).await?;

println!("User: {} ({})", response.user.name, response.user.email);
println!("Member of {} organizations", response.organizations.len());
println!("Access to {} workspaces", response.workspaces.len());

// Process organizations
for org in response.organizations {
    if let Some(name) = org.get("name").and_then(|v| v.as_str()) {
        println!("Organization: {}", name);
    }
}

See Also