// @generated by jacquard-lexicon. DO NOT EDIT.
//
// Lexicon: games.gamesgamesgamesgames.getGame
//
// This file was automatically generated from Lexicon schemas.
// Any manual changes will be overwritten on the next regeneration.

#[allow(unused_imports)]
use alloc::collections::BTreeMap;

#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr};
use jacquard_common::deps::smol_str::SmolStr;
use jacquard_common::types::string::AtUri;
use jacquard_common::types::value::Data;
use jacquard_derive::IntoStatic;
use serde::{Serialize, Deserialize};
use crate::games_gamesgamesgamesgames::GameDetailView;

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct GetGame<S: BosStr = DefaultStr> {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub apple_app_store_id: Option<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub epic_games_id: Option<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub gog_id: Option<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub google_play_id: Option<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub humble_bundle_id: Option<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub igdb_id: Option<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub include_actor_credits: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub include_org_credits: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub nintendo_eshop_id: Option<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub play_station_id: Option<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub slug: Option<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub steam_id: Option<S>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub uri: Option<AtUri<S>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub xbox_id: Option<S>,
}


#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct GetGameOutput<S: BosStr = DefaultStr> {
    pub game: GameDetailView<S>,
    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}

/** Response marker for the `games.gamesgamesgamesgames.getGame` query.

Implements `jacquard_common::xrpc::XrpcResp`; successful bodies decode as `Self::Output<S>`, which is `GetGameOutput<S>` for this endpoint.*/
pub struct GetGameResponse;
impl jacquard_common::xrpc::XrpcResp for GetGameResponse {
    const NSID: &'static str = "games.gamesgamesgamesgames.getGame";
    const ENCODING: &'static str = "application/json";
    type Output<S: BosStr> = GetGameOutput<S>;
    type Err = jacquard_common::xrpc::GenericError;
}

impl<S: BosStr> jacquard_common::xrpc::XrpcRequest for GetGame<S> {
    const NSID: &'static str = "games.gamesgamesgamesgames.getGame";
    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
    type Response = GetGameResponse;
}

/** Endpoint marker for the `games.gamesgamesgamesgames.getGame` query.

Path: `/xrpc/games.gamesgamesgamesgames.getGame`. The request payload type is `GetGame<S>`; send that request with `jacquard::Client` or use this marker through lower-level `XrpcEndpoint` APIs.*/
pub struct GetGameRequest;
impl jacquard_common::xrpc::XrpcEndpoint for GetGameRequest {
    const PATH: &'static str = "/xrpc/games.gamesgamesgamesgames.getGame";
    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
    type Request<S: BosStr> = GetGame<S>;
    type Response = GetGameResponse;
}

pub mod get_game_state {

    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
    #[allow(unused)]
    use ::core::marker::PhantomData;
    mod sealed {
        pub trait Sealed {}
    }
    /// State trait tracking which required fields have been set
    pub trait State: sealed::Sealed {}
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {}
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {}
}

/// Builder for constructing an instance of this type.
pub struct GetGameBuilder<St: get_game_state::State, S: BosStr = DefaultStr> {
    _state: PhantomData<fn() -> St>,
    _fields: (
        Option<S>,
        Option<S>,
        Option<S>,
        Option<S>,
        Option<S>,
        Option<S>,
        Option<bool>,
        Option<bool>,
        Option<S>,
        Option<S>,
        Option<S>,
        Option<S>,
        Option<AtUri<S>>,
        Option<S>,
    ),
    _type: PhantomData<fn() -> S>,
}

impl GetGame<DefaultStr> {
    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
    pub fn new() -> GetGameBuilder<get_game_state::Empty, DefaultStr> {
        GetGameBuilder::new()
    }
}

impl<S: BosStr> GetGame<S> {
    /// Create a new builder for this type
    pub fn builder() -> GetGameBuilder<get_game_state::Empty, S> {
        GetGameBuilder::builder()
    }
}

impl GetGameBuilder<get_game_state::Empty, DefaultStr> {
    /// Create a new builder with all fields unset, using the default string type, if needed
    pub fn new() -> Self {
        GetGameBuilder {
            _state: PhantomData,
            _fields: (
                None,
                None,
                None,
                None,
                None,
                None,
                None,
                None,
                None,
                None,
                None,
                None,
                None,
                None,
            ),
            _type: PhantomData,
        }
    }
}

impl<S: BosStr> GetGameBuilder<get_game_state::Empty, S> {
    /// Create a new builder with all fields unset
    pub fn builder() -> Self {
        GetGameBuilder {
            _state: PhantomData,
            _fields: (
                None,
                None,
                None,
                None,
                None,
                None,
                None,
                None,
                None,
                None,
                None,
                None,
                None,
                None,
            ),
            _type: PhantomData,
        }
    }
}

impl<St: get_game_state::State, S: BosStr> GetGameBuilder<St, S> {
    /// Set the `appleAppStoreId` field (optional)
    pub fn apple_app_store_id(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.0 = value.into();
        self
    }
    /// Set the `appleAppStoreId` field to an Option value (optional)
    pub fn maybe_apple_app_store_id(mut self, value: Option<S>) -> Self {
        self._fields.0 = value;
        self
    }
}

impl<St: get_game_state::State, S: BosStr> GetGameBuilder<St, S> {
    /// Set the `epicGamesId` field (optional)
    pub fn epic_games_id(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.1 = value.into();
        self
    }
    /// Set the `epicGamesId` field to an Option value (optional)
    pub fn maybe_epic_games_id(mut self, value: Option<S>) -> Self {
        self._fields.1 = value;
        self
    }
}

