// @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;
use jacquard_common::types::string::AtUri;
use jacquard_derive::{IntoStatic, lexicon};
use serde::{Serialize, Deserialize};
use crate::games_gamesgamesgamesgames::GameDetailView;

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct GetGame<'a> {
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub apple_app_store_id: Option<CowStr<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub epic_games_id: Option<CowStr<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub gog_id: Option<CowStr<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub google_play_id: Option<CowStr<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub humble_bundle_id: Option<CowStr<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub igdb_id: Option<CowStr<'a>>,
    #[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")]
    #[serde(borrow)]
    pub nintendo_eshop_id: Option<CowStr<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub play_station_id: Option<CowStr<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub slug: Option<CowStr<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub steam_id: Option<CowStr<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub uri: Option<AtUri<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub xbox_id: Option<CowStr<'a>>,
}


#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct GetGameOutput<'a> {
    #[serde(borrow)]
    pub game: GameDetailView<'a>,
}

/// Response type for games.gamesgamesgamesgames.getGame
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<'de> = GetGameOutput<'de>;
    type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
}

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

/// Endpoint type for games.gamesgamesgamesgames.getGame
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<'de> = GetGame<'de>;
    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<'a, S: get_game_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (
        Option<CowStr<'a>>,
        Option<CowStr<'a>>,
        Option<CowStr<'a>>,
        Option<CowStr<'a>>,
        Option<CowStr<'a>>,
        Option<CowStr<'a>>,
        Option<bool>,
        Option<bool>,
        Option<CowStr<'a>>,
        Option<CowStr<'a>>,
        Option<CowStr<'a>>,
        Option<CowStr<'a>>,
        Option<AtUri<'a>>,
        Option<CowStr<'a>>,
    ),
    _lifetime: PhantomData<&'a ()>,
}

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

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

impl<'a, S: get_game_state::State> GetGameBuilder<'a, S> {
    /// Set the `appleAppStoreId` field (optional)
    pub fn apple_app_store_id(mut self, value: impl Into<Option<CowStr<'a>>>) -> 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<CowStr<'a>>) -> Self {
        self._fields.0 = value;
        self
    }
}

impl<'a, S: get_game_state::State> GetGameBuilder<'a, S> {
    /// Set the `epicGamesId` field (optional)
    pub fn epic_games_id(mut self, value: impl Into<Option<CowStr<'a>>>) -> 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<CowStr<'a>>) -> Self {
        self._fields.1 = value;
        self
    }
}

impl<'a, S: get_game_state::State> GetGameBuilder<'a, S> {
    /// Set the `gogId` field (optional)
    pub fn gog_id(mut self, value: impl Into<Option<CowStr<'a>>>) -> 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<CowStr<'a>>) -> Self {
        self._fields.2 = value;
        self
    }
}

impl<'a, S: get_game_state::State> GetGameBuilder<'a, S> {
    /// Set the `googlePlayId` field (optional)
    pub fn google_play_id(mut self, value: impl Into<Option<CowStr<'a>>>) -> 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<CowStr<'a>>) -> Self {
        self._fields.3 = value;
        self
    }
}

impl<'a, S: get_game_state::State> GetGameBuilder<'a, S> {
    /// Set the `humbleBundleId` field (optional)
    pub fn humble_bundle_id(mut self, value: impl Into<Option<CowStr<'a>>>) -> 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<CowStr<'a>>) -> Self {
        self._fields.4 = value;
        self
    }
}

impl<'a, S: get_game_state::State> GetGameBuilder<'a, S> {
    /// Set the `igdbId` field (optional)
    pub fn igdb_id(mut self, value: impl Into<Option<CowStr<'a>>>) -> 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<CowStr<'a>>) -> Self {
        self._fields.5 = value;
        self
    }
}

impl<'a, S: get_game_state::State> GetGameBuilder<'a, 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<'a, S: get_game_state::State> GetGameBuilder<'a, 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<'a, S: get_game_state::State> GetGameBuilder<'a, S> {
    /// Set the `nintendoEshopId` field (optional)
    pub fn nintendo_eshop_id(mut self, value: impl Into<Option<CowStr<'a>>>) -> 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<CowStr<'a>>) -> Self {
        self._fields.8 = value;
        self
    }
}

impl<'a, S: get_game_state::State> GetGameBuilder<'a, S> {
    /// Set the `playStationId` field (optional)
    pub fn play_station_id(mut self, value: impl Into<Option<CowStr<'a>>>) -> 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<CowStr<'a>>) -> Self {
        self._fields.9 = value;
        self
    }
}

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

impl<'a, S: get_game_state::State> GetGameBuilder<'a, S> {
    /// Set the `steamId` field (optional)
    pub fn steam_id(mut self, value: impl Into<Option<CowStr<'a>>>) -> 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<CowStr<'a>>) -> Self {
        self._fields.11 = value;
        self
    }
}

impl<'a, S: get_game_state::State> GetGameBuilder<'a, S> {
    /// Set the `uri` field (optional)
    pub fn uri(mut self, value: impl Into<Option<AtUri<'a>>>) -> 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<'a>>) -> Self {
        self._fields.12 = value;
        self
    }
}

impl<'a, S: get_game_state::State> GetGameBuilder<'a, S> {
    /// Set the `xboxId` field (optional)
    pub fn xbox_id(mut self, value: impl Into<Option<CowStr<'a>>>) -> 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<CowStr<'a>>) -> Self {
        self._fields.13 = value;
        self
    }
}

impl<'a, S> GetGameBuilder<'a, S>
where
    S: get_game_state::State,
{
    /// Build the final struct
    pub fn build(self) -> GetGame<'a> {
        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,
        }
    }
}