#[allow(unused_imports)]
use alloc::collections::BTreeMap;
use crate::games_gamesgamesgamesgames::GameDetailView;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::deps::smol_str::SmolStr;
use jacquard_common::types::string::AtUri;
use jacquard_common::types::value::Data;
use jacquard_common::{BosStr, CowStr, DefaultStr, FromStaticStr};
use jacquard_derive::IntoStatic;
use serde::{Deserialize, Serialize};
#[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>>>,
}
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;
}
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::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {}
#[allow(non_camel_case_types)]
pub mod members {}
}
pub struct GetGameBuilder<S: BosStr, St: get_game_state::State> {
_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<S: BosStr> GetGame<S> {
pub fn new() -> GetGameBuilder<S, get_game_state::Empty> {
GetGameBuilder::new()
}
}
impl<S: BosStr> GetGameBuilder<S, get_game_state::Empty> {
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, St: get_game_state::State> GetGameBuilder<S, St> {
pub fn apple_app_store_id(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_apple_app_store_id(mut self, value: Option<S>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St: get_game_state::State> GetGameBuilder<S, St> {
pub fn epic_games_id(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_epic_games_id(mut self, value: Option<S>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St: get_game_state::State> GetGameBuilder<S, St> {
pub fn gog_id(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_gog_id(mut self, value: Option<S>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St: get_game_state::State> GetGameBuilder<S, St> {
pub fn google_play_id(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_google_play_id(mut self, value: Option<S>) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St: get_game_state::State> GetGameBuilder<S, St> {
pub fn humble_bundle_id(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_humble_bundle_id(mut self, value: Option<S>) -> Self {
self._fields.4 = value;
self
}
}
impl<S: BosStr, St: get_game_state::State> GetGameBuilder<S, St> {
pub fn igdb_id(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_igdb_id(mut self, value: Option<S>) -> Self {
self._fields.5 = value;
self
}
}
impl<S: BosStr, St: get_game_state::State> GetGameBuilder<S, St> {
pub fn include_actor_credits(mut self, value: impl Into<Option<bool>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_include_actor_credits(mut self, value: Option<bool>) -> Self {
self._fields.6 = value;
self
}
}
impl<S: BosStr, St: get_game_state::State> GetGameBuilder<S, St> {
pub fn include_org_credits(mut self, value: impl Into<Option<bool>>) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_include_org_credits(mut self, value: Option<bool>) -> Self {
self._fields.7 = value;
self
}
}
impl<S: BosStr, St: get_game_state::State> GetGameBuilder<S, St> {
pub fn nintendo_eshop_id(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.8 = value.into();
self
}
pub fn maybe_nintendo_eshop_id(mut self, value: Option<S>) -> Self {
self._fields.8 = value;
self
}
}
impl<S: BosStr, St: get_game_state::State> GetGameBuilder<S, St> {
pub fn play_station_id(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.9 = value.into();
self
}
pub fn maybe_play_station_id(mut self, value: Option<S>) -> Self {
self._fields.9 = value;
self
}
}
impl<S: BosStr, St: get_game_state::State> GetGameBuilder<S, St> {
pub fn slug(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.10 = value.into();
self
}
pub fn maybe_slug(mut self, value: Option<S>) -> Self {
self._fields.10 = value;
self
}
}
impl<S: BosStr, St: get_game_state::State> GetGameBuilder<S, St> {
pub fn steam_id(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.11 = value.into();
self
}
pub fn maybe_steam_id(mut self, value: Option<S>) -> Self {
self._fields.11 = value;
self
}
}
impl<S: BosStr, St: get_game_state::State> GetGameBuilder<S, St> {
pub fn uri(mut self, value: impl Into<Option<AtUri<S>>>) -> Self {
self._fields.12 = value.into();
self
}
pub fn maybe_uri(mut self, value: Option<AtUri<S>>) -> Self {
self._fields.12 = value;
self
}
}
impl<S: BosStr, St: get_game_state::State> GetGameBuilder<S, St> {
pub fn xbox_id(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.13 = value.into();
self
}
pub fn maybe_xbox_id(mut self, value: Option<S>) -> Self {
self._fields.13 = value;
self
}
}
impl<S: BosStr, St> GetGameBuilder<S, St>
where
St: get_game_state::State,
{
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,
}
}
}