//! Generated from Pokémon GO masterfile — VsSeekerPokemonRewards.

use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Range {
    pub max: u64,
    pub min: u64,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AttackIvOverride {
    pub range: Range,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PokemonDisplay {
    pub form: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Pokemon {
    pub pokemon_display: PokemonDisplay,
    pub pokemon_id: String,
    pub shiny_probability: f64,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct GuaranteedLimitedPokemonReward {
    pub identifier: String,
    pub per_competitive_combat_season_max_count: u64,
    pub pokemon: Pokemon,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AvailablePokemon {
    pub attack_iv_override: AttackIvOverride,
    pub defense_iv_override: AttackIvOverride,
    pub guaranteed_limited_pokemon_reward: GuaranteedLimitedPokemonReward,
    pub stamina_iv_override: AttackIvOverride,
    pub unlocked_at_rank: u64,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PokemonV2 {
    pub pokemon_display: PokemonDisplay,
    pub pokemon_id: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct GuaranteedLimitedPokemonRewardV2 {
    pub identifier: String,
    pub lifetime_max_count: u64,
    pub pokemon: PokemonV2,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AvailablePokemonV2 {
    pub attack_iv_override: AttackIvOverride,
    pub defense_iv_override: AttackIvOverride,
    pub guaranteed_limited_pokemon_reward: GuaranteedLimitedPokemonRewardV2,
    pub stamina_iv_override: AttackIvOverride,
    pub unlocked_at_rank: u64,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AvailablePokemonV3 {
    pub attack_iv_override: AttackIvOverride,
    pub defense_iv_override: AttackIvOverride,
    pub pokemon: PokemonV2,
    pub stamina_iv_override: AttackIvOverride,
    pub unlocked_at_rank: u64,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PokemonV3 {
    pub pokemon_display: PokemonDisplay,
    pub pokemon_id: String,
    pub shiny_probability: Option<f64>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct GuaranteedLimitedPokemonRewardV3 {
    pub identifier: String,
    pub lifetime_max_count: Option<u64>,
    pub per_competitive_combat_season_max_count: Option<u64>,
    pub pokemon: PokemonV3,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AvailablePokemonV4 {
    pub attack_iv_override: AttackIvOverride,
    pub defense_iv_override: AttackIvOverride,
    pub guaranteed_limited_pokemon_reward: Option<GuaranteedLimitedPokemonRewardV3>,
    pub pokemon: Option<PokemonV2>,
    pub stamina_iv_override: AttackIvOverride,
    pub unlocked_at_rank: u64,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Misc {
    pub available_pokemon: Vec<AvailablePokemonV4>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct RewardTrack {
    pub available_pokemon: Vec<AvailablePokemonV4>,
    pub reward_track: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum VsSeekerPokemonRewards {
    Misc(Misc),
    RewardTrack(RewardTrack),
}

crate::masterfile_entry!(VsSeekerPokemonRewardsEntry, VsSeekerPokemonRewardsEntryData, vs_seeker_pokemon_rewards: VsSeekerPokemonRewards);
