#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct PutGame<'a> {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub age_ratings: std::option::Option<
Vec<crate::games_gamesgamesgamesgames::AgeRating<'a>>,
>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub alternative_names: std::option::Option<
Vec<crate::games_gamesgamesgamesgames::AlternativeName<'a>>,
>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub application_type: std::option::Option<
crate::games_gamesgamesgamesgames::ApplicationType<'a>,
>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub created_at: std::option::Option<jacquard_common::types::string::Datetime>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub engines: std::option::Option<Vec<jacquard_common::types::string::AtUri<'a>>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub genres: std::option::Option<Vec<crate::games_gamesgamesgamesgames::Genre<'a>>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub keywords: std::option::Option<Vec<jacquard_common::CowStr<'a>>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub language_supports: std::option::Option<
Vec<crate::games_gamesgamesgamesgames::LanguageSupport<'a>>,
>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub media: std::option::Option<
Vec<crate::games_gamesgamesgamesgames::MediaItem<'a>>,
>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub modes: std::option::Option<Vec<crate::games_gamesgamesgamesgames::Mode<'a>>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub multiplayer_modes: std::option::Option<
Vec<crate::games_gamesgamesgamesgames::MultiplayerMode<'a>>,
>,
#[serde(borrow)]
pub name: jacquard_common::CowStr<'a>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub parent: std::option::Option<jacquard_common::types::string::AtUri<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub player_perspectives: std::option::Option<
Vec<crate::games_gamesgamesgamesgames::PlayerPerspective<'a>>,
>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub releases: std::option::Option<
Vec<crate::games_gamesgamesgamesgames::Release<'a>>,
>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub should_publish: std::option::Option<bool>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub storyline: std::option::Option<jacquard_common::CowStr<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub summary: std::option::Option<jacquard_common::CowStr<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub themes: std::option::Option<Vec<crate::games_gamesgamesgamesgames::Theme<'a>>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub time_to_beat: std::option::Option<
crate::games_gamesgamesgamesgames::TimeToBeat<'a>,
>,
#[serde(borrow)]
pub uri: jacquard_common::types::string::AtUri<'a>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub videos: std::option::Option<
Vec<crate::games_gamesgamesgamesgames::ExternalVideo<'a>>,
>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub websites: std::option::Option<
Vec<crate::games_gamesgamesgamesgames::Website<'a>>,
>,
}
pub mod put_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 {
type Name;
type Uri;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Name = Unset;
type Uri = Unset;
}
pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetName<S> {}
impl<S: State> State for SetName<S> {
type Name = Set<members::name>;
type Uri = S::Uri;
}
pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetUri<S> {}
impl<S: State> State for SetUri<S> {
type Name = S::Name;
type Uri = Set<members::uri>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct name(());
pub struct uri(());
}
}
pub struct PutGameBuilder<'a, S: put_game_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<Vec<crate::games_gamesgamesgamesgames::AgeRating<'a>>>,
::core::option::Option<
Vec<crate::games_gamesgamesgamesgames::AlternativeName<'a>>,
>,
::core::option::Option<crate::games_gamesgamesgamesgames::ApplicationType<'a>>,
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<Vec<jacquard_common::types::string::AtUri<'a>>>,
::core::option::Option<Vec<crate::games_gamesgamesgamesgames::Genre<'a>>>,
::core::option::Option<Vec<jacquard_common::CowStr<'a>>>,
::core::option::Option<
Vec<crate::games_gamesgamesgamesgames::LanguageSupport<'a>>,
>,
::core::option::Option<Vec<crate::games_gamesgamesgamesgames::MediaItem<'a>>>,
::core::option::Option<Vec<crate::games_gamesgamesgamesgames::Mode<'a>>>,
::core::option::Option<
Vec<crate::games_gamesgamesgamesgames::MultiplayerMode<'a>>,
>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
::core::option::Option<
Vec<crate::games_gamesgamesgamesgames::PlayerPerspective<'a>>,
>,
::core::option::Option<Vec<crate::games_gamesgamesgamesgames::Release<'a>>>,
::core::option::Option<bool>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<Vec<crate::games_gamesgamesgamesgames::Theme<'a>>>,
::core::option::Option<crate::games_gamesgamesgamesgames::TimeToBeat<'a>>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
::core::option::Option<
Vec<crate::games_gamesgamesgamesgames::ExternalVideo<'a>>,
>,
::core::option::Option<Vec<crate::games_gamesgamesgamesgames::Website<'a>>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> PutGame<'a> {
pub fn new() -> PutGameBuilder<'a, put_game_state::Empty> {
PutGameBuilder::new()
}
}
impl<'a> PutGameBuilder<'a, put_game_state::Empty> {
pub fn new() -> Self {
PutGameBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: put_game_state::State> PutGameBuilder<'a, S> {
pub fn age_ratings(
mut self,
value: impl Into<Option<Vec<crate::games_gamesgamesgamesgames::AgeRating<'a>>>>,
) -> Self {
self.__unsafe_private_named.0 = value.into();
self
}
pub fn maybe_age_ratings(
mut self,
value: Option<Vec<crate::games_gamesgamesgamesgames::AgeRating<'a>>>,
) -> Self {
self.__unsafe_private_named.0 = value;
self
}
}
impl<'a, S: put_game_state::State> PutGameBuilder<'a, S> {
pub fn alternative_names(
mut self,
value: impl Into<
Option<Vec<crate::games_gamesgamesgamesgames::AlternativeName<'a>>>,
>,
) -> Self {
self.__unsafe_private_named.1 = value.into();
self
}
pub fn maybe_alternative_names(
mut self,
value: Option<Vec<crate::games_gamesgamesgamesgames::AlternativeName<'a>>>,
) -> Self {
self.__unsafe_private_named.1 = value;
self
}
}
impl<'a, S: put_game_state::State> PutGameBuilder<'a, S> {
pub fn application_type(
mut self,
value: impl Into<Option<crate::games_gamesgamesgamesgames::ApplicationType<'a>>>,
) -> Self {
self.__unsafe_private_named.2 = value.into();
self
}
pub fn maybe_application_type(
mut self,
value: Option<crate::games_gamesgamesgamesgames::ApplicationType<'a>>,
) -> Self {
self.__unsafe_private_named.2 = value;
self
}
}
impl<'a, S: put_game_state::State> PutGameBuilder<'a, S> {
pub fn created_at(
mut self,
value: impl Into<Option<jacquard_common::types::string::Datetime>>,
) -> Self {
self.__unsafe_private_named.3 = value.into();
self
}
pub fn maybe_created_at(
mut self,
value: Option<jacquard_common::types::string::Datetime>,
) -> Self {
self.__unsafe_private_named.3 = value;
self
}
}
impl<'a, S: put_game_state::State> PutGameBuilder<'a, S> {
pub fn engines(
mut self,
value: impl Into<Option<Vec<jacquard_common::types::string::AtUri<'a>>>>,
) -> Self {
self.__unsafe_private_named.4 = value.into();
self
}
pub fn maybe_engines(
mut self,
value: Option<Vec<jacquard_common::types::string::AtUri<'a>>>,
) -> Self {
self.__unsafe_private_named.4 = value;
self
}
}
impl<'a, S: put_game_state::State> PutGameBuilder<'a, S> {
pub fn genres(
mut self,
value: impl Into<Option<Vec<crate::games_gamesgamesgamesgames::Genre<'a>>>>,
) -> Self {
self.__unsafe_private_named.5 = value.into();
self
}
pub fn maybe_genres(
mut self,
value: Option<Vec<crate::games_gamesgamesgamesgames::Genre<'a>>>,
) -> Self {
self.__unsafe_private_named.5 = value;
self
}
}
impl<'a, S: put_game_state::State> PutGameBuilder<'a, S> {
pub fn keywords(
mut self,
value: impl Into<Option<Vec<jacquard_common::CowStr<'a>>>>,
) -> Self {
self.__unsafe_private_named.6 = value.into();
self
}
pub fn maybe_keywords(
mut self,
value: Option<Vec<jacquard_common::CowStr<'a>>>,
) -> Self {
self.__unsafe_private_named.6 = value;
self
}
}
impl<'a, S: put_game_state::State> PutGameBuilder<'a, S> {
pub fn language_supports(
mut self,
value: impl Into<
Option<Vec<crate::games_gamesgamesgamesgames::LanguageSupport<'a>>>,
>,
) -> Self {
self.__unsafe_private_named.7 = value.into();
self
}
pub fn maybe_language_supports(
mut self,
value: Option<Vec<crate::games_gamesgamesgamesgames::LanguageSupport<'a>>>,
) -> Self {
self.__unsafe_private_named.7 = value;
self
}
}
impl<'a, S: put_game_state::State> PutGameBuilder<'a, S> {
pub fn media(
mut self,
value: impl Into<Option<Vec<crate::games_gamesgamesgamesgames::MediaItem<'a>>>>,
) -> Self {
self.__unsafe_private_named.8 = value.into();
self
}
pub fn maybe_media(
mut self,
value: Option<Vec<crate::games_gamesgamesgamesgames::MediaItem<'a>>>,
) -> Self {
self.__unsafe_private_named.8 = value;
self
}
}
impl<'a, S: put_game_state::State> PutGameBuilder<'a, S> {
pub fn modes(
mut self,
value: impl Into<Option<Vec<crate::games_gamesgamesgamesgames::Mode<'a>>>>,
) -> Self {
self.__unsafe_private_named.9 = value.into();
self
}
pub fn maybe_modes(
mut self,
value: Option<Vec<crate::games_gamesgamesgamesgames::Mode<'a>>>,
) -> Self {
self.__unsafe_private_named.9 = value;
self
}
}
impl<'a, S: put_game_state::State> PutGameBuilder<'a, S> {
pub fn multiplayer_modes(
mut self,
value: impl Into<
Option<Vec<crate::games_gamesgamesgamesgames::MultiplayerMode<'a>>>,
>,
) -> Self {
self.__unsafe_private_named.10 = value.into();
self
}
pub fn maybe_multiplayer_modes(
mut self,
value: Option<Vec<crate::games_gamesgamesgamesgames::MultiplayerMode<'a>>>,
) -> Self {
self.__unsafe_private_named.10 = value;
self
}
}
impl<'a, S> PutGameBuilder<'a, S>
where
S: put_game_state::State,
S::Name: put_game_state::IsUnset,
{
pub fn name(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> PutGameBuilder<'a, put_game_state::SetName<S>> {
self.__unsafe_private_named.11 = ::core::option::Option::Some(value.into());
PutGameBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: put_game_state::State> PutGameBuilder<'a, S> {
pub fn parent(
mut self,
value: impl Into<Option<jacquard_common::types::string::AtUri<'a>>>,
) -> Self {
self.__unsafe_private_named.12 = value.into();
self
}
pub fn maybe_parent(
mut self,
value: Option<jacquard_common::types::string::AtUri<'a>>,
) -> Self {
self.__unsafe_private_named.12 = value;
self
}
}
impl<'a, S: put_game_state::State> PutGameBuilder<'a, S> {
pub fn player_perspectives(
mut self,
value: impl Into<
Option<Vec<crate::games_gamesgamesgamesgames::PlayerPerspective<'a>>>,
>,
) -> Self {
self.__unsafe_private_named.13 = value.into();
self
}
pub fn maybe_player_perspectives(
mut self,
value: Option<Vec<crate::games_gamesgamesgamesgames::PlayerPerspective<'a>>>,
) -> Self {
self.__unsafe_private_named.13 = value;
self
}
}
impl<'a, S: put_game_state::State> PutGameBuilder<'a, S> {
pub fn releases(
mut self,
value: impl Into<Option<Vec<crate::games_gamesgamesgamesgames::Release<'a>>>>,
) -> Self {
self.__unsafe_private_named.14 = value.into();
self
}
pub fn maybe_releases(
mut self,
value: Option<Vec<crate::games_gamesgamesgamesgames::Release<'a>>>,
) -> Self {
self.__unsafe_private_named.14 = value;
self
}
}
impl<'a, S: put_game_state::State> PutGameBuilder<'a, S> {
pub fn should_publish(mut self, value: impl Into<Option<bool>>) -> Self {
self.__unsafe_private_named.15 = value.into();
self
}
pub fn maybe_should_publish(mut self, value: Option<bool>) -> Self {
self.__unsafe_private_named.15 = value;
self
}
}
impl<'a, S: put_game_state::State> PutGameBuilder<'a, S> {
pub fn storyline(
mut self,
value: impl Into<Option<jacquard_common::CowStr<'a>>>,
) -> Self {
self.__unsafe_private_named.16 = value.into();
self
}
pub fn maybe_storyline(
mut self,
value: Option<jacquard_common::CowStr<'a>>,
) -> Self {
self.__unsafe_private_named.16 = value;
self
}
}
impl<'a, S: put_game_state::State> PutGameBuilder<'a, S> {
pub fn summary(
mut self,
value: impl Into<Option<jacquard_common::CowStr<'a>>>,
) -> Self {
self.__unsafe_private_named.17 = value.into();
self
}
pub fn maybe_summary(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self {
self.__unsafe_private_named.17 = value;
self
}
}
impl<'a, S: put_game_state::State> PutGameBuilder<'a, S> {
pub fn themes(
mut self,
value: impl Into<Option<Vec<crate::games_gamesgamesgamesgames::Theme<'a>>>>,
) -> Self {
self.__unsafe_private_named.18 = value.into();
self
}
pub fn maybe_themes(
mut self,
value: Option<Vec<crate::games_gamesgamesgamesgames::Theme<'a>>>,
) -> Self {
self.__unsafe_private_named.18 = value;
self
}
}
impl<'a, S: put_game_state::State> PutGameBuilder<'a, S> {
pub fn time_to_beat(
mut self,
value: impl Into<Option<crate::games_gamesgamesgamesgames::TimeToBeat<'a>>>,
) -> Self {
self.__unsafe_private_named.19 = value.into();
self
}
pub fn maybe_time_to_beat(
mut self,
value: Option<crate::games_gamesgamesgamesgames::TimeToBeat<'a>>,
) -> Self {
self.__unsafe_private_named.19 = value;
self
}
}
impl<'a, S> PutGameBuilder<'a, S>
where
S: put_game_state::State,
S::Uri: put_game_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> PutGameBuilder<'a, put_game_state::SetUri<S>> {
self.__unsafe_private_named.20 = ::core::option::Option::Some(value.into());
PutGameBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: put_game_state::State> PutGameBuilder<'a, S> {
pub fn videos(
mut self,
value: impl Into<
Option<Vec<crate::games_gamesgamesgamesgames::ExternalVideo<'a>>>,
>,
) -> Self {
self.__unsafe_private_named.21 = value.into();
self
}
pub fn maybe_videos(
mut self,
value: Option<Vec<crate::games_gamesgamesgamesgames::ExternalVideo<'a>>>,
) -> Self {
self.__unsafe_private_named.21 = value;
self
}
}
impl<'a, S: put_game_state::State> PutGameBuilder<'a, S> {
pub fn websites(
mut self,
value: impl Into<Option<Vec<crate::games_gamesgamesgamesgames::Website<'a>>>>,
) -> Self {
self.__unsafe_private_named.22 = value.into();
self
}
pub fn maybe_websites(
mut self,
value: Option<Vec<crate::games_gamesgamesgamesgames::Website<'a>>>,
) -> Self {
self.__unsafe_private_named.22 = value;
self
}
}
impl<'a, S> PutGameBuilder<'a, S>
where
S: put_game_state::State,
S::Name: put_game_state::IsSet,
S::Uri: put_game_state::IsSet,
{
pub fn build(self) -> PutGame<'a> {
PutGame {
age_ratings: self.__unsafe_private_named.0,
alternative_names: self.__unsafe_private_named.1,
application_type: self.__unsafe_private_named.2,
created_at: self.__unsafe_private_named.3,
engines: self.__unsafe_private_named.4,
genres: self.__unsafe_private_named.5,
keywords: self.__unsafe_private_named.6,
language_supports: self.__unsafe_private_named.7,
media: self.__unsafe_private_named.8,
modes: self.__unsafe_private_named.9,
multiplayer_modes: self.__unsafe_private_named.10,
name: self.__unsafe_private_named.11.unwrap(),
parent: self.__unsafe_private_named.12,
player_perspectives: self.__unsafe_private_named.13,
releases: self.__unsafe_private_named.14,
should_publish: self.__unsafe_private_named.15,
storyline: self.__unsafe_private_named.16,
summary: self.__unsafe_private_named.17,
themes: self.__unsafe_private_named.18,
time_to_beat: self.__unsafe_private_named.19,
uri: self.__unsafe_private_named.20.unwrap(),
videos: self.__unsafe_private_named.21,
websites: self.__unsafe_private_named.22,
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> PutGame<'a> {
PutGame {
age_ratings: self.__unsafe_private_named.0,
alternative_names: self.__unsafe_private_named.1,
application_type: self.__unsafe_private_named.2,
created_at: self.__unsafe_private_named.3,
engines: self.__unsafe_private_named.4,
genres: self.__unsafe_private_named.5,
keywords: self.__unsafe_private_named.6,
language_supports: self.__unsafe_private_named.7,
media: self.__unsafe_private_named.8,
modes: self.__unsafe_private_named.9,
multiplayer_modes: self.__unsafe_private_named.10,
name: self.__unsafe_private_named.11.unwrap(),
parent: self.__unsafe_private_named.12,
player_perspectives: self.__unsafe_private_named.13,
releases: self.__unsafe_private_named.14,
should_publish: self.__unsafe_private_named.15,
storyline: self.__unsafe_private_named.16,
summary: self.__unsafe_private_named.17,
themes: self.__unsafe_private_named.18,
time_to_beat: self.__unsafe_private_named.19,
uri: self.__unsafe_private_named.20.unwrap(),
videos: self.__unsafe_private_named.21,
websites: self.__unsafe_private_named.22,
extra_data: Some(extra_data),
}
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct PutGameOutput<'a> {
#[serde(borrow)]
pub cid: jacquard_common::CowStr<'a>,
#[serde(borrow)]
pub uri: jacquard_common::types::string::AtUri<'a>,
}
pub struct PutGameResponse;
impl jacquard_common::xrpc::XrpcResp for PutGameResponse {
const NSID: &'static str = "games.gamesgamesgamesgames.putGame";
const ENCODING: &'static str = "application/json";
type Output<'de> = PutGameOutput<'de>;
type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
}
impl<'a> jacquard_common::xrpc::XrpcRequest for PutGame<'a> {
const NSID: &'static str = "games.gamesgamesgamesgames.putGame";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
"application/json",
);
type Response = PutGameResponse;
}
pub struct PutGameRequest;
impl jacquard_common::xrpc::XrpcEndpoint for PutGameRequest {
const PATH: &'static str = "/xrpc/games.gamesgamesgamesgames.putGame";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
"application/json",
);
type Request<'de> = PutGame<'de>;
type Response = PutGameResponse;
}