#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct Game<'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(borrow)]
pub application_type: crate::games_gamesgamesgamesgames::ApplicationType<'a>,
pub created_at: jacquard_common::types::string::Datetime,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub description: std::option::Option<jacquard_common::CowStr<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub description_facets: std::option::Option<
Vec<jacquard_common::types::value::Data<'a>>,
>,
#[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 external_ids: std::option::Option<
crate::games_gamesgamesgamesgames::ExternalIds<'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 platform_features: std::option::Option<
Vec<crate::games_gamesgamesgamesgames::PlatformFeatures<'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")]
pub published_at: std::option::Option<jacquard_common::types::string::Datetime>,
#[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")]
#[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 system_requirements: std::option::Option<
Vec<crate::games_gamesgamesgamesgames::SystemRequirements<'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(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 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 CreatedAt;
type ApplicationType;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Name = Unset;
type CreatedAt = Unset;
type ApplicationType = 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 CreatedAt = S::CreatedAt;
type ApplicationType = S::ApplicationType;
}
pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCreatedAt<S> {}
impl<S: State> State for SetCreatedAt<S> {
type Name = S::Name;
type CreatedAt = Set<members::created_at>;
type ApplicationType = S::ApplicationType;
}
pub struct SetApplicationType<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetApplicationType<S> {}
impl<S: State> State for SetApplicationType<S> {
type Name = S::Name;
type CreatedAt = S::CreatedAt;
type ApplicationType = Set<members::application_type>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct name(());
pub struct created_at(());
pub struct application_type(());
}
}
pub struct GameBuilder<'a, S: 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<jacquard_common::CowStr<'a>>,
::core::option::Option<Vec<jacquard_common::types::value::Data<'a>>>,
::core::option::Option<Vec<jacquard_common::types::string::AtUri<'a>>>,
::core::option::Option<crate::games_gamesgamesgamesgames::ExternalIds<'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::PlatformFeatures<'a>>,
>,
::core::option::Option<
Vec<crate::games_gamesgamesgamesgames::PlayerPerspective<'a>>,
>,
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<Vec<crate::games_gamesgamesgamesgames::Release<'a>>>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<
Vec<crate::games_gamesgamesgamesgames::SystemRequirements<'a>>,
>,
::core::option::Option<Vec<crate::games_gamesgamesgamesgames::Theme<'a>>>,
::core::option::Option<crate::games_gamesgamesgamesgames::TimeToBeat<'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> Game<'a> {
pub fn new() -> GameBuilder<'a, game_state::Empty> {
GameBuilder::new()
}
}
impl<'a> GameBuilder<'a, game_state::Empty> {
pub fn new() -> Self {
GameBuilder {
_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,
None,
None,
None,
None,
),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: game_state::State> GameBuilder<'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: game_state::State> GameBuilder<'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> GameBuilder<'a, S>
where
S: game_state::State,
S::ApplicationType: game_state::IsUnset,
{
pub fn application_type(
mut self,
value: impl Into<crate::games_gamesgamesgamesgames::ApplicationType<'a>>,
) -> GameBuilder<'a, game_state::SetApplicationType<S>> {
self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
GameBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> GameBuilder<'a, S>
where
S: game_state::State,
S::CreatedAt: game_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<jacquard_common::types::string::Datetime>,
) -> GameBuilder<'a, game_state::SetCreatedAt<S>> {
self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
GameBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: game_state::State> GameBuilder<'a, S> {
pub fn description(
mut self,
value: impl Into<Option<jacquard_common::CowStr<'a>>>,
) -> Self {
self.__unsafe_private_named.4 = value.into();
self
}
pub fn maybe_description(
mut self,
value: Option<jacquard_common::CowStr<'a>>,
) -> Self {
self.__unsafe_private_named.4 = value;
self
}
}
impl<'a, S: game_state::State> GameBuilder<'a, S> {
pub fn description_facets(
mut self,
value: impl Into<Option<Vec<jacquard_common::types::value::Data<'a>>>>,
) -> Self {
self.__unsafe_private_named.5 = value.into();
self
}
pub fn maybe_description_facets(
mut self,
value: Option<Vec<jacquard_common::types::value::Data<'a>>>,
) -> Self {
self.__unsafe_private_named.5 = value;
self
}
}
impl<'a, S: game_state::State> GameBuilder<'a, S> {
pub fn engines(
mut self,
value: impl Into<Option<Vec<jacquard_common::types::string::AtUri<'a>>>>,
) -> Self {
self.__unsafe_private_named.6 = value.into();
self
}
pub fn maybe_engines(
mut self,
value: Option<Vec<jacquard_common::types::string::AtUri<'a>>>,
) -> Self {
self.__unsafe_private_named.6 = value;
self
}
}
impl<'a, S: game_state::State> GameBuilder<'a, S> {
pub fn external_ids(
mut self,
value: impl Into<Option<crate::games_gamesgamesgamesgames::ExternalIds<'a>>>,
) -> Self {
self.__unsafe_private_named.7 = value.into();
self
}
pub fn maybe_external_ids(
mut self,
value: Option<crate::games_gamesgamesgamesgames::ExternalIds<'a>>,
) -> Self {
self.__unsafe_private_named.7 = value;
self
}
}
impl<'a, S: game_state::State> GameBuilder<'a, S> {
pub fn genres(
mut self,
value: impl Into<Option<Vec<crate::games_gamesgamesgamesgames::Genre<'a>>>>,
) -> Self {
self.__unsafe_private_named.8 = value.into();
self
}
pub fn maybe_genres(
mut self,
value: Option<Vec<crate::games_gamesgamesgamesgames::Genre<'a>>>,
) -> Self {
self.__unsafe_private_named.8 = value;
self
}
}
impl<'a, S: game_state::State> GameBuilder<'a, S> {
pub fn keywords(
mut self,
value: impl Into<Option<Vec<jacquard_common::CowStr<'a>>>>,
) -> Self {
self.__unsafe_private_named.9 = value.into();
self
}
pub fn maybe_keywords(
mut self,
value: Option<Vec<jacquard_common::CowStr<'a>>>,
) -> Self {
self.__unsafe_private_named.9 = value;
self
}
}
impl<'a, S: game_state::State> GameBuilder<'a, S> {
pub fn language_supports(
mut self,
value: impl Into<
Option<Vec<crate::games_gamesgamesgamesgames::LanguageSupport<'a>>>,
>,
) -> Self {
self.__unsafe_private_named.10 = value.into();
self
}
pub fn maybe_language_supports(
mut self,
value: Option<Vec<crate::games_gamesgamesgamesgames::LanguageSupport<'a>>>,
) -> Self {
self.__unsafe_private_named.10 = value;
self
}
}
impl<'a, S: game_state::State> GameBuilder<'a, S> {
pub fn media(
mut self,
value: impl Into<Option<Vec<crate::games_gamesgamesgamesgames::MediaItem<'a>>>>,
) -> Self {
self.__unsafe_private_named.11 = value.into();
self
}
pub fn maybe_media(
mut self,
value: Option<Vec<crate::games_gamesgamesgamesgames::MediaItem<'a>>>,
) -> Self {
self.__unsafe_private_named.11 = value;
self
}
}
impl<'a, S: game_state::State> GameBuilder<'a, S> {
pub fn modes(
mut self,
value: impl Into<Option<Vec<crate::games_gamesgamesgamesgames::Mode<'a>>>>,
) -> Self {
self.__unsafe_private_named.12 = value.into();
self
}
pub fn maybe_modes(
mut self,
value: Option<Vec<crate::games_gamesgamesgamesgames::Mode<'a>>>,
) -> Self {
self.__unsafe_private_named.12 = value;
self
}
}
impl<'a, S: game_state::State> GameBuilder<'a, S> {
pub fn multiplayer_modes(
mut self,
value: impl Into<
Option<Vec<crate::games_gamesgamesgamesgames::MultiplayerMode<'a>>>,
>,
) -> Self {
self.__unsafe_private_named.13 = value.into();
self
}
pub fn maybe_multiplayer_modes(
mut self,
value: Option<Vec<crate::games_gamesgamesgamesgames::MultiplayerMode<'a>>>,
) -> Self {
self.__unsafe_private_named.13 = value;
self
}
}
impl<'a, S> GameBuilder<'a, S>
where
S: game_state::State,
S::Name: game_state::IsUnset,
{
pub fn name(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> GameBuilder<'a, game_state::SetName<S>> {
self.__unsafe_private_named.14 = ::core::option::Option::Some(value.into());
GameBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: game_state::State> GameBuilder<'a, S> {
pub fn parent(
mut self,
value: impl Into<Option<jacquard_common::types::string::AtUri<'a>>>,
) -> Self {
self.__unsafe_private_named.15 = value.into();
self
}
pub fn maybe_parent(
mut self,
value: Option<jacquard_common::types::string::AtUri<'a>>,
) -> Self {
self.__unsafe_private_named.15 = value;
self
}
}
impl<'a, S: game_state::State> GameBuilder<'a, S> {
pub fn platform_features(
mut self,
value: impl Into<
Option<Vec<crate::games_gamesgamesgamesgames::PlatformFeatures<'a>>>,
>,
) -> Self {
self.__unsafe_private_named.16 = value.into();
self
}
pub fn maybe_platform_features(
mut self,
value: Option<Vec<crate::games_gamesgamesgamesgames::PlatformFeatures<'a>>>,
) -> Self {
self.__unsafe_private_named.16 = value;
self
}
}
impl<'a, S: game_state::State> GameBuilder<'a, S> {
pub fn player_perspectives(
mut self,
value: impl Into<
Option<Vec<crate::games_gamesgamesgamesgames::PlayerPerspective<'a>>>,
>,
) -> Self {
self.__unsafe_private_named.17 = value.into();
self
}
pub fn maybe_player_perspectives(
mut self,
value: Option<Vec<crate::games_gamesgamesgamesgames::PlayerPerspective<'a>>>,
) -> Self {
self.__unsafe_private_named.17 = value;
self
}
}
impl<'a, S: game_state::State> GameBuilder<'a, S> {
pub fn published_at(
mut self,
value: impl Into<Option<jacquard_common::types::string::Datetime>>,
) -> Self {
self.__unsafe_private_named.18 = value.into();
self
}
pub fn maybe_published_at(
mut self,
value: Option<jacquard_common::types::string::Datetime>,
) -> Self {
self.__unsafe_private_named.18 = value;
self
}
}
impl<'a, S: game_state::State> GameBuilder<'a, S> {
pub fn releases(
mut self,
value: impl Into<Option<Vec<crate::games_gamesgamesgamesgames::Release<'a>>>>,
) -> Self {
self.__unsafe_private_named.19 = value.into();
self
}
pub fn maybe_releases(
mut self,
value: Option<Vec<crate::games_gamesgamesgamesgames::Release<'a>>>,
) -> Self {
self.__unsafe_private_named.19 = value;
self
}
}
impl<'a, S: game_state::State> GameBuilder<'a, S> {
pub fn storyline(
mut self,
value: impl Into<Option<jacquard_common::CowStr<'a>>>,
) -> Self {
self.__unsafe_private_named.20 = value.into();
self
}
pub fn maybe_storyline(
mut self,
value: Option<jacquard_common::CowStr<'a>>,
) -> Self {
self.__unsafe_private_named.20 = value;
self
}
}
impl<'a, S: game_state::State> GameBuilder<'a, S> {
pub fn summary(
mut self,
value: impl Into<Option<jacquard_common::CowStr<'a>>>,
) -> Self {
self.__unsafe_private_named.21 = value.into();
self
}
pub fn maybe_summary(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self {
self.__unsafe_private_named.21 = value;
self
}
}
impl<'a, S: game_state::State> GameBuilder<'a, S> {
pub fn system_requirements(
mut self,
value: impl Into<
Option<Vec<crate::games_gamesgamesgamesgames::SystemRequirements<'a>>>,
>,
) -> Self {
self.__unsafe_private_named.22 = value.into();
self
}
pub fn maybe_system_requirements(
mut self,
value: Option<Vec<crate::games_gamesgamesgamesgames::SystemRequirements<'a>>>,
) -> Self {
self.__unsafe_private_named.22 = value;
self
}
}
impl<'a, S: game_state::State> GameBuilder<'a, S> {
pub fn themes(
mut self,
value: impl Into<Option<Vec<crate::games_gamesgamesgamesgames::Theme<'a>>>>,
) -> Self {
self.__unsafe_private_named.23 = value.into();
self
}
pub fn maybe_themes(
mut self,
value: Option<Vec<crate::games_gamesgamesgamesgames::Theme<'a>>>,
) -> Self {
self.__unsafe_private_named.23 = value;
self
}
}
impl<'a, S: game_state::State> GameBuilder<'a, S> {
pub fn time_to_beat(
mut self,
value: impl Into<Option<crate::games_gamesgamesgamesgames::TimeToBeat<'a>>>,
) -> Self {
self.__unsafe_private_named.24 = value.into();
self
}
pub fn maybe_time_to_beat(
mut self,
value: Option<crate::games_gamesgamesgamesgames::TimeToBeat<'a>>,
) -> Self {
self.__unsafe_private_named.24 = value;
self
}
}
impl<'a, S: game_state::State> GameBuilder<'a, S> {
pub fn videos(
mut self,
value: impl Into<
Option<Vec<crate::games_gamesgamesgamesgames::ExternalVideo<'a>>>,
>,
) -> Self {
self.__unsafe_private_named.25 = value.into();
self
}
pub fn maybe_videos(
mut self,
value: Option<Vec<crate::games_gamesgamesgamesgames::ExternalVideo<'a>>>,
) -> Self {
self.__unsafe_private_named.25 = value;
self
}
}
impl<'a, S: game_state::State> GameBuilder<'a, S> {
pub fn websites(
mut self,
value: impl Into<Option<Vec<crate::games_gamesgamesgamesgames::Website<'a>>>>,
) -> Self {
self.__unsafe_private_named.26 = value.into();
self
}
pub fn maybe_websites(
mut self,
value: Option<Vec<crate::games_gamesgamesgamesgames::Website<'a>>>,
) -> Self {
self.__unsafe_private_named.26 = value;
self
}
}
impl<'a, S> GameBuilder<'a, S>
where
S: game_state::State,
S::Name: game_state::IsSet,
S::CreatedAt: game_state::IsSet,
S::ApplicationType: game_state::IsSet,
{
pub fn build(self) -> Game<'a> {
Game {
age_ratings: self.__unsafe_private_named.0,
alternative_names: self.__unsafe_private_named.1,
application_type: self.__unsafe_private_named.2.unwrap(),
created_at: self.__unsafe_private_named.3.unwrap(),
description: self.__unsafe_private_named.4,
description_facets: self.__unsafe_private_named.5,
engines: self.__unsafe_private_named.6,
external_ids: self.__unsafe_private_named.7,
genres: self.__unsafe_private_named.8,
keywords: self.__unsafe_private_named.9,
language_supports: self.__unsafe_private_named.10,
media: self.__unsafe_private_named.11,
modes: self.__unsafe_private_named.12,
multiplayer_modes: self.__unsafe_private_named.13,
name: self.__unsafe_private_named.14.unwrap(),
parent: self.__unsafe_private_named.15,
platform_features: self.__unsafe_private_named.16,
player_perspectives: self.__unsafe_private_named.17,
published_at: self.__unsafe_private_named.18,
releases: self.__unsafe_private_named.19,
storyline: self.__unsafe_private_named.20,
summary: self.__unsafe_private_named.21,
system_requirements: self.__unsafe_private_named.22,
themes: self.__unsafe_private_named.23,
time_to_beat: self.__unsafe_private_named.24,
videos: self.__unsafe_private_named.25,
websites: self.__unsafe_private_named.26,
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>,
>,
) -> Game<'a> {
Game {
age_ratings: self.__unsafe_private_named.0,
alternative_names: self.__unsafe_private_named.1,
application_type: self.__unsafe_private_named.2.unwrap(),
created_at: self.__unsafe_private_named.3.unwrap(),
description: self.__unsafe_private_named.4,
description_facets: self.__unsafe_private_named.5,
engines: self.__unsafe_private_named.6,
external_ids: self.__unsafe_private_named.7,
genres: self.__unsafe_private_named.8,
keywords: self.__unsafe_private_named.9,
language_supports: self.__unsafe_private_named.10,
media: self.__unsafe_private_named.11,
modes: self.__unsafe_private_named.12,
multiplayer_modes: self.__unsafe_private_named.13,
name: self.__unsafe_private_named.14.unwrap(),
parent: self.__unsafe_private_named.15,
platform_features: self.__unsafe_private_named.16,
player_perspectives: self.__unsafe_private_named.17,
published_at: self.__unsafe_private_named.18,
releases: self.__unsafe_private_named.19,
storyline: self.__unsafe_private_named.20,
summary: self.__unsafe_private_named.21,
system_requirements: self.__unsafe_private_named.22,
themes: self.__unsafe_private_named.23,
time_to_beat: self.__unsafe_private_named.24,
videos: self.__unsafe_private_named.25,
websites: self.__unsafe_private_named.26,
extra_data: Some(extra_data),
}
}
}
impl<'a> Game<'a> {
pub fn uri(
uri: impl Into<jacquard_common::CowStr<'a>>,
) -> Result<
jacquard_common::types::uri::RecordUri<'a, GameRecord>,
jacquard_common::types::uri::UriError,
> {
jacquard_common::types::uri::RecordUri::try_from_uri(
jacquard_common::types::string::AtUri::new_cow(uri.into())?,
)
}
}
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct GameGetRecordOutput<'a> {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>,
#[serde(borrow)]
pub uri: jacquard_common::types::string::AtUri<'a>,
#[serde(borrow)]
pub value: Game<'a>,
}
impl From<GameGetRecordOutput<'_>> for Game<'_> {
fn from(output: GameGetRecordOutput<'_>) -> Self {
use jacquard_common::IntoStatic;
output.value.into_static()
}
}
impl jacquard_common::types::collection::Collection for Game<'_> {
const NSID: &'static str = "games.gamesgamesgamesgames.game";
type Record = GameRecord;
}
#[derive(Debug, serde::Serialize, serde::Deserialize)]
pub struct GameRecord;
impl jacquard_common::xrpc::XrpcResp for GameRecord {
const NSID: &'static str = "games.gamesgamesgamesgames.game";
const ENCODING: &'static str = "application/json";
type Output<'de> = GameGetRecordOutput<'de>;
type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
}
impl jacquard_common::types::collection::Collection for GameRecord {
const NSID: &'static str = "games.gamesgamesgamesgames.game";
type Record = GameRecord;
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Game<'a> {
fn nsid() -> &'static str {
"games.gamesgamesgamesgames.game"
}
fn def_name() -> &'static str {
"main"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_games_gamesgamesgamesgames_game()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}
fn lexicon_doc_games_gamesgamesgamesgames_game() -> ::jacquard_lexicon::lexicon::LexiconDoc<
'static,
> {
::jacquard_lexicon::lexicon::LexiconDoc {
lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
id: ::jacquard_common::CowStr::new_static("games.gamesgamesgamesgames.game"),
revision: None,
description: None,
defs: {
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("main"),
::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord {
description: Some(
::jacquard_common::CowStr::new_static("A video game."),
),
key: Some(::jacquard_common::CowStr::new_static("any")),
record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("name"),
::jacquard_common::deps::smol_str::SmolStr::new_static("createdAt"),
::jacquard_common::deps::smol_str::SmolStr::new_static("applicationType")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"ageRatings",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: None,
items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"games.gamesgamesgamesgames.defs#ageRating",
),
}),
min_length: None,
max_length: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"alternativeNames",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: None,
items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"games.gamesgamesgamesgames.defs#alternativeName",
),
}),
min_length: None,
max_length: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"applicationType",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"games.gamesgamesgamesgames.defs#applicationType",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"createdAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"description",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Detailed game description in plain text, with formatting expressed via descriptionFacets.",
),
),
format: None,
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"descriptionFacets",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: Some(
::jacquard_common::CowStr::new_static(
"Rich text facets for the description field.",
),
),
items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"games.gamesgamesgamesgames.richtext.facet",
),
}),
min_length: None,
max_length: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"engines",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: None,
items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::AtUri,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
min_length: None,
max_length: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"externalIds",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"games.gamesgamesgamesgames.defs#externalIds",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"genres",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: None,
items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"games.gamesgamesgamesgames.defs#genre",
),
}),
min_length: None,
max_length: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"keywords",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: None,
items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: None,
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
min_length: None,
max_length: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"languageSupports",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: None,
items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"games.gamesgamesgamesgames.defs#languageSupport",
),
}),
min_length: None,
max_length: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"media",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: Some(
::jacquard_common::CowStr::new_static(
"Images associated with the game.",
),
),
items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"games.gamesgamesgamesgames.defs#mediaItem",
),
}),
min_length: None,
max_length: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"modes",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: None,
items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"games.gamesgamesgamesgames.defs#mode",
),
}),
min_length: None,
max_length: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"multiplayerModes",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: None,
items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"games.gamesgamesgamesgames.defs#multiplayerMode",
),
}),
min_length: None,
max_length: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"name",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: None,
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"parent",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::AtUri,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"platformFeatures",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: Some(
::jacquard_common::CowStr::new_static(
"Platform-specific feature support.",
),
),
items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"games.gamesgamesgamesgames.defs#platformFeatures",
),
}),
min_length: None,
max_length: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"playerPerspectives",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: None,
items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"games.gamesgamesgamesgames.defs#playerPerspective",
),
}),
min_length: None,
max_length: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"publishedAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"When this record was marked ready for public viewing.",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"releases",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: None,
items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"games.gamesgamesgamesgames.defs#release",
),
}),
min_length: None,
max_length: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"storyline",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: None,
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"summary",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: None,
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"systemRequirements",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: Some(
::jacquard_common::CowStr::new_static(
"System requirements per platform.",
),
),
items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"games.gamesgamesgamesgames.defs#systemRequirements",
),
}),
min_length: None,
max_length: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"themes",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: None,
items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"games.gamesgamesgamesgames.defs#theme",
),
}),
min_length: None,
max_length: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"timeToBeat",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"games.gamesgamesgamesgames.defs#timeToBeat",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"videos",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: None,
items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"games.gamesgamesgamesgames.defs#externalVideo",
),
}),
min_length: None,
max_length: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"websites",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: None,
items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"games.gamesgamesgamesgames.defs#website",
),
}),
min_length: None,
max_length: None,
}),
);
map
},
}),
}),
);
map
},
}
}