use serde::{Deserialize, Serialize};
use crate::v2::model::matches::structs::matches::Match;
use crate::v2::model::score::structs::multiplayer::multiplayer_scores::Params;
use crate::v2::model::user::structs::country::Country;
#[cfg_attr(feature = "export", derive(tsify::Tsify))]
#[cfg_attr(feature = "export", tsify(into_wasm_abi, from_wasm_abi))]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GetMatchesListingResponse {
pub matches: Vec<Match>,
pub params: Params,
#[cfg_attr(feature = "export", tsify(type = "CursorInMatches"))]
pub cursor: Cursor,
pub cursor_string: String,
}
#[cfg_attr(feature = "export", derive(tsify::Tsify))]
#[cfg_attr(
feature = "export",
tsify(into_wasm_abi, from_wasm_abi, type_suffix = "InMatches")
)]
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Cursor {
pub match_id: u64,
}
#[cfg_attr(feature = "export", derive(tsify::Tsify))]
#[cfg_attr(feature = "export", tsify(into_wasm_abi, from_wasm_abi))]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GetMatchResponse {
#[serde(rename = "match")]
pub matchh: Match,
pub events: Vec<Event>,
#[cfg_attr(feature = "export", tsify(type = "UserInMatches[]"))]
pub users: Vec<User>,
pub first_event_id: u64,
pub latest_event_id: u64,
pub current_game_id: Option<u64>,
}
#[cfg_attr(feature = "export", derive(tsify::Tsify))]
#[cfg_attr(feature = "export", tsify(into_wasm_abi, from_wasm_abi))]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Event {
pub id: u64,
pub detail: Detail,
pub timestamp: String,
pub user_id: Option<u64>,
}
#[cfg_attr(feature = "export", derive(tsify::Tsify))]
#[cfg_attr(feature = "export", tsify(into_wasm_abi, from_wasm_abi))]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Detail {
#[serde(rename = "type")]
pub event_type: String,
}
#[cfg_attr(feature = "export", derive(tsify::Tsify))]
#[cfg_attr(
feature = "export",
tsify(into_wasm_abi, from_wasm_abi, type_suffix = "InMatches")
)]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct User {
pub avatar_url: String,
pub country_code: String,
pub default_group: String,
pub id: u64,
pub is_active: bool,
pub is_bot: bool,
pub is_deleted: bool,
pub is_online: bool,
pub is_supporter: bool,
pub last_visit: Option<String>,
pub pm_friends_only: bool,
pub profile_colour: Option<String>,
pub username: String,
#[cfg_attr(feature = "export", tsify(type = "Country"))]
pub country: Country,
}