impl<St: get_game_state::State, S: BosStr> GetGameBuilder<St, S> {
    /// Set the `gogId` field (optional)
    pub fn gog_id(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.2 = value.into();
        self
    }
    /// Set the `gogId` field to an Option value (optional)
    pub fn maybe_gog_id(mut self, value: Option<S>) -> Self {
        self._fields.2 = value;
        self
    }
}

impl<St: get_game_state::State, S: BosStr> GetGameBuilder<St, S> {
    /// Set the `googlePlayId` field (optional)
    pub fn google_play_id(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.3 = value.into();
        self
    }
    /// Set the `googlePlayId` field to an Option value (optional)
    pub fn maybe_google_play_id(mut self, value: Option<S>) -> Self {
        self._fields.3 = value;
        self
    }
}

impl<St: get_game_state::State, S: BosStr> GetGameBuilder<St, S> {
    /// Set the `humbleBundleId` field (optional)
    pub fn humble_bundle_id(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.4 = value.into();
        self
    }
    /// Set the `humbleBundleId` field to an Option value (optional)
    pub fn maybe_humble_bundle_id(mut self, value: Option<S>) -> Self {
        self._fields.4 = value;
        self
    }
}

impl<St: get_game_state::State, S: BosStr> GetGameBuilder<St, S> {
    /// Set the `igdbId` field (optional)
    pub fn igdb_id(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.5 = value.into();
        self
    }
    /// Set the `igdbId` field to an Option value (optional)
    pub fn maybe_igdb_id(mut self, value: Option<S>) -> Self {
        self._fields.5 = value;
        self
    }
}

impl<St: get_game_state::State, S: BosStr> GetGameBuilder<St, S> {
    /// Set the `includeActorCredits` field (optional)
    pub fn include_actor_credits(mut self, value: impl Into<Option<bool>>) -> Self {
        self._fields.6 = value.into();
        self
    }
    /// Set the `includeActorCredits` field to an Option value (optional)
    pub fn maybe_include_actor_credits(mut self, value: Option<bool>) -> Self {
        self._fields.6 = value;
        self
    }
}

impl<St: get_game_state::State, S: BosStr> GetGameBuilder<St, S> {
    /// Set the `includeOrgCredits` field (optional)
    pub fn include_org_credits(mut self, value: impl Into<Option<bool>>) -> Self {
        self._fields.7 = value.into();
        self
    }
    /// Set the `includeOrgCredits` field to an Option value (optional)
    pub fn maybe_include_org_credits(mut self, value: Option<bool>) -> Self {
        self._fields.7 = value;
        self
    }
}

impl<St: get_game_state::State, S: BosStr> GetGameBuilder<St, S> {
    /// Set the `nintendoEshopId` field (optional)
    pub fn nintendo_eshop_id(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.8 = value.into();
        self
    }
    /// Set the `nintendoEshopId` field to an Option value (optional)
    pub fn maybe_nintendo_eshop_id(mut self, value: Option<S>) -> Self {
        self._fields.8 = value;
        self
    }
}

impl<St: get_game_state::State, S: BosStr> GetGameBuilder<St, S> {
    /// Set the `playStationId` field (optional)
    pub fn play_station_id(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.9 = value.into();
        self
    }
    /// Set the `playStationId` field to an Option value (optional)
    pub fn maybe_play_station_id(mut self, value: Option<S>) -> Self {
        self._fields.9 = value;
        self
    }
}

impl<St: get_game_state::State, S: BosStr> GetGameBuilder<St, S> {
    /// Set the `slug` field (optional)
    pub fn slug(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.10 = value.into();
        self
    }
    /// Set the `slug` field to an Option value (optional)
    pub fn maybe_slug(mut self, value: Option<S>) -> Self {
        self._fields.10 = value;
        self
    }
}

impl<St: get_game_state::State, S: BosStr> GetGameBuilder<St, S> {
    /// Set the `steamId` field (optional)
    pub fn steam_id(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.11 = value.into();
        self
    }
    /// Set the `steamId` field to an Option value (optional)
    pub fn maybe_steam_id(mut self, value: Option<S>) -> Self {
        self._fields.11 = value;
        self
    }
}

impl<St: get_game_state::State, S: BosStr> GetGameBuilder<St, S> {
    /// Set the `uri` field (optional)
    pub fn uri(mut self, value: impl Into<Option<AtUri<S>>>) -> Self {
        self._fields.12 = value.into();
        self
    }
    /// Set the `uri` field to an Option value (optional)
    pub fn maybe_uri(mut self, value: Option<AtUri<S>>) -> Self {
        self._fields.12 = value;
        self
    }
}

impl<St: get_game_state::State, S: BosStr> GetGameBuilder<St, S> {
    /// Set the `xboxId` field (optional)
    pub fn xbox_id(mut self, value: impl Into<Option<S>>) -> Self {
        self._fields.13 = value.into();
        self
    }
    /// Set the `xboxId` field to an Option value (optional)
    pub fn maybe_xbox_id(mut self, value: Option<S>) -> Self {
        self._fields.13 = value;
        self
    }
}

impl<St, S: BosStr> GetGameBuilder<St, S>
where
    St: get_game_state::State,
{
    /// Build the final struct.
    pub fn build(self) -> GetGame<S> {
        GetGame {
            apple_app_store_id: self._fields.0,
            epic_games_id: self._fields.1,
            gog_id: self._fields.2,
            google_play_id: self._fields.3,
            humble_bundle_id: self._fields.4,
            igdb_id: self._fields.5,
            include_actor_credits: self._fields.6,
            include_org_credits: self._fields.7,
            nintendo_eshop_id: self._fields.8,
            play_station_id: self._fields.9,
            slug: self._fields.10,
            steam_id: self._fields.11,
            uri: self._fields.12,
            xbox_id: self._fields.13,
        }
    }
}