#[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>,
}
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;
}
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 {}
}
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<'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> {
pub fn new() -> GetGameBuilder<'a, get_game_state::Empty> {
GetGameBuilder::new()
}
}
impl<'a> GetGameBuilder<'a, 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,
),
_lifetime: PhantomData,
}
}
}
impl<'a, S: get_game_state::State> GetGameBuilder<'a, S> {
pub fn apple_app_store_id(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.0 = value.into();
self
}
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> {
pub fn epic_games_id(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.1 = value.into();
self
}
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> {
pub fn gog_id(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.2 = value.into();
self
}
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> {
pub fn google_play_id(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.3 = value.into();
self
}
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> {
pub fn humble_bundle_id(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.4 = value.into();
self
}
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> {
pub fn igdb_id(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.5 = value.into();
self
}
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> {
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<'a, S: get_game_state::State> GetGameBuilder<'a, S> {
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<'a, S: get_game_state::State> GetGameBuilder<'a, S> {
pub fn nintendo_eshop_id(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.8 = value.into();
self
}
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> {
pub fn play_station_id(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.9 = value.into();
self
}
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> {
pub fn slug(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.10 = value.into();
self
}
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> {
pub fn steam_id(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.11 = value.into();
self
}
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> {
pub fn uri(mut self, value: impl Into<Option<AtUri<'a>>>) -> Self {
self._fields.12 = value.into();
self
}
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> {
pub fn xbox_id(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.13 = value.into();
self
}
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,
{
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,
}
}
}