use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct ApiError {
pub code: u32,
pub message: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub field: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub user_facing_message: Option<String>,
}
#[derive(Serialize, Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct ApiErrors {
pub errors: Vec<ApiError>,
}
#[derive(Serialize, Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct Group {
pub id: u64,
pub name: String,
pub description: String,
pub owner: Option<GroupUser>,
pub shout: Option<GroupShout>,
pub member_count: u64,
pub is_builders_club_only: bool,
pub public_entry_allowed: bool,
pub is_locked: Option<bool>,
pub has_verified_badge: bool,
}
#[derive(Serialize, Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct GroupUser {
pub builders_club_membership_type: Option<u64>,
pub has_verified_badge: bool,
pub user_id: u64,
pub username: String,
pub display_name: String,
}
#[derive(Serialize, Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct GroupShout {
pub body: String,
pub poster: GroupUser,
pub created: String,
pub updated: String,
}
#[derive(Serialize, Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct AuditPage {
pub previous_page_cursor: Option<String>,
pub next_page_cursor: Option<String>,
pub data: Vec<Option<AuditItem>>,
}
#[derive(Serialize, Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct AuditItem {
pub actor: AuditItemActor,
pub action_type: String,
pub description: serde_json::Value,
pub created: String,
}
#[derive(Serialize, Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct AuditItemActor {
pub user: GroupUser,
pub role: Role,
}
#[derive(Serialize, Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct Role {
pub id: u64,
pub name: String,
pub description: Option<String>,
pub rank: u64,
pub member_count: Option<u64>,
}