diff --git a/.prettierrc b/.prettierrc index bab43f7..35fc8d4 100644 --- a/.prettierrc +++ b/.prettierrc @@ -3,7 +3,5 @@ "singleQuote": false, "trailingComma": "all", "tabWidth": 2, - "printWidth": 80, - "plugins": ["prettier-plugin-svelte"], - "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }] + "printWidth": 80 } diff --git a/Cargo.lock b/Cargo.lock index 2faa7af..2dbd248 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -120,12 +120,12 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "3.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -169,20 +169,6 @@ dependencies = [ "syn 2.0.43", ] -[[package]] -name = "async-tungstenite" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6acf7e4a267eecbb127ed696bb2d50572c22ba7f586a646321e1798d8336a1" -dependencies = [ - "futures-io", - "futures-util", - "log", - "pin-project-lite", - "tokio", - "tungstenite", -] - [[package]] name = "asynchronous-codec" version = "0.6.2" @@ -233,44 +219,12 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "axum" -version = "0.6.20" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +checksum = "d09dbe0e490df5da9d69b36dca48a76635288a82f92eca90024883a56202026d" dependencies = [ "async-trait", - "axum-core 0.3.4", - "bitflags 1.3.2", - "bytes", - "futures-util", - "http 0.2.11", - "http-body 0.4.6", - "hyper 0.14.28", - "itoa", - "matchit", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "rustversion", - "serde", - "serde_json", - "serde_path_to_error", - "serde_urlencoded", - "sync_wrapper", - "tokio", - "tower", - "tower-layer", - "tower-service", -] - -[[package]] -name = "axum" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "202651474fe73c62d9e0a56c6133f7a0ff1dc1c8cf7a5b03381af2a26553ac9d" -dependencies = [ - "async-trait", - "axum-core 0.4.1", + "axum-core", "bytes", "futures-util", "http 1.0.0", @@ -294,30 +248,14 @@ dependencies = [ "tower", "tower-layer", "tower-service", + "tracing", ] [[package]] name = "axum-core" -version = "0.3.4" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http 0.2.11", - "http-body 0.4.6", - "mime", - "rustversion", - "tower-layer", - "tower-service", -] - -[[package]] -name = "axum-core" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77cb22c689c44d4c07b0ab44ebc25d69d8ae601a2f28fb8d672d344178fa17aa" +checksum = "e87c8503f93e6d144ee5690907ba22db7ba79ab001a932ab99034f0fe836b3df" dependencies = [ "async-trait", "bytes", @@ -331,6 +269,7 @@ dependencies = [ "sync_wrapper", "tower-layer", "tower-service", + "tracing", ] [[package]] @@ -338,20 +277,13 @@ name = "backend" version = "0.1.0" dependencies = [ "anyhow", - "axum 0.7.2", - "chrono", - "clap 4.4.11", - "colourado", - "names", - "petgraph 0.6.4", + "axum", + "clap 4.4.12", + "common", "prisma-client-rust", - "rand 0.8.5", - "rand_chacha 0.3.1", - "rspc", "serde", "serde_json", "tokio", - "triangle", ] [[package]] @@ -397,12 +329,6 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" -[[package]] -name = "base64" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5" - [[package]] name = "base64" version = "0.21.5" @@ -688,9 +614,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.11" +version = "4.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2" +checksum = "dcfab8ba68f3668e89f6ff60f5b205cea56aa7b769451a59f34b8682f51c056d" dependencies = [ "clap_builder", "clap_derive 4.4.7", @@ -698,9 +624,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.11" +version = "4.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a216b506622bb1d316cd51328dce24e07bdff4a6128a47c7e7fad11878d5adbb" +checksum = "fb7fb5e4e979aec3be7791562fcba452f94ad85e954da024396433e0e25a79e9" dependencies = [ "anstream", "anstyle", @@ -804,6 +730,24 @@ dependencies = [ "unreachable", ] +[[package]] +name = "common" +version = "0.1.0" +dependencies = [ + "anyhow", + "chrono", + "colourado", + "getrandom 0.2.11", + "names", + "petgraph 0.6.4", + "prisma-client-rust", + "rand 0.8.5", + "rand_chacha 0.3.1", + "serde", + "serde_json", + "triangle", +] + [[package]] name = "connection-string" version = "0.1.14" @@ -841,17 +785,6 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "cookie" -version = "0.16.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb" -dependencies = [ - "percent-encoding", - "time", - "version_check", -] - [[package]] name = "core-foundation" version = "0.9.4" @@ -1662,8 +1595,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] @@ -1892,25 +1827,6 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" -[[package]] -name = "httpz" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6769d2cb10425c442c41a787d1a3719744770a188cfa7885cd4d8126fa13f37a" -dependencies = [ - "async-tungstenite", - "axum 0.6.20", - "base64 0.20.0", - "cookie", - "form_urlencoded", - "futures", - "http 0.2.11", - "hyper 0.14.28", - "sha1", - "thiserror", - "tokio", -] - [[package]] name = "hyper" version = "0.14.28" @@ -4154,7 +4070,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c68477fb8c11280503aeab140c41b7a0eed57156a73185062ffb4782c18a918f" dependencies = [ "futures", - "httpz", "serde", "serde_json", "specta", @@ -5398,25 +5313,6 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" -[[package]] -name = "tungstenite" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ee6ab729cd4cf0fd55218530c4522ed30b7b6081752839b68fcec8d0960788" -dependencies = [ - "base64 0.13.1", - "byteorder", - "bytes", - "http 0.2.11", - "httparse", - "log", - "rand 0.8.5", - "sha1", - "thiserror", - "url", - "utf-8", -] - [[package]] name = "twox-hash" version = "1.6.3" @@ -5541,12 +5437,6 @@ dependencies = [ "user-facing-error-macros", ] -[[package]] -name = "utf-8" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" - [[package]] name = "utf8parse" version = "0.2.1" diff --git a/Cargo.toml b/Cargo.toml index 3d75b22..1bfb157 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,3 @@ -workspace.members = ["backend", "prisma-cli", "triangle", "triangle-sys"] +workspace.members = ["backend", "common", "prisma-cli", "triangle", "triangle-sys"] workspace.resolver = "2" workspace.default-members = ["backend"] diff --git a/README.md b/README.md index 01915f9..f6747bf 100644 --- a/README.md +++ b/README.md @@ -3,4 +3,4 @@ ## TODO Items - [ ] Fog of war -- [ ] \ No newline at end of file +- [ ] diff --git a/backend/Cargo.toml b/backend/Cargo.toml index 3cb17a5..1758970 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -4,21 +4,14 @@ version = "0.1.0" edition = "2021" [dependencies] -triangle = { path = "../triangle" } +common = { path = "../common", features = ["worldgen"] } anyhow = "1.0.76" axum = { version = "0.7.2", features = ["http2"] } -chrono = "0.4.31" clap = { version = "4.4.11", features = ["derive"] } serde = { version = "1.0.193", features = ["derive"] } -tokio = { version = "1.35.1", features = ["full"] } serde_json = "1.0.108" -petgraph = "0.6.4" -names = "0.14.0" -rand = "0.8.5" -rspc = { version = "0.1.3", features = ["axum"] } -rand_chacha = "0.3.1" -colourado = "0.2.0" +tokio = { version = "1.35.1", features = ["full"] } [dependencies.prisma-client-rust] git = "https://github.com/Brendonovich/prisma-client-rust" diff --git a/backend/src/main.rs b/backend/src/main.rs index d7ebcfb..a26fd43 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -1,23 +1,18 @@ #[macro_use] extern crate serde_json; -mod generate; -#[allow(unused_imports, dead_code, clippy::all)] -pub mod prisma; mod routes; -pub mod state; -mod utils; + +pub use common::prisma; use std::sync::Arc; use anyhow::Result; use axum::{routing::get, Router}; use clap::{Parser, Subcommand}; -use prisma::PrismaClient; +use common::{generate::generate_initial_game_state, prisma::PrismaClient}; -use routes::{empire_list, universe_list, universe_map}; - -use crate::generate::generate_initial_game_state; +use crate::routes::{empire_list, universe_list, universe_map}; #[derive(Debug, Parser)] struct Opt { @@ -33,7 +28,7 @@ enum Command { #[derive(Clone)] struct AppState { - prisma: Arc, + pub prisma: Arc, } #[tokio::main] diff --git a/backend/src/routes/mod.rs b/backend/src/routes.rs similarity index 92% rename from backend/src/routes/mod.rs rename to backend/src/routes.rs index 910e869..0a1ce42 100644 --- a/backend/src/routes/mod.rs +++ b/backend/src/routes.rs @@ -5,11 +5,9 @@ use axum::{ use prisma_client_rust::Direction; use serde_json::Value; -use crate::{ - prisma::{empire, planet, star_system, star_system_edges}, - state::UniverseId, - AppState, -}; +use common::prisma::{empire, planet, star_system, star_system_edges}; + +use crate::AppState; pub async fn universe_list(state: State) -> Json { let universes = state @@ -51,7 +49,7 @@ pub async fn universe_map( .star_system() .find_many(vec![star_system::universe_id::equals(universe_id)]) .order_by(star_system::index::order(Direction::Asc)) - .select(star_system::select!({ index coord_x coord_y owned_by_empire_id })) + .select(star_system::select!({ index coord_x coord_y owned_by_empire_id planets })) .exec() .await .unwrap(); diff --git a/common/Cargo.toml b/common/Cargo.toml new file mode 100644 index 0000000..aec31b0 --- /dev/null +++ b/common/Cargo.toml @@ -0,0 +1,34 @@ +[package] +name = "common" +version = "0.1.0" +edition = "2021" + +[lib] +crate-type = ["cdylib", "rlib"] + +[features] +default = [] +worldgen = ["db", "dep:triangle"] +db = ["dep:prisma-client-rust"] + +[dependencies] +triangle = { path = "../triangle", optional = true } + +anyhow = "1.0.76" +chrono = "0.4.31" +colourado = "0.2.0" +names = "0.14.0" +petgraph = "0.6.4" +rand = "0.8.5" +rand_chacha = "0.3.1" +# rspc = { version = "0.1.3", features = ["axum"] } +serde = { version = "1.0.193", features = ["derive"] } +serde_json = "1.0.108" +# tokio = { version = "1.35.1", features = ["full"] } +getrandom = { version = "0.2.11", features = ["js"] } + +[dependencies.prisma-client-rust] +git = "https://github.com/Brendonovich/prisma-client-rust" +tag = "0.6.10" +features = ["rspc"] +optional = true diff --git a/backend/src/generate/map.rs b/common/src/generate/map.rs similarity index 98% rename from backend/src/generate/map.rs rename to common/src/generate/map.rs index 1978471..fd7621d 100644 --- a/backend/src/generate/map.rs +++ b/common/src/generate/map.rs @@ -31,7 +31,7 @@ pub fn generate_map() -> Result { TrianglulateOpts::builder() .point_list(point_list) .voronoi(true) - .maximum_triangle_area(6_000.0) + .maximum_triangle_area(7_500.0) .build()?, )? }; diff --git a/backend/src/generate/mod.rs b/common/src/generate/mod.rs similarity index 98% rename from backend/src/generate/mod.rs rename to common/src/generate/mod.rs index f0301bc..ee4c4e2 100644 --- a/backend/src/generate/mod.rs +++ b/common/src/generate/mod.rs @@ -11,7 +11,7 @@ use rand::{seq::SliceRandom, thread_rng, RngCore, SeedableRng}; use rand_chacha::ChaCha12Rng; use crate::{ - prisma::{planet, star_system, universe, PrismaClient}, + prisma::PrismaClient, state::{ EmpireCoreState, EmpireId, GameCoreState, PlanetCoreState, PlanetId, StarSystemId, UniverseId, diff --git a/common/src/lib.rs b/common/src/lib.rs new file mode 100644 index 0000000..3aa1713 --- /dev/null +++ b/common/src/lib.rs @@ -0,0 +1,11 @@ +#[macro_use] +extern crate serde_json; + +#[cfg(feature = "worldgen")] +pub mod generate; + +#[allow(unused_imports, dead_code, clippy::all)] +#[cfg(feature = "db")] +pub mod prisma; +pub mod state; +pub mod utils; diff --git a/common/src/prisma.rs b/common/src/prisma.rs new file mode 100644 index 0000000..0d6555c --- /dev/null +++ b/common/src/prisma.rs @@ -0,0 +1,17776 @@ +// Code generated by Prisma Client Rust. DO NOT EDIT + +pub static DATAMODEL_STR: &'static str = + include_str!("/Users/michael/Projects/openstellaris/prisma/schema.prisma"); +static DATABASE_STR: &'static str = "postgresql"; +pub async fn new_client( +) -> Result { + PrismaClient::_builder().build().await +} +pub async fn new_client_with_url( + url: &str, +) -> Result { + PrismaClient::_builder() + .with_url(url.to_string()) + .build() + .await +} +pub mod universe { + use super::_prisma::*; + use super::*; + pub const NAME: &str = "Universe"; + pub mod id { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "id"; + pub struct Set(pub i32); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetId(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::Id(v) + } + } + pub fn set>(value: i32) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::Id(direction) + } + pub fn equals>(value: i32) -> T { + UniqueWhereParam::IdEquals(value).into() + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::IntFilter, + Id, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: i32) -> Lt; + fn lte(_: i32) -> Lte; + fn gt(_: i32) -> Gt; + fn gte(_: i32) -> Gte; + fn not(_: i32) -> Not; + } + ); + pub fn increment(value: i32) -> SetParam { + SetParam::IncrementId(value) + } + pub fn decrement(value: i32) -> SetParam { + SetParam::DecrementId(value) + } + pub fn multiply(value: i32) -> SetParam { + SetParam::MultiplyId(value) + } + pub fn divide(value: i32) -> SetParam { + SetParam::DivideId(value) + } + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Id(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Id(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod config { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "config"; + pub struct Set(pub ::prisma_client_rust::serde_json::Value); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetConfig(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::Config(v) + } + } + pub fn set>( + value: ::prisma_client_rust::serde_json::Value, + ) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::Config(direction) + } + pub fn equals( + value: ::prisma_client_rust::serde_json::Value, + ) -> WhereParam { + WhereParam::Config(_prisma::read_filters::JsonFilter::Equals(value)) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::JsonFilter, + Config, + { + fn path(_: Vec) -> Path; + fn string_contains(_: String) -> StringContains; + fn string_starts_with(_: String) -> StringStartsWith; + fn string_ends_with(_: String) -> StringEndsWith; + fn array_contains( + _: Option<::prisma_client_rust::serde_json::Value>, + ) -> ArrayContains; + fn array_starts_with( + _: Option<::prisma_client_rust::serde_json::Value>, + ) -> ArrayStartsWith; + fn array_ends_with( + _: Option<::prisma_client_rust::serde_json::Value>, + ) -> ArrayEndsWith; + fn lt(_: ::prisma_client_rust::serde_json::Value) -> Lt; + fn lte(_: ::prisma_client_rust::serde_json::Value) -> Lte; + fn gt(_: ::prisma_client_rust::serde_json::Value) -> Gt; + fn gte(_: ::prisma_client_rust::serde_json::Value) -> Gte; + fn not(_: ::prisma_client_rust::serde_json::Value) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Config(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Config(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod players { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "players"; + pub struct Fetch(pub player::ManyArgs); + impl Fetch { + pub fn with(mut self, params: impl Into) -> Self { + self.0 = self.0.with(params.into()); + self + } + pub fn order_by(mut self, param: player::OrderByParam) -> Self { + self.0 = self.0.order_by(param); + self + } + pub fn skip(mut self, value: i64) -> Self { + self.0 = self.0.skip(value); + self + } + pub fn take(mut self, value: i64) -> Self { + self.0 = self.0.take(value); + self + } + pub fn cursor(mut self, value: player::UniqueWhereParam) -> Self { + self.0 = self.0.cursor(value.into()); + self + } + } + impl From for WithParam { + fn from(Fetch(v): Fetch) -> Self { + WithParam::Players(v) + } + } + pub fn fetch(params: Vec) -> Fetch { + Fetch(player::ManyArgs::new(params)) + } + pub struct Connect(pub Vec); + impl From for SetParam { + fn from(Connect(v): Connect) -> Self { + Self::ConnectPlayers(v) + } + } + pub fn connect>( + params: Vec, + ) -> T { + Connect(params).into() + } + pub fn disconnect(params: Vec) -> SetParam { + SetParam::DisconnectPlayers(params) + } + pub fn set(params: Vec) -> SetParam { + SetParam::SetPlayers(params) + } + pub fn some(value: Vec) -> WhereParam { + WhereParam::PlayersSome(value) + } + pub fn every(value: Vec) -> WhereParam { + WhereParam::PlayersEvery(value) + } + pub fn none(value: Vec) -> WhereParam { + WhereParam::PlayersNone(value) + } + pub enum Include { + Select(player::ManyArgs, Vec), + Include(player::ManyArgs, Vec), + Fetch(player::ManyArgs), + } + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Players(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let (args , selections) = match self { Self :: Select (args , selections) => (args . to_graphql () . 0 , selections . into_iter () . map (| s | s . to_selection ()) . collect ()) , Self :: Include (args , selections) => (args . to_graphql () . 0 , { let mut nested_selections = < player :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections }) , Self :: Fetch (args) => (args . to_graphql () . 0 , < player :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; + ::prisma_client_rust::Selection::new(NAME, None, args, selections) + } + pub fn select( + args: player::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Select(args, nested_selections) + } + pub fn include( + args: player::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Include(args, nested_selections) + } + } + pub enum Select { + Select(player::ManyArgs, Vec), + Include(player::ManyArgs, Vec), + Fetch(player::ManyArgs), + } + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Players(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let (args , selections) = match self { Self :: Select (args , selections) => (args . to_graphql () . 0 , selections . into_iter () . map (| s | s . to_selection ()) . collect ()) , Self :: Include (args , selections) => (args . to_graphql () . 0 , { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections }) , Self :: Fetch (args) => (args . to_graphql () . 0 , < player :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; + ::prisma_client_rust::Selection::new(NAME, None, args, selections) + } + pub fn select( + args: player::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Select(args, nested_selections) + } + pub fn include( + args: player::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Include(args, nested_selections) + } + } + } + pub mod empires { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "empires"; + pub struct Fetch(pub empire::ManyArgs); + impl Fetch { + pub fn with(mut self, params: impl Into) -> Self { + self.0 = self.0.with(params.into()); + self + } + pub fn order_by(mut self, param: empire::OrderByParam) -> Self { + self.0 = self.0.order_by(param); + self + } + pub fn skip(mut self, value: i64) -> Self { + self.0 = self.0.skip(value); + self + } + pub fn take(mut self, value: i64) -> Self { + self.0 = self.0.take(value); + self + } + pub fn cursor(mut self, value: empire::UniqueWhereParam) -> Self { + self.0 = self.0.cursor(value.into()); + self + } + } + impl From for WithParam { + fn from(Fetch(v): Fetch) -> Self { + WithParam::Empires(v) + } + } + pub fn fetch(params: Vec) -> Fetch { + Fetch(empire::ManyArgs::new(params)) + } + pub struct Connect(pub Vec); + impl From for SetParam { + fn from(Connect(v): Connect) -> Self { + Self::ConnectEmpires(v) + } + } + pub fn connect>( + params: Vec, + ) -> T { + Connect(params).into() + } + pub fn disconnect(params: Vec) -> SetParam { + SetParam::DisconnectEmpires(params) + } + pub fn set(params: Vec) -> SetParam { + SetParam::SetEmpires(params) + } + pub fn some(value: Vec) -> WhereParam { + WhereParam::EmpiresSome(value) + } + pub fn every(value: Vec) -> WhereParam { + WhereParam::EmpiresEvery(value) + } + pub fn none(value: Vec) -> WhereParam { + WhereParam::EmpiresNone(value) + } + pub enum Include { + Select(empire::ManyArgs, Vec), + Include(empire::ManyArgs, Vec), + Fetch(empire::ManyArgs), + } + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Empires(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let (args , selections) = match self { Self :: Select (args , selections) => (args . to_graphql () . 0 , selections . into_iter () . map (| s | s . to_selection ()) . collect ()) , Self :: Include (args , selections) => (args . to_graphql () . 0 , { let mut nested_selections = < empire :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections }) , Self :: Fetch (args) => (args . to_graphql () . 0 , < empire :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; + ::prisma_client_rust::Selection::new(NAME, None, args, selections) + } + pub fn select( + args: empire::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Select(args, nested_selections) + } + pub fn include( + args: empire::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Include(args, nested_selections) + } + } + pub enum Select { + Select(empire::ManyArgs, Vec), + Include(empire::ManyArgs, Vec), + Fetch(empire::ManyArgs), + } + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Empires(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let (args , selections) = match self { Self :: Select (args , selections) => (args . to_graphql () . 0 , selections . into_iter () . map (| s | s . to_selection ()) . collect ()) , Self :: Include (args , selections) => (args . to_graphql () . 0 , { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections }) , Self :: Fetch (args) => (args . to_graphql () . 0 , < empire :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; + ::prisma_client_rust::Selection::new(NAME, None, args, selections) + } + pub fn select( + args: empire::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Select(args, nested_selections) + } + pub fn include( + args: empire::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Include(args, nested_selections) + } + } + } + pub mod star_systems { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "starSystems"; + pub struct Fetch(pub star_system::ManyArgs); + impl Fetch { + pub fn with(mut self, params: impl Into) -> Self { + self.0 = self.0.with(params.into()); + self + } + pub fn order_by(mut self, param: star_system::OrderByParam) -> Self { + self.0 = self.0.order_by(param); + self + } + pub fn skip(mut self, value: i64) -> Self { + self.0 = self.0.skip(value); + self + } + pub fn take(mut self, value: i64) -> Self { + self.0 = self.0.take(value); + self + } + pub fn cursor(mut self, value: star_system::UniqueWhereParam) -> Self { + self.0 = self.0.cursor(value.into()); + self + } + } + impl From for WithParam { + fn from(Fetch(v): Fetch) -> Self { + WithParam::StarSystems(v) + } + } + pub fn fetch(params: Vec) -> Fetch { + Fetch(star_system::ManyArgs::new(params)) + } + pub struct Connect(pub Vec); + impl From for SetParam { + fn from(Connect(v): Connect) -> Self { + Self::ConnectStarSystems(v) + } + } + pub fn connect>( + params: Vec, + ) -> T { + Connect(params).into() + } + pub fn disconnect(params: Vec) -> SetParam { + SetParam::DisconnectStarSystems(params) + } + pub fn set(params: Vec) -> SetParam { + SetParam::SetStarSystems(params) + } + pub fn some(value: Vec) -> WhereParam { + WhereParam::StarSystemsSome(value) + } + pub fn every(value: Vec) -> WhereParam { + WhereParam::StarSystemsEvery(value) + } + pub fn none(value: Vec) -> WhereParam { + WhereParam::StarSystemsNone(value) + } + pub enum Include { + Select(star_system::ManyArgs, Vec), + Include(star_system::ManyArgs, Vec), + Fetch(star_system::ManyArgs), + } + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::StarSystems(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let (args , selections) = match self { Self :: Select (args , selections) => (args . to_graphql () . 0 , selections . into_iter () . map (| s | s . to_selection ()) . collect ()) , Self :: Include (args , selections) => (args . to_graphql () . 0 , { let mut nested_selections = < star_system :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections }) , Self :: Fetch (args) => (args . to_graphql () . 0 , < star_system :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; + ::prisma_client_rust::Selection::new(NAME, None, args, selections) + } + pub fn select( + args: star_system::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Select(args, nested_selections) + } + pub fn include( + args: star_system::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Include(args, nested_selections) + } + } + pub enum Select { + Select(star_system::ManyArgs, Vec), + Include(star_system::ManyArgs, Vec), + Fetch(star_system::ManyArgs), + } + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::StarSystems(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let (args , selections) = match self { Self :: Select (args , selections) => (args . to_graphql () . 0 , selections . into_iter () . map (| s | s . to_selection ()) . collect ()) , Self :: Include (args , selections) => (args . to_graphql () . 0 , { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections }) , Self :: Fetch (args) => (args . to_graphql () . 0 , < star_system :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; + ::prisma_client_rust::Selection::new(NAME, None, args, selections) + } + pub fn select( + args: star_system::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Select(args, nested_selections) + } + pub fn include( + args: star_system::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Include(args, nested_selections) + } + } + } + pub mod planets { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "planets"; + pub struct Fetch(pub planet::ManyArgs); + impl Fetch { + pub fn with(mut self, params: impl Into) -> Self { + self.0 = self.0.with(params.into()); + self + } + pub fn order_by(mut self, param: planet::OrderByParam) -> Self { + self.0 = self.0.order_by(param); + self + } + pub fn skip(mut self, value: i64) -> Self { + self.0 = self.0.skip(value); + self + } + pub fn take(mut self, value: i64) -> Self { + self.0 = self.0.take(value); + self + } + pub fn cursor(mut self, value: planet::UniqueWhereParam) -> Self { + self.0 = self.0.cursor(value.into()); + self + } + } + impl From for WithParam { + fn from(Fetch(v): Fetch) -> Self { + WithParam::Planets(v) + } + } + pub fn fetch(params: Vec) -> Fetch { + Fetch(planet::ManyArgs::new(params)) + } + pub struct Connect(pub Vec); + impl From for SetParam { + fn from(Connect(v): Connect) -> Self { + Self::ConnectPlanets(v) + } + } + pub fn connect>( + params: Vec, + ) -> T { + Connect(params).into() + } + pub fn disconnect(params: Vec) -> SetParam { + SetParam::DisconnectPlanets(params) + } + pub fn set(params: Vec) -> SetParam { + SetParam::SetPlanets(params) + } + pub fn some(value: Vec) -> WhereParam { + WhereParam::PlanetsSome(value) + } + pub fn every(value: Vec) -> WhereParam { + WhereParam::PlanetsEvery(value) + } + pub fn none(value: Vec) -> WhereParam { + WhereParam::PlanetsNone(value) + } + pub enum Include { + Select(planet::ManyArgs, Vec), + Include(planet::ManyArgs, Vec), + Fetch(planet::ManyArgs), + } + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Planets(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let (args , selections) = match self { Self :: Select (args , selections) => (args . to_graphql () . 0 , selections . into_iter () . map (| s | s . to_selection ()) . collect ()) , Self :: Include (args , selections) => (args . to_graphql () . 0 , { let mut nested_selections = < planet :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections }) , Self :: Fetch (args) => (args . to_graphql () . 0 , < planet :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; + ::prisma_client_rust::Selection::new(NAME, None, args, selections) + } + pub fn select( + args: planet::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Select(args, nested_selections) + } + pub fn include( + args: planet::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Include(args, nested_selections) + } + } + pub enum Select { + Select(planet::ManyArgs, Vec), + Include(planet::ManyArgs, Vec), + Fetch(planet::ManyArgs), + } + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Planets(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let (args , selections) = match self { Self :: Select (args , selections) => (args . to_graphql () . 0 , selections . into_iter () . map (| s | s . to_selection ()) . collect ()) , Self :: Include (args , selections) => (args . to_graphql () . 0 , { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections }) , Self :: Fetch (args) => (args . to_graphql () . 0 , < planet :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; + ::prisma_client_rust::Selection::new(NAME, None, args, selections) + } + pub fn select( + args: planet::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Select(args, nested_selections) + } + pub fn include( + args: planet::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Include(args, nested_selections) + } + } + } + pub mod fleets { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "fleets"; + pub struct Fetch(pub fleet::ManyArgs); + impl Fetch { + pub fn with(mut self, params: impl Into) -> Self { + self.0 = self.0.with(params.into()); + self + } + pub fn order_by(mut self, param: fleet::OrderByParam) -> Self { + self.0 = self.0.order_by(param); + self + } + pub fn skip(mut self, value: i64) -> Self { + self.0 = self.0.skip(value); + self + } + pub fn take(mut self, value: i64) -> Self { + self.0 = self.0.take(value); + self + } + pub fn cursor(mut self, value: fleet::UniqueWhereParam) -> Self { + self.0 = self.0.cursor(value.into()); + self + } + } + impl From for WithParam { + fn from(Fetch(v): Fetch) -> Self { + WithParam::Fleets(v) + } + } + pub fn fetch(params: Vec) -> Fetch { + Fetch(fleet::ManyArgs::new(params)) + } + pub struct Connect(pub Vec); + impl From for SetParam { + fn from(Connect(v): Connect) -> Self { + Self::ConnectFleets(v) + } + } + pub fn connect>( + params: Vec, + ) -> T { + Connect(params).into() + } + pub fn disconnect(params: Vec) -> SetParam { + SetParam::DisconnectFleets(params) + } + pub fn set(params: Vec) -> SetParam { + SetParam::SetFleets(params) + } + pub fn some(value: Vec) -> WhereParam { + WhereParam::FleetsSome(value) + } + pub fn every(value: Vec) -> WhereParam { + WhereParam::FleetsEvery(value) + } + pub fn none(value: Vec) -> WhereParam { + WhereParam::FleetsNone(value) + } + pub enum Include { + Select(fleet::ManyArgs, Vec), + Include(fleet::ManyArgs, Vec), + Fetch(fleet::ManyArgs), + } + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Fleets(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let (args , selections) = match self { Self :: Select (args , selections) => (args . to_graphql () . 0 , selections . into_iter () . map (| s | s . to_selection ()) . collect ()) , Self :: Include (args , selections) => (args . to_graphql () . 0 , { let mut nested_selections = < fleet :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections }) , Self :: Fetch (args) => (args . to_graphql () . 0 , < fleet :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; + ::prisma_client_rust::Selection::new(NAME, None, args, selections) + } + pub fn select( + args: fleet::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Select(args, nested_selections) + } + pub fn include( + args: fleet::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Include(args, nested_selections) + } + } + pub enum Select { + Select(fleet::ManyArgs, Vec), + Include(fleet::ManyArgs, Vec), + Fetch(fleet::ManyArgs), + } + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Fleets(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let (args , selections) = match self { Self :: Select (args , selections) => (args . to_graphql () . 0 , selections . into_iter () . map (| s | s . to_selection ()) . collect ()) , Self :: Include (args , selections) => (args . to_graphql () . 0 , { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections }) , Self :: Fetch (args) => (args . to_graphql () . 0 , < fleet :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; + ::prisma_client_rust::Selection::new(NAME, None, args, selections) + } + pub fn select( + args: fleet::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Select(args, nested_selections) + } + pub fn include( + args: fleet::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Include(args, nested_selections) + } + } + } + pub mod hyperlanes { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "hyperlanes"; + pub struct Fetch(pub star_system_edges::ManyArgs); + impl Fetch { + pub fn with( + mut self, + params: impl Into, + ) -> Self { + self.0 = self.0.with(params.into()); + self + } + pub fn order_by( + mut self, + param: star_system_edges::OrderByParam, + ) -> Self { + self.0 = self.0.order_by(param); + self + } + pub fn skip(mut self, value: i64) -> Self { + self.0 = self.0.skip(value); + self + } + pub fn take(mut self, value: i64) -> Self { + self.0 = self.0.take(value); + self + } + pub fn cursor( + mut self, + value: star_system_edges::UniqueWhereParam, + ) -> Self { + self.0 = self.0.cursor(value.into()); + self + } + } + impl From for WithParam { + fn from(Fetch(v): Fetch) -> Self { + WithParam::Hyperlanes(v) + } + } + pub fn fetch(params: Vec) -> Fetch { + Fetch(star_system_edges::ManyArgs::new(params)) + } + pub struct Connect(pub Vec); + impl From for SetParam { + fn from(Connect(v): Connect) -> Self { + Self::ConnectHyperlanes(v) + } + } + pub fn connect>( + params: Vec, + ) -> T { + Connect(params).into() + } + pub fn disconnect( + params: Vec, + ) -> SetParam { + SetParam::DisconnectHyperlanes(params) + } + pub fn set(params: Vec) -> SetParam { + SetParam::SetHyperlanes(params) + } + pub fn some(value: Vec) -> WhereParam { + WhereParam::HyperlanesSome(value) + } + pub fn every(value: Vec) -> WhereParam { + WhereParam::HyperlanesEvery(value) + } + pub fn none(value: Vec) -> WhereParam { + WhereParam::HyperlanesNone(value) + } + pub enum Include { + Select( + star_system_edges::ManyArgs, + Vec, + ), + Include( + star_system_edges::ManyArgs, + Vec, + ), + Fetch(star_system_edges::ManyArgs), + } + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Hyperlanes(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let (args , selections) = match self { Self :: Select (args , selections) => (args . to_graphql () . 0 , selections . into_iter () . map (| s | s . to_selection ()) . collect ()) , Self :: Include (args , selections) => (args . to_graphql () . 0 , { let mut nested_selections = < star_system_edges :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections }) , Self :: Fetch (args) => (args . to_graphql () . 0 , < star_system_edges :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; + ::prisma_client_rust::Selection::new(NAME, None, args, selections) + } + pub fn select( + args: star_system_edges::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Select(args, nested_selections) + } + pub fn include( + args: star_system_edges::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Include(args, nested_selections) + } + } + pub enum Select { + Select( + star_system_edges::ManyArgs, + Vec, + ), + Include( + star_system_edges::ManyArgs, + Vec, + ), + Fetch(star_system_edges::ManyArgs), + } + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Hyperlanes(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let (args , selections) = match self { Self :: Select (args , selections) => (args . to_graphql () . 0 , selections . into_iter () . map (| s | s . to_selection ()) . collect ()) , Self :: Include (args , selections) => (args . to_graphql () . 0 , { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections }) , Self :: Fetch (args) => (args . to_graphql () . 0 , < star_system_edges :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; + ::prisma_client_rust::Selection::new(NAME, None, args, selections) + } + pub fn select( + args: star_system_edges::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Select(args, nested_selections) + } + pub fn include( + args: star_system_edges::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Include(args, nested_selections) + } + } + } + pub mod starbases { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "starbases"; + pub struct Fetch(pub starbase::ManyArgs); + impl Fetch { + pub fn with(mut self, params: impl Into) -> Self { + self.0 = self.0.with(params.into()); + self + } + pub fn order_by(mut self, param: starbase::OrderByParam) -> Self { + self.0 = self.0.order_by(param); + self + } + pub fn skip(mut self, value: i64) -> Self { + self.0 = self.0.skip(value); + self + } + pub fn take(mut self, value: i64) -> Self { + self.0 = self.0.take(value); + self + } + pub fn cursor(mut self, value: starbase::UniqueWhereParam) -> Self { + self.0 = self.0.cursor(value.into()); + self + } + } + impl From for WithParam { + fn from(Fetch(v): Fetch) -> Self { + WithParam::Starbases(v) + } + } + pub fn fetch(params: Vec) -> Fetch { + Fetch(starbase::ManyArgs::new(params)) + } + pub struct Connect(pub Vec); + impl From for SetParam { + fn from(Connect(v): Connect) -> Self { + Self::ConnectStarbases(v) + } + } + pub fn connect>( + params: Vec, + ) -> T { + Connect(params).into() + } + pub fn disconnect(params: Vec) -> SetParam { + SetParam::DisconnectStarbases(params) + } + pub fn set(params: Vec) -> SetParam { + SetParam::SetStarbases(params) + } + pub fn some(value: Vec) -> WhereParam { + WhereParam::StarbasesSome(value) + } + pub fn every(value: Vec) -> WhereParam { + WhereParam::StarbasesEvery(value) + } + pub fn none(value: Vec) -> WhereParam { + WhereParam::StarbasesNone(value) + } + pub enum Include { + Select(starbase::ManyArgs, Vec), + Include(starbase::ManyArgs, Vec), + Fetch(starbase::ManyArgs), + } + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Starbases(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let (args , selections) = match self { Self :: Select (args , selections) => (args . to_graphql () . 0 , selections . into_iter () . map (| s | s . to_selection ()) . collect ()) , Self :: Include (args , selections) => (args . to_graphql () . 0 , { let mut nested_selections = < starbase :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections }) , Self :: Fetch (args) => (args . to_graphql () . 0 , < starbase :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; + ::prisma_client_rust::Selection::new(NAME, None, args, selections) + } + pub fn select( + args: starbase::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Select(args, nested_selections) + } + pub fn include( + args: starbase::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Include(args, nested_selections) + } + } + pub enum Select { + Select(starbase::ManyArgs, Vec), + Include(starbase::ManyArgs, Vec), + Fetch(starbase::ManyArgs), + } + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Starbases(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let (args , selections) = match self { Self :: Select (args , selections) => (args . to_graphql () . 0 , selections . into_iter () . map (| s | s . to_selection ()) . collect ()) , Self :: Include (args , selections) => (args . to_graphql () . 0 , { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections }) , Self :: Fetch (args) => (args . to_graphql () . 0 , < starbase :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; + ::prisma_client_rust::Selection::new(NAME, None, args, selections) + } + pub fn select( + args: starbase::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Select(args, nested_selections) + } + pub fn include( + args: starbase::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Include(args, nested_selections) + } + } + } + pub fn create( + config: ::prisma_client_rust::serde_json::Value, + _params: Vec, + ) -> (::prisma_client_rust::serde_json::Value, Vec) { + (config, _params) + } + pub fn create_unchecked( + config: ::prisma_client_rust::serde_json::Value, + _params: Vec, + ) -> (::prisma_client_rust::serde_json::Value, Vec) { + (config, _params) + } + #[macro_export] + macro_rules ! _select_universe { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: universe :: select ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: universe :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: universe :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: universe :: select ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: universe :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: universe :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { id , config , players , empires , star_systems , planets , fleets , hyperlanes , starbases } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } const SPECTA_TYPE_NAME : & 'static str = prisma_client_rust :: macros :: to_pascal_case ! ($ ($ module_name) ?) ; crate :: prisma :: universe :: select ! (@ specta_data_struct ; pub struct Data { $ (# [specta (rename_from_path = crate :: prisma :: universe :: $ field :: NAME)] pub $ field : crate :: prisma :: universe :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } ; $ ($ module_name) ?) ; impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) +] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: universe :: $ field :: NAME , & self . $ field) ? ;) * state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: universe :: $ field :: NAME) , + ,] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: universe :: $ field :: NAME => Ok (Field :: $ field)) , * , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * while let Some (key) = map . next_key () ? { match key { $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: universe :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: universe :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "config" , "players" , "empires" , "starSystems" , "planets" , "fleets" , "hyperlanes" , "starbases"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: universe :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { i32 } ; (@ field_type ; config) => { :: prisma_client_rust :: serde_json :: Value } ; (@ field_type ; players : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < players :: Data > } ; (@ field_type ; players) => { Vec < crate :: prisma :: player :: Data > } ; (@ field_type ; empires : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < empires :: Data > } ; (@ field_type ; empires) => { Vec < crate :: prisma :: empire :: Data > } ; (@ field_type ; star_systems : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < star_systems :: Data > } ; (@ field_type ; star_systems) => { Vec < crate :: prisma :: star_system :: Data > } ; (@ field_type ; planets : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < planets :: Data > } ; (@ field_type ; planets) => { Vec < crate :: prisma :: planet :: Data > } ; (@ field_type ; fleets : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < fleets :: Data > } ; (@ field_type ; fleets) => { Vec < crate :: prisma :: fleet :: Data > } ; (@ field_type ; hyperlanes : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < hyperlanes :: Data > } ; (@ field_type ; hyperlanes) => { Vec < crate :: prisma :: star_system_edges :: Data > } ; (@ field_type ; starbases : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < starbases :: Data > } ; (@ field_type ; starbases) => { Vec < crate :: prisma :: starbase :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Universe" , available relations are "id, config, players, empires, star_systems, planets, fleets, hyperlanes, starbases")) } ; (@ field_module ; players : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: player :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; empires : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: empire :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; star_systems : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: star_system :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; planets : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: planet :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; fleets : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: fleet :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; hyperlanes : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: star_system_edges :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; starbases : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: starbase :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: universe :: SelectParam > :: into (crate :: prisma :: universe :: id :: Select) } ; (@ selection_field_to_selection_param ; config) => { Into :: < crate :: prisma :: universe :: SelectParam > :: into (crate :: prisma :: universe :: config :: Select) } ; (@ selection_field_to_selection_param ; players $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: universe :: SelectParam > :: into (crate :: prisma :: universe :: players :: Select :: $ selection_mode (crate :: prisma :: player :: ManyArgs :: new (crate :: prisma :: player :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: player :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; players $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: universe :: SelectParam > :: into (crate :: prisma :: universe :: players :: Select :: Fetch (crate :: prisma :: player :: ManyArgs :: new (crate :: prisma :: player :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; empires $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: universe :: SelectParam > :: into (crate :: prisma :: universe :: empires :: Select :: $ selection_mode (crate :: prisma :: empire :: ManyArgs :: new (crate :: prisma :: empire :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: empire :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; empires $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: universe :: SelectParam > :: into (crate :: prisma :: universe :: empires :: Select :: Fetch (crate :: prisma :: empire :: ManyArgs :: new (crate :: prisma :: empire :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; star_systems $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: universe :: SelectParam > :: into (crate :: prisma :: universe :: star_systems :: Select :: $ selection_mode (crate :: prisma :: star_system :: ManyArgs :: new (crate :: prisma :: star_system :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: star_system :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; star_systems $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: universe :: SelectParam > :: into (crate :: prisma :: universe :: star_systems :: Select :: Fetch (crate :: prisma :: star_system :: ManyArgs :: new (crate :: prisma :: star_system :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; planets $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: universe :: SelectParam > :: into (crate :: prisma :: universe :: planets :: Select :: $ selection_mode (crate :: prisma :: planet :: ManyArgs :: new (crate :: prisma :: planet :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: planet :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; planets $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: universe :: SelectParam > :: into (crate :: prisma :: universe :: planets :: Select :: Fetch (crate :: prisma :: planet :: ManyArgs :: new (crate :: prisma :: planet :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; fleets $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: universe :: SelectParam > :: into (crate :: prisma :: universe :: fleets :: Select :: $ selection_mode (crate :: prisma :: fleet :: ManyArgs :: new (crate :: prisma :: fleet :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: fleet :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; fleets $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: universe :: SelectParam > :: into (crate :: prisma :: universe :: fleets :: Select :: Fetch (crate :: prisma :: fleet :: ManyArgs :: new (crate :: prisma :: fleet :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; hyperlanes $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: universe :: SelectParam > :: into (crate :: prisma :: universe :: hyperlanes :: Select :: $ selection_mode (crate :: prisma :: star_system_edges :: ManyArgs :: new (crate :: prisma :: star_system_edges :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: star_system_edges :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; hyperlanes $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: universe :: SelectParam > :: into (crate :: prisma :: universe :: hyperlanes :: Select :: Fetch (crate :: prisma :: star_system_edges :: ManyArgs :: new (crate :: prisma :: star_system_edges :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; starbases $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: universe :: SelectParam > :: into (crate :: prisma :: universe :: starbases :: Select :: $ selection_mode (crate :: prisma :: starbase :: ManyArgs :: new (crate :: prisma :: starbase :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: starbase :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; starbases $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: universe :: SelectParam > :: into (crate :: prisma :: universe :: starbases :: Select :: Fetch (crate :: prisma :: starbase :: ManyArgs :: new (crate :: prisma :: starbase :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: universe :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; config) => { "config" } ; (@ field_serde_name ; players) => { "players" } ; (@ field_serde_name ; empires) => { "empires" } ; (@ field_serde_name ; star_systems) => { "starSystems" } ; (@ field_serde_name ; planets) => { "planets" } ; (@ field_serde_name ; fleets) => { "fleets" } ; (@ field_serde_name ; hyperlanes) => { "hyperlanes" } ; (@ field_serde_name ; starbases) => { "starbases" } ; (@ specta_data_struct ; $ struct : item ;) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] # [specta (inline)] $ struct } ; (@ specta_data_struct ; $ struct : item ; $ name : ident) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] $ struct } ; } + pub use _select_universe as select; + pub enum SelectParam { + Id(id::Select), + Config(config::Select), + Players(players::Select), + Empires(empires::Select), + StarSystems(star_systems::Select), + Planets(planets::Select), + Fleets(fleets::Select), + Hyperlanes(hyperlanes::Select), + Starbases(starbases::Select), + } + impl SelectParam { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + match self { + Self::Id(data) => data.to_selection(), + Self::Config(data) => data.to_selection(), + Self::Players(data) => data.to_selection(), + Self::Empires(data) => data.to_selection(), + Self::StarSystems(data) => data.to_selection(), + Self::Planets(data) => data.to_selection(), + Self::Fleets(data) => data.to_selection(), + Self::Hyperlanes(data) => data.to_selection(), + Self::Starbases(data) => data.to_selection(), + } + } + } + #[macro_export] + macro_rules ! _include_universe { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: universe :: include ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: universe :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: universe :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: universe :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: universe :: include ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: universe :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: universe :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: universe :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { players , empires , star_systems , planets , fleets , hyperlanes , starbases } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } const SPECTA_TYPE_NAME : & 'static str = prisma_client_rust :: macros :: to_pascal_case ! ($ ($ module_name) ?) ; crate :: prisma :: universe :: include ! (@ specta_data_struct ; pub struct Data { # [specta (rename_from_path = crate :: prisma :: universe :: id :: NAME)] pub id : i32 , # [specta (rename_from_path = crate :: prisma :: universe :: config :: NAME)] pub config : :: prisma_client_rust :: serde_json :: Value , $ (# [specta (rename_from_path = crate :: prisma :: universe :: $ field :: NAME)] pub $ field : crate :: prisma :: universe :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } ; $ ($ module_name) ?) ; impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) + stringify ! (id) , stringify ! (config)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: universe :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: universe :: id :: NAME , & self . id) ? ; state . serialize_field (crate :: prisma :: universe :: config :: NAME , & self . config) ? ; state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , id , config } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: universe :: $ field :: NAME) , + , crate :: prisma :: universe :: id :: NAME , crate :: prisma :: universe :: config :: NAME] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: universe :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: universe :: id :: NAME => Ok (Field :: id) , crate :: prisma :: universe :: config :: NAME => Ok (Field :: config) , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * let mut id = None ; let mut config = None ; while let Some (key) = map . next_key () ? { match key { Field :: id => { if id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: universe :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } Field :: config => { if config . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: universe :: config :: NAME)) ; } config = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: universe :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: universe :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: universe :: id :: NAME)) ? ; let config = config . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: universe :: config :: NAME)) ? ; Ok (Data { id , config , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "config" , "players" , "empires" , "starSystems" , "planets" , "fleets" , "hyperlanes" , "starbases"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: universe :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; players : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < players :: Data > } ; (@ field_type ; players) => { Vec < crate :: prisma :: player :: Data > } ; (@ field_type ; empires : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < empires :: Data > } ; (@ field_type ; empires) => { Vec < crate :: prisma :: empire :: Data > } ; (@ field_type ; star_systems : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < star_systems :: Data > } ; (@ field_type ; star_systems) => { Vec < crate :: prisma :: star_system :: Data > } ; (@ field_type ; planets : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < planets :: Data > } ; (@ field_type ; planets) => { Vec < crate :: prisma :: planet :: Data > } ; (@ field_type ; fleets : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < fleets :: Data > } ; (@ field_type ; fleets) => { Vec < crate :: prisma :: fleet :: Data > } ; (@ field_type ; hyperlanes : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < hyperlanes :: Data > } ; (@ field_type ; hyperlanes) => { Vec < crate :: prisma :: star_system_edges :: Data > } ; (@ field_type ; starbases : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < starbases :: Data > } ; (@ field_type ; starbases) => { Vec < crate :: prisma :: starbase :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Universe" , available relations are "players, empires, star_systems, planets, fleets, hyperlanes, starbases")) } ; (@ field_module ; players : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: player :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; empires : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: empire :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; star_systems : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: star_system :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; planets : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: planet :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; fleets : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: fleet :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; hyperlanes : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: star_system_edges :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; starbases : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: starbase :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; players $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: universe :: IncludeParam > :: into (crate :: prisma :: universe :: players :: Include :: $ selection_mode (crate :: prisma :: player :: ManyArgs :: new (crate :: prisma :: player :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: player :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; players $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: universe :: IncludeParam > :: into (crate :: prisma :: universe :: players :: Include :: Fetch (crate :: prisma :: player :: ManyArgs :: new (crate :: prisma :: player :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; empires $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: universe :: IncludeParam > :: into (crate :: prisma :: universe :: empires :: Include :: $ selection_mode (crate :: prisma :: empire :: ManyArgs :: new (crate :: prisma :: empire :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: empire :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; empires $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: universe :: IncludeParam > :: into (crate :: prisma :: universe :: empires :: Include :: Fetch (crate :: prisma :: empire :: ManyArgs :: new (crate :: prisma :: empire :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; star_systems $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: universe :: IncludeParam > :: into (crate :: prisma :: universe :: star_systems :: Include :: $ selection_mode (crate :: prisma :: star_system :: ManyArgs :: new (crate :: prisma :: star_system :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: star_system :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; star_systems $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: universe :: IncludeParam > :: into (crate :: prisma :: universe :: star_systems :: Include :: Fetch (crate :: prisma :: star_system :: ManyArgs :: new (crate :: prisma :: star_system :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; planets $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: universe :: IncludeParam > :: into (crate :: prisma :: universe :: planets :: Include :: $ selection_mode (crate :: prisma :: planet :: ManyArgs :: new (crate :: prisma :: planet :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: planet :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; planets $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: universe :: IncludeParam > :: into (crate :: prisma :: universe :: planets :: Include :: Fetch (crate :: prisma :: planet :: ManyArgs :: new (crate :: prisma :: planet :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; fleets $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: universe :: IncludeParam > :: into (crate :: prisma :: universe :: fleets :: Include :: $ selection_mode (crate :: prisma :: fleet :: ManyArgs :: new (crate :: prisma :: fleet :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: fleet :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; fleets $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: universe :: IncludeParam > :: into (crate :: prisma :: universe :: fleets :: Include :: Fetch (crate :: prisma :: fleet :: ManyArgs :: new (crate :: prisma :: fleet :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; hyperlanes $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: universe :: IncludeParam > :: into (crate :: prisma :: universe :: hyperlanes :: Include :: $ selection_mode (crate :: prisma :: star_system_edges :: ManyArgs :: new (crate :: prisma :: star_system_edges :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: star_system_edges :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; hyperlanes $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: universe :: IncludeParam > :: into (crate :: prisma :: universe :: hyperlanes :: Include :: Fetch (crate :: prisma :: star_system_edges :: ManyArgs :: new (crate :: prisma :: star_system_edges :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; starbases $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: universe :: IncludeParam > :: into (crate :: prisma :: universe :: starbases :: Include :: $ selection_mode (crate :: prisma :: starbase :: ManyArgs :: new (crate :: prisma :: starbase :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: starbase :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; starbases $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: universe :: IncludeParam > :: into (crate :: prisma :: universe :: starbases :: Include :: Fetch (crate :: prisma :: starbase :: ManyArgs :: new (crate :: prisma :: starbase :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: universe :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; config) => { "config" } ; (@ field_serde_name ; players) => { "players" } ; (@ field_serde_name ; empires) => { "empires" } ; (@ field_serde_name ; star_systems) => { "starSystems" } ; (@ field_serde_name ; planets) => { "planets" } ; (@ field_serde_name ; fleets) => { "fleets" } ; (@ field_serde_name ; hyperlanes) => { "hyperlanes" } ; (@ field_serde_name ; starbases) => { "starbases" } ; (@ specta_data_struct ; $ struct : item ;) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] # [specta (inline)] $ struct } ; (@ specta_data_struct ; $ struct : item ; $ name : ident) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] $ struct } ; } + pub use _include_universe as include; + pub enum IncludeParam { + Id(id::Include), + Config(config::Include), + Players(players::Include), + Empires(empires::Include), + StarSystems(star_systems::Include), + Planets(planets::Include), + Fleets(fleets::Include), + Hyperlanes(hyperlanes::Include), + Starbases(starbases::Include), + } + impl IncludeParam { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + match self { + Self::Id(data) => data.to_selection(), + Self::Config(data) => data.to_selection(), + Self::Players(data) => data.to_selection(), + Self::Empires(data) => data.to_selection(), + Self::StarSystems(data) => data.to_selection(), + Self::Planets(data) => data.to_selection(), + Self::Fleets(data) => data.to_selection(), + Self::Hyperlanes(data) => data.to_selection(), + Self::Starbases(data) => data.to_selection(), + } + } + } + #[macro_export] + macro_rules ! _partial_unchecked_universe { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: universe struct $ struct_name { # [serde (rename = "id")] pub id : i32 , # [serde (rename = "config")] pub config : :: prisma_client_rust :: serde_json :: Value } [$ ($ scalar_field) , +] } } ; } + pub use _partial_unchecked_universe as partial_unchecked; + #[derive( + Debug, + Clone, + :: serde :: Serialize, + :: serde :: Deserialize, + :: prisma_client_rust :: specta :: Type, + )] + #[specta(rename = "Universe", crate = "prisma_client_rust::specta")] + pub struct Data { + #[serde(rename = "id")] + pub id: i32, + #[serde(rename = "config")] + pub config: ::prisma_client_rust::serde_json::Value, + #[serde(rename = "players")] + #[specta(skip)] + pub players: Option>, + #[serde(rename = "empires")] + #[specta(skip)] + pub empires: Option>, + #[serde(rename = "starSystems")] + #[specta(skip)] + pub star_systems: Option>, + #[serde(rename = "planets")] + #[specta(skip)] + pub planets: Option>, + #[serde(rename = "fleets")] + #[specta(skip)] + pub fleets: Option>, + #[serde(rename = "hyperlanes")] + #[specta(skip)] + pub hyperlanes: Option>, + #[serde(rename = "starbases")] + #[specta(skip)] + pub starbases: Option>, + } + impl Data { + pub fn players( + &self, + ) -> Result< + &Vec, + ::prisma_client_rust::RelationNotFetchedError, + > { + self.players.as_ref().ok_or( + ::prisma_client_rust::RelationNotFetchedError::new(stringify!(players)), + ) + } + pub fn empires( + &self, + ) -> Result< + &Vec, + ::prisma_client_rust::RelationNotFetchedError, + > { + self.empires.as_ref().ok_or( + ::prisma_client_rust::RelationNotFetchedError::new(stringify!(empires)), + ) + } + pub fn star_systems( + &self, + ) -> Result< + &Vec, + ::prisma_client_rust::RelationNotFetchedError, + > { + self.star_systems.as_ref().ok_or( + ::prisma_client_rust::RelationNotFetchedError::new(stringify!( + star_systems + )), + ) + } + pub fn planets( + &self, + ) -> Result< + &Vec, + ::prisma_client_rust::RelationNotFetchedError, + > { + self.planets.as_ref().ok_or( + ::prisma_client_rust::RelationNotFetchedError::new(stringify!(planets)), + ) + } + pub fn fleets( + &self, + ) -> Result< + &Vec, + ::prisma_client_rust::RelationNotFetchedError, + > { + self.fleets.as_ref().ok_or( + ::prisma_client_rust::RelationNotFetchedError::new(stringify!(fleets)), + ) + } + pub fn hyperlanes( + &self, + ) -> Result< + &Vec, + ::prisma_client_rust::RelationNotFetchedError, + > { + self.hyperlanes.as_ref().ok_or( + ::prisma_client_rust::RelationNotFetchedError::new(stringify!( + hyperlanes + )), + ) + } + pub fn starbases( + &self, + ) -> Result< + &Vec, + ::prisma_client_rust::RelationNotFetchedError, + > { + self.starbases.as_ref().ok_or( + ::prisma_client_rust::RelationNotFetchedError::new(stringify!( + starbases + )), + ) + } + } + #[derive(Clone)] + pub enum WithParam { + Players(super::player::ManyArgs), + Empires(super::empire::ManyArgs), + StarSystems(super::star_system::ManyArgs), + Planets(super::planet::ManyArgs), + Fleets(super::fleet::ManyArgs), + Hyperlanes(super::star_system_edges::ManyArgs), + Starbases(super::starbase::ManyArgs), + } + impl Into<::prisma_client_rust::Selection> for WithParam { + fn into(self) -> ::prisma_client_rust::Selection { + match self { + Self::Players(args) => { + let (arguments, mut nested_selections) = args.to_graphql(); + nested_selections . extend (< super :: player :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) ; + ::prisma_client_rust::Selection::new( + players::NAME, + None, + arguments, + nested_selections, + ) + } + Self::Empires(args) => { + let (arguments, mut nested_selections) = args.to_graphql(); + nested_selections . extend (< super :: empire :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) ; + ::prisma_client_rust::Selection::new( + empires::NAME, + None, + arguments, + nested_selections, + ) + } + Self::StarSystems(args) => { + let (arguments, mut nested_selections) = args.to_graphql(); + nested_selections . extend (< super :: star_system :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) ; + ::prisma_client_rust::Selection::new( + star_systems::NAME, + None, + arguments, + nested_selections, + ) + } + Self::Planets(args) => { + let (arguments, mut nested_selections) = args.to_graphql(); + nested_selections . extend (< super :: planet :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) ; + ::prisma_client_rust::Selection::new( + planets::NAME, + None, + arguments, + nested_selections, + ) + } + Self::Fleets(args) => { + let (arguments, mut nested_selections) = args.to_graphql(); + nested_selections . extend (< super :: fleet :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) ; + ::prisma_client_rust::Selection::new( + fleets::NAME, + None, + arguments, + nested_selections, + ) + } + Self::Hyperlanes(args) => { + let (arguments, mut nested_selections) = args.to_graphql(); + nested_selections . extend (< super :: star_system_edges :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) ; + ::prisma_client_rust::Selection::new( + hyperlanes::NAME, + None, + arguments, + nested_selections, + ) + } + Self::Starbases(args) => { + let (arguments, mut nested_selections) = args.to_graphql(); + nested_selections . extend (< super :: starbase :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) ; + ::prisma_client_rust::Selection::new( + starbases::NAME, + None, + arguments, + nested_selections, + ) + } + } + } + } + #[derive(Clone)] + pub enum SetParam { + SetId(i32), + IncrementId(i32), + DecrementId(i32), + MultiplyId(i32), + DivideId(i32), + SetConfig(::prisma_client_rust::serde_json::Value), + ConnectPlayers(Vec), + DisconnectPlayers(Vec), + SetPlayers(Vec), + ConnectEmpires(Vec), + DisconnectEmpires(Vec), + SetEmpires(Vec), + ConnectStarSystems(Vec), + DisconnectStarSystems(Vec), + SetStarSystems(Vec), + ConnectPlanets(Vec), + DisconnectPlanets(Vec), + SetPlanets(Vec), + ConnectFleets(Vec), + DisconnectFleets(Vec), + SetFleets(Vec), + ConnectHyperlanes(Vec), + DisconnectHyperlanes(Vec), + SetHyperlanes(Vec), + ConnectStarbases(Vec), + DisconnectStarbases(Vec), + SetStarbases(Vec), + } + impl From for (String, ::prisma_client_rust::PrismaValue) { + fn from(param: SetParam) -> Self { + match param { + SetParam::SetId(value) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + ), + SetParam::IncrementId(value) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "increment".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::DecrementId(value) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "decrement".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::MultiplyId(value) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "multiply".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::DivideId(value) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "divide".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::SetConfig(value) => ( + config::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Json( + ::prisma_client_rust::serde_json::to_string(&value).unwrap(), + ), + ), + SetParam::ConnectPlayers(where_params) => ( + players::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "connect".to_string(), + ::prisma_client_rust::PrismaValue::List( + where_params + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) + .collect(), + ), + )]), + ), + SetParam::DisconnectPlayers(where_params) => ( + players::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "disconnect".to_string(), + ::prisma_client_rust::PrismaValue::List( + where_params + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) + .collect(), + ), + )]), + ), + SetParam::SetPlayers(where_params) => ( + players::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "set".to_string(), + ::prisma_client_rust::PrismaValue::List( + where_params + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) + .collect(), + ), + )]), + ), + SetParam::ConnectEmpires(where_params) => ( + empires::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "connect".to_string(), + ::prisma_client_rust::PrismaValue::List( + where_params + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) + .collect(), + ), + )]), + ), + SetParam::DisconnectEmpires(where_params) => ( + empires::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "disconnect".to_string(), + ::prisma_client_rust::PrismaValue::List( + where_params + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) + .collect(), + ), + )]), + ), + SetParam::SetEmpires(where_params) => ( + empires::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "set".to_string(), + ::prisma_client_rust::PrismaValue::List( + where_params + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) + .collect(), + ), + )]), + ), + SetParam::ConnectStarSystems(where_params) => ( + star_systems::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "connect".to_string(), + ::prisma_client_rust::PrismaValue::List( + where_params + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) + .collect(), + ), + )]), + ), + SetParam::DisconnectStarSystems(where_params) => ( + star_systems::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "disconnect".to_string(), + ::prisma_client_rust::PrismaValue::List( + where_params + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) + .collect(), + ), + )]), + ), + SetParam::SetStarSystems(where_params) => ( + star_systems::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "set".to_string(), + ::prisma_client_rust::PrismaValue::List( + where_params + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) + .collect(), + ), + )]), + ), + SetParam::ConnectPlanets(where_params) => ( + planets::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "connect".to_string(), + ::prisma_client_rust::PrismaValue::List( + where_params + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) + .collect(), + ), + )]), + ), + SetParam::DisconnectPlanets(where_params) => ( + planets::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "disconnect".to_string(), + ::prisma_client_rust::PrismaValue::List( + where_params + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) + .collect(), + ), + )]), + ), + SetParam::SetPlanets(where_params) => ( + planets::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "set".to_string(), + ::prisma_client_rust::PrismaValue::List( + where_params + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) + .collect(), + ), + )]), + ), + SetParam::ConnectFleets(where_params) => ( + fleets::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "connect".to_string(), + ::prisma_client_rust::PrismaValue::List( + where_params + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) + .collect(), + ), + )]), + ), + SetParam::DisconnectFleets(where_params) => ( + fleets::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "disconnect".to_string(), + ::prisma_client_rust::PrismaValue::List( + where_params + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) + .collect(), + ), + )]), + ), + SetParam::SetFleets(where_params) => ( + fleets::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "set".to_string(), + ::prisma_client_rust::PrismaValue::List( + where_params + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) + .collect(), + ), + )]), + ), + SetParam::ConnectHyperlanes(where_params) => ( + hyperlanes::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "connect".to_string(), + ::prisma_client_rust::PrismaValue::List( + where_params + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) + .collect(), + ), + )]), + ), + SetParam::DisconnectHyperlanes(where_params) => ( + hyperlanes::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "disconnect".to_string(), + ::prisma_client_rust::PrismaValue::List( + where_params + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) + .collect(), + ), + )]), + ), + SetParam::SetHyperlanes(where_params) => ( + hyperlanes::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "set".to_string(), + ::prisma_client_rust::PrismaValue::List( + where_params + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) + .collect(), + ), + )]), + ), + SetParam::ConnectStarbases(where_params) => ( + starbases::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "connect".to_string(), + ::prisma_client_rust::PrismaValue::List( + where_params + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) + .collect(), + ), + )]), + ), + SetParam::DisconnectStarbases(where_params) => ( + starbases::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "disconnect".to_string(), + ::prisma_client_rust::PrismaValue::List( + where_params + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) + .collect(), + ), + )]), + ), + SetParam::SetStarbases(where_params) => ( + starbases::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "set".to_string(), + ::prisma_client_rust::PrismaValue::List( + where_params + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) + .collect(), + ), + )]), + ), + } + } + } + #[derive(Clone)] + pub enum UncheckedSetParam { + Id(i32), + Config(::prisma_client_rust::serde_json::Value), + } + impl From for SetParam { + fn from(param: UncheckedSetParam) -> Self { + match param { + UncheckedSetParam::Id(value) => Self::SetId(value), + UncheckedSetParam::Config(value) => Self::SetConfig(value), + } + } + } + #[derive(Clone)] + pub enum OrderByParam { + Id(::prisma_client_rust::Direction), + Config(::prisma_client_rust::Direction), + } + impl Into<(String, ::prisma_client_rust::PrismaValue)> for OrderByParam { + fn into(self) -> (String, ::prisma_client_rust::PrismaValue) { + match self { + Self::Id(direction) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::Config(direction) => ( + config::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + } + } + } + #[derive(Clone)] + pub enum WhereParam { + Not(Vec), + Or(Vec), + And(Vec), + Id(_prisma::read_filters::IntFilter), + Config(_prisma::read_filters::JsonFilter), + PlayersSome(Vec), + PlayersEvery(Vec), + PlayersNone(Vec), + EmpiresSome(Vec), + EmpiresEvery(Vec), + EmpiresNone(Vec), + StarSystemsSome(Vec), + StarSystemsEvery(Vec), + StarSystemsNone(Vec), + PlanetsSome(Vec), + PlanetsEvery(Vec), + PlanetsNone(Vec), + FleetsSome(Vec), + FleetsEvery(Vec), + FleetsNone(Vec), + HyperlanesSome(Vec), + HyperlanesEvery(Vec), + HyperlanesNone(Vec), + StarbasesSome(Vec), + StarbasesEvery(Vec), + StarbasesNone(Vec), + } + impl ::prisma_client_rust::WhereInput for WhereParam { + fn serialize(self) -> ::prisma_client_rust::SerializedWhereInput { + let (name, value) = match self { + Self::Not(value) => ( + "NOT", + ::prisma_client_rust::SerializedWhereValue::Object( + ::prisma_client_rust::merge_fields( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .collect(), + ), + ), + ), + Self::Or(value) => ( + "OR", + ::prisma_client_rust::SerializedWhereValue::List( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .map(|v| vec![v]) + .map(::prisma_client_rust::PrismaValue::Object) + .collect(), + ), + ), + Self::And(value) => ( + "AND", + ::prisma_client_rust::SerializedWhereValue::Object( + ::prisma_client_rust::merge_fields( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .collect(), + ), + ), + ), + Self::Id(value) => (id::NAME, value.into()), + Self::Config(value) => (config::NAME, value.into()), + Self::PlayersSome(where_params) => ( + players::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "some".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::PlayersEvery(where_params) => ( + players::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "every".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::PlayersNone(where_params) => ( + players::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "none".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::EmpiresSome(where_params) => ( + empires::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "some".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::EmpiresEvery(where_params) => ( + empires::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "every".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::EmpiresNone(where_params) => ( + empires::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "none".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::StarSystemsSome(where_params) => ( + star_systems::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "some".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::StarSystemsEvery(where_params) => ( + star_systems::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "every".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::StarSystemsNone(where_params) => ( + star_systems::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "none".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::PlanetsSome(where_params) => ( + planets::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "some".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::PlanetsEvery(where_params) => ( + planets::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "every".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::PlanetsNone(where_params) => ( + planets::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "none".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::FleetsSome(where_params) => ( + fleets::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "some".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::FleetsEvery(where_params) => ( + fleets::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "every".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::FleetsNone(where_params) => ( + fleets::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "none".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::HyperlanesSome(where_params) => ( + hyperlanes::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "some".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::HyperlanesEvery(where_params) => ( + hyperlanes::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "every".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::HyperlanesNone(where_params) => ( + hyperlanes::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "none".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::StarbasesSome(where_params) => ( + starbases::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "some".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::StarbasesEvery(where_params) => ( + starbases::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "every".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::StarbasesNone(where_params) => ( + starbases::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "none".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + }; + ::prisma_client_rust::SerializedWhereInput::new(name, value.into()) + } + } + #[derive(Clone)] + pub enum UniqueWhereParam { + IdEquals(i32), + } + impl From for WhereParam { + fn from(value: UniqueWhereParam) -> Self { + match value { + UniqueWhereParam::IdEquals(value) => { + Self::Id(_prisma::read_filters::IntFilter::Equals(value)) + } + } + } + } + impl From<::prisma_client_rust::Operator> for WhereParam { + fn from(op: ::prisma_client_rust::Operator) -> Self { + match op { + ::prisma_client_rust::Operator::Not(value) => Self::Not(value), + ::prisma_client_rust::Operator::And(value) => Self::And(value), + ::prisma_client_rust::Operator::Or(value) => Self::Or(value), + } + } + } + #[derive(Clone)] + pub struct Types; + impl ::prisma_client_rust::ModelTypes for Types { + type Data = Data; + type Where = WhereParam; + type UncheckedSet = UncheckedSetParam; + type Set = SetParam; + type With = WithParam; + type OrderBy = OrderByParam; + type Cursor = UniqueWhereParam; + const MODEL: &'static str = NAME; + fn scalar_selections() -> Vec<::prisma_client_rust::Selection> { + vec![ + ::prisma_client_rust::sel(id::NAME), + ::prisma_client_rust::sel(config::NAME), + ] + } + } + pub type UniqueArgs = ::prisma_client_rust::UniqueArgs; + pub type ManyArgs = ::prisma_client_rust::ManyArgs; + pub type Count<'a> = ::prisma_client_rust::Count<'a, Types>; + pub type Create<'a> = ::prisma_client_rust::Create<'a, Types>; + pub type CreateMany<'a> = ::prisma_client_rust::CreateMany<'a, Types>; + pub type FindUnique<'a> = ::prisma_client_rust::FindUnique<'a, Types>; + pub type FindMany<'a> = ::prisma_client_rust::FindMany<'a, Types>; + pub type FindFirst<'a> = ::prisma_client_rust::FindFirst<'a, Types>; + pub type Update<'a> = ::prisma_client_rust::Update<'a, Types>; + pub type UpdateMany<'a> = ::prisma_client_rust::UpdateMany<'a, Types>; + pub type Upsert<'a> = ::prisma_client_rust::Upsert<'a, Types>; + pub type Delete<'a> = ::prisma_client_rust::Delete<'a, Types>; + pub type DeleteMany<'a> = ::prisma_client_rust::DeleteMany<'a, Types>; + #[derive(Clone)] + pub struct Actions<'a> { + pub client: &'a ::prisma_client_rust::PrismaClientInternals, + } + impl<'a> Actions<'a> { + pub fn find_unique(self, _where: UniqueWhereParam) -> FindUnique<'a> { + FindUnique::new(self.client, _where.into()) + } + pub fn find_first(self, _where: Vec) -> FindFirst<'a> { + FindFirst::new(self.client, _where) + } + pub fn find_many(self, _where: Vec) -> FindMany<'a> { + FindMany::new(self.client, _where) + } + pub fn create( + self, + config: ::prisma_client_rust::serde_json::Value, + mut _params: Vec, + ) -> Create<'a> { + _params.extend([config::set(config)]); + Create::new(self.client, _params) + } + pub fn create_unchecked( + self, + config: ::prisma_client_rust::serde_json::Value, + mut _params: Vec, + ) -> Create<'a> { + _params.extend([config::set(config)]); + Create::new(self.client, _params.into_iter().map(Into::into).collect()) + } + pub fn create_many( + self, + data: Vec<(::prisma_client_rust::serde_json::Value, Vec)>, + ) -> CreateMany<'a> { + let data = data + .into_iter() + .map(|(config, mut _params)| { + _params.extend([config::set(config)]); + _params + }) + .collect(); + CreateMany::new(self.client, data) + } + pub fn update( + self, + _where: UniqueWhereParam, + _params: Vec, + ) -> Update<'a> { + Update::new(self.client, _where.into(), _params, vec![]) + } + pub fn update_unchecked( + self, + _where: UniqueWhereParam, + _params: Vec, + ) -> Update<'a> { + Update::new( + self.client, + _where.into(), + _params.into_iter().map(Into::into).collect(), + vec![], + ) + } + pub fn update_many( + self, + _where: Vec, + _params: Vec, + ) -> UpdateMany<'a> { + UpdateMany::new(self.client, _where, _params) + } + pub fn upsert( + self, + _where: UniqueWhereParam, + (config, mut _params): ( + ::prisma_client_rust::serde_json::Value, + Vec, + ), + _update: Vec, + ) -> Upsert<'a> { + _params.extend([config::set(config)]); + Upsert::new(self.client, _where.into(), _params, _update) + } + pub fn delete(self, _where: UniqueWhereParam) -> Delete<'a> { + Delete::new(self.client, _where.into(), vec![]) + } + pub fn delete_many(self, _where: Vec) -> DeleteMany<'a> { + DeleteMany::new(self.client, _where) + } + pub fn count(self, _where: Vec) -> Count<'a> { + Count::new(self.client, _where) + } + pub fn find_raw( + self, + ) -> ::prisma_client_rust::FindRaw<'a, Types, T> { + ::prisma_client_rust::FindRaw::new(self.client) + } + pub fn aggregate_raw( + self, + ) -> ::prisma_client_rust::AggregateRaw<'a, Types, T> { + ::prisma_client_rust::AggregateRaw::new(self.client) + } + } +} +pub mod user { + use super::_prisma::*; + use super::*; + pub const NAME: &str = "User"; + pub mod id { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "id"; + pub struct Set(pub String); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetId(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::Id(v) + } + } + pub fn set>(value: String) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::Id(direction) + } + pub fn equals>(value: String) -> T { + UniqueWhereParam::IdEquals(value).into() + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::StringFilter, + Id, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: String) -> Lt; + fn lte(_: String) -> Lte; + fn gt(_: String) -> Gt; + fn gte(_: String) -> Gte; + fn contains(_: String) -> Contains; + fn starts_with(_: String) -> StartsWith; + fn ends_with(_: String) -> EndsWith; + fn mode(_: super::super::QueryMode) -> Mode; + fn not(_: String) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Id(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Id(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod email { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "email"; + pub struct Set(pub Option); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetEmail(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::Email(v) + } + } + pub fn set>(value: Option) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::Email(direction) + } + pub fn equals< + A, + T: ::prisma_client_rust::FromOptionalUniqueArg, + >( + value: A, + ) -> T { + T::from_arg(value) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::StringNullableFilter, + Email, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: String) -> Lt; + fn lte(_: String) -> Lte; + fn gt(_: String) -> Gt; + fn gte(_: String) -> Gte; + fn contains(_: String) -> Contains; + fn starts_with(_: String) -> StartsWith; + fn ends_with(_: String) -> EndsWith; + fn mode(_: super::super::QueryMode) -> Mode; + fn not(_: Option) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Email(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Email(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod email_verified { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "emailVerified"; + pub struct Set( + pub Option< + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + >, + ); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetEmailVerified(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::EmailVerified(v) + } + } + pub fn set>( + value: Option< + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + >, + ) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::EmailVerified(direction) + } + pub fn equals( + value: Option< + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + >, + ) -> WhereParam { + WhereParam::EmailVerified( + _prisma::read_filters::DateTimeNullableFilter::Equals(value), + ) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::DateTimeNullableFilter, + EmailVerified, + { + fn in_vec( + _: Vec< + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + >, + ) -> InVec; + fn not_in_vec( + _: Vec< + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + >, + ) -> NotInVec; + fn lt( + _: ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ) -> Lt; + fn lte( + _: ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ) -> Lte; + fn gt( + _: ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ) -> Gt; + fn gte( + _: ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ) -> Gte; + fn not( + _: Option< + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + >, + ) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::EmailVerified(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::EmailVerified(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod name { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "name"; + pub struct Set(pub String); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetName(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::Name(v) + } + } + pub fn set>(value: String) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::Name(direction) + } + pub fn equals(value: String) -> WhereParam { + WhereParam::Name(_prisma::read_filters::StringFilter::Equals(value)) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::StringFilter, + Name, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: String) -> Lt; + fn lte(_: String) -> Lte; + fn gt(_: String) -> Gt; + fn gte(_: String) -> Gte; + fn contains(_: String) -> Contains; + fn starts_with(_: String) -> StartsWith; + fn ends_with(_: String) -> EndsWith; + fn mode(_: super::super::QueryMode) -> Mode; + fn not(_: String) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Name(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Name(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod image { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "image"; + pub struct Set(pub Option); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetImage(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::Image(v) + } + } + pub fn set>(value: Option) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::Image(direction) + } + pub fn equals(value: Option) -> WhereParam { + WhereParam::Image(_prisma::read_filters::StringNullableFilter::Equals( + value, + )) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::StringNullableFilter, + Image, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: String) -> Lt; + fn lte(_: String) -> Lte; + fn gt(_: String) -> Gt; + fn gte(_: String) -> Gte; + fn contains(_: String) -> Contains; + fn starts_with(_: String) -> StartsWith; + fn ends_with(_: String) -> EndsWith; + fn mode(_: super::super::QueryMode) -> Mode; + fn not(_: Option) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Image(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Image(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod accounts { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "accounts"; + pub struct Fetch(pub account::ManyArgs); + impl Fetch { + pub fn with(mut self, params: impl Into) -> Self { + self.0 = self.0.with(params.into()); + self + } + pub fn order_by(mut self, param: account::OrderByParam) -> Self { + self.0 = self.0.order_by(param); + self + } + pub fn skip(mut self, value: i64) -> Self { + self.0 = self.0.skip(value); + self + } + pub fn take(mut self, value: i64) -> Self { + self.0 = self.0.take(value); + self + } + pub fn cursor(mut self, value: account::UniqueWhereParam) -> Self { + self.0 = self.0.cursor(value.into()); + self + } + } + impl From for WithParam { + fn from(Fetch(v): Fetch) -> Self { + WithParam::Accounts(v) + } + } + pub fn fetch(params: Vec) -> Fetch { + Fetch(account::ManyArgs::new(params)) + } + pub struct Connect(pub Vec); + impl From for SetParam { + fn from(Connect(v): Connect) -> Self { + Self::ConnectAccounts(v) + } + } + pub fn connect>( + params: Vec, + ) -> T { + Connect(params).into() + } + pub fn disconnect(params: Vec) -> SetParam { + SetParam::DisconnectAccounts(params) + } + pub fn set(params: Vec) -> SetParam { + SetParam::SetAccounts(params) + } + pub fn some(value: Vec) -> WhereParam { + WhereParam::AccountsSome(value) + } + pub fn every(value: Vec) -> WhereParam { + WhereParam::AccountsEvery(value) + } + pub fn none(value: Vec) -> WhereParam { + WhereParam::AccountsNone(value) + } + pub enum Include { + Select(account::ManyArgs, Vec), + Include(account::ManyArgs, Vec), + Fetch(account::ManyArgs), + } + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Accounts(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let (args , selections) = match self { Self :: Select (args , selections) => (args . to_graphql () . 0 , selections . into_iter () . map (| s | s . to_selection ()) . collect ()) , Self :: Include (args , selections) => (args . to_graphql () . 0 , { let mut nested_selections = < account :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections }) , Self :: Fetch (args) => (args . to_graphql () . 0 , < account :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; + ::prisma_client_rust::Selection::new(NAME, None, args, selections) + } + pub fn select( + args: account::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Select(args, nested_selections) + } + pub fn include( + args: account::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Include(args, nested_selections) + } + } + pub enum Select { + Select(account::ManyArgs, Vec), + Include(account::ManyArgs, Vec), + Fetch(account::ManyArgs), + } + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Accounts(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let (args , selections) = match self { Self :: Select (args , selections) => (args . to_graphql () . 0 , selections . into_iter () . map (| s | s . to_selection ()) . collect ()) , Self :: Include (args , selections) => (args . to_graphql () . 0 , { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections }) , Self :: Fetch (args) => (args . to_graphql () . 0 , < account :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; + ::prisma_client_rust::Selection::new(NAME, None, args, selections) + } + pub fn select( + args: account::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Select(args, nested_selections) + } + pub fn include( + args: account::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Include(args, nested_selections) + } + } + } + pub mod sessions { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "sessions"; + pub struct Fetch(pub session::ManyArgs); + impl Fetch { + pub fn with(mut self, params: impl Into) -> Self { + self.0 = self.0.with(params.into()); + self + } + pub fn order_by(mut self, param: session::OrderByParam) -> Self { + self.0 = self.0.order_by(param); + self + } + pub fn skip(mut self, value: i64) -> Self { + self.0 = self.0.skip(value); + self + } + pub fn take(mut self, value: i64) -> Self { + self.0 = self.0.take(value); + self + } + pub fn cursor(mut self, value: session::UniqueWhereParam) -> Self { + self.0 = self.0.cursor(value.into()); + self + } + } + impl From for WithParam { + fn from(Fetch(v): Fetch) -> Self { + WithParam::Sessions(v) + } + } + pub fn fetch(params: Vec) -> Fetch { + Fetch(session::ManyArgs::new(params)) + } + pub struct Connect(pub Vec); + impl From for SetParam { + fn from(Connect(v): Connect) -> Self { + Self::ConnectSessions(v) + } + } + pub fn connect>( + params: Vec, + ) -> T { + Connect(params).into() + } + pub fn disconnect(params: Vec) -> SetParam { + SetParam::DisconnectSessions(params) + } + pub fn set(params: Vec) -> SetParam { + SetParam::SetSessions(params) + } + pub fn some(value: Vec) -> WhereParam { + WhereParam::SessionsSome(value) + } + pub fn every(value: Vec) -> WhereParam { + WhereParam::SessionsEvery(value) + } + pub fn none(value: Vec) -> WhereParam { + WhereParam::SessionsNone(value) + } + pub enum Include { + Select(session::ManyArgs, Vec), + Include(session::ManyArgs, Vec), + Fetch(session::ManyArgs), + } + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Sessions(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let (args , selections) = match self { Self :: Select (args , selections) => (args . to_graphql () . 0 , selections . into_iter () . map (| s | s . to_selection ()) . collect ()) , Self :: Include (args , selections) => (args . to_graphql () . 0 , { let mut nested_selections = < session :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections }) , Self :: Fetch (args) => (args . to_graphql () . 0 , < session :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; + ::prisma_client_rust::Selection::new(NAME, None, args, selections) + } + pub fn select( + args: session::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Select(args, nested_selections) + } + pub fn include( + args: session::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Include(args, nested_selections) + } + } + pub enum Select { + Select(session::ManyArgs, Vec), + Include(session::ManyArgs, Vec), + Fetch(session::ManyArgs), + } + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Sessions(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let (args , selections) = match self { Self :: Select (args , selections) => (args . to_graphql () . 0 , selections . into_iter () . map (| s | s . to_selection ()) . collect ()) , Self :: Include (args , selections) => (args . to_graphql () . 0 , { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections }) , Self :: Fetch (args) => (args . to_graphql () . 0 , < session :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; + ::prisma_client_rust::Selection::new(NAME, None, args, selections) + } + pub fn select( + args: session::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Select(args, nested_selections) + } + pub fn include( + args: session::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Include(args, nested_selections) + } + } + } + pub fn create( + name: String, + _params: Vec, + ) -> (String, Vec) { + (name, _params) + } + pub fn create_unchecked( + name: String, + _params: Vec, + ) -> (String, Vec) { + (name, _params) + } + #[macro_export] + macro_rules ! _select_user { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: user :: select ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: user :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: user :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: user :: select ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: user :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: user :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { id , email , email_verified , name , image , accounts , sessions } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } const SPECTA_TYPE_NAME : & 'static str = prisma_client_rust :: macros :: to_pascal_case ! ($ ($ module_name) ?) ; crate :: prisma :: user :: select ! (@ specta_data_struct ; pub struct Data { $ (# [specta (rename_from_path = crate :: prisma :: user :: $ field :: NAME)] pub $ field : crate :: prisma :: user :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } ; $ ($ module_name) ?) ; impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) +] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: user :: $ field :: NAME , & self . $ field) ? ;) * state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: user :: $ field :: NAME) , + ,] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: user :: $ field :: NAME => Ok (Field :: $ field)) , * , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * while let Some (key) = map . next_key () ? { match key { $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: user :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: user :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "email" , "emailVerified" , "name" , "image" , "accounts" , "sessions"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: user :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { String } ; (@ field_type ; email) => { Option < String > } ; (@ field_type ; email_verified) => { Option < :: prisma_client_rust :: chrono :: DateTime < :: prisma_client_rust :: chrono :: FixedOffset , > > } ; (@ field_type ; name) => { String } ; (@ field_type ; image) => { Option < String > } ; (@ field_type ; accounts : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < accounts :: Data > } ; (@ field_type ; accounts) => { Vec < crate :: prisma :: account :: Data > } ; (@ field_type ; sessions : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < sessions :: Data > } ; (@ field_type ; sessions) => { Vec < crate :: prisma :: session :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "User" , available relations are "id, email, email_verified, name, image, accounts, sessions")) } ; (@ field_module ; accounts : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: account :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; sessions : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: session :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: user :: SelectParam > :: into (crate :: prisma :: user :: id :: Select) } ; (@ selection_field_to_selection_param ; email) => { Into :: < crate :: prisma :: user :: SelectParam > :: into (crate :: prisma :: user :: email :: Select) } ; (@ selection_field_to_selection_param ; email_verified) => { Into :: < crate :: prisma :: user :: SelectParam > :: into (crate :: prisma :: user :: email_verified :: Select) } ; (@ selection_field_to_selection_param ; name) => { Into :: < crate :: prisma :: user :: SelectParam > :: into (crate :: prisma :: user :: name :: Select) } ; (@ selection_field_to_selection_param ; image) => { Into :: < crate :: prisma :: user :: SelectParam > :: into (crate :: prisma :: user :: image :: Select) } ; (@ selection_field_to_selection_param ; accounts $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: user :: SelectParam > :: into (crate :: prisma :: user :: accounts :: Select :: $ selection_mode (crate :: prisma :: account :: ManyArgs :: new (crate :: prisma :: account :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: account :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; accounts $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: user :: SelectParam > :: into (crate :: prisma :: user :: accounts :: Select :: Fetch (crate :: prisma :: account :: ManyArgs :: new (crate :: prisma :: account :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; sessions $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: user :: SelectParam > :: into (crate :: prisma :: user :: sessions :: Select :: $ selection_mode (crate :: prisma :: session :: ManyArgs :: new (crate :: prisma :: session :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: session :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; sessions $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: user :: SelectParam > :: into (crate :: prisma :: user :: sessions :: Select :: Fetch (crate :: prisma :: session :: ManyArgs :: new (crate :: prisma :: session :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: user :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; email) => { "email" } ; (@ field_serde_name ; email_verified) => { "emailVerified" } ; (@ field_serde_name ; name) => { "name" } ; (@ field_serde_name ; image) => { "image" } ; (@ field_serde_name ; accounts) => { "accounts" } ; (@ field_serde_name ; sessions) => { "sessions" } ; (@ specta_data_struct ; $ struct : item ;) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] # [specta (inline)] $ struct } ; (@ specta_data_struct ; $ struct : item ; $ name : ident) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] $ struct } ; } + pub use _select_user as select; + pub enum SelectParam { + Id(id::Select), + Email(email::Select), + EmailVerified(email_verified::Select), + Name(name::Select), + Image(image::Select), + Accounts(accounts::Select), + Sessions(sessions::Select), + } + impl SelectParam { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + match self { + Self::Id(data) => data.to_selection(), + Self::Email(data) => data.to_selection(), + Self::EmailVerified(data) => data.to_selection(), + Self::Name(data) => data.to_selection(), + Self::Image(data) => data.to_selection(), + Self::Accounts(data) => data.to_selection(), + Self::Sessions(data) => data.to_selection(), + } + } + } + #[macro_export] + macro_rules ! _include_user { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: user :: include ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: user :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: user :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: user :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: user :: include ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: user :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: user :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: user :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { accounts , sessions } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } const SPECTA_TYPE_NAME : & 'static str = prisma_client_rust :: macros :: to_pascal_case ! ($ ($ module_name) ?) ; crate :: prisma :: user :: include ! (@ specta_data_struct ; pub struct Data { # [specta (rename_from_path = crate :: prisma :: user :: id :: NAME)] pub id : String , # [specta (rename_from_path = crate :: prisma :: user :: email :: NAME)] pub email : Option < String > , # [specta (rename_from_path = crate :: prisma :: user :: email_verified :: NAME)] pub email_verified : Option < :: prisma_client_rust :: chrono :: DateTime < :: prisma_client_rust :: chrono :: FixedOffset , > > , # [specta (rename_from_path = crate :: prisma :: user :: name :: NAME)] pub name : String , # [specta (rename_from_path = crate :: prisma :: user :: image :: NAME)] pub image : Option < String > , $ (# [specta (rename_from_path = crate :: prisma :: user :: $ field :: NAME)] pub $ field : crate :: prisma :: user :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } ; $ ($ module_name) ?) ; impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) + stringify ! (id) , stringify ! (email) , stringify ! (email_verified) , stringify ! (name) , stringify ! (image)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: user :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: user :: id :: NAME , & self . id) ? ; state . serialize_field (crate :: prisma :: user :: email :: NAME , & self . email) ? ; state . serialize_field (crate :: prisma :: user :: email_verified :: NAME , & self . email_verified) ? ; state . serialize_field (crate :: prisma :: user :: name :: NAME , & self . name) ? ; state . serialize_field (crate :: prisma :: user :: image :: NAME , & self . image) ? ; state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , id , email , email_verified , name , image } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: user :: $ field :: NAME) , + , crate :: prisma :: user :: id :: NAME , crate :: prisma :: user :: email :: NAME , crate :: prisma :: user :: email_verified :: NAME , crate :: prisma :: user :: name :: NAME , crate :: prisma :: user :: image :: NAME] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: user :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: user :: id :: NAME => Ok (Field :: id) , crate :: prisma :: user :: email :: NAME => Ok (Field :: email) , crate :: prisma :: user :: email_verified :: NAME => Ok (Field :: email_verified) , crate :: prisma :: user :: name :: NAME => Ok (Field :: name) , crate :: prisma :: user :: image :: NAME => Ok (Field :: image) , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * let mut id = None ; let mut email = None ; let mut email_verified = None ; let mut name = None ; let mut image = None ; while let Some (key) = map . next_key () ? { match key { Field :: id => { if id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: user :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } Field :: email => { if email . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: user :: email :: NAME)) ; } email = Some (map . next_value () ?) ; } Field :: email_verified => { if email_verified . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: user :: email_verified :: NAME)) ; } email_verified = Some (map . next_value () ?) ; } Field :: name => { if name . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: user :: name :: NAME)) ; } name = Some (map . next_value () ?) ; } Field :: image => { if image . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: user :: image :: NAME)) ; } image = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: user :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: user :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: user :: id :: NAME)) ? ; let email = email . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: user :: email :: NAME)) ? ; let email_verified = email_verified . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: user :: email_verified :: NAME)) ? ; let name = name . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: user :: name :: NAME)) ? ; let image = image . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: user :: image :: NAME)) ? ; Ok (Data { id , email , email_verified , name , image , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "email" , "emailVerified" , "name" , "image" , "accounts" , "sessions"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: user :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; accounts : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < accounts :: Data > } ; (@ field_type ; accounts) => { Vec < crate :: prisma :: account :: Data > } ; (@ field_type ; sessions : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < sessions :: Data > } ; (@ field_type ; sessions) => { Vec < crate :: prisma :: session :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "User" , available relations are "accounts, sessions")) } ; (@ field_module ; accounts : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: account :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; sessions : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: session :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; accounts $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: user :: IncludeParam > :: into (crate :: prisma :: user :: accounts :: Include :: $ selection_mode (crate :: prisma :: account :: ManyArgs :: new (crate :: prisma :: account :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: account :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; accounts $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: user :: IncludeParam > :: into (crate :: prisma :: user :: accounts :: Include :: Fetch (crate :: prisma :: account :: ManyArgs :: new (crate :: prisma :: account :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; sessions $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: user :: IncludeParam > :: into (crate :: prisma :: user :: sessions :: Include :: $ selection_mode (crate :: prisma :: session :: ManyArgs :: new (crate :: prisma :: session :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: session :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; sessions $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: user :: IncludeParam > :: into (crate :: prisma :: user :: sessions :: Include :: Fetch (crate :: prisma :: session :: ManyArgs :: new (crate :: prisma :: session :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: user :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; email) => { "email" } ; (@ field_serde_name ; email_verified) => { "emailVerified" } ; (@ field_serde_name ; name) => { "name" } ; (@ field_serde_name ; image) => { "image" } ; (@ field_serde_name ; accounts) => { "accounts" } ; (@ field_serde_name ; sessions) => { "sessions" } ; (@ specta_data_struct ; $ struct : item ;) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] # [specta (inline)] $ struct } ; (@ specta_data_struct ; $ struct : item ; $ name : ident) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] $ struct } ; } + pub use _include_user as include; + pub enum IncludeParam { + Id(id::Include), + Email(email::Include), + EmailVerified(email_verified::Include), + Name(name::Include), + Image(image::Include), + Accounts(accounts::Include), + Sessions(sessions::Include), + } + impl IncludeParam { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + match self { + Self::Id(data) => data.to_selection(), + Self::Email(data) => data.to_selection(), + Self::EmailVerified(data) => data.to_selection(), + Self::Name(data) => data.to_selection(), + Self::Image(data) => data.to_selection(), + Self::Accounts(data) => data.to_selection(), + Self::Sessions(data) => data.to_selection(), + } + } + } + #[macro_export] + macro_rules ! _partial_unchecked_user { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: user struct $ struct_name { # [serde (rename = "id")] pub id : String , # [serde (rename = "email")] # [serde (default , with = "::prisma_client_rust::serde::double_option")] pub email : Option < String > , # [serde (rename = "emailVerified")] # [serde (default , with = "::prisma_client_rust::serde::double_option")] pub email_verified : Option < :: prisma_client_rust :: chrono :: DateTime < :: prisma_client_rust :: chrono :: FixedOffset , > > , # [serde (rename = "name")] pub name : String , # [serde (rename = "image")] # [serde (default , with = "::prisma_client_rust::serde::double_option")] pub image : Option < String > } [$ ($ scalar_field) , +] } } ; } + pub use _partial_unchecked_user as partial_unchecked; + #[derive( + Debug, + Clone, + :: serde :: Serialize, + :: serde :: Deserialize, + :: prisma_client_rust :: specta :: Type, + )] + #[specta(rename = "User", crate = "prisma_client_rust::specta")] + pub struct Data { + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "email")] + pub email: Option, + #[serde(rename = "emailVerified")] + pub email_verified: Option< + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + >, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "image")] + pub image: Option, + #[serde(rename = "accounts")] + #[specta(skip)] + pub accounts: Option>, + #[serde(rename = "sessions")] + #[specta(skip)] + pub sessions: Option>, + } + impl Data { + pub fn accounts( + &self, + ) -> Result< + &Vec, + ::prisma_client_rust::RelationNotFetchedError, + > { + self.accounts.as_ref().ok_or( + ::prisma_client_rust::RelationNotFetchedError::new(stringify!( + accounts + )), + ) + } + pub fn sessions( + &self, + ) -> Result< + &Vec, + ::prisma_client_rust::RelationNotFetchedError, + > { + self.sessions.as_ref().ok_or( + ::prisma_client_rust::RelationNotFetchedError::new(stringify!( + sessions + )), + ) + } + } + #[derive(Clone)] + pub enum WithParam { + Accounts(super::account::ManyArgs), + Sessions(super::session::ManyArgs), + } + impl Into<::prisma_client_rust::Selection> for WithParam { + fn into(self) -> ::prisma_client_rust::Selection { + match self { + Self::Accounts(args) => { + let (arguments, mut nested_selections) = args.to_graphql(); + nested_selections . extend (< super :: account :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) ; + ::prisma_client_rust::Selection::new( + accounts::NAME, + None, + arguments, + nested_selections, + ) + } + Self::Sessions(args) => { + let (arguments, mut nested_selections) = args.to_graphql(); + nested_selections . extend (< super :: session :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) ; + ::prisma_client_rust::Selection::new( + sessions::NAME, + None, + arguments, + nested_selections, + ) + } + } + } + } + #[derive(Clone)] + pub enum SetParam { + SetId(String), + SetEmail(Option), + SetEmailVerified( + Option< + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + >, + ), + SetName(String), + SetImage(Option), + ConnectAccounts(Vec), + DisconnectAccounts(Vec), + SetAccounts(Vec), + ConnectSessions(Vec), + DisconnectSessions(Vec), + SetSessions(Vec), + } + impl From for (String, ::prisma_client_rust::PrismaValue) { + fn from(param: SetParam) -> Self { + match param { + SetParam::SetId(value) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(value), + ), + SetParam::SetEmail(value) => ( + email::NAME.to_string(), + value + .map(|value| ::prisma_client_rust::PrismaValue::String(value)) + .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), + ), + SetParam::SetEmailVerified(value) => ( + email_verified::NAME.to_string(), + value + .map(|value| ::prisma_client_rust::PrismaValue::DateTime(value)) + .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), + ), + SetParam::SetName(value) => ( + name::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(value), + ), + SetParam::SetImage(value) => ( + image::NAME.to_string(), + value + .map(|value| ::prisma_client_rust::PrismaValue::String(value)) + .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), + ), + SetParam::ConnectAccounts(where_params) => ( + accounts::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "connect".to_string(), + ::prisma_client_rust::PrismaValue::List( + where_params + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) + .collect(), + ), + )]), + ), + SetParam::DisconnectAccounts(where_params) => ( + accounts::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "disconnect".to_string(), + ::prisma_client_rust::PrismaValue::List( + where_params + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) + .collect(), + ), + )]), + ), + SetParam::SetAccounts(where_params) => ( + accounts::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "set".to_string(), + ::prisma_client_rust::PrismaValue::List( + where_params + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) + .collect(), + ), + )]), + ), + SetParam::ConnectSessions(where_params) => ( + sessions::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "connect".to_string(), + ::prisma_client_rust::PrismaValue::List( + where_params + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) + .collect(), + ), + )]), + ), + SetParam::DisconnectSessions(where_params) => ( + sessions::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "disconnect".to_string(), + ::prisma_client_rust::PrismaValue::List( + where_params + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) + .collect(), + ), + )]), + ), + SetParam::SetSessions(where_params) => ( + sessions::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "set".to_string(), + ::prisma_client_rust::PrismaValue::List( + where_params + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) + .collect(), + ), + )]), + ), + } + } + } + #[derive(Clone)] + pub enum UncheckedSetParam { + Id(String), + Email(Option), + EmailVerified( + Option< + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + >, + ), + Name(String), + Image(Option), + } + impl From for SetParam { + fn from(param: UncheckedSetParam) -> Self { + match param { + UncheckedSetParam::Id(value) => Self::SetId(value), + UncheckedSetParam::Email(value) => Self::SetEmail(value), + UncheckedSetParam::EmailVerified(value) => { + Self::SetEmailVerified(value) + } + UncheckedSetParam::Name(value) => Self::SetName(value), + UncheckedSetParam::Image(value) => Self::SetImage(value), + } + } + } + #[derive(Clone)] + pub enum OrderByParam { + Id(::prisma_client_rust::Direction), + Email(::prisma_client_rust::Direction), + EmailVerified(::prisma_client_rust::Direction), + Name(::prisma_client_rust::Direction), + Image(::prisma_client_rust::Direction), + } + impl Into<(String, ::prisma_client_rust::PrismaValue)> for OrderByParam { + fn into(self) -> (String, ::prisma_client_rust::PrismaValue) { + match self { + Self::Id(direction) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::Email(direction) => ( + email::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::EmailVerified(direction) => ( + email_verified::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::Name(direction) => ( + name::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::Image(direction) => ( + image::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + } + } + } + #[derive(Clone)] + pub enum WhereParam { + Not(Vec), + Or(Vec), + And(Vec), + Id(_prisma::read_filters::StringFilter), + Email(_prisma::read_filters::StringNullableFilter), + EmailVerified(_prisma::read_filters::DateTimeNullableFilter), + Name(_prisma::read_filters::StringFilter), + Image(_prisma::read_filters::StringNullableFilter), + AccountsSome(Vec), + AccountsEvery(Vec), + AccountsNone(Vec), + SessionsSome(Vec), + SessionsEvery(Vec), + SessionsNone(Vec), + } + impl ::prisma_client_rust::WhereInput for WhereParam { + fn serialize(self) -> ::prisma_client_rust::SerializedWhereInput { + let (name, value) = match self { + Self::Not(value) => ( + "NOT", + ::prisma_client_rust::SerializedWhereValue::Object( + ::prisma_client_rust::merge_fields( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .collect(), + ), + ), + ), + Self::Or(value) => ( + "OR", + ::prisma_client_rust::SerializedWhereValue::List( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .map(|v| vec![v]) + .map(::prisma_client_rust::PrismaValue::Object) + .collect(), + ), + ), + Self::And(value) => ( + "AND", + ::prisma_client_rust::SerializedWhereValue::Object( + ::prisma_client_rust::merge_fields( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .collect(), + ), + ), + ), + Self::Id(value) => (id::NAME, value.into()), + Self::Email(value) => (email::NAME, value.into()), + Self::EmailVerified(value) => (email_verified::NAME, value.into()), + Self::Name(value) => (name::NAME, value.into()), + Self::Image(value) => (image::NAME, value.into()), + Self::AccountsSome(where_params) => ( + accounts::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "some".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::AccountsEvery(where_params) => ( + accounts::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "every".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::AccountsNone(where_params) => ( + accounts::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "none".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::SessionsSome(where_params) => ( + sessions::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "some".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::SessionsEvery(where_params) => ( + sessions::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "every".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::SessionsNone(where_params) => ( + sessions::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "none".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + }; + ::prisma_client_rust::SerializedWhereInput::new(name, value.into()) + } + } + #[derive(Clone)] + pub enum UniqueWhereParam { + EmailEquals(String), + IdEquals(String), + } + impl From for WhereParam { + fn from(value: UniqueWhereParam) -> Self { + match value { + UniqueWhereParam::EmailEquals(value) => Self::Email( + _prisma::read_filters::StringNullableFilter::Equals(Some(value)), + ), + UniqueWhereParam::IdEquals(value) => { + Self::Id(_prisma::read_filters::StringFilter::Equals(value)) + } + } + } + } + impl ::prisma_client_rust::FromOptionalUniqueArg for WhereParam { + type Arg = Option; + fn from_arg(arg: Self::Arg) -> Self + where + Self: Sized, + { + Self::Email(_prisma::read_filters::StringNullableFilter::Equals(arg)) + } + } + impl ::prisma_client_rust::FromOptionalUniqueArg + for UniqueWhereParam + { + type Arg = String; + fn from_arg(arg: Self::Arg) -> Self + where + Self: Sized, + { + Self::EmailEquals(arg) + } + } + impl From<::prisma_client_rust::Operator> for WhereParam { + fn from(op: ::prisma_client_rust::Operator) -> Self { + match op { + ::prisma_client_rust::Operator::Not(value) => Self::Not(value), + ::prisma_client_rust::Operator::And(value) => Self::And(value), + ::prisma_client_rust::Operator::Or(value) => Self::Or(value), + } + } + } + #[derive(Clone)] + pub struct Types; + impl ::prisma_client_rust::ModelTypes for Types { + type Data = Data; + type Where = WhereParam; + type UncheckedSet = UncheckedSetParam; + type Set = SetParam; + type With = WithParam; + type OrderBy = OrderByParam; + type Cursor = UniqueWhereParam; + const MODEL: &'static str = NAME; + fn scalar_selections() -> Vec<::prisma_client_rust::Selection> { + vec![ + ::prisma_client_rust::sel(id::NAME), + ::prisma_client_rust::sel(email::NAME), + ::prisma_client_rust::sel(email_verified::NAME), + ::prisma_client_rust::sel(name::NAME), + ::prisma_client_rust::sel(image::NAME), + ] + } + } + pub type UniqueArgs = ::prisma_client_rust::UniqueArgs; + pub type ManyArgs = ::prisma_client_rust::ManyArgs; + pub type Count<'a> = ::prisma_client_rust::Count<'a, Types>; + pub type Create<'a> = ::prisma_client_rust::Create<'a, Types>; + pub type CreateMany<'a> = ::prisma_client_rust::CreateMany<'a, Types>; + pub type FindUnique<'a> = ::prisma_client_rust::FindUnique<'a, Types>; + pub type FindMany<'a> = ::prisma_client_rust::FindMany<'a, Types>; + pub type FindFirst<'a> = ::prisma_client_rust::FindFirst<'a, Types>; + pub type Update<'a> = ::prisma_client_rust::Update<'a, Types>; + pub type UpdateMany<'a> = ::prisma_client_rust::UpdateMany<'a, Types>; + pub type Upsert<'a> = ::prisma_client_rust::Upsert<'a, Types>; + pub type Delete<'a> = ::prisma_client_rust::Delete<'a, Types>; + pub type DeleteMany<'a> = ::prisma_client_rust::DeleteMany<'a, Types>; + #[derive(Clone)] + pub struct Actions<'a> { + pub client: &'a ::prisma_client_rust::PrismaClientInternals, + } + impl<'a> Actions<'a> { + pub fn find_unique(self, _where: UniqueWhereParam) -> FindUnique<'a> { + FindUnique::new(self.client, _where.into()) + } + pub fn find_first(self, _where: Vec) -> FindFirst<'a> { + FindFirst::new(self.client, _where) + } + pub fn find_many(self, _where: Vec) -> FindMany<'a> { + FindMany::new(self.client, _where) + } + pub fn create( + self, + name: String, + mut _params: Vec, + ) -> Create<'a> { + _params.extend([name::set(name)]); + Create::new(self.client, _params) + } + pub fn create_unchecked( + self, + name: String, + mut _params: Vec, + ) -> Create<'a> { + _params.extend([name::set(name)]); + Create::new(self.client, _params.into_iter().map(Into::into).collect()) + } + pub fn create_many( + self, + data: Vec<(String, Vec)>, + ) -> CreateMany<'a> { + let data = data + .into_iter() + .map(|(name, mut _params)| { + _params.extend([name::set(name)]); + _params + }) + .collect(); + CreateMany::new(self.client, data) + } + pub fn update( + self, + _where: UniqueWhereParam, + _params: Vec, + ) -> Update<'a> { + Update::new(self.client, _where.into(), _params, vec![]) + } + pub fn update_unchecked( + self, + _where: UniqueWhereParam, + _params: Vec, + ) -> Update<'a> { + Update::new( + self.client, + _where.into(), + _params.into_iter().map(Into::into).collect(), + vec![], + ) + } + pub fn update_many( + self, + _where: Vec, + _params: Vec, + ) -> UpdateMany<'a> { + UpdateMany::new(self.client, _where, _params) + } + pub fn upsert( + self, + _where: UniqueWhereParam, + (name, mut _params): (String, Vec), + _update: Vec, + ) -> Upsert<'a> { + _params.extend([name::set(name)]); + Upsert::new(self.client, _where.into(), _params, _update) + } + pub fn delete(self, _where: UniqueWhereParam) -> Delete<'a> { + Delete::new(self.client, _where.into(), vec![]) + } + pub fn delete_many(self, _where: Vec) -> DeleteMany<'a> { + DeleteMany::new(self.client, _where) + } + pub fn count(self, _where: Vec) -> Count<'a> { + Count::new(self.client, _where) + } + pub fn find_raw( + self, + ) -> ::prisma_client_rust::FindRaw<'a, Types, T> { + ::prisma_client_rust::FindRaw::new(self.client) + } + pub fn aggregate_raw( + self, + ) -> ::prisma_client_rust::AggregateRaw<'a, Types, T> { + ::prisma_client_rust::AggregateRaw::new(self.client) + } + } +} +pub mod player { + use super::_prisma::*; + use super::*; + pub const NAME: &str = "Player"; + pub mod id { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "id"; + pub struct Set(pub String); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetId(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::Id(v) + } + } + pub fn set>(value: String) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::Id(direction) + } + pub fn equals>(value: String) -> T { + UniqueWhereParam::IdEquals(value).into() + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::StringFilter, + Id, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: String) -> Lt; + fn lte(_: String) -> Lte; + fn gt(_: String) -> Gt; + fn gte(_: String) -> Gte; + fn contains(_: String) -> Contains; + fn starts_with(_: String) -> StartsWith; + fn ends_with(_: String) -> EndsWith; + fn mode(_: super::super::QueryMode) -> Mode; + fn not(_: String) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Id(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Id(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod universe_id { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "universeId"; + pub struct Set(pub i32); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetUniverseId(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::UniverseId(v) + } + } + pub fn set>(value: i32) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::UniverseId(direction) + } + pub fn equals(value: i32) -> WhereParam { + WhereParam::UniverseId(_prisma::read_filters::IntFilter::Equals(value)) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::IntFilter, + UniverseId, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: i32) -> Lt; + fn lte(_: i32) -> Lte; + fn gt(_: i32) -> Gt; + fn gte(_: i32) -> Gte; + fn not(_: i32) -> Not; + } + ); + pub fn increment(value: i32) -> SetParam { + SetParam::IncrementUniverseId(value) + } + pub fn decrement(value: i32) -> SetParam { + SetParam::DecrementUniverseId(value) + } + pub fn multiply(value: i32) -> SetParam { + SetParam::MultiplyUniverseId(value) + } + pub fn divide(value: i32) -> SetParam { + SetParam::DivideUniverseId(value) + } + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::UniverseId(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::UniverseId(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod universe { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "universe"; + pub struct Fetch(pub universe::UniqueArgs); + impl Fetch { + pub fn with(mut self, params: impl Into) -> Self { + self.0 = self.0.with(params.into()); + self + } + } + impl From for WithParam { + fn from(Fetch(v): Fetch) -> Self { + WithParam::Universe(v) + } + } + pub fn fetch() -> Fetch { + Fetch(universe::UniqueArgs::new()) + } + pub struct Connect(universe::UniqueWhereParam); + impl From for SetParam { + fn from(Connect(v): Connect) -> Self { + Self::ConnectUniverse(v) + } + } + pub fn connect>(value: universe::UniqueWhereParam) -> T { + Connect(value).into() + } + pub fn is(value: Vec) -> WhereParam { + WhereParam::UniverseIs(value) + } + pub fn is_not(value: Vec) -> WhereParam { + WhereParam::UniverseIsNot(value) + } + pub enum Include { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Universe(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = < universe :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < universe :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; + ::prisma_client_rust::Selection::new("universe", None, [], selections) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include(nested_selections: Vec) -> Self { + Self::Include(nested_selections) + } + } + pub enum Select { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Universe(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < universe :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; + ::prisma_client_rust::Selection::new("universe", None, [], selections) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include(nested_selections: Vec) -> Self { + Self::Include(nested_selections) + } + } + } + pub mod empire { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "empire"; + pub struct Fetch(pub empire::UniqueArgs); + impl Fetch { + pub fn with(mut self, params: impl Into) -> Self { + self.0 = self.0.with(params.into()); + self + } + } + impl From for WithParam { + fn from(Fetch(v): Fetch) -> Self { + WithParam::Empire(v) + } + } + pub fn fetch() -> Fetch { + Fetch(empire::UniqueArgs::new()) + } + pub struct Connect(empire::UniqueWhereParam); + impl From for SetParam { + fn from(Connect(v): Connect) -> Self { + Self::ConnectEmpire(v) + } + } + pub fn connect>(value: empire::UniqueWhereParam) -> T { + Connect(value).into() + } + pub fn disconnect() -> SetParam { + SetParam::DisconnectEmpire + } + pub fn is_null() -> WhereParam { + WhereParam::EmpireIsNull + } + pub fn is(value: Vec) -> WhereParam { + WhereParam::EmpireIs(value) + } + pub fn is_not(value: Vec) -> WhereParam { + WhereParam::EmpireIsNot(value) + } + pub enum Include { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Empire(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = < empire :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < empire :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; + ::prisma_client_rust::Selection::new("empire", None, [], selections) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include(nested_selections: Vec) -> Self { + Self::Include(nested_selections) + } + } + pub enum Select { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Empire(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < empire :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; + ::prisma_client_rust::Selection::new("empire", None, [], selections) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include(nested_selections: Vec) -> Self { + Self::Include(nested_selections) + } + } + } + pub fn create( + universe: super::universe::UniqueWhereParam, + _params: Vec, + ) -> (super::universe::UniqueWhereParam, Vec) { + (universe, _params) + } + pub fn create_unchecked( + universe_id: i32, + _params: Vec, + ) -> (i32, Vec) { + (universe_id, _params) + } + #[macro_export] + macro_rules ! _select_player { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: player :: select ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: player :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: player :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: player :: select ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: player :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: player :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { id , universe_id , universe , empire } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } const SPECTA_TYPE_NAME : & 'static str = prisma_client_rust :: macros :: to_pascal_case ! ($ ($ module_name) ?) ; crate :: prisma :: player :: select ! (@ specta_data_struct ; pub struct Data { $ (# [specta (rename_from_path = crate :: prisma :: player :: $ field :: NAME)] pub $ field : crate :: prisma :: player :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } ; $ ($ module_name) ?) ; impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) +] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: player :: $ field :: NAME , & self . $ field) ? ;) * state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: player :: $ field :: NAME) , + ,] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: player :: $ field :: NAME => Ok (Field :: $ field)) , * , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * while let Some (key) = map . next_key () ? { match key { $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: player :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: player :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "universeId" , "universe" , "empire"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: player :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { String } ; (@ field_type ; universe_id) => { i32 } ; (@ field_type ; universe : $ selection_mode : ident { $ ($ selections : tt) + }) => { universe :: Data } ; (@ field_type ; universe) => { crate :: prisma :: universe :: Data } ; (@ field_type ; empire : $ selection_mode : ident { $ ($ selections : tt) + }) => { Option < empire :: Data > } ; (@ field_type ; empire) => { Option < crate :: prisma :: empire :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Player" , available relations are "id, universe_id, universe, empire")) } ; (@ field_module ; universe : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: universe :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; empire : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: empire :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: player :: SelectParam > :: into (crate :: prisma :: player :: id :: Select) } ; (@ selection_field_to_selection_param ; universe_id) => { Into :: < crate :: prisma :: player :: SelectParam > :: into (crate :: prisma :: player :: universe_id :: Select) } ; (@ selection_field_to_selection_param ; universe $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: player :: SelectParam > :: into (crate :: prisma :: player :: universe :: Select :: $ selection_mode (crate :: prisma :: universe :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; universe $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: player :: SelectParam > :: into (crate :: prisma :: player :: universe :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; empire $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: player :: SelectParam > :: into (crate :: prisma :: player :: empire :: Select :: $ selection_mode (crate :: prisma :: empire :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; empire $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: player :: SelectParam > :: into (crate :: prisma :: player :: empire :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: player :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; universe_id) => { "universeId" } ; (@ field_serde_name ; universe) => { "universe" } ; (@ field_serde_name ; empire) => { "empire" } ; (@ specta_data_struct ; $ struct : item ;) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] # [specta (inline)] $ struct } ; (@ specta_data_struct ; $ struct : item ; $ name : ident) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] $ struct } ; } + pub use _select_player as select; + pub enum SelectParam { + Id(id::Select), + UniverseId(universe_id::Select), + Universe(universe::Select), + Empire(empire::Select), + } + impl SelectParam { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + match self { + Self::Id(data) => data.to_selection(), + Self::UniverseId(data) => data.to_selection(), + Self::Universe(data) => data.to_selection(), + Self::Empire(data) => data.to_selection(), + } + } + } + #[macro_export] + macro_rules ! _include_player { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: player :: include ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: player :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: player :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: player :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: player :: include ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: player :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: player :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: player :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { universe , empire } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } const SPECTA_TYPE_NAME : & 'static str = prisma_client_rust :: macros :: to_pascal_case ! ($ ($ module_name) ?) ; crate :: prisma :: player :: include ! (@ specta_data_struct ; pub struct Data { # [specta (rename_from_path = crate :: prisma :: player :: id :: NAME)] pub id : String , # [specta (rename_from_path = crate :: prisma :: player :: universe_id :: NAME)] pub universe_id : i32 , $ (# [specta (rename_from_path = crate :: prisma :: player :: $ field :: NAME)] pub $ field : crate :: prisma :: player :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } ; $ ($ module_name) ?) ; impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) + stringify ! (id) , stringify ! (universe_id)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: player :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: player :: id :: NAME , & self . id) ? ; state . serialize_field (crate :: prisma :: player :: universe_id :: NAME , & self . universe_id) ? ; state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , id , universe_id } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: player :: $ field :: NAME) , + , crate :: prisma :: player :: id :: NAME , crate :: prisma :: player :: universe_id :: NAME] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: player :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: player :: id :: NAME => Ok (Field :: id) , crate :: prisma :: player :: universe_id :: NAME => Ok (Field :: universe_id) , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * let mut id = None ; let mut universe_id = None ; while let Some (key) = map . next_key () ? { match key { Field :: id => { if id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: player :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } Field :: universe_id => { if universe_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: player :: universe_id :: NAME)) ; } universe_id = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: player :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: player :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: player :: id :: NAME)) ? ; let universe_id = universe_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: player :: universe_id :: NAME)) ? ; Ok (Data { id , universe_id , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "universeId" , "universe" , "empire"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: player :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; universe : $ selection_mode : ident { $ ($ selections : tt) + }) => { universe :: Data } ; (@ field_type ; universe) => { crate :: prisma :: universe :: Data } ; (@ field_type ; empire : $ selection_mode : ident { $ ($ selections : tt) + }) => { Option < empire :: Data > } ; (@ field_type ; empire) => { Option < crate :: prisma :: empire :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Player" , available relations are "universe, empire")) } ; (@ field_module ; universe : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: universe :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; empire : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: empire :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; universe $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: player :: IncludeParam > :: into (crate :: prisma :: player :: universe :: Include :: $ selection_mode (crate :: prisma :: universe :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; universe $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: player :: IncludeParam > :: into (crate :: prisma :: player :: universe :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; empire $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: player :: IncludeParam > :: into (crate :: prisma :: player :: empire :: Include :: $ selection_mode (crate :: prisma :: empire :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; empire $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: player :: IncludeParam > :: into (crate :: prisma :: player :: empire :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: player :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; universe_id) => { "universeId" } ; (@ field_serde_name ; universe) => { "universe" } ; (@ field_serde_name ; empire) => { "empire" } ; (@ specta_data_struct ; $ struct : item ;) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] # [specta (inline)] $ struct } ; (@ specta_data_struct ; $ struct : item ; $ name : ident) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] $ struct } ; } + pub use _include_player as include; + pub enum IncludeParam { + Id(id::Include), + UniverseId(universe_id::Include), + Universe(universe::Include), + Empire(empire::Include), + } + impl IncludeParam { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + match self { + Self::Id(data) => data.to_selection(), + Self::UniverseId(data) => data.to_selection(), + Self::Universe(data) => data.to_selection(), + Self::Empire(data) => data.to_selection(), + } + } + } + #[macro_export] + macro_rules ! _partial_unchecked_player { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: player struct $ struct_name { # [serde (rename = "id")] pub id : String , # [serde (rename = "universeId")] pub universe_id : i32 } [$ ($ scalar_field) , +] } } ; } + pub use _partial_unchecked_player as partial_unchecked; + #[derive( + Debug, + Clone, + :: serde :: Serialize, + :: serde :: Deserialize, + :: prisma_client_rust :: specta :: Type, + )] + #[specta(rename = "Player", crate = "prisma_client_rust::specta")] + pub struct Data { + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "universeId")] + pub universe_id: i32, + #[serde(rename = "universe")] + #[specta(skip)] + pub universe: Option>, + #[serde( + rename = "empire", + default, + skip_serializing_if = "Option::is_none", + with = "prisma_client_rust::serde::double_option" + )] + #[specta(skip)] + pub empire: Option>>, + } + impl Data { + pub fn universe( + &self, + ) -> Result< + &super::universe::Data, + ::prisma_client_rust::RelationNotFetchedError, + > { + self + .universe + .as_ref() + .ok_or(::prisma_client_rust::RelationNotFetchedError::new( + stringify!(universe), + )) + .map(|v| v.as_ref()) + } + pub fn empire( + &self, + ) -> Result< + Option<&super::empire::Data>, + ::prisma_client_rust::RelationNotFetchedError, + > { + self + .empire + .as_ref() + .ok_or(::prisma_client_rust::RelationNotFetchedError::new( + stringify!(empire), + )) + .map(|v| v.as_ref().map(|v| v.as_ref())) + } + } + #[derive(Clone)] + pub enum WithParam { + Universe(super::universe::UniqueArgs), + Empire(super::empire::UniqueArgs), + } + impl Into<::prisma_client_rust::Selection> for WithParam { + fn into(self) -> ::prisma_client_rust::Selection { + match self { + Self::Universe(args) => { + let mut selections = < super :: universe :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; + selections.extend( + args + .with_params + .into_iter() + .map(Into::<::prisma_client_rust::Selection>::into), + ); + ::prisma_client_rust::Selection::new( + universe::NAME, + None, + [], + selections, + ) + } + Self::Empire(args) => { + let mut selections = < super :: empire :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; + selections.extend( + args + .with_params + .into_iter() + .map(Into::<::prisma_client_rust::Selection>::into), + ); + ::prisma_client_rust::Selection::new( + empire::NAME, + None, + [], + selections, + ) + } + } + } + } + #[derive(Clone)] + pub enum SetParam { + SetId(String), + SetUniverseId(i32), + IncrementUniverseId(i32), + DecrementUniverseId(i32), + MultiplyUniverseId(i32), + DivideUniverseId(i32), + ConnectUniverse(super::universe::UniqueWhereParam), + ConnectEmpire(super::empire::UniqueWhereParam), + DisconnectEmpire, + } + impl From for (String, ::prisma_client_rust::PrismaValue) { + fn from(param: SetParam) -> Self { + match param { + SetParam::SetId(value) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(value), + ), + SetParam::SetUniverseId(value) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + ), + SetParam::IncrementUniverseId(value) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "increment".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::DecrementUniverseId(value) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "decrement".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::MultiplyUniverseId(value) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "multiply".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::DivideUniverseId(value) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "divide".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::ConnectUniverse(where_param) => ( + universe::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "connect".to_string(), + ::prisma_client_rust::PrismaValue::Object( + [where_param] + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + SetParam::ConnectEmpire(where_param) => ( + empire::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "connect".to_string(), + ::prisma_client_rust::PrismaValue::Object( + [where_param] + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + SetParam::DisconnectEmpire => ( + empire::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "disconnect".to_string(), + ::prisma_client_rust::PrismaValue::Boolean(true), + )]), + ), + } + } + } + #[derive(Clone)] + pub enum UncheckedSetParam { + Id(String), + UniverseId(i32), + } + impl From for SetParam { + fn from(param: UncheckedSetParam) -> Self { + match param { + UncheckedSetParam::Id(value) => Self::SetId(value), + UncheckedSetParam::UniverseId(value) => Self::SetUniverseId(value), + } + } + } + #[derive(Clone)] + pub enum OrderByParam { + Id(::prisma_client_rust::Direction), + UniverseId(::prisma_client_rust::Direction), + } + impl Into<(String, ::prisma_client_rust::PrismaValue)> for OrderByParam { + fn into(self) -> (String, ::prisma_client_rust::PrismaValue) { + match self { + Self::Id(direction) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::UniverseId(direction) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + } + } + } + #[derive(Clone)] + pub enum WhereParam { + Not(Vec), + Or(Vec), + And(Vec), + Id(_prisma::read_filters::StringFilter), + UniverseId(_prisma::read_filters::IntFilter), + UniverseIs(Vec), + UniverseIsNot(Vec), + EmpireIsNull, + EmpireIs(Vec), + EmpireIsNot(Vec), + } + impl ::prisma_client_rust::WhereInput for WhereParam { + fn serialize(self) -> ::prisma_client_rust::SerializedWhereInput { + let (name, value) = match self { + Self::Not(value) => ( + "NOT", + ::prisma_client_rust::SerializedWhereValue::Object( + ::prisma_client_rust::merge_fields( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .collect(), + ), + ), + ), + Self::Or(value) => ( + "OR", + ::prisma_client_rust::SerializedWhereValue::List( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .map(|v| vec![v]) + .map(::prisma_client_rust::PrismaValue::Object) + .collect(), + ), + ), + Self::And(value) => ( + "AND", + ::prisma_client_rust::SerializedWhereValue::Object( + ::prisma_client_rust::merge_fields( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .collect(), + ), + ), + ), + Self::Id(value) => (id::NAME, value.into()), + Self::UniverseId(value) => (universe_id::NAME, value.into()), + Self::UniverseIs(where_params) => ( + universe::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "is".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::UniverseIsNot(where_params) => ( + universe::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "isNot".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::EmpireIsNull => ( + empire::NAME, + ::prisma_client_rust::SerializedWhereValue::Value( + ::prisma_client_rust::PrismaValue::Null, + ), + ), + Self::EmpireIs(where_params) => ( + empire::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "is".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::EmpireIsNot(where_params) => ( + empire::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "isNot".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + }; + ::prisma_client_rust::SerializedWhereInput::new(name, value.into()) + } + } + #[derive(Clone)] + pub enum UniqueWhereParam { + IdEquals(String), + } + impl From for WhereParam { + fn from(value: UniqueWhereParam) -> Self { + match value { + UniqueWhereParam::IdEquals(value) => { + Self::Id(_prisma::read_filters::StringFilter::Equals(value)) + } + } + } + } + impl From<::prisma_client_rust::Operator> for WhereParam { + fn from(op: ::prisma_client_rust::Operator) -> Self { + match op { + ::prisma_client_rust::Operator::Not(value) => Self::Not(value), + ::prisma_client_rust::Operator::And(value) => Self::And(value), + ::prisma_client_rust::Operator::Or(value) => Self::Or(value), + } + } + } + #[derive(Clone)] + pub struct Types; + impl ::prisma_client_rust::ModelTypes for Types { + type Data = Data; + type Where = WhereParam; + type UncheckedSet = UncheckedSetParam; + type Set = SetParam; + type With = WithParam; + type OrderBy = OrderByParam; + type Cursor = UniqueWhereParam; + const MODEL: &'static str = NAME; + fn scalar_selections() -> Vec<::prisma_client_rust::Selection> { + vec![ + ::prisma_client_rust::sel(id::NAME), + ::prisma_client_rust::sel(universe_id::NAME), + ] + } + } + pub type UniqueArgs = ::prisma_client_rust::UniqueArgs; + pub type ManyArgs = ::prisma_client_rust::ManyArgs; + pub type Count<'a> = ::prisma_client_rust::Count<'a, Types>; + pub type Create<'a> = ::prisma_client_rust::Create<'a, Types>; + pub type CreateMany<'a> = ::prisma_client_rust::CreateMany<'a, Types>; + pub type FindUnique<'a> = ::prisma_client_rust::FindUnique<'a, Types>; + pub type FindMany<'a> = ::prisma_client_rust::FindMany<'a, Types>; + pub type FindFirst<'a> = ::prisma_client_rust::FindFirst<'a, Types>; + pub type Update<'a> = ::prisma_client_rust::Update<'a, Types>; + pub type UpdateMany<'a> = ::prisma_client_rust::UpdateMany<'a, Types>; + pub type Upsert<'a> = ::prisma_client_rust::Upsert<'a, Types>; + pub type Delete<'a> = ::prisma_client_rust::Delete<'a, Types>; + pub type DeleteMany<'a> = ::prisma_client_rust::DeleteMany<'a, Types>; + #[derive(Clone)] + pub struct Actions<'a> { + pub client: &'a ::prisma_client_rust::PrismaClientInternals, + } + impl<'a> Actions<'a> { + pub fn find_unique(self, _where: UniqueWhereParam) -> FindUnique<'a> { + FindUnique::new(self.client, _where.into()) + } + pub fn find_first(self, _where: Vec) -> FindFirst<'a> { + FindFirst::new(self.client, _where) + } + pub fn find_many(self, _where: Vec) -> FindMany<'a> { + FindMany::new(self.client, _where) + } + pub fn create( + self, + universe: super::universe::UniqueWhereParam, + mut _params: Vec, + ) -> Create<'a> { + _params.extend([universe::connect(universe)]); + Create::new(self.client, _params) + } + pub fn create_unchecked( + self, + universe_id: i32, + mut _params: Vec, + ) -> Create<'a> { + _params.extend([universe_id::set(universe_id)]); + Create::new(self.client, _params.into_iter().map(Into::into).collect()) + } + pub fn create_many( + self, + data: Vec<(i32, Vec)>, + ) -> CreateMany<'a> { + let data = data + .into_iter() + .map(|(universe_id, mut _params)| { + _params.extend([universe_id::set(universe_id)]); + _params + }) + .collect(); + CreateMany::new(self.client, data) + } + pub fn update( + self, + _where: UniqueWhereParam, + _params: Vec, + ) -> Update<'a> { + Update::new(self.client, _where.into(), _params, vec![]) + } + pub fn update_unchecked( + self, + _where: UniqueWhereParam, + _params: Vec, + ) -> Update<'a> { + Update::new( + self.client, + _where.into(), + _params.into_iter().map(Into::into).collect(), + vec![], + ) + } + pub fn update_many( + self, + _where: Vec, + _params: Vec, + ) -> UpdateMany<'a> { + UpdateMany::new(self.client, _where, _params) + } + pub fn upsert( + self, + _where: UniqueWhereParam, + (universe, mut _params): ( + super::universe::UniqueWhereParam, + Vec, + ), + _update: Vec, + ) -> Upsert<'a> { + _params.extend([universe::connect(universe)]); + Upsert::new(self.client, _where.into(), _params, _update) + } + pub fn delete(self, _where: UniqueWhereParam) -> Delete<'a> { + Delete::new(self.client, _where.into(), vec![]) + } + pub fn delete_many(self, _where: Vec) -> DeleteMany<'a> { + DeleteMany::new(self.client, _where) + } + pub fn count(self, _where: Vec) -> Count<'a> { + Count::new(self.client, _where) + } + pub fn find_raw( + self, + ) -> ::prisma_client_rust::FindRaw<'a, Types, T> { + ::prisma_client_rust::FindRaw::new(self.client) + } + pub fn aggregate_raw( + self, + ) -> ::prisma_client_rust::AggregateRaw<'a, Types, T> { + ::prisma_client_rust::AggregateRaw::new(self.client) + } + } +} +pub mod empire { + use super::_prisma::*; + use super::*; + pub const NAME: &str = "Empire"; + pub mod id { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "id"; + pub struct Set(pub i32); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetId(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::Id(v) + } + } + pub fn set>(value: i32) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::Id(direction) + } + pub fn equals(value: i32) -> WhereParam { + WhereParam::Id(_prisma::read_filters::IntFilter::Equals(value)) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::IntFilter, + Id, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: i32) -> Lt; + fn lte(_: i32) -> Lte; + fn gt(_: i32) -> Gt; + fn gte(_: i32) -> Gte; + fn not(_: i32) -> Not; + } + ); + pub fn increment(value: i32) -> SetParam { + SetParam::IncrementId(value) + } + pub fn decrement(value: i32) -> SetParam { + SetParam::DecrementId(value) + } + pub fn multiply(value: i32) -> SetParam { + SetParam::MultiplyId(value) + } + pub fn divide(value: i32) -> SetParam { + SetParam::DivideId(value) + } + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Id(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Id(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod universe_id { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "universeId"; + pub struct Set(pub i32); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetUniverseId(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::UniverseId(v) + } + } + pub fn set>(value: i32) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::UniverseId(direction) + } + pub fn equals(value: i32) -> WhereParam { + WhereParam::UniverseId(_prisma::read_filters::IntFilter::Equals(value)) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::IntFilter, + UniverseId, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: i32) -> Lt; + fn lte(_: i32) -> Lte; + fn gt(_: i32) -> Gt; + fn gte(_: i32) -> Gte; + fn not(_: i32) -> Not; + } + ); + pub fn increment(value: i32) -> SetParam { + SetParam::IncrementUniverseId(value) + } + pub fn decrement(value: i32) -> SetParam { + SetParam::DecrementUniverseId(value) + } + pub fn multiply(value: i32) -> SetParam { + SetParam::MultiplyUniverseId(value) + } + pub fn divide(value: i32) -> SetParam { + SetParam::DivideUniverseId(value) + } + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::UniverseId(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::UniverseId(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod universe { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "universe"; + pub struct Fetch(pub universe::UniqueArgs); + impl Fetch { + pub fn with(mut self, params: impl Into) -> Self { + self.0 = self.0.with(params.into()); + self + } + } + impl From for WithParam { + fn from(Fetch(v): Fetch) -> Self { + WithParam::Universe(v) + } + } + pub fn fetch() -> Fetch { + Fetch(universe::UniqueArgs::new()) + } + pub struct Connect(universe::UniqueWhereParam); + impl From for SetParam { + fn from(Connect(v): Connect) -> Self { + Self::ConnectUniverse(v) + } + } + pub fn connect>(value: universe::UniqueWhereParam) -> T { + Connect(value).into() + } + pub fn is(value: Vec) -> WhereParam { + WhereParam::UniverseIs(value) + } + pub fn is_not(value: Vec) -> WhereParam { + WhereParam::UniverseIsNot(value) + } + pub enum Include { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Universe(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = < universe :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < universe :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; + ::prisma_client_rust::Selection::new("universe", None, [], selections) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include(nested_selections: Vec) -> Self { + Self::Include(nested_selections) + } + } + pub enum Select { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Universe(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < universe :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; + ::prisma_client_rust::Selection::new("universe", None, [], selections) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include(nested_selections: Vec) -> Self { + Self::Include(nested_selections) + } + } + } + pub mod name { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "name"; + pub struct Set(pub String); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetName(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::Name(v) + } + } + pub fn set>(value: String) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::Name(direction) + } + pub fn equals(value: String) -> WhereParam { + WhereParam::Name(_prisma::read_filters::StringFilter::Equals(value)) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::StringFilter, + Name, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: String) -> Lt; + fn lte(_: String) -> Lte; + fn gt(_: String) -> Gt; + fn gte(_: String) -> Gte; + fn contains(_: String) -> Contains; + fn starts_with(_: String) -> StartsWith; + fn ends_with(_: String) -> EndsWith; + fn mode(_: super::super::QueryMode) -> Mode; + fn not(_: String) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Name(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Name(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod color { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "color"; + pub struct Set(pub String); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetColor(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::Color(v) + } + } + pub fn set>(value: String) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::Color(direction) + } + pub fn equals(value: String) -> WhereParam { + WhereParam::Color(_prisma::read_filters::StringFilter::Equals(value)) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::StringFilter, + Color, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: String) -> Lt; + fn lte(_: String) -> Lte; + fn gt(_: String) -> Gt; + fn gte(_: String) -> Gte; + fn contains(_: String) -> Contains; + fn starts_with(_: String) -> StartsWith; + fn ends_with(_: String) -> EndsWith; + fn mode(_: super::super::QueryMode) -> Mode; + fn not(_: String) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Color(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Color(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod player_id { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "playerId"; + pub struct Set(pub Option); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetPlayerId(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::PlayerId(v) + } + } + pub fn set>(value: Option) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::PlayerId(direction) + } + pub fn equals< + A, + T: ::prisma_client_rust::FromOptionalUniqueArg, + >( + value: A, + ) -> T { + T::from_arg(value) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::StringNullableFilter, + PlayerId, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: String) -> Lt; + fn lte(_: String) -> Lte; + fn gt(_: String) -> Gt; + fn gte(_: String) -> Gte; + fn contains(_: String) -> Contains; + fn starts_with(_: String) -> StartsWith; + fn ends_with(_: String) -> EndsWith; + fn mode(_: super::super::QueryMode) -> Mode; + fn not(_: Option) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::PlayerId(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::PlayerId(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod player { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "player"; + pub struct Fetch(pub player::UniqueArgs); + impl Fetch { + pub fn with(mut self, params: impl Into) -> Self { + self.0 = self.0.with(params.into()); + self + } + } + impl From for WithParam { + fn from(Fetch(v): Fetch) -> Self { + WithParam::Player(v) + } + } + pub fn fetch() -> Fetch { + Fetch(player::UniqueArgs::new()) + } + pub struct Connect(player::UniqueWhereParam); + impl From for SetParam { + fn from(Connect(v): Connect) -> Self { + Self::ConnectPlayer(v) + } + } + pub fn connect>(value: player::UniqueWhereParam) -> T { + Connect(value).into() + } + pub fn disconnect() -> SetParam { + SetParam::DisconnectPlayer + } + pub fn is_null() -> WhereParam { + WhereParam::PlayerIsNull + } + pub fn is(value: Vec) -> WhereParam { + WhereParam::PlayerIs(value) + } + pub fn is_not(value: Vec) -> WhereParam { + WhereParam::PlayerIsNot(value) + } + pub enum Include { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Player(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = < player :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < player :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; + ::prisma_client_rust::Selection::new("player", None, [], selections) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include(nested_selections: Vec) -> Self { + Self::Include(nested_selections) + } + } + pub enum Select { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Player(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < player :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; + ::prisma_client_rust::Selection::new("player", None, [], selections) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include(nested_selections: Vec) -> Self { + Self::Include(nested_selections) + } + } + } + pub mod star_systems { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "starSystems"; + pub struct Fetch(pub star_system::ManyArgs); + impl Fetch { + pub fn with(mut self, params: impl Into) -> Self { + self.0 = self.0.with(params.into()); + self + } + pub fn order_by(mut self, param: star_system::OrderByParam) -> Self { + self.0 = self.0.order_by(param); + self + } + pub fn skip(mut self, value: i64) -> Self { + self.0 = self.0.skip(value); + self + } + pub fn take(mut self, value: i64) -> Self { + self.0 = self.0.take(value); + self + } + pub fn cursor(mut self, value: star_system::UniqueWhereParam) -> Self { + self.0 = self.0.cursor(value.into()); + self + } + } + impl From for WithParam { + fn from(Fetch(v): Fetch) -> Self { + WithParam::StarSystems(v) + } + } + pub fn fetch(params: Vec) -> Fetch { + Fetch(star_system::ManyArgs::new(params)) + } + pub struct Connect(pub Vec); + impl From for SetParam { + fn from(Connect(v): Connect) -> Self { + Self::ConnectStarSystems(v) + } + } + pub fn connect>( + params: Vec, + ) -> T { + Connect(params).into() + } + pub fn disconnect(params: Vec) -> SetParam { + SetParam::DisconnectStarSystems(params) + } + pub fn set(params: Vec) -> SetParam { + SetParam::SetStarSystems(params) + } + pub fn some(value: Vec) -> WhereParam { + WhereParam::StarSystemsSome(value) + } + pub fn every(value: Vec) -> WhereParam { + WhereParam::StarSystemsEvery(value) + } + pub fn none(value: Vec) -> WhereParam { + WhereParam::StarSystemsNone(value) + } + pub enum Include { + Select(star_system::ManyArgs, Vec), + Include(star_system::ManyArgs, Vec), + Fetch(star_system::ManyArgs), + } + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::StarSystems(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let (args , selections) = match self { Self :: Select (args , selections) => (args . to_graphql () . 0 , selections . into_iter () . map (| s | s . to_selection ()) . collect ()) , Self :: Include (args , selections) => (args . to_graphql () . 0 , { let mut nested_selections = < star_system :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections }) , Self :: Fetch (args) => (args . to_graphql () . 0 , < star_system :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; + ::prisma_client_rust::Selection::new(NAME, None, args, selections) + } + pub fn select( + args: star_system::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Select(args, nested_selections) + } + pub fn include( + args: star_system::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Include(args, nested_selections) + } + } + pub enum Select { + Select(star_system::ManyArgs, Vec), + Include(star_system::ManyArgs, Vec), + Fetch(star_system::ManyArgs), + } + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::StarSystems(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let (args , selections) = match self { Self :: Select (args , selections) => (args . to_graphql () . 0 , selections . into_iter () . map (| s | s . to_selection ()) . collect ()) , Self :: Include (args , selections) => (args . to_graphql () . 0 , { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections }) , Self :: Fetch (args) => (args . to_graphql () . 0 , < star_system :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; + ::prisma_client_rust::Selection::new(NAME, None, args, selections) + } + pub fn select( + args: star_system::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Select(args, nested_selections) + } + pub fn include( + args: star_system::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Include(args, nested_selections) + } + } + } + pub mod resources { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "resources"; + pub struct Set(pub ::prisma_client_rust::serde_json::Value); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetResources(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::Resources(v) + } + } + pub fn set>( + value: ::prisma_client_rust::serde_json::Value, + ) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::Resources(direction) + } + pub fn equals( + value: ::prisma_client_rust::serde_json::Value, + ) -> WhereParam { + WhereParam::Resources(_prisma::read_filters::JsonFilter::Equals(value)) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::JsonFilter, + Resources, + { + fn path(_: Vec) -> Path; + fn string_contains(_: String) -> StringContains; + fn string_starts_with(_: String) -> StringStartsWith; + fn string_ends_with(_: String) -> StringEndsWith; + fn array_contains( + _: Option<::prisma_client_rust::serde_json::Value>, + ) -> ArrayContains; + fn array_starts_with( + _: Option<::prisma_client_rust::serde_json::Value>, + ) -> ArrayStartsWith; + fn array_ends_with( + _: Option<::prisma_client_rust::serde_json::Value>, + ) -> ArrayEndsWith; + fn lt(_: ::prisma_client_rust::serde_json::Value) -> Lt; + fn lte(_: ::prisma_client_rust::serde_json::Value) -> Lte; + fn gt(_: ::prisma_client_rust::serde_json::Value) -> Gt; + fn gte(_: ::prisma_client_rust::serde_json::Value) -> Gte; + fn not(_: ::prisma_client_rust::serde_json::Value) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Resources(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Resources(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub fn universe_id_id>( + universe_id: i32, + id: i32, + ) -> T { + UniqueWhereParam::UniverseIdIdEquals(universe_id, id).into() + } + pub fn create( + universe: super::universe::UniqueWhereParam, + name: String, + color: String, + resources: ::prisma_client_rust::serde_json::Value, + _params: Vec, + ) -> ( + super::universe::UniqueWhereParam, + String, + String, + ::prisma_client_rust::serde_json::Value, + Vec, + ) { + (universe, name, color, resources, _params) + } + pub fn create_unchecked( + universe_id: i32, + name: String, + color: String, + resources: ::prisma_client_rust::serde_json::Value, + _params: Vec, + ) -> ( + i32, + String, + String, + ::prisma_client_rust::serde_json::Value, + Vec, + ) { + (universe_id, name, color, resources, _params) + } + #[macro_export] + macro_rules ! _select_empire { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: empire :: select ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: empire :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: empire :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: empire :: select ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: empire :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: empire :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { id , universe_id , universe , name , color , player_id , player , star_systems , resources } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } const SPECTA_TYPE_NAME : & 'static str = prisma_client_rust :: macros :: to_pascal_case ! ($ ($ module_name) ?) ; crate :: prisma :: empire :: select ! (@ specta_data_struct ; pub struct Data { $ (# [specta (rename_from_path = crate :: prisma :: empire :: $ field :: NAME)] pub $ field : crate :: prisma :: empire :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } ; $ ($ module_name) ?) ; impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) +] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: empire :: $ field :: NAME , & self . $ field) ? ;) * state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: empire :: $ field :: NAME) , + ,] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: empire :: $ field :: NAME => Ok (Field :: $ field)) , * , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * while let Some (key) = map . next_key () ? { match key { $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: empire :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: empire :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "universeId" , "universe" , "name" , "color" , "playerId" , "player" , "starSystems" , "resources"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: empire :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { i32 } ; (@ field_type ; universe_id) => { i32 } ; (@ field_type ; universe : $ selection_mode : ident { $ ($ selections : tt) + }) => { universe :: Data } ; (@ field_type ; universe) => { crate :: prisma :: universe :: Data } ; (@ field_type ; name) => { String } ; (@ field_type ; color) => { String } ; (@ field_type ; player_id) => { Option < String > } ; (@ field_type ; player : $ selection_mode : ident { $ ($ selections : tt) + }) => { Option < player :: Data > } ; (@ field_type ; player) => { Option < crate :: prisma :: player :: Data > } ; (@ field_type ; star_systems : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < star_systems :: Data > } ; (@ field_type ; star_systems) => { Vec < crate :: prisma :: star_system :: Data > } ; (@ field_type ; resources) => { :: prisma_client_rust :: serde_json :: Value } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Empire" , available relations are "id, universe_id, universe, name, color, player_id, player, star_systems, resources")) } ; (@ field_module ; universe : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: universe :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; player : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: player :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; star_systems : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: star_system :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: empire :: SelectParam > :: into (crate :: prisma :: empire :: id :: Select) } ; (@ selection_field_to_selection_param ; universe_id) => { Into :: < crate :: prisma :: empire :: SelectParam > :: into (crate :: prisma :: empire :: universe_id :: Select) } ; (@ selection_field_to_selection_param ; universe $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: empire :: SelectParam > :: into (crate :: prisma :: empire :: universe :: Select :: $ selection_mode (crate :: prisma :: universe :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; universe $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: empire :: SelectParam > :: into (crate :: prisma :: empire :: universe :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; name) => { Into :: < crate :: prisma :: empire :: SelectParam > :: into (crate :: prisma :: empire :: name :: Select) } ; (@ selection_field_to_selection_param ; color) => { Into :: < crate :: prisma :: empire :: SelectParam > :: into (crate :: prisma :: empire :: color :: Select) } ; (@ selection_field_to_selection_param ; player_id) => { Into :: < crate :: prisma :: empire :: SelectParam > :: into (crate :: prisma :: empire :: player_id :: Select) } ; (@ selection_field_to_selection_param ; player $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: empire :: SelectParam > :: into (crate :: prisma :: empire :: player :: Select :: $ selection_mode (crate :: prisma :: player :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; player $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: empire :: SelectParam > :: into (crate :: prisma :: empire :: player :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; star_systems $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: empire :: SelectParam > :: into (crate :: prisma :: empire :: star_systems :: Select :: $ selection_mode (crate :: prisma :: star_system :: ManyArgs :: new (crate :: prisma :: star_system :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: star_system :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; star_systems $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: empire :: SelectParam > :: into (crate :: prisma :: empire :: star_systems :: Select :: Fetch (crate :: prisma :: star_system :: ManyArgs :: new (crate :: prisma :: star_system :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; resources) => { Into :: < crate :: prisma :: empire :: SelectParam > :: into (crate :: prisma :: empire :: resources :: Select) } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: empire :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; universe_id) => { "universeId" } ; (@ field_serde_name ; universe) => { "universe" } ; (@ field_serde_name ; name) => { "name" } ; (@ field_serde_name ; color) => { "color" } ; (@ field_serde_name ; player_id) => { "playerId" } ; (@ field_serde_name ; player) => { "player" } ; (@ field_serde_name ; star_systems) => { "starSystems" } ; (@ field_serde_name ; resources) => { "resources" } ; (@ specta_data_struct ; $ struct : item ;) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] # [specta (inline)] $ struct } ; (@ specta_data_struct ; $ struct : item ; $ name : ident) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] $ struct } ; } + pub use _select_empire as select; + pub enum SelectParam { + Id(id::Select), + UniverseId(universe_id::Select), + Universe(universe::Select), + Name(name::Select), + Color(color::Select), + PlayerId(player_id::Select), + Player(player::Select), + StarSystems(star_systems::Select), + Resources(resources::Select), + } + impl SelectParam { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + match self { + Self::Id(data) => data.to_selection(), + Self::UniverseId(data) => data.to_selection(), + Self::Universe(data) => data.to_selection(), + Self::Name(data) => data.to_selection(), + Self::Color(data) => data.to_selection(), + Self::PlayerId(data) => data.to_selection(), + Self::Player(data) => data.to_selection(), + Self::StarSystems(data) => data.to_selection(), + Self::Resources(data) => data.to_selection(), + } + } + } + #[macro_export] + macro_rules ! _include_empire { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: empire :: include ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: empire :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: empire :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: empire :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: empire :: include ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: empire :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: empire :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: empire :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { universe , player , star_systems } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } const SPECTA_TYPE_NAME : & 'static str = prisma_client_rust :: macros :: to_pascal_case ! ($ ($ module_name) ?) ; crate :: prisma :: empire :: include ! (@ specta_data_struct ; pub struct Data { # [specta (rename_from_path = crate :: prisma :: empire :: id :: NAME)] pub id : i32 , # [specta (rename_from_path = crate :: prisma :: empire :: universe_id :: NAME)] pub universe_id : i32 , # [specta (rename_from_path = crate :: prisma :: empire :: name :: NAME)] pub name : String , # [specta (rename_from_path = crate :: prisma :: empire :: color :: NAME)] pub color : String , # [specta (rename_from_path = crate :: prisma :: empire :: player_id :: NAME)] pub player_id : Option < String > , # [specta (rename_from_path = crate :: prisma :: empire :: resources :: NAME)] pub resources : :: prisma_client_rust :: serde_json :: Value , $ (# [specta (rename_from_path = crate :: prisma :: empire :: $ field :: NAME)] pub $ field : crate :: prisma :: empire :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } ; $ ($ module_name) ?) ; impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) + stringify ! (id) , stringify ! (universe_id) , stringify ! (name) , stringify ! (color) , stringify ! (player_id) , stringify ! (resources)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: empire :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: empire :: id :: NAME , & self . id) ? ; state . serialize_field (crate :: prisma :: empire :: universe_id :: NAME , & self . universe_id) ? ; state . serialize_field (crate :: prisma :: empire :: name :: NAME , & self . name) ? ; state . serialize_field (crate :: prisma :: empire :: color :: NAME , & self . color) ? ; state . serialize_field (crate :: prisma :: empire :: player_id :: NAME , & self . player_id) ? ; state . serialize_field (crate :: prisma :: empire :: resources :: NAME , & self . resources) ? ; state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , id , universe_id , name , color , player_id , resources } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: empire :: $ field :: NAME) , + , crate :: prisma :: empire :: id :: NAME , crate :: prisma :: empire :: universe_id :: NAME , crate :: prisma :: empire :: name :: NAME , crate :: prisma :: empire :: color :: NAME , crate :: prisma :: empire :: player_id :: NAME , crate :: prisma :: empire :: resources :: NAME] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: empire :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: empire :: id :: NAME => Ok (Field :: id) , crate :: prisma :: empire :: universe_id :: NAME => Ok (Field :: universe_id) , crate :: prisma :: empire :: name :: NAME => Ok (Field :: name) , crate :: prisma :: empire :: color :: NAME => Ok (Field :: color) , crate :: prisma :: empire :: player_id :: NAME => Ok (Field :: player_id) , crate :: prisma :: empire :: resources :: NAME => Ok (Field :: resources) , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * let mut id = None ; let mut universe_id = None ; let mut name = None ; let mut color = None ; let mut player_id = None ; let mut resources = None ; while let Some (key) = map . next_key () ? { match key { Field :: id => { if id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: empire :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } Field :: universe_id => { if universe_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: empire :: universe_id :: NAME)) ; } universe_id = Some (map . next_value () ?) ; } Field :: name => { if name . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: empire :: name :: NAME)) ; } name = Some (map . next_value () ?) ; } Field :: color => { if color . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: empire :: color :: NAME)) ; } color = Some (map . next_value () ?) ; } Field :: player_id => { if player_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: empire :: player_id :: NAME)) ; } player_id = Some (map . next_value () ?) ; } Field :: resources => { if resources . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: empire :: resources :: NAME)) ; } resources = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: empire :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: empire :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: empire :: id :: NAME)) ? ; let universe_id = universe_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: empire :: universe_id :: NAME)) ? ; let name = name . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: empire :: name :: NAME)) ? ; let color = color . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: empire :: color :: NAME)) ? ; let player_id = player_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: empire :: player_id :: NAME)) ? ; let resources = resources . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: empire :: resources :: NAME)) ? ; Ok (Data { id , universe_id , name , color , player_id , resources , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "universeId" , "universe" , "name" , "color" , "playerId" , "player" , "starSystems" , "resources"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: empire :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; universe : $ selection_mode : ident { $ ($ selections : tt) + }) => { universe :: Data } ; (@ field_type ; universe) => { crate :: prisma :: universe :: Data } ; (@ field_type ; player : $ selection_mode : ident { $ ($ selections : tt) + }) => { Option < player :: Data > } ; (@ field_type ; player) => { Option < crate :: prisma :: player :: Data > } ; (@ field_type ; star_systems : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < star_systems :: Data > } ; (@ field_type ; star_systems) => { Vec < crate :: prisma :: star_system :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Empire" , available relations are "universe, player, star_systems")) } ; (@ field_module ; universe : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: universe :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; player : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: player :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; star_systems : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: star_system :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; universe $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: empire :: IncludeParam > :: into (crate :: prisma :: empire :: universe :: Include :: $ selection_mode (crate :: prisma :: universe :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; universe $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: empire :: IncludeParam > :: into (crate :: prisma :: empire :: universe :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; player $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: empire :: IncludeParam > :: into (crate :: prisma :: empire :: player :: Include :: $ selection_mode (crate :: prisma :: player :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; player $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: empire :: IncludeParam > :: into (crate :: prisma :: empire :: player :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; star_systems $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: empire :: IncludeParam > :: into (crate :: prisma :: empire :: star_systems :: Include :: $ selection_mode (crate :: prisma :: star_system :: ManyArgs :: new (crate :: prisma :: star_system :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: star_system :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; star_systems $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: empire :: IncludeParam > :: into (crate :: prisma :: empire :: star_systems :: Include :: Fetch (crate :: prisma :: star_system :: ManyArgs :: new (crate :: prisma :: star_system :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: empire :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; universe_id) => { "universeId" } ; (@ field_serde_name ; universe) => { "universe" } ; (@ field_serde_name ; name) => { "name" } ; (@ field_serde_name ; color) => { "color" } ; (@ field_serde_name ; player_id) => { "playerId" } ; (@ field_serde_name ; player) => { "player" } ; (@ field_serde_name ; star_systems) => { "starSystems" } ; (@ field_serde_name ; resources) => { "resources" } ; (@ specta_data_struct ; $ struct : item ;) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] # [specta (inline)] $ struct } ; (@ specta_data_struct ; $ struct : item ; $ name : ident) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] $ struct } ; } + pub use _include_empire as include; + pub enum IncludeParam { + Id(id::Include), + UniverseId(universe_id::Include), + Universe(universe::Include), + Name(name::Include), + Color(color::Include), + PlayerId(player_id::Include), + Player(player::Include), + StarSystems(star_systems::Include), + Resources(resources::Include), + } + impl IncludeParam { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + match self { + Self::Id(data) => data.to_selection(), + Self::UniverseId(data) => data.to_selection(), + Self::Universe(data) => data.to_selection(), + Self::Name(data) => data.to_selection(), + Self::Color(data) => data.to_selection(), + Self::PlayerId(data) => data.to_selection(), + Self::Player(data) => data.to_selection(), + Self::StarSystems(data) => data.to_selection(), + Self::Resources(data) => data.to_selection(), + } + } + } + #[macro_export] + macro_rules ! _partial_unchecked_empire { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: empire struct $ struct_name { # [serde (rename = "id")] pub id : i32 , # [serde (rename = "universeId")] pub universe_id : i32 , # [serde (rename = "name")] pub name : String , # [serde (rename = "color")] pub color : String , # [serde (rename = "playerId")] # [serde (default , with = "::prisma_client_rust::serde::double_option")] pub player_id : Option < String > , # [serde (rename = "resources")] pub resources : :: prisma_client_rust :: serde_json :: Value } [$ ($ scalar_field) , +] } } ; } + pub use _partial_unchecked_empire as partial_unchecked; + #[derive( + Debug, + Clone, + :: serde :: Serialize, + :: serde :: Deserialize, + :: prisma_client_rust :: specta :: Type, + )] + #[specta(rename = "Empire", crate = "prisma_client_rust::specta")] + pub struct Data { + #[serde(rename = "id")] + pub id: i32, + #[serde(rename = "universeId")] + pub universe_id: i32, + #[serde(rename = "universe")] + #[specta(skip)] + pub universe: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "color")] + pub color: String, + #[serde(rename = "playerId")] + pub player_id: Option, + #[serde( + rename = "player", + default, + skip_serializing_if = "Option::is_none", + with = "prisma_client_rust::serde::double_option" + )] + #[specta(skip)] + pub player: Option>>, + #[serde(rename = "starSystems")] + #[specta(skip)] + pub star_systems: Option>, + #[serde(rename = "resources")] + pub resources: ::prisma_client_rust::serde_json::Value, + } + impl Data { + pub fn universe( + &self, + ) -> Result< + &super::universe::Data, + ::prisma_client_rust::RelationNotFetchedError, + > { + self + .universe + .as_ref() + .ok_or(::prisma_client_rust::RelationNotFetchedError::new( + stringify!(universe), + )) + .map(|v| v.as_ref()) + } + pub fn player( + &self, + ) -> Result< + Option<&super::player::Data>, + ::prisma_client_rust::RelationNotFetchedError, + > { + self + .player + .as_ref() + .ok_or(::prisma_client_rust::RelationNotFetchedError::new( + stringify!(player), + )) + .map(|v| v.as_ref().map(|v| v.as_ref())) + } + pub fn star_systems( + &self, + ) -> Result< + &Vec, + ::prisma_client_rust::RelationNotFetchedError, + > { + self.star_systems.as_ref().ok_or( + ::prisma_client_rust::RelationNotFetchedError::new(stringify!( + star_systems + )), + ) + } + } + #[derive(Clone)] + pub enum WithParam { + Universe(super::universe::UniqueArgs), + Player(super::player::UniqueArgs), + StarSystems(super::star_system::ManyArgs), + } + impl Into<::prisma_client_rust::Selection> for WithParam { + fn into(self) -> ::prisma_client_rust::Selection { + match self { + Self::Universe(args) => { + let mut selections = < super :: universe :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; + selections.extend( + args + .with_params + .into_iter() + .map(Into::<::prisma_client_rust::Selection>::into), + ); + ::prisma_client_rust::Selection::new( + universe::NAME, + None, + [], + selections, + ) + } + Self::Player(args) => { + let mut selections = < super :: player :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; + selections.extend( + args + .with_params + .into_iter() + .map(Into::<::prisma_client_rust::Selection>::into), + ); + ::prisma_client_rust::Selection::new( + player::NAME, + None, + [], + selections, + ) + } + Self::StarSystems(args) => { + let (arguments, mut nested_selections) = args.to_graphql(); + nested_selections . extend (< super :: star_system :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) ; + ::prisma_client_rust::Selection::new( + star_systems::NAME, + None, + arguments, + nested_selections, + ) + } + } + } + } + #[derive(Clone)] + pub enum SetParam { + SetId(i32), + IncrementId(i32), + DecrementId(i32), + MultiplyId(i32), + DivideId(i32), + SetUniverseId(i32), + IncrementUniverseId(i32), + DecrementUniverseId(i32), + MultiplyUniverseId(i32), + DivideUniverseId(i32), + ConnectUniverse(super::universe::UniqueWhereParam), + SetName(String), + SetColor(String), + SetPlayerId(Option), + ConnectPlayer(super::player::UniqueWhereParam), + DisconnectPlayer, + ConnectStarSystems(Vec), + DisconnectStarSystems(Vec), + SetStarSystems(Vec), + SetResources(::prisma_client_rust::serde_json::Value), + } + impl From for (String, ::prisma_client_rust::PrismaValue) { + fn from(param: SetParam) -> Self { + match param { + SetParam::SetId(value) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + ), + SetParam::IncrementId(value) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "increment".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::DecrementId(value) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "decrement".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::MultiplyId(value) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "multiply".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::DivideId(value) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "divide".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::SetUniverseId(value) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + ), + SetParam::IncrementUniverseId(value) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "increment".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::DecrementUniverseId(value) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "decrement".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::MultiplyUniverseId(value) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "multiply".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::DivideUniverseId(value) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "divide".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::ConnectUniverse(where_param) => ( + universe::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "connect".to_string(), + ::prisma_client_rust::PrismaValue::Object( + [where_param] + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + SetParam::SetName(value) => ( + name::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(value), + ), + SetParam::SetColor(value) => ( + color::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(value), + ), + SetParam::SetPlayerId(value) => ( + player_id::NAME.to_string(), + value + .map(|value| ::prisma_client_rust::PrismaValue::String(value)) + .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), + ), + SetParam::ConnectPlayer(where_param) => ( + player::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "connect".to_string(), + ::prisma_client_rust::PrismaValue::Object( + [where_param] + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + SetParam::DisconnectPlayer => ( + player::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "disconnect".to_string(), + ::prisma_client_rust::PrismaValue::Boolean(true), + )]), + ), + SetParam::ConnectStarSystems(where_params) => ( + star_systems::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "connect".to_string(), + ::prisma_client_rust::PrismaValue::List( + where_params + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) + .collect(), + ), + )]), + ), + SetParam::DisconnectStarSystems(where_params) => ( + star_systems::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "disconnect".to_string(), + ::prisma_client_rust::PrismaValue::List( + where_params + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) + .collect(), + ), + )]), + ), + SetParam::SetStarSystems(where_params) => ( + star_systems::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "set".to_string(), + ::prisma_client_rust::PrismaValue::List( + where_params + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) + .collect(), + ), + )]), + ), + SetParam::SetResources(value) => ( + resources::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Json( + ::prisma_client_rust::serde_json::to_string(&value).unwrap(), + ), + ), + } + } + } + #[derive(Clone)] + pub enum UncheckedSetParam { + Id(i32), + UniverseId(i32), + Name(String), + Color(String), + PlayerId(Option), + Resources(::prisma_client_rust::serde_json::Value), + } + impl From for SetParam { + fn from(param: UncheckedSetParam) -> Self { + match param { + UncheckedSetParam::Id(value) => Self::SetId(value), + UncheckedSetParam::UniverseId(value) => Self::SetUniverseId(value), + UncheckedSetParam::Name(value) => Self::SetName(value), + UncheckedSetParam::Color(value) => Self::SetColor(value), + UncheckedSetParam::PlayerId(value) => Self::SetPlayerId(value), + UncheckedSetParam::Resources(value) => Self::SetResources(value), + } + } + } + #[derive(Clone)] + pub enum OrderByParam { + Id(::prisma_client_rust::Direction), + UniverseId(::prisma_client_rust::Direction), + Name(::prisma_client_rust::Direction), + Color(::prisma_client_rust::Direction), + PlayerId(::prisma_client_rust::Direction), + Resources(::prisma_client_rust::Direction), + } + impl Into<(String, ::prisma_client_rust::PrismaValue)> for OrderByParam { + fn into(self) -> (String, ::prisma_client_rust::PrismaValue) { + match self { + Self::Id(direction) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::UniverseId(direction) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::Name(direction) => ( + name::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::Color(direction) => ( + color::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::PlayerId(direction) => ( + player_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::Resources(direction) => ( + resources::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + } + } + } + #[derive(Clone)] + pub enum WhereParam { + Not(Vec), + Or(Vec), + And(Vec), + UniverseIdIdEquals(i32, i32), + Id(_prisma::read_filters::IntFilter), + UniverseId(_prisma::read_filters::IntFilter), + UniverseIs(Vec), + UniverseIsNot(Vec), + Name(_prisma::read_filters::StringFilter), + Color(_prisma::read_filters::StringFilter), + PlayerId(_prisma::read_filters::StringNullableFilter), + PlayerIsNull, + PlayerIs(Vec), + PlayerIsNot(Vec), + StarSystemsSome(Vec), + StarSystemsEvery(Vec), + StarSystemsNone(Vec), + Resources(_prisma::read_filters::JsonFilter), + } + impl ::prisma_client_rust::WhereInput for WhereParam { + fn serialize(self) -> ::prisma_client_rust::SerializedWhereInput { + let (name, value) = match self { + Self::Not(value) => ( + "NOT", + ::prisma_client_rust::SerializedWhereValue::Object( + ::prisma_client_rust::merge_fields( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .collect(), + ), + ), + ), + Self::Or(value) => ( + "OR", + ::prisma_client_rust::SerializedWhereValue::List( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .map(|v| vec![v]) + .map(::prisma_client_rust::PrismaValue::Object) + .collect(), + ), + ), + Self::And(value) => ( + "AND", + ::prisma_client_rust::SerializedWhereValue::Object( + ::prisma_client_rust::merge_fields( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .collect(), + ), + ), + ), + Self::UniverseIdIdEquals(universe_id, id) => ( + "universeId_id", + ::prisma_client_rust::SerializedWhereValue::Object(vec![ + ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Int(universe_id as i64), + ), + ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Int(id as i64), + ), + ]), + ), + Self::Id(value) => (id::NAME, value.into()), + Self::UniverseId(value) => (universe_id::NAME, value.into()), + Self::UniverseIs(where_params) => ( + universe::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "is".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::UniverseIsNot(where_params) => ( + universe::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "isNot".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::Name(value) => (name::NAME, value.into()), + Self::Color(value) => (color::NAME, value.into()), + Self::PlayerId(value) => (player_id::NAME, value.into()), + Self::PlayerIsNull => ( + player::NAME, + ::prisma_client_rust::SerializedWhereValue::Value( + ::prisma_client_rust::PrismaValue::Null, + ), + ), + Self::PlayerIs(where_params) => ( + player::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "is".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::PlayerIsNot(where_params) => ( + player::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "isNot".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::StarSystemsSome(where_params) => ( + star_systems::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "some".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::StarSystemsEvery(where_params) => ( + star_systems::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "every".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::StarSystemsNone(where_params) => ( + star_systems::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "none".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::Resources(value) => (resources::NAME, value.into()), + }; + ::prisma_client_rust::SerializedWhereInput::new(name, value.into()) + } + } + #[derive(Clone)] + pub enum UniqueWhereParam { + PlayerIdEquals(String), + UniverseIdIdEquals(i32, i32), + } + impl From for WhereParam { + fn from(value: UniqueWhereParam) -> Self { + match value { + UniqueWhereParam::PlayerIdEquals(value) => Self::PlayerId( + _prisma::read_filters::StringNullableFilter::Equals(Some(value)), + ), + UniqueWhereParam::UniverseIdIdEquals(universe_id, id) => { + Self::UniverseIdIdEquals(universe_id, id) + } + } + } + } + impl ::prisma_client_rust::FromOptionalUniqueArg + for WhereParam + { + type Arg = Option; + fn from_arg(arg: Self::Arg) -> Self + where + Self: Sized, + { + Self::PlayerId(_prisma::read_filters::StringNullableFilter::Equals(arg)) + } + } + impl ::prisma_client_rust::FromOptionalUniqueArg + for UniqueWhereParam + { + type Arg = String; + fn from_arg(arg: Self::Arg) -> Self + where + Self: Sized, + { + Self::PlayerIdEquals(arg) + } + } + impl From<::prisma_client_rust::Operator> for WhereParam { + fn from(op: ::prisma_client_rust::Operator) -> Self { + match op { + ::prisma_client_rust::Operator::Not(value) => Self::Not(value), + ::prisma_client_rust::Operator::And(value) => Self::And(value), + ::prisma_client_rust::Operator::Or(value) => Self::Or(value), + } + } + } + #[derive(Clone)] + pub struct Types; + impl ::prisma_client_rust::ModelTypes for Types { + type Data = Data; + type Where = WhereParam; + type UncheckedSet = UncheckedSetParam; + type Set = SetParam; + type With = WithParam; + type OrderBy = OrderByParam; + type Cursor = UniqueWhereParam; + const MODEL: &'static str = NAME; + fn scalar_selections() -> Vec<::prisma_client_rust::Selection> { + vec![ + ::prisma_client_rust::sel(id::NAME), + ::prisma_client_rust::sel(universe_id::NAME), + ::prisma_client_rust::sel(name::NAME), + ::prisma_client_rust::sel(color::NAME), + ::prisma_client_rust::sel(player_id::NAME), + ::prisma_client_rust::sel(resources::NAME), + ] + } + } + pub type UniqueArgs = ::prisma_client_rust::UniqueArgs; + pub type ManyArgs = ::prisma_client_rust::ManyArgs; + pub type Count<'a> = ::prisma_client_rust::Count<'a, Types>; + pub type Create<'a> = ::prisma_client_rust::Create<'a, Types>; + pub type CreateMany<'a> = ::prisma_client_rust::CreateMany<'a, Types>; + pub type FindUnique<'a> = ::prisma_client_rust::FindUnique<'a, Types>; + pub type FindMany<'a> = ::prisma_client_rust::FindMany<'a, Types>; + pub type FindFirst<'a> = ::prisma_client_rust::FindFirst<'a, Types>; + pub type Update<'a> = ::prisma_client_rust::Update<'a, Types>; + pub type UpdateMany<'a> = ::prisma_client_rust::UpdateMany<'a, Types>; + pub type Upsert<'a> = ::prisma_client_rust::Upsert<'a, Types>; + pub type Delete<'a> = ::prisma_client_rust::Delete<'a, Types>; + pub type DeleteMany<'a> = ::prisma_client_rust::DeleteMany<'a, Types>; + #[derive(Clone)] + pub struct Actions<'a> { + pub client: &'a ::prisma_client_rust::PrismaClientInternals, + } + impl<'a> Actions<'a> { + pub fn find_unique(self, _where: UniqueWhereParam) -> FindUnique<'a> { + FindUnique::new(self.client, _where.into()) + } + pub fn find_first(self, _where: Vec) -> FindFirst<'a> { + FindFirst::new(self.client, _where) + } + pub fn find_many(self, _where: Vec) -> FindMany<'a> { + FindMany::new(self.client, _where) + } + pub fn create( + self, + universe: super::universe::UniqueWhereParam, + name: String, + color: String, + resources: ::prisma_client_rust::serde_json::Value, + mut _params: Vec, + ) -> Create<'a> { + _params.extend([ + universe::connect(universe), + name::set(name), + color::set(color), + resources::set(resources), + ]); + Create::new(self.client, _params) + } + pub fn create_unchecked( + self, + universe_id: i32, + name: String, + color: String, + resources: ::prisma_client_rust::serde_json::Value, + mut _params: Vec, + ) -> Create<'a> { + _params.extend([ + universe_id::set(universe_id), + name::set(name), + color::set(color), + resources::set(resources), + ]); + Create::new(self.client, _params.into_iter().map(Into::into).collect()) + } + pub fn create_many( + self, + data: Vec<( + i32, + String, + String, + ::prisma_client_rust::serde_json::Value, + Vec, + )>, + ) -> CreateMany<'a> { + let data = data + .into_iter() + .map(|(universe_id, name, color, resources, mut _params)| { + _params.extend([ + universe_id::set(universe_id), + name::set(name), + color::set(color), + resources::set(resources), + ]); + _params + }) + .collect(); + CreateMany::new(self.client, data) + } + pub fn update( + self, + _where: UniqueWhereParam, + _params: Vec, + ) -> Update<'a> { + Update::new(self.client, _where.into(), _params, vec![]) + } + pub fn update_unchecked( + self, + _where: UniqueWhereParam, + _params: Vec, + ) -> Update<'a> { + Update::new( + self.client, + _where.into(), + _params.into_iter().map(Into::into).collect(), + vec![], + ) + } + pub fn update_many( + self, + _where: Vec, + _params: Vec, + ) -> UpdateMany<'a> { + UpdateMany::new(self.client, _where, _params) + } + pub fn upsert( + self, + _where: UniqueWhereParam, + (universe, name, color, resources, mut _params): ( + super::universe::UniqueWhereParam, + String, + String, + ::prisma_client_rust::serde_json::Value, + Vec, + ), + _update: Vec, + ) -> Upsert<'a> { + _params.extend([ + universe::connect(universe), + name::set(name), + color::set(color), + resources::set(resources), + ]); + Upsert::new(self.client, _where.into(), _params, _update) + } + pub fn delete(self, _where: UniqueWhereParam) -> Delete<'a> { + Delete::new(self.client, _where.into(), vec![]) + } + pub fn delete_many(self, _where: Vec) -> DeleteMany<'a> { + DeleteMany::new(self.client, _where) + } + pub fn count(self, _where: Vec) -> Count<'a> { + Count::new(self.client, _where) + } + pub fn find_raw( + self, + ) -> ::prisma_client_rust::FindRaw<'a, Types, T> { + ::prisma_client_rust::FindRaw::new(self.client) + } + pub fn aggregate_raw( + self, + ) -> ::prisma_client_rust::AggregateRaw<'a, Types, T> { + ::prisma_client_rust::AggregateRaw::new(self.client) + } + } +} +pub mod star_system { + use super::_prisma::*; + use super::*; + pub const NAME: &str = "StarSystem"; + pub mod index { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "index"; + pub struct Set(pub i32); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetIndex(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::Index(v) + } + } + pub fn set>(value: i32) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::Index(direction) + } + pub fn equals(value: i32) -> WhereParam { + WhereParam::Index(_prisma::read_filters::IntFilter::Equals(value)) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::IntFilter, + Index, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: i32) -> Lt; + fn lte(_: i32) -> Lte; + fn gt(_: i32) -> Gt; + fn gte(_: i32) -> Gte; + fn not(_: i32) -> Not; + } + ); + pub fn increment(value: i32) -> SetParam { + SetParam::IncrementIndex(value) + } + pub fn decrement(value: i32) -> SetParam { + SetParam::DecrementIndex(value) + } + pub fn multiply(value: i32) -> SetParam { + SetParam::MultiplyIndex(value) + } + pub fn divide(value: i32) -> SetParam { + SetParam::DivideIndex(value) + } + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Index(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Index(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod universe_id { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "universeId"; + pub struct Set(pub i32); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetUniverseId(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::UniverseId(v) + } + } + pub fn set>(value: i32) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::UniverseId(direction) + } + pub fn equals(value: i32) -> WhereParam { + WhereParam::UniverseId(_prisma::read_filters::IntFilter::Equals(value)) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::IntFilter, + UniverseId, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: i32) -> Lt; + fn lte(_: i32) -> Lte; + fn gt(_: i32) -> Gt; + fn gte(_: i32) -> Gte; + fn not(_: i32) -> Not; + } + ); + pub fn increment(value: i32) -> SetParam { + SetParam::IncrementUniverseId(value) + } + pub fn decrement(value: i32) -> SetParam { + SetParam::DecrementUniverseId(value) + } + pub fn multiply(value: i32) -> SetParam { + SetParam::MultiplyUniverseId(value) + } + pub fn divide(value: i32) -> SetParam { + SetParam::DivideUniverseId(value) + } + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::UniverseId(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::UniverseId(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod universe { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "universe"; + pub struct Fetch(pub universe::UniqueArgs); + impl Fetch { + pub fn with(mut self, params: impl Into) -> Self { + self.0 = self.0.with(params.into()); + self + } + } + impl From for WithParam { + fn from(Fetch(v): Fetch) -> Self { + WithParam::Universe(v) + } + } + pub fn fetch() -> Fetch { + Fetch(universe::UniqueArgs::new()) + } + pub struct Connect(universe::UniqueWhereParam); + impl From for SetParam { + fn from(Connect(v): Connect) -> Self { + Self::ConnectUniverse(v) + } + } + pub fn connect>(value: universe::UniqueWhereParam) -> T { + Connect(value).into() + } + pub fn is(value: Vec) -> WhereParam { + WhereParam::UniverseIs(value) + } + pub fn is_not(value: Vec) -> WhereParam { + WhereParam::UniverseIsNot(value) + } + pub enum Include { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Universe(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = < universe :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < universe :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; + ::prisma_client_rust::Selection::new("universe", None, [], selections) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include(nested_selections: Vec) -> Self { + Self::Include(nested_selections) + } + } + pub enum Select { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Universe(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < universe :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; + ::prisma_client_rust::Selection::new("universe", None, [], selections) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include(nested_selections: Vec) -> Self { + Self::Include(nested_selections) + } + } + } + pub mod coord_x { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "coordX"; + pub struct Set(pub f64); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetCoordX(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::CoordX(v) + } + } + pub fn set>(value: f64) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::CoordX(direction) + } + pub fn equals(value: f64) -> WhereParam { + WhereParam::CoordX(_prisma::read_filters::FloatFilter::Equals(value)) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::FloatFilter, + CoordX, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: f64) -> Lt; + fn lte(_: f64) -> Lte; + fn gt(_: f64) -> Gt; + fn gte(_: f64) -> Gte; + fn not(_: f64) -> Not; + } + ); + pub fn increment(value: f64) -> SetParam { + SetParam::IncrementCoordX(value) + } + pub fn decrement(value: f64) -> SetParam { + SetParam::DecrementCoordX(value) + } + pub fn multiply(value: f64) -> SetParam { + SetParam::MultiplyCoordX(value) + } + pub fn divide(value: f64) -> SetParam { + SetParam::DivideCoordX(value) + } + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::CoordX(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::CoordX(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod coord_y { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "coordY"; + pub struct Set(pub f64); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetCoordY(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::CoordY(v) + } + } + pub fn set>(value: f64) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::CoordY(direction) + } + pub fn equals(value: f64) -> WhereParam { + WhereParam::CoordY(_prisma::read_filters::FloatFilter::Equals(value)) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::FloatFilter, + CoordY, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: f64) -> Lt; + fn lte(_: f64) -> Lte; + fn gt(_: f64) -> Gt; + fn gte(_: f64) -> Gte; + fn not(_: f64) -> Not; + } + ); + pub fn increment(value: f64) -> SetParam { + SetParam::IncrementCoordY(value) + } + pub fn decrement(value: f64) -> SetParam { + SetParam::DecrementCoordY(value) + } + pub fn multiply(value: f64) -> SetParam { + SetParam::MultiplyCoordY(value) + } + pub fn divide(value: f64) -> SetParam { + SetParam::DivideCoordY(value) + } + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::CoordY(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::CoordY(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod inbound { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "inbound"; + pub struct Fetch(pub star_system_edges::ManyArgs); + impl Fetch { + pub fn with( + mut self, + params: impl Into, + ) -> Self { + self.0 = self.0.with(params.into()); + self + } + pub fn order_by( + mut self, + param: star_system_edges::OrderByParam, + ) -> Self { + self.0 = self.0.order_by(param); + self + } + pub fn skip(mut self, value: i64) -> Self { + self.0 = self.0.skip(value); + self + } + pub fn take(mut self, value: i64) -> Self { + self.0 = self.0.take(value); + self + } + pub fn cursor( + mut self, + value: star_system_edges::UniqueWhereParam, + ) -> Self { + self.0 = self.0.cursor(value.into()); + self + } + } + impl From for WithParam { + fn from(Fetch(v): Fetch) -> Self { + WithParam::Inbound(v) + } + } + pub fn fetch(params: Vec) -> Fetch { + Fetch(star_system_edges::ManyArgs::new(params)) + } + pub struct Connect(pub Vec); + impl From for SetParam { + fn from(Connect(v): Connect) -> Self { + Self::ConnectInbound(v) + } + } + pub fn connect>( + params: Vec, + ) -> T { + Connect(params).into() + } + pub fn disconnect( + params: Vec, + ) -> SetParam { + SetParam::DisconnectInbound(params) + } + pub fn set(params: Vec) -> SetParam { + SetParam::SetInbound(params) + } + pub fn some(value: Vec) -> WhereParam { + WhereParam::InboundSome(value) + } + pub fn every(value: Vec) -> WhereParam { + WhereParam::InboundEvery(value) + } + pub fn none(value: Vec) -> WhereParam { + WhereParam::InboundNone(value) + } + pub enum Include { + Select( + star_system_edges::ManyArgs, + Vec, + ), + Include( + star_system_edges::ManyArgs, + Vec, + ), + Fetch(star_system_edges::ManyArgs), + } + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Inbound(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let (args , selections) = match self { Self :: Select (args , selections) => (args . to_graphql () . 0 , selections . into_iter () . map (| s | s . to_selection ()) . collect ()) , Self :: Include (args , selections) => (args . to_graphql () . 0 , { let mut nested_selections = < star_system_edges :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections }) , Self :: Fetch (args) => (args . to_graphql () . 0 , < star_system_edges :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; + ::prisma_client_rust::Selection::new(NAME, None, args, selections) + } + pub fn select( + args: star_system_edges::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Select(args, nested_selections) + } + pub fn include( + args: star_system_edges::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Include(args, nested_selections) + } + } + pub enum Select { + Select( + star_system_edges::ManyArgs, + Vec, + ), + Include( + star_system_edges::ManyArgs, + Vec, + ), + Fetch(star_system_edges::ManyArgs), + } + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Inbound(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let (args , selections) = match self { Self :: Select (args , selections) => (args . to_graphql () . 0 , selections . into_iter () . map (| s | s . to_selection ()) . collect ()) , Self :: Include (args , selections) => (args . to_graphql () . 0 , { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections }) , Self :: Fetch (args) => (args . to_graphql () . 0 , < star_system_edges :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; + ::prisma_client_rust::Selection::new(NAME, None, args, selections) + } + pub fn select( + args: star_system_edges::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Select(args, nested_selections) + } + pub fn include( + args: star_system_edges::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Include(args, nested_selections) + } + } + } + pub mod outbound { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "outbound"; + pub struct Fetch(pub star_system_edges::ManyArgs); + impl Fetch { + pub fn with( + mut self, + params: impl Into, + ) -> Self { + self.0 = self.0.with(params.into()); + self + } + pub fn order_by( + mut self, + param: star_system_edges::OrderByParam, + ) -> Self { + self.0 = self.0.order_by(param); + self + } + pub fn skip(mut self, value: i64) -> Self { + self.0 = self.0.skip(value); + self + } + pub fn take(mut self, value: i64) -> Self { + self.0 = self.0.take(value); + self + } + pub fn cursor( + mut self, + value: star_system_edges::UniqueWhereParam, + ) -> Self { + self.0 = self.0.cursor(value.into()); + self + } + } + impl From for WithParam { + fn from(Fetch(v): Fetch) -> Self { + WithParam::Outbound(v) + } + } + pub fn fetch(params: Vec) -> Fetch { + Fetch(star_system_edges::ManyArgs::new(params)) + } + pub struct Connect(pub Vec); + impl From for SetParam { + fn from(Connect(v): Connect) -> Self { + Self::ConnectOutbound(v) + } + } + pub fn connect>( + params: Vec, + ) -> T { + Connect(params).into() + } + pub fn disconnect( + params: Vec, + ) -> SetParam { + SetParam::DisconnectOutbound(params) + } + pub fn set(params: Vec) -> SetParam { + SetParam::SetOutbound(params) + } + pub fn some(value: Vec) -> WhereParam { + WhereParam::OutboundSome(value) + } + pub fn every(value: Vec) -> WhereParam { + WhereParam::OutboundEvery(value) + } + pub fn none(value: Vec) -> WhereParam { + WhereParam::OutboundNone(value) + } + pub enum Include { + Select( + star_system_edges::ManyArgs, + Vec, + ), + Include( + star_system_edges::ManyArgs, + Vec, + ), + Fetch(star_system_edges::ManyArgs), + } + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Outbound(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let (args , selections) = match self { Self :: Select (args , selections) => (args . to_graphql () . 0 , selections . into_iter () . map (| s | s . to_selection ()) . collect ()) , Self :: Include (args , selections) => (args . to_graphql () . 0 , { let mut nested_selections = < star_system_edges :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections }) , Self :: Fetch (args) => (args . to_graphql () . 0 , < star_system_edges :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; + ::prisma_client_rust::Selection::new(NAME, None, args, selections) + } + pub fn select( + args: star_system_edges::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Select(args, nested_selections) + } + pub fn include( + args: star_system_edges::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Include(args, nested_selections) + } + } + pub enum Select { + Select( + star_system_edges::ManyArgs, + Vec, + ), + Include( + star_system_edges::ManyArgs, + Vec, + ), + Fetch(star_system_edges::ManyArgs), + } + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Outbound(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let (args , selections) = match self { Self :: Select (args , selections) => (args . to_graphql () . 0 , selections . into_iter () . map (| s | s . to_selection ()) . collect ()) , Self :: Include (args , selections) => (args . to_graphql () . 0 , { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections }) , Self :: Fetch (args) => (args . to_graphql () . 0 , < star_system_edges :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; + ::prisma_client_rust::Selection::new(NAME, None, args, selections) + } + pub fn select( + args: star_system_edges::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Select(args, nested_selections) + } + pub fn include( + args: star_system_edges::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Include(args, nested_selections) + } + } + } + pub mod owned_by_empire_id { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "ownedByEmpireId"; + pub struct Set(pub Option); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetOwnedByEmpireId(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::OwnedByEmpireId(v) + } + } + pub fn set>(value: Option) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::OwnedByEmpireId(direction) + } + pub fn equals(value: Option) -> WhereParam { + WhereParam::OwnedByEmpireId( + _prisma::read_filters::IntNullableFilter::Equals(value), + ) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::IntNullableFilter, + OwnedByEmpireId, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: i32) -> Lt; + fn lte(_: i32) -> Lte; + fn gt(_: i32) -> Gt; + fn gte(_: i32) -> Gte; + fn not(_: Option) -> Not; + } + ); + pub fn increment(value: i32) -> SetParam { + SetParam::IncrementOwnedByEmpireId(value) + } + pub fn decrement(value: i32) -> SetParam { + SetParam::DecrementOwnedByEmpireId(value) + } + pub fn multiply(value: i32) -> SetParam { + SetParam::MultiplyOwnedByEmpireId(value) + } + pub fn divide(value: i32) -> SetParam { + SetParam::DivideOwnedByEmpireId(value) + } + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::OwnedByEmpireId(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::OwnedByEmpireId(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod owned_by_empire { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "ownedByEmpire"; + pub struct Fetch(pub empire::UniqueArgs); + impl Fetch { + pub fn with(mut self, params: impl Into) -> Self { + self.0 = self.0.with(params.into()); + self + } + } + impl From for WithParam { + fn from(Fetch(v): Fetch) -> Self { + WithParam::OwnedByEmpire(v) + } + } + pub fn fetch() -> Fetch { + Fetch(empire::UniqueArgs::new()) + } + pub struct Connect(empire::UniqueWhereParam); + impl From for SetParam { + fn from(Connect(v): Connect) -> Self { + Self::ConnectOwnedByEmpire(v) + } + } + pub fn connect>(value: empire::UniqueWhereParam) -> T { + Connect(value).into() + } + pub fn disconnect() -> SetParam { + SetParam::DisconnectOwnedByEmpire + } + pub fn is_null() -> WhereParam { + WhereParam::OwnedByEmpireIsNull + } + pub fn is(value: Vec) -> WhereParam { + WhereParam::OwnedByEmpireIs(value) + } + pub fn is_not(value: Vec) -> WhereParam { + WhereParam::OwnedByEmpireIsNot(value) + } + pub enum Include { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::OwnedByEmpire(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = < empire :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < empire :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; + ::prisma_client_rust::Selection::new( + "ownedByEmpire", + None, + [], + selections, + ) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include(nested_selections: Vec) -> Self { + Self::Include(nested_selections) + } + } + pub enum Select { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::OwnedByEmpire(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < empire :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; + ::prisma_client_rust::Selection::new( + "ownedByEmpire", + None, + [], + selections, + ) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include(nested_selections: Vec) -> Self { + Self::Include(nested_selections) + } + } + } + pub mod planets { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "planets"; + pub struct Fetch(pub planet::ManyArgs); + impl Fetch { + pub fn with(mut self, params: impl Into) -> Self { + self.0 = self.0.with(params.into()); + self + } + pub fn order_by(mut self, param: planet::OrderByParam) -> Self { + self.0 = self.0.order_by(param); + self + } + pub fn skip(mut self, value: i64) -> Self { + self.0 = self.0.skip(value); + self + } + pub fn take(mut self, value: i64) -> Self { + self.0 = self.0.take(value); + self + } + pub fn cursor(mut self, value: planet::UniqueWhereParam) -> Self { + self.0 = self.0.cursor(value.into()); + self + } + } + impl From for WithParam { + fn from(Fetch(v): Fetch) -> Self { + WithParam::Planets(v) + } + } + pub fn fetch(params: Vec) -> Fetch { + Fetch(planet::ManyArgs::new(params)) + } + pub struct Connect(pub Vec); + impl From for SetParam { + fn from(Connect(v): Connect) -> Self { + Self::ConnectPlanets(v) + } + } + pub fn connect>( + params: Vec, + ) -> T { + Connect(params).into() + } + pub fn disconnect(params: Vec) -> SetParam { + SetParam::DisconnectPlanets(params) + } + pub fn set(params: Vec) -> SetParam { + SetParam::SetPlanets(params) + } + pub fn some(value: Vec) -> WhereParam { + WhereParam::PlanetsSome(value) + } + pub fn every(value: Vec) -> WhereParam { + WhereParam::PlanetsEvery(value) + } + pub fn none(value: Vec) -> WhereParam { + WhereParam::PlanetsNone(value) + } + pub enum Include { + Select(planet::ManyArgs, Vec), + Include(planet::ManyArgs, Vec), + Fetch(planet::ManyArgs), + } + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Planets(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let (args , selections) = match self { Self :: Select (args , selections) => (args . to_graphql () . 0 , selections . into_iter () . map (| s | s . to_selection ()) . collect ()) , Self :: Include (args , selections) => (args . to_graphql () . 0 , { let mut nested_selections = < planet :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections }) , Self :: Fetch (args) => (args . to_graphql () . 0 , < planet :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; + ::prisma_client_rust::Selection::new(NAME, None, args, selections) + } + pub fn select( + args: planet::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Select(args, nested_selections) + } + pub fn include( + args: planet::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Include(args, nested_selections) + } + } + pub enum Select { + Select(planet::ManyArgs, Vec), + Include(planet::ManyArgs, Vec), + Fetch(planet::ManyArgs), + } + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Planets(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let (args , selections) = match self { Self :: Select (args , selections) => (args . to_graphql () . 0 , selections . into_iter () . map (| s | s . to_selection ()) . collect ()) , Self :: Include (args , selections) => (args . to_graphql () . 0 , { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections }) , Self :: Fetch (args) => (args . to_graphql () . 0 , < planet :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; + ::prisma_client_rust::Selection::new(NAME, None, args, selections) + } + pub fn select( + args: planet::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Select(args, nested_selections) + } + pub fn include( + args: planet::ManyArgs, + nested_selections: Vec, + ) -> Self { + Self::Include(args, nested_selections) + } + } + } + pub mod starbase { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "starbase"; + pub struct Fetch(pub starbase::UniqueArgs); + impl Fetch { + pub fn with(mut self, params: impl Into) -> Self { + self.0 = self.0.with(params.into()); + self + } + } + impl From for WithParam { + fn from(Fetch(v): Fetch) -> Self { + WithParam::Starbase(v) + } + } + pub fn fetch() -> Fetch { + Fetch(starbase::UniqueArgs::new()) + } + pub struct Connect(starbase::UniqueWhereParam); + impl From for SetParam { + fn from(Connect(v): Connect) -> Self { + Self::ConnectStarbase(v) + } + } + pub fn connect>(value: starbase::UniqueWhereParam) -> T { + Connect(value).into() + } + pub fn disconnect() -> SetParam { + SetParam::DisconnectStarbase + } + pub fn is_null() -> WhereParam { + WhereParam::StarbaseIsNull + } + pub fn is(value: Vec) -> WhereParam { + WhereParam::StarbaseIs(value) + } + pub fn is_not(value: Vec) -> WhereParam { + WhereParam::StarbaseIsNot(value) + } + pub enum Include { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Starbase(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = < starbase :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < starbase :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; + ::prisma_client_rust::Selection::new("starbase", None, [], selections) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include(nested_selections: Vec) -> Self { + Self::Include(nested_selections) + } + } + pub enum Select { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Starbase(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < starbase :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; + ::prisma_client_rust::Selection::new("starbase", None, [], selections) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include(nested_selections: Vec) -> Self { + Self::Include(nested_selections) + } + } + } + pub fn universe_id_index>( + universe_id: i32, + index: i32, + ) -> T { + UniqueWhereParam::UniverseIdIndexEquals(universe_id, index).into() + } + pub fn create( + index: i32, + universe: super::universe::UniqueWhereParam, + coord_x: f64, + coord_y: f64, + _params: Vec, + ) -> ( + i32, + super::universe::UniqueWhereParam, + f64, + f64, + Vec, + ) { + (index, universe, coord_x, coord_y, _params) + } + pub fn create_unchecked( + index: i32, + universe_id: i32, + coord_x: f64, + coord_y: f64, + _params: Vec, + ) -> (i32, i32, f64, f64, Vec) { + (index, universe_id, coord_x, coord_y, _params) + } + #[macro_export] + macro_rules ! _select_star_system { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: star_system :: select ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: star_system :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: star_system :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: star_system :: select ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: star_system :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: star_system :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { index , universe_id , universe , coord_x , coord_y , inbound , outbound , owned_by_empire_id , owned_by_empire , planets , starbase } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } const SPECTA_TYPE_NAME : & 'static str = prisma_client_rust :: macros :: to_pascal_case ! ($ ($ module_name) ?) ; crate :: prisma :: star_system :: select ! (@ specta_data_struct ; pub struct Data { $ (# [specta (rename_from_path = crate :: prisma :: star_system :: $ field :: NAME)] pub $ field : crate :: prisma :: star_system :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } ; $ ($ module_name) ?) ; impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) +] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: star_system :: $ field :: NAME , & self . $ field) ? ;) * state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: star_system :: $ field :: NAME) , + ,] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: star_system :: $ field :: NAME => Ok (Field :: $ field)) , * , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * while let Some (key) = map . next_key () ? { match key { $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: star_system :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: star_system :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["index" , "universeId" , "universe" , "coordX" , "coordY" , "inbound" , "outbound" , "ownedByEmpireId" , "ownedByEmpire" , "planets" , "starbase"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: star_system :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; index) => { i32 } ; (@ field_type ; universe_id) => { i32 } ; (@ field_type ; universe : $ selection_mode : ident { $ ($ selections : tt) + }) => { universe :: Data } ; (@ field_type ; universe) => { crate :: prisma :: universe :: Data } ; (@ field_type ; coord_x) => { f64 } ; (@ field_type ; coord_y) => { f64 } ; (@ field_type ; inbound : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < inbound :: Data > } ; (@ field_type ; inbound) => { Vec < crate :: prisma :: star_system_edges :: Data > } ; (@ field_type ; outbound : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < outbound :: Data > } ; (@ field_type ; outbound) => { Vec < crate :: prisma :: star_system_edges :: Data > } ; (@ field_type ; owned_by_empire_id) => { Option < i32 > } ; (@ field_type ; owned_by_empire : $ selection_mode : ident { $ ($ selections : tt) + }) => { Option < owned_by_empire :: Data > } ; (@ field_type ; owned_by_empire) => { Option < crate :: prisma :: empire :: Data > } ; (@ field_type ; planets : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < planets :: Data > } ; (@ field_type ; planets) => { Vec < crate :: prisma :: planet :: Data > } ; (@ field_type ; starbase : $ selection_mode : ident { $ ($ selections : tt) + }) => { Option < starbase :: Data > } ; (@ field_type ; starbase) => { Option < crate :: prisma :: starbase :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "StarSystem" , available relations are "index, universe_id, universe, coord_x, coord_y, inbound, outbound, owned_by_empire_id, owned_by_empire, planets, starbase")) } ; (@ field_module ; universe : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: universe :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; inbound : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: star_system_edges :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; outbound : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: star_system_edges :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; owned_by_empire : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: empire :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; planets : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: planet :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; starbase : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: starbase :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; index) => { Into :: < crate :: prisma :: star_system :: SelectParam > :: into (crate :: prisma :: star_system :: index :: Select) } ; (@ selection_field_to_selection_param ; universe_id) => { Into :: < crate :: prisma :: star_system :: SelectParam > :: into (crate :: prisma :: star_system :: universe_id :: Select) } ; (@ selection_field_to_selection_param ; universe $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: star_system :: SelectParam > :: into (crate :: prisma :: star_system :: universe :: Select :: $ selection_mode (crate :: prisma :: universe :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; universe $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: star_system :: SelectParam > :: into (crate :: prisma :: star_system :: universe :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; coord_x) => { Into :: < crate :: prisma :: star_system :: SelectParam > :: into (crate :: prisma :: star_system :: coord_x :: Select) } ; (@ selection_field_to_selection_param ; coord_y) => { Into :: < crate :: prisma :: star_system :: SelectParam > :: into (crate :: prisma :: star_system :: coord_y :: Select) } ; (@ selection_field_to_selection_param ; inbound $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: star_system :: SelectParam > :: into (crate :: prisma :: star_system :: inbound :: Select :: $ selection_mode (crate :: prisma :: star_system_edges :: ManyArgs :: new (crate :: prisma :: star_system_edges :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: star_system_edges :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; inbound $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: star_system :: SelectParam > :: into (crate :: prisma :: star_system :: inbound :: Select :: Fetch (crate :: prisma :: star_system_edges :: ManyArgs :: new (crate :: prisma :: star_system_edges :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; outbound $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: star_system :: SelectParam > :: into (crate :: prisma :: star_system :: outbound :: Select :: $ selection_mode (crate :: prisma :: star_system_edges :: ManyArgs :: new (crate :: prisma :: star_system_edges :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: star_system_edges :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; outbound $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: star_system :: SelectParam > :: into (crate :: prisma :: star_system :: outbound :: Select :: Fetch (crate :: prisma :: star_system_edges :: ManyArgs :: new (crate :: prisma :: star_system_edges :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; owned_by_empire_id) => { Into :: < crate :: prisma :: star_system :: SelectParam > :: into (crate :: prisma :: star_system :: owned_by_empire_id :: Select) } ; (@ selection_field_to_selection_param ; owned_by_empire $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: star_system :: SelectParam > :: into (crate :: prisma :: star_system :: owned_by_empire :: Select :: $ selection_mode (crate :: prisma :: empire :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; owned_by_empire $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: star_system :: SelectParam > :: into (crate :: prisma :: star_system :: owned_by_empire :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; planets $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: star_system :: SelectParam > :: into (crate :: prisma :: star_system :: planets :: Select :: $ selection_mode (crate :: prisma :: planet :: ManyArgs :: new (crate :: prisma :: planet :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: planet :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; planets $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: star_system :: SelectParam > :: into (crate :: prisma :: star_system :: planets :: Select :: Fetch (crate :: prisma :: planet :: ManyArgs :: new (crate :: prisma :: planet :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; starbase $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: star_system :: SelectParam > :: into (crate :: prisma :: star_system :: starbase :: Select :: $ selection_mode (crate :: prisma :: starbase :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; starbase $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: star_system :: SelectParam > :: into (crate :: prisma :: star_system :: starbase :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: star_system :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; index) => { "index" } ; (@ field_serde_name ; universe_id) => { "universeId" } ; (@ field_serde_name ; universe) => { "universe" } ; (@ field_serde_name ; coord_x) => { "coordX" } ; (@ field_serde_name ; coord_y) => { "coordY" } ; (@ field_serde_name ; inbound) => { "inbound" } ; (@ field_serde_name ; outbound) => { "outbound" } ; (@ field_serde_name ; owned_by_empire_id) => { "ownedByEmpireId" } ; (@ field_serde_name ; owned_by_empire) => { "ownedByEmpire" } ; (@ field_serde_name ; planets) => { "planets" } ; (@ field_serde_name ; starbase) => { "starbase" } ; (@ specta_data_struct ; $ struct : item ;) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] # [specta (inline)] $ struct } ; (@ specta_data_struct ; $ struct : item ; $ name : ident) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] $ struct } ; } + pub use _select_star_system as select; + pub enum SelectParam { + Index(index::Select), + UniverseId(universe_id::Select), + Universe(universe::Select), + CoordX(coord_x::Select), + CoordY(coord_y::Select), + Inbound(inbound::Select), + Outbound(outbound::Select), + OwnedByEmpireId(owned_by_empire_id::Select), + OwnedByEmpire(owned_by_empire::Select), + Planets(planets::Select), + Starbase(starbase::Select), + } + impl SelectParam { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + match self { + Self::Index(data) => data.to_selection(), + Self::UniverseId(data) => data.to_selection(), + Self::Universe(data) => data.to_selection(), + Self::CoordX(data) => data.to_selection(), + Self::CoordY(data) => data.to_selection(), + Self::Inbound(data) => data.to_selection(), + Self::Outbound(data) => data.to_selection(), + Self::OwnedByEmpireId(data) => data.to_selection(), + Self::OwnedByEmpire(data) => data.to_selection(), + Self::Planets(data) => data.to_selection(), + Self::Starbase(data) => data.to_selection(), + } + } + } + #[macro_export] + macro_rules ! _include_star_system { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: star_system :: include ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: star_system :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: star_system :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: star_system :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: star_system :: include ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: star_system :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: star_system :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: star_system :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { universe , inbound , outbound , owned_by_empire , planets , starbase } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } const SPECTA_TYPE_NAME : & 'static str = prisma_client_rust :: macros :: to_pascal_case ! ($ ($ module_name) ?) ; crate :: prisma :: star_system :: include ! (@ specta_data_struct ; pub struct Data { # [specta (rename_from_path = crate :: prisma :: star_system :: index :: NAME)] pub index : i32 , # [specta (rename_from_path = crate :: prisma :: star_system :: universe_id :: NAME)] pub universe_id : i32 , # [specta (rename_from_path = crate :: prisma :: star_system :: coord_x :: NAME)] pub coord_x : f64 , # [specta (rename_from_path = crate :: prisma :: star_system :: coord_y :: NAME)] pub coord_y : f64 , # [specta (rename_from_path = crate :: prisma :: star_system :: owned_by_empire_id :: NAME)] pub owned_by_empire_id : Option < i32 > , $ (# [specta (rename_from_path = crate :: prisma :: star_system :: $ field :: NAME)] pub $ field : crate :: prisma :: star_system :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } ; $ ($ module_name) ?) ; impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) + stringify ! (index) , stringify ! (universe_id) , stringify ! (coord_x) , stringify ! (coord_y) , stringify ! (owned_by_empire_id)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: star_system :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: star_system :: index :: NAME , & self . index) ? ; state . serialize_field (crate :: prisma :: star_system :: universe_id :: NAME , & self . universe_id) ? ; state . serialize_field (crate :: prisma :: star_system :: coord_x :: NAME , & self . coord_x) ? ; state . serialize_field (crate :: prisma :: star_system :: coord_y :: NAME , & self . coord_y) ? ; state . serialize_field (crate :: prisma :: star_system :: owned_by_empire_id :: NAME , & self . owned_by_empire_id) ? ; state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , index , universe_id , coord_x , coord_y , owned_by_empire_id } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: star_system :: $ field :: NAME) , + , crate :: prisma :: star_system :: index :: NAME , crate :: prisma :: star_system :: universe_id :: NAME , crate :: prisma :: star_system :: coord_x :: NAME , crate :: prisma :: star_system :: coord_y :: NAME , crate :: prisma :: star_system :: owned_by_empire_id :: NAME] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: star_system :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: star_system :: index :: NAME => Ok (Field :: index) , crate :: prisma :: star_system :: universe_id :: NAME => Ok (Field :: universe_id) , crate :: prisma :: star_system :: coord_x :: NAME => Ok (Field :: coord_x) , crate :: prisma :: star_system :: coord_y :: NAME => Ok (Field :: coord_y) , crate :: prisma :: star_system :: owned_by_empire_id :: NAME => Ok (Field :: owned_by_empire_id) , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * let mut index = None ; let mut universe_id = None ; let mut coord_x = None ; let mut coord_y = None ; let mut owned_by_empire_id = None ; while let Some (key) = map . next_key () ? { match key { Field :: index => { if index . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: star_system :: index :: NAME)) ; } index = Some (map . next_value () ?) ; } Field :: universe_id => { if universe_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: star_system :: universe_id :: NAME)) ; } universe_id = Some (map . next_value () ?) ; } Field :: coord_x => { if coord_x . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: star_system :: coord_x :: NAME)) ; } coord_x = Some (map . next_value () ?) ; } Field :: coord_y => { if coord_y . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: star_system :: coord_y :: NAME)) ; } coord_y = Some (map . next_value () ?) ; } Field :: owned_by_empire_id => { if owned_by_empire_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: star_system :: owned_by_empire_id :: NAME)) ; } owned_by_empire_id = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: star_system :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: star_system :: $ field :: NAME)) ? ;) * let index = index . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: star_system :: index :: NAME)) ? ; let universe_id = universe_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: star_system :: universe_id :: NAME)) ? ; let coord_x = coord_x . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: star_system :: coord_x :: NAME)) ? ; let coord_y = coord_y . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: star_system :: coord_y :: NAME)) ? ; let owned_by_empire_id = owned_by_empire_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: star_system :: owned_by_empire_id :: NAME)) ? ; Ok (Data { index , universe_id , coord_x , coord_y , owned_by_empire_id , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["index" , "universeId" , "universe" , "coordX" , "coordY" , "inbound" , "outbound" , "ownedByEmpireId" , "ownedByEmpire" , "planets" , "starbase"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: star_system :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; universe : $ selection_mode : ident { $ ($ selections : tt) + }) => { universe :: Data } ; (@ field_type ; universe) => { crate :: prisma :: universe :: Data } ; (@ field_type ; inbound : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < inbound :: Data > } ; (@ field_type ; inbound) => { Vec < crate :: prisma :: star_system_edges :: Data > } ; (@ field_type ; outbound : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < outbound :: Data > } ; (@ field_type ; outbound) => { Vec < crate :: prisma :: star_system_edges :: Data > } ; (@ field_type ; owned_by_empire : $ selection_mode : ident { $ ($ selections : tt) + }) => { Option < owned_by_empire :: Data > } ; (@ field_type ; owned_by_empire) => { Option < crate :: prisma :: empire :: Data > } ; (@ field_type ; planets : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < planets :: Data > } ; (@ field_type ; planets) => { Vec < crate :: prisma :: planet :: Data > } ; (@ field_type ; starbase : $ selection_mode : ident { $ ($ selections : tt) + }) => { Option < starbase :: Data > } ; (@ field_type ; starbase) => { Option < crate :: prisma :: starbase :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "StarSystem" , available relations are "universe, inbound, outbound, owned_by_empire, planets, starbase")) } ; (@ field_module ; universe : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: universe :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; inbound : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: star_system_edges :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; outbound : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: star_system_edges :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; owned_by_empire : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: empire :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; planets : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: planet :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; starbase : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: starbase :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; universe $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: star_system :: IncludeParam > :: into (crate :: prisma :: star_system :: universe :: Include :: $ selection_mode (crate :: prisma :: universe :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; universe $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: star_system :: IncludeParam > :: into (crate :: prisma :: star_system :: universe :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; inbound $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: star_system :: IncludeParam > :: into (crate :: prisma :: star_system :: inbound :: Include :: $ selection_mode (crate :: prisma :: star_system_edges :: ManyArgs :: new (crate :: prisma :: star_system_edges :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: star_system_edges :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; inbound $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: star_system :: IncludeParam > :: into (crate :: prisma :: star_system :: inbound :: Include :: Fetch (crate :: prisma :: star_system_edges :: ManyArgs :: new (crate :: prisma :: star_system_edges :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; outbound $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: star_system :: IncludeParam > :: into (crate :: prisma :: star_system :: outbound :: Include :: $ selection_mode (crate :: prisma :: star_system_edges :: ManyArgs :: new (crate :: prisma :: star_system_edges :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: star_system_edges :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; outbound $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: star_system :: IncludeParam > :: into (crate :: prisma :: star_system :: outbound :: Include :: Fetch (crate :: prisma :: star_system_edges :: ManyArgs :: new (crate :: prisma :: star_system_edges :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; owned_by_empire $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: star_system :: IncludeParam > :: into (crate :: prisma :: star_system :: owned_by_empire :: Include :: $ selection_mode (crate :: prisma :: empire :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; owned_by_empire $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: star_system :: IncludeParam > :: into (crate :: prisma :: star_system :: owned_by_empire :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; planets $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: star_system :: IncludeParam > :: into (crate :: prisma :: star_system :: planets :: Include :: $ selection_mode (crate :: prisma :: planet :: ManyArgs :: new (crate :: prisma :: planet :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: planet :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; planets $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: star_system :: IncludeParam > :: into (crate :: prisma :: star_system :: planets :: Include :: Fetch (crate :: prisma :: planet :: ManyArgs :: new (crate :: prisma :: planet :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; starbase $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: star_system :: IncludeParam > :: into (crate :: prisma :: star_system :: starbase :: Include :: $ selection_mode (crate :: prisma :: starbase :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; starbase $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: star_system :: IncludeParam > :: into (crate :: prisma :: star_system :: starbase :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: star_system :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; index) => { "index" } ; (@ field_serde_name ; universe_id) => { "universeId" } ; (@ field_serde_name ; universe) => { "universe" } ; (@ field_serde_name ; coord_x) => { "coordX" } ; (@ field_serde_name ; coord_y) => { "coordY" } ; (@ field_serde_name ; inbound) => { "inbound" } ; (@ field_serde_name ; outbound) => { "outbound" } ; (@ field_serde_name ; owned_by_empire_id) => { "ownedByEmpireId" } ; (@ field_serde_name ; owned_by_empire) => { "ownedByEmpire" } ; (@ field_serde_name ; planets) => { "planets" } ; (@ field_serde_name ; starbase) => { "starbase" } ; (@ specta_data_struct ; $ struct : item ;) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] # [specta (inline)] $ struct } ; (@ specta_data_struct ; $ struct : item ; $ name : ident) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] $ struct } ; } + pub use _include_star_system as include; + pub enum IncludeParam { + Index(index::Include), + UniverseId(universe_id::Include), + Universe(universe::Include), + CoordX(coord_x::Include), + CoordY(coord_y::Include), + Inbound(inbound::Include), + Outbound(outbound::Include), + OwnedByEmpireId(owned_by_empire_id::Include), + OwnedByEmpire(owned_by_empire::Include), + Planets(planets::Include), + Starbase(starbase::Include), + } + impl IncludeParam { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + match self { + Self::Index(data) => data.to_selection(), + Self::UniverseId(data) => data.to_selection(), + Self::Universe(data) => data.to_selection(), + Self::CoordX(data) => data.to_selection(), + Self::CoordY(data) => data.to_selection(), + Self::Inbound(data) => data.to_selection(), + Self::Outbound(data) => data.to_selection(), + Self::OwnedByEmpireId(data) => data.to_selection(), + Self::OwnedByEmpire(data) => data.to_selection(), + Self::Planets(data) => data.to_selection(), + Self::Starbase(data) => data.to_selection(), + } + } + } + #[macro_export] + macro_rules ! _partial_unchecked_star_system { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: star_system struct $ struct_name { # [serde (rename = "index")] pub index : i32 , # [serde (rename = "universeId")] pub universe_id : i32 , # [serde (rename = "coordX")] pub coord_x : f64 , # [serde (rename = "coordY")] pub coord_y : f64 , # [serde (rename = "ownedByEmpireId")] # [serde (default , with = "::prisma_client_rust::serde::double_option")] pub owned_by_empire_id : Option < i32 > } [$ ($ scalar_field) , +] } } ; } + pub use _partial_unchecked_star_system as partial_unchecked; + #[derive( + Debug, + Clone, + :: serde :: Serialize, + :: serde :: Deserialize, + :: prisma_client_rust :: specta :: Type, + )] + #[specta(rename = "StarSystem", crate = "prisma_client_rust::specta")] + pub struct Data { + #[serde(rename = "index")] + pub index: i32, + #[serde(rename = "universeId")] + pub universe_id: i32, + #[serde(rename = "universe")] + #[specta(skip)] + pub universe: Option>, + #[serde(rename = "coordX")] + pub coord_x: f64, + #[serde(rename = "coordY")] + pub coord_y: f64, + #[serde(rename = "inbound")] + #[specta(skip)] + pub inbound: Option>, + #[serde(rename = "outbound")] + #[specta(skip)] + pub outbound: Option>, + #[serde(rename = "ownedByEmpireId")] + pub owned_by_empire_id: Option, + #[serde( + rename = "ownedByEmpire", + default, + skip_serializing_if = "Option::is_none", + with = "prisma_client_rust::serde::double_option" + )] + #[specta(skip)] + pub owned_by_empire: Option>>, + #[serde(rename = "planets")] + #[specta(skip)] + pub planets: Option>, + #[serde( + rename = "starbase", + default, + skip_serializing_if = "Option::is_none", + with = "prisma_client_rust::serde::double_option" + )] + #[specta(skip)] + pub starbase: Option>>, + } + impl Data { + pub fn universe( + &self, + ) -> Result< + &super::universe::Data, + ::prisma_client_rust::RelationNotFetchedError, + > { + self + .universe + .as_ref() + .ok_or(::prisma_client_rust::RelationNotFetchedError::new( + stringify!(universe), + )) + .map(|v| v.as_ref()) + } + pub fn inbound( + &self, + ) -> Result< + &Vec, + ::prisma_client_rust::RelationNotFetchedError, + > { + self.inbound.as_ref().ok_or( + ::prisma_client_rust::RelationNotFetchedError::new(stringify!(inbound)), + ) + } + pub fn outbound( + &self, + ) -> Result< + &Vec, + ::prisma_client_rust::RelationNotFetchedError, + > { + self.outbound.as_ref().ok_or( + ::prisma_client_rust::RelationNotFetchedError::new(stringify!( + outbound + )), + ) + } + pub fn owned_by_empire( + &self, + ) -> Result< + Option<&super::empire::Data>, + ::prisma_client_rust::RelationNotFetchedError, + > { + self + .owned_by_empire + .as_ref() + .ok_or(::prisma_client_rust::RelationNotFetchedError::new( + stringify!(owned_by_empire), + )) + .map(|v| v.as_ref().map(|v| v.as_ref())) + } + pub fn planets( + &self, + ) -> Result< + &Vec, + ::prisma_client_rust::RelationNotFetchedError, + > { + self.planets.as_ref().ok_or( + ::prisma_client_rust::RelationNotFetchedError::new(stringify!(planets)), + ) + } + pub fn starbase( + &self, + ) -> Result< + Option<&super::starbase::Data>, + ::prisma_client_rust::RelationNotFetchedError, + > { + self + .starbase + .as_ref() + .ok_or(::prisma_client_rust::RelationNotFetchedError::new( + stringify!(starbase), + )) + .map(|v| v.as_ref().map(|v| v.as_ref())) + } + } + #[derive(Clone)] + pub enum WithParam { + Universe(super::universe::UniqueArgs), + Inbound(super::star_system_edges::ManyArgs), + Outbound(super::star_system_edges::ManyArgs), + OwnedByEmpire(super::empire::UniqueArgs), + Planets(super::planet::ManyArgs), + Starbase(super::starbase::UniqueArgs), + } + impl Into<::prisma_client_rust::Selection> for WithParam { + fn into(self) -> ::prisma_client_rust::Selection { + match self { + Self::Universe(args) => { + let mut selections = < super :: universe :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; + selections.extend( + args + .with_params + .into_iter() + .map(Into::<::prisma_client_rust::Selection>::into), + ); + ::prisma_client_rust::Selection::new( + universe::NAME, + None, + [], + selections, + ) + } + Self::Inbound(args) => { + let (arguments, mut nested_selections) = args.to_graphql(); + nested_selections . extend (< super :: star_system_edges :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) ; + ::prisma_client_rust::Selection::new( + inbound::NAME, + None, + arguments, + nested_selections, + ) + } + Self::Outbound(args) => { + let (arguments, mut nested_selections) = args.to_graphql(); + nested_selections . extend (< super :: star_system_edges :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) ; + ::prisma_client_rust::Selection::new( + outbound::NAME, + None, + arguments, + nested_selections, + ) + } + Self::OwnedByEmpire(args) => { + let mut selections = < super :: empire :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; + selections.extend( + args + .with_params + .into_iter() + .map(Into::<::prisma_client_rust::Selection>::into), + ); + ::prisma_client_rust::Selection::new( + owned_by_empire::NAME, + None, + [], + selections, + ) + } + Self::Planets(args) => { + let (arguments, mut nested_selections) = args.to_graphql(); + nested_selections . extend (< super :: planet :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) ; + ::prisma_client_rust::Selection::new( + planets::NAME, + None, + arguments, + nested_selections, + ) + } + Self::Starbase(args) => { + let mut selections = < super :: starbase :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; + selections.extend( + args + .with_params + .into_iter() + .map(Into::<::prisma_client_rust::Selection>::into), + ); + ::prisma_client_rust::Selection::new( + starbase::NAME, + None, + [], + selections, + ) + } + } + } + } + #[derive(Clone)] + pub enum SetParam { + SetIndex(i32), + IncrementIndex(i32), + DecrementIndex(i32), + MultiplyIndex(i32), + DivideIndex(i32), + SetUniverseId(i32), + IncrementUniverseId(i32), + DecrementUniverseId(i32), + MultiplyUniverseId(i32), + DivideUniverseId(i32), + ConnectUniverse(super::universe::UniqueWhereParam), + SetCoordX(f64), + IncrementCoordX(f64), + DecrementCoordX(f64), + MultiplyCoordX(f64), + DivideCoordX(f64), + SetCoordY(f64), + IncrementCoordY(f64), + DecrementCoordY(f64), + MultiplyCoordY(f64), + DivideCoordY(f64), + ConnectInbound(Vec), + DisconnectInbound(Vec), + SetInbound(Vec), + ConnectOutbound(Vec), + DisconnectOutbound(Vec), + SetOutbound(Vec), + SetOwnedByEmpireId(Option), + IncrementOwnedByEmpireId(i32), + DecrementOwnedByEmpireId(i32), + MultiplyOwnedByEmpireId(i32), + DivideOwnedByEmpireId(i32), + ConnectOwnedByEmpire(super::empire::UniqueWhereParam), + DisconnectOwnedByEmpire, + ConnectPlanets(Vec), + DisconnectPlanets(Vec), + SetPlanets(Vec), + ConnectStarbase(super::starbase::UniqueWhereParam), + DisconnectStarbase, + } + impl From for (String, ::prisma_client_rust::PrismaValue) { + fn from(param: SetParam) -> Self { + match param { SetParam :: SetIndex (value) => (index :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Int (value as i64)) , SetParam :: IncrementIndex (value) => (index :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("increment" . to_string () , :: prisma_client_rust :: PrismaValue :: Int (value as i64))])) , SetParam :: DecrementIndex (value) => (index :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("decrement" . to_string () , :: prisma_client_rust :: PrismaValue :: Int (value as i64))])) , SetParam :: MultiplyIndex (value) => (index :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("multiply" . to_string () , :: prisma_client_rust :: PrismaValue :: Int (value as i64))])) , SetParam :: DivideIndex (value) => (index :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("divide" . to_string () , :: prisma_client_rust :: PrismaValue :: Int (value as i64))])) , SetParam :: SetUniverseId (value) => (universe_id :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Int (value as i64)) , SetParam :: IncrementUniverseId (value) => (universe_id :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("increment" . to_string () , :: prisma_client_rust :: PrismaValue :: Int (value as i64))])) , SetParam :: DecrementUniverseId (value) => (universe_id :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("decrement" . to_string () , :: prisma_client_rust :: PrismaValue :: Int (value as i64))])) , SetParam :: MultiplyUniverseId (value) => (universe_id :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("multiply" . to_string () , :: prisma_client_rust :: PrismaValue :: Int (value as i64))])) , SetParam :: DivideUniverseId (value) => (universe_id :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("divide" . to_string () , :: prisma_client_rust :: PrismaValue :: Int (value as i64))])) , SetParam :: ConnectUniverse (where_param) => (universe :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("connect" . to_string () , :: prisma_client_rust :: PrismaValue :: Object ([where_param] . into_iter () . map (Into :: < super :: universe :: WhereParam > :: into) . map (:: prisma_client_rust :: WhereInput :: serialize) . map (:: prisma_client_rust :: SerializedWhereInput :: transform_equals) . collect ()))])) , SetParam :: SetCoordX (value) => (coord_x :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Float (< :: prisma_client_rust :: bigdecimal :: BigDecimal as :: prisma_client_rust :: bigdecimal :: FromPrimitive > :: from_f64 (value) . unwrap () . normalized ())) , SetParam :: IncrementCoordX (value) => (coord_x :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("increment" . to_string () , :: prisma_client_rust :: PrismaValue :: Float (< :: prisma_client_rust :: bigdecimal :: BigDecimal as :: prisma_client_rust :: bigdecimal :: FromPrimitive > :: from_f64 (value) . unwrap () . normalized ()))])) , SetParam :: DecrementCoordX (value) => (coord_x :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("decrement" . to_string () , :: prisma_client_rust :: PrismaValue :: Float (< :: prisma_client_rust :: bigdecimal :: BigDecimal as :: prisma_client_rust :: bigdecimal :: FromPrimitive > :: from_f64 (value) . unwrap () . normalized ()))])) , SetParam :: MultiplyCoordX (value) => (coord_x :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("multiply" . to_string () , :: prisma_client_rust :: PrismaValue :: Float (< :: prisma_client_rust :: bigdecimal :: BigDecimal as :: prisma_client_rust :: bigdecimal :: FromPrimitive > :: from_f64 (value) . unwrap () . normalized ()))])) , SetParam :: DivideCoordX (value) => (coord_x :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("divide" . to_string () , :: prisma_client_rust :: PrismaValue :: Float (< :: prisma_client_rust :: bigdecimal :: BigDecimal as :: prisma_client_rust :: bigdecimal :: FromPrimitive > :: from_f64 (value) . unwrap () . normalized ()))])) , SetParam :: SetCoordY (value) => (coord_y :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Float (< :: prisma_client_rust :: bigdecimal :: BigDecimal as :: prisma_client_rust :: bigdecimal :: FromPrimitive > :: from_f64 (value) . unwrap () . normalized ())) , SetParam :: IncrementCoordY (value) => (coord_y :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("increment" . to_string () , :: prisma_client_rust :: PrismaValue :: Float (< :: prisma_client_rust :: bigdecimal :: BigDecimal as :: prisma_client_rust :: bigdecimal :: FromPrimitive > :: from_f64 (value) . unwrap () . normalized ()))])) , SetParam :: DecrementCoordY (value) => (coord_y :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("decrement" . to_string () , :: prisma_client_rust :: PrismaValue :: Float (< :: prisma_client_rust :: bigdecimal :: BigDecimal as :: prisma_client_rust :: bigdecimal :: FromPrimitive > :: from_f64 (value) . unwrap () . normalized ()))])) , SetParam :: MultiplyCoordY (value) => (coord_y :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("multiply" . to_string () , :: prisma_client_rust :: PrismaValue :: Float (< :: prisma_client_rust :: bigdecimal :: BigDecimal as :: prisma_client_rust :: bigdecimal :: FromPrimitive > :: from_f64 (value) . unwrap () . normalized ()))])) , SetParam :: DivideCoordY (value) => (coord_y :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("divide" . to_string () , :: prisma_client_rust :: PrismaValue :: Float (< :: prisma_client_rust :: bigdecimal :: BigDecimal as :: prisma_client_rust :: bigdecimal :: FromPrimitive > :: from_f64 (value) . unwrap () . normalized ()))])) , SetParam :: ConnectInbound (where_params) => (inbound :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("connect" . to_string () , :: prisma_client_rust :: PrismaValue :: List (where_params . into_iter () . map (Into :: < super :: star_system_edges :: WhereParam > :: into) . map (:: prisma_client_rust :: WhereInput :: serialize) . map (:: prisma_client_rust :: SerializedWhereInput :: transform_equals) . map (| v | :: prisma_client_rust :: PrismaValue :: Object (vec ! [v])) . collect ()))])) , SetParam :: DisconnectInbound (where_params) => (inbound :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("disconnect" . to_string () , :: prisma_client_rust :: PrismaValue :: List (where_params . into_iter () . map (Into :: < super :: star_system_edges :: WhereParam > :: into) . map (:: prisma_client_rust :: WhereInput :: serialize) . map (:: prisma_client_rust :: SerializedWhereInput :: transform_equals) . map (| v | :: prisma_client_rust :: PrismaValue :: Object (vec ! [v])) . collect ()))])) , SetParam :: SetInbound (where_params) => (inbound :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("set" . to_string () , :: prisma_client_rust :: PrismaValue :: List (where_params . into_iter () . map (Into :: < super :: star_system_edges :: WhereParam > :: into) . map (:: prisma_client_rust :: WhereInput :: serialize) . map (:: prisma_client_rust :: SerializedWhereInput :: transform_equals) . map (| v | :: prisma_client_rust :: PrismaValue :: Object (vec ! [v])) . collect ()))])) , SetParam :: ConnectOutbound (where_params) => (outbound :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("connect" . to_string () , :: prisma_client_rust :: PrismaValue :: List (where_params . into_iter () . map (Into :: < super :: star_system_edges :: WhereParam > :: into) . map (:: prisma_client_rust :: WhereInput :: serialize) . map (:: prisma_client_rust :: SerializedWhereInput :: transform_equals) . map (| v | :: prisma_client_rust :: PrismaValue :: Object (vec ! [v])) . collect ()))])) , SetParam :: DisconnectOutbound (where_params) => (outbound :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("disconnect" . to_string () , :: prisma_client_rust :: PrismaValue :: List (where_params . into_iter () . map (Into :: < super :: star_system_edges :: WhereParam > :: into) . map (:: prisma_client_rust :: WhereInput :: serialize) . map (:: prisma_client_rust :: SerializedWhereInput :: transform_equals) . map (| v | :: prisma_client_rust :: PrismaValue :: Object (vec ! [v])) . collect ()))])) , SetParam :: SetOutbound (where_params) => (outbound :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("set" . to_string () , :: prisma_client_rust :: PrismaValue :: List (where_params . into_iter () . map (Into :: < super :: star_system_edges :: WhereParam > :: into) . map (:: prisma_client_rust :: WhereInput :: serialize) . map (:: prisma_client_rust :: SerializedWhereInput :: transform_equals) . map (| v | :: prisma_client_rust :: PrismaValue :: Object (vec ! [v])) . collect ()))])) , SetParam :: SetOwnedByEmpireId (value) => (owned_by_empire_id :: NAME . to_string () , value . map (| value | :: prisma_client_rust :: PrismaValue :: Int (value as i64)) . unwrap_or_else (|| :: prisma_client_rust :: PrismaValue :: Null)) , SetParam :: IncrementOwnedByEmpireId (value) => (owned_by_empire_id :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("increment" . to_string () , :: prisma_client_rust :: PrismaValue :: Int (value as i64))])) , SetParam :: DecrementOwnedByEmpireId (value) => (owned_by_empire_id :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("decrement" . to_string () , :: prisma_client_rust :: PrismaValue :: Int (value as i64))])) , SetParam :: MultiplyOwnedByEmpireId (value) => (owned_by_empire_id :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("multiply" . to_string () , :: prisma_client_rust :: PrismaValue :: Int (value as i64))])) , SetParam :: DivideOwnedByEmpireId (value) => (owned_by_empire_id :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("divide" . to_string () , :: prisma_client_rust :: PrismaValue :: Int (value as i64))])) , SetParam :: ConnectOwnedByEmpire (where_param) => (owned_by_empire :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("connect" . to_string () , :: prisma_client_rust :: PrismaValue :: Object ([where_param] . into_iter () . map (Into :: < super :: empire :: WhereParam > :: into) . map (:: prisma_client_rust :: WhereInput :: serialize) . map (:: prisma_client_rust :: SerializedWhereInput :: transform_equals) . collect ()))])) , SetParam :: DisconnectOwnedByEmpire => (owned_by_empire :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("disconnect" . to_string () , :: prisma_client_rust :: PrismaValue :: Boolean (true))])) , SetParam :: ConnectPlanets (where_params) => (planets :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("connect" . to_string () , :: prisma_client_rust :: PrismaValue :: List (where_params . into_iter () . map (Into :: < super :: planet :: WhereParam > :: into) . map (:: prisma_client_rust :: WhereInput :: serialize) . map (:: prisma_client_rust :: SerializedWhereInput :: transform_equals) . map (| v | :: prisma_client_rust :: PrismaValue :: Object (vec ! [v])) . collect ()))])) , SetParam :: DisconnectPlanets (where_params) => (planets :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("disconnect" . to_string () , :: prisma_client_rust :: PrismaValue :: List (where_params . into_iter () . map (Into :: < super :: planet :: WhereParam > :: into) . map (:: prisma_client_rust :: WhereInput :: serialize) . map (:: prisma_client_rust :: SerializedWhereInput :: transform_equals) . map (| v | :: prisma_client_rust :: PrismaValue :: Object (vec ! [v])) . collect ()))])) , SetParam :: SetPlanets (where_params) => (planets :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("set" . to_string () , :: prisma_client_rust :: PrismaValue :: List (where_params . into_iter () . map (Into :: < super :: planet :: WhereParam > :: into) . map (:: prisma_client_rust :: WhereInput :: serialize) . map (:: prisma_client_rust :: SerializedWhereInput :: transform_equals) . map (| v | :: prisma_client_rust :: PrismaValue :: Object (vec ! [v])) . collect ()))])) , SetParam :: ConnectStarbase (where_param) => (starbase :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("connect" . to_string () , :: prisma_client_rust :: PrismaValue :: Object ([where_param] . into_iter () . map (Into :: < super :: starbase :: WhereParam > :: into) . map (:: prisma_client_rust :: WhereInput :: serialize) . map (:: prisma_client_rust :: SerializedWhereInput :: transform_equals) . collect ()))])) , SetParam :: DisconnectStarbase => (starbase :: NAME . to_string () , :: prisma_client_rust :: PrismaValue :: Object (vec ! [("disconnect" . to_string () , :: prisma_client_rust :: PrismaValue :: Boolean (true))])) } + } + } + #[derive(Clone)] + pub enum UncheckedSetParam { + Index(i32), + UniverseId(i32), + CoordX(f64), + CoordY(f64), + OwnedByEmpireId(Option), + } + impl From for SetParam { + fn from(param: UncheckedSetParam) -> Self { + match param { + UncheckedSetParam::Index(value) => Self::SetIndex(value), + UncheckedSetParam::UniverseId(value) => Self::SetUniverseId(value), + UncheckedSetParam::CoordX(value) => Self::SetCoordX(value), + UncheckedSetParam::CoordY(value) => Self::SetCoordY(value), + UncheckedSetParam::OwnedByEmpireId(value) => { + Self::SetOwnedByEmpireId(value) + } + } + } + } + #[derive(Clone)] + pub enum OrderByParam { + Index(::prisma_client_rust::Direction), + UniverseId(::prisma_client_rust::Direction), + CoordX(::prisma_client_rust::Direction), + CoordY(::prisma_client_rust::Direction), + OwnedByEmpireId(::prisma_client_rust::Direction), + } + impl Into<(String, ::prisma_client_rust::PrismaValue)> for OrderByParam { + fn into(self) -> (String, ::prisma_client_rust::PrismaValue) { + match self { + Self::Index(direction) => ( + index::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::UniverseId(direction) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::CoordX(direction) => ( + coord_x::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::CoordY(direction) => ( + coord_y::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::OwnedByEmpireId(direction) => ( + owned_by_empire_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + } + } + } + #[derive(Clone)] + pub enum WhereParam { + Not(Vec), + Or(Vec), + And(Vec), + UniverseIdIndexEquals(i32, i32), + Index(_prisma::read_filters::IntFilter), + UniverseId(_prisma::read_filters::IntFilter), + UniverseIs(Vec), + UniverseIsNot(Vec), + CoordX(_prisma::read_filters::FloatFilter), + CoordY(_prisma::read_filters::FloatFilter), + InboundSome(Vec), + InboundEvery(Vec), + InboundNone(Vec), + OutboundSome(Vec), + OutboundEvery(Vec), + OutboundNone(Vec), + OwnedByEmpireId(_prisma::read_filters::IntNullableFilter), + OwnedByEmpireIsNull, + OwnedByEmpireIs(Vec), + OwnedByEmpireIsNot(Vec), + PlanetsSome(Vec), + PlanetsEvery(Vec), + PlanetsNone(Vec), + StarbaseIsNull, + StarbaseIs(Vec), + StarbaseIsNot(Vec), + } + impl ::prisma_client_rust::WhereInput for WhereParam { + fn serialize(self) -> ::prisma_client_rust::SerializedWhereInput { + let (name, value) = match self { + Self::Not(value) => ( + "NOT", + ::prisma_client_rust::SerializedWhereValue::Object( + ::prisma_client_rust::merge_fields( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .collect(), + ), + ), + ), + Self::Or(value) => ( + "OR", + ::prisma_client_rust::SerializedWhereValue::List( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .map(|v| vec![v]) + .map(::prisma_client_rust::PrismaValue::Object) + .collect(), + ), + ), + Self::And(value) => ( + "AND", + ::prisma_client_rust::SerializedWhereValue::Object( + ::prisma_client_rust::merge_fields( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .collect(), + ), + ), + ), + Self::UniverseIdIndexEquals(universe_id, index) => ( + "universeId_index", + ::prisma_client_rust::SerializedWhereValue::Object(vec![ + ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Int(universe_id as i64), + ), + ( + index::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Int(index as i64), + ), + ]), + ), + Self::Index(value) => (index::NAME, value.into()), + Self::UniverseId(value) => (universe_id::NAME, value.into()), + Self::UniverseIs(where_params) => ( + universe::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "is".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::UniverseIsNot(where_params) => ( + universe::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "isNot".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::CoordX(value) => (coord_x::NAME, value.into()), + Self::CoordY(value) => (coord_y::NAME, value.into()), + Self::InboundSome(where_params) => ( + inbound::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "some".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::InboundEvery(where_params) => ( + inbound::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "every".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::InboundNone(where_params) => ( + inbound::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "none".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::OutboundSome(where_params) => ( + outbound::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "some".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::OutboundEvery(where_params) => ( + outbound::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "every".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::OutboundNone(where_params) => ( + outbound::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "none".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::OwnedByEmpireId(value) => { + (owned_by_empire_id::NAME, value.into()) + } + Self::OwnedByEmpireIsNull => ( + owned_by_empire::NAME, + ::prisma_client_rust::SerializedWhereValue::Value( + ::prisma_client_rust::PrismaValue::Null, + ), + ), + Self::OwnedByEmpireIs(where_params) => ( + owned_by_empire::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "is".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::OwnedByEmpireIsNot(where_params) => ( + owned_by_empire::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "isNot".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::PlanetsSome(where_params) => ( + planets::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "some".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::PlanetsEvery(where_params) => ( + planets::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "every".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::PlanetsNone(where_params) => ( + planets::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "none".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::StarbaseIsNull => ( + starbase::NAME, + ::prisma_client_rust::SerializedWhereValue::Value( + ::prisma_client_rust::PrismaValue::Null, + ), + ), + Self::StarbaseIs(where_params) => ( + starbase::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "is".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::StarbaseIsNot(where_params) => ( + starbase::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "isNot".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + }; + ::prisma_client_rust::SerializedWhereInput::new(name, value.into()) + } + } + #[derive(Clone)] + pub enum UniqueWhereParam { + UniverseIdIndexEquals(i32, i32), + } + impl From for WhereParam { + fn from(value: UniqueWhereParam) -> Self { + match value { + UniqueWhereParam::UniverseIdIndexEquals(universe_id, index) => { + Self::UniverseIdIndexEquals(universe_id, index) + } + } + } + } + impl From<::prisma_client_rust::Operator> for WhereParam { + fn from(op: ::prisma_client_rust::Operator) -> Self { + match op { + ::prisma_client_rust::Operator::Not(value) => Self::Not(value), + ::prisma_client_rust::Operator::And(value) => Self::And(value), + ::prisma_client_rust::Operator::Or(value) => Self::Or(value), + } + } + } + #[derive(Clone)] + pub struct Types; + impl ::prisma_client_rust::ModelTypes for Types { + type Data = Data; + type Where = WhereParam; + type UncheckedSet = UncheckedSetParam; + type Set = SetParam; + type With = WithParam; + type OrderBy = OrderByParam; + type Cursor = UniqueWhereParam; + const MODEL: &'static str = NAME; + fn scalar_selections() -> Vec<::prisma_client_rust::Selection> { + vec![ + ::prisma_client_rust::sel(index::NAME), + ::prisma_client_rust::sel(universe_id::NAME), + ::prisma_client_rust::sel(coord_x::NAME), + ::prisma_client_rust::sel(coord_y::NAME), + ::prisma_client_rust::sel(owned_by_empire_id::NAME), + ] + } + } + pub type UniqueArgs = ::prisma_client_rust::UniqueArgs; + pub type ManyArgs = ::prisma_client_rust::ManyArgs; + pub type Count<'a> = ::prisma_client_rust::Count<'a, Types>; + pub type Create<'a> = ::prisma_client_rust::Create<'a, Types>; + pub type CreateMany<'a> = ::prisma_client_rust::CreateMany<'a, Types>; + pub type FindUnique<'a> = ::prisma_client_rust::FindUnique<'a, Types>; + pub type FindMany<'a> = ::prisma_client_rust::FindMany<'a, Types>; + pub type FindFirst<'a> = ::prisma_client_rust::FindFirst<'a, Types>; + pub type Update<'a> = ::prisma_client_rust::Update<'a, Types>; + pub type UpdateMany<'a> = ::prisma_client_rust::UpdateMany<'a, Types>; + pub type Upsert<'a> = ::prisma_client_rust::Upsert<'a, Types>; + pub type Delete<'a> = ::prisma_client_rust::Delete<'a, Types>; + pub type DeleteMany<'a> = ::prisma_client_rust::DeleteMany<'a, Types>; + #[derive(Clone)] + pub struct Actions<'a> { + pub client: &'a ::prisma_client_rust::PrismaClientInternals, + } + impl<'a> Actions<'a> { + pub fn find_unique(self, _where: UniqueWhereParam) -> FindUnique<'a> { + FindUnique::new(self.client, _where.into()) + } + pub fn find_first(self, _where: Vec) -> FindFirst<'a> { + FindFirst::new(self.client, _where) + } + pub fn find_many(self, _where: Vec) -> FindMany<'a> { + FindMany::new(self.client, _where) + } + pub fn create( + self, + index: i32, + universe: super::universe::UniqueWhereParam, + coord_x: f64, + coord_y: f64, + mut _params: Vec, + ) -> Create<'a> { + _params.extend([ + index::set(index), + universe::connect(universe), + coord_x::set(coord_x), + coord_y::set(coord_y), + ]); + Create::new(self.client, _params) + } + pub fn create_unchecked( + self, + index: i32, + universe_id: i32, + coord_x: f64, + coord_y: f64, + mut _params: Vec, + ) -> Create<'a> { + _params.extend([ + index::set(index), + universe_id::set(universe_id), + coord_x::set(coord_x), + coord_y::set(coord_y), + ]); + Create::new(self.client, _params.into_iter().map(Into::into).collect()) + } + pub fn create_many( + self, + data: Vec<(i32, i32, f64, f64, Vec)>, + ) -> CreateMany<'a> { + let data = data + .into_iter() + .map(|(index, universe_id, coord_x, coord_y, mut _params)| { + _params.extend([ + index::set(index), + universe_id::set(universe_id), + coord_x::set(coord_x), + coord_y::set(coord_y), + ]); + _params + }) + .collect(); + CreateMany::new(self.client, data) + } + pub fn update( + self, + _where: UniqueWhereParam, + _params: Vec, + ) -> Update<'a> { + Update::new(self.client, _where.into(), _params, vec![]) + } + pub fn update_unchecked( + self, + _where: UniqueWhereParam, + _params: Vec, + ) -> Update<'a> { + Update::new( + self.client, + _where.into(), + _params.into_iter().map(Into::into).collect(), + vec![], + ) + } + pub fn update_many( + self, + _where: Vec, + _params: Vec, + ) -> UpdateMany<'a> { + UpdateMany::new(self.client, _where, _params) + } + pub fn upsert( + self, + _where: UniqueWhereParam, + (index, universe, coord_x, coord_y, mut _params): ( + i32, + super::universe::UniqueWhereParam, + f64, + f64, + Vec, + ), + _update: Vec, + ) -> Upsert<'a> { + _params.extend([ + index::set(index), + universe::connect(universe), + coord_x::set(coord_x), + coord_y::set(coord_y), + ]); + Upsert::new(self.client, _where.into(), _params, _update) + } + pub fn delete(self, _where: UniqueWhereParam) -> Delete<'a> { + Delete::new(self.client, _where.into(), vec![]) + } + pub fn delete_many(self, _where: Vec) -> DeleteMany<'a> { + DeleteMany::new(self.client, _where) + } + pub fn count(self, _where: Vec) -> Count<'a> { + Count::new(self.client, _where) + } + pub fn find_raw( + self, + ) -> ::prisma_client_rust::FindRaw<'a, Types, T> { + ::prisma_client_rust::FindRaw::new(self.client) + } + pub fn aggregate_raw( + self, + ) -> ::prisma_client_rust::AggregateRaw<'a, Types, T> { + ::prisma_client_rust::AggregateRaw::new(self.client) + } + } +} +pub mod star_system_edges { + use super::_prisma::*; + use super::*; + pub const NAME: &str = "StarSystemEdges"; + pub mod universe_id { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "universeId"; + pub struct Set(pub i32); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetUniverseId(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::UniverseId(v) + } + } + pub fn set>(value: i32) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::UniverseId(direction) + } + pub fn equals(value: i32) -> WhereParam { + WhereParam::UniverseId(_prisma::read_filters::IntFilter::Equals(value)) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::IntFilter, + UniverseId, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: i32) -> Lt; + fn lte(_: i32) -> Lte; + fn gt(_: i32) -> Gt; + fn gte(_: i32) -> Gte; + fn not(_: i32) -> Not; + } + ); + pub fn increment(value: i32) -> SetParam { + SetParam::IncrementUniverseId(value) + } + pub fn decrement(value: i32) -> SetParam { + SetParam::DecrementUniverseId(value) + } + pub fn multiply(value: i32) -> SetParam { + SetParam::MultiplyUniverseId(value) + } + pub fn divide(value: i32) -> SetParam { + SetParam::DivideUniverseId(value) + } + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::UniverseId(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::UniverseId(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod universe { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "universe"; + pub struct Fetch(pub universe::UniqueArgs); + impl Fetch { + pub fn with(mut self, params: impl Into) -> Self { + self.0 = self.0.with(params.into()); + self + } + } + impl From for WithParam { + fn from(Fetch(v): Fetch) -> Self { + WithParam::Universe(v) + } + } + pub fn fetch() -> Fetch { + Fetch(universe::UniqueArgs::new()) + } + pub struct Connect(universe::UniqueWhereParam); + impl From for SetParam { + fn from(Connect(v): Connect) -> Self { + Self::ConnectUniverse(v) + } + } + pub fn connect>(value: universe::UniqueWhereParam) -> T { + Connect(value).into() + } + pub fn is(value: Vec) -> WhereParam { + WhereParam::UniverseIs(value) + } + pub fn is_not(value: Vec) -> WhereParam { + WhereParam::UniverseIsNot(value) + } + pub enum Include { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Universe(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = < universe :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < universe :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; + ::prisma_client_rust::Selection::new("universe", None, [], selections) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include(nested_selections: Vec) -> Self { + Self::Include(nested_selections) + } + } + pub enum Select { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Universe(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < universe :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; + ::prisma_client_rust::Selection::new("universe", None, [], selections) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include(nested_selections: Vec) -> Self { + Self::Include(nested_selections) + } + } + } + pub mod from_system_id { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "fromSystemId"; + pub struct Set(pub i32); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetFromSystemId(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::FromSystemId(v) + } + } + pub fn set>(value: i32) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::FromSystemId(direction) + } + pub fn equals(value: i32) -> WhereParam { + WhereParam::FromSystemId(_prisma::read_filters::IntFilter::Equals(value)) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::IntFilter, + FromSystemId, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: i32) -> Lt; + fn lte(_: i32) -> Lte; + fn gt(_: i32) -> Gt; + fn gte(_: i32) -> Gte; + fn not(_: i32) -> Not; + } + ); + pub fn increment(value: i32) -> SetParam { + SetParam::IncrementFromSystemId(value) + } + pub fn decrement(value: i32) -> SetParam { + SetParam::DecrementFromSystemId(value) + } + pub fn multiply(value: i32) -> SetParam { + SetParam::MultiplyFromSystemId(value) + } + pub fn divide(value: i32) -> SetParam { + SetParam::DivideFromSystemId(value) + } + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::FromSystemId(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::FromSystemId(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod from { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "from"; + pub struct Fetch(pub star_system::UniqueArgs); + impl Fetch { + pub fn with(mut self, params: impl Into) -> Self { + self.0 = self.0.with(params.into()); + self + } + } + impl From for WithParam { + fn from(Fetch(v): Fetch) -> Self { + WithParam::From(v) + } + } + pub fn fetch() -> Fetch { + Fetch(star_system::UniqueArgs::new()) + } + pub struct Connect(star_system::UniqueWhereParam); + impl From for SetParam { + fn from(Connect(v): Connect) -> Self { + Self::ConnectFrom(v) + } + } + pub fn connect>( + value: star_system::UniqueWhereParam, + ) -> T { + Connect(value).into() + } + pub fn is(value: Vec) -> WhereParam { + WhereParam::FromIs(value) + } + pub fn is_not(value: Vec) -> WhereParam { + WhereParam::FromIsNot(value) + } + pub enum Include { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::From(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = < star_system :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < star_system :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; + ::prisma_client_rust::Selection::new("from", None, [], selections) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include( + nested_selections: Vec, + ) -> Self { + Self::Include(nested_selections) + } + } + pub enum Select { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::From(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < star_system :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; + ::prisma_client_rust::Selection::new("from", None, [], selections) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include( + nested_selections: Vec, + ) -> Self { + Self::Include(nested_selections) + } + } + } + pub mod to_system_id { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "toSystemId"; + pub struct Set(pub i32); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetToSystemId(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::ToSystemId(v) + } + } + pub fn set>(value: i32) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::ToSystemId(direction) + } + pub fn equals(value: i32) -> WhereParam { + WhereParam::ToSystemId(_prisma::read_filters::IntFilter::Equals(value)) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::IntFilter, + ToSystemId, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: i32) -> Lt; + fn lte(_: i32) -> Lte; + fn gt(_: i32) -> Gt; + fn gte(_: i32) -> Gte; + fn not(_: i32) -> Not; + } + ); + pub fn increment(value: i32) -> SetParam { + SetParam::IncrementToSystemId(value) + } + pub fn decrement(value: i32) -> SetParam { + SetParam::DecrementToSystemId(value) + } + pub fn multiply(value: i32) -> SetParam { + SetParam::MultiplyToSystemId(value) + } + pub fn divide(value: i32) -> SetParam { + SetParam::DivideToSystemId(value) + } + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::ToSystemId(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::ToSystemId(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod to { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "to"; + pub struct Fetch(pub star_system::UniqueArgs); + impl Fetch { + pub fn with(mut self, params: impl Into) -> Self { + self.0 = self.0.with(params.into()); + self + } + } + impl From for WithParam { + fn from(Fetch(v): Fetch) -> Self { + WithParam::To(v) + } + } + pub fn fetch() -> Fetch { + Fetch(star_system::UniqueArgs::new()) + } + pub struct Connect(star_system::UniqueWhereParam); + impl From for SetParam { + fn from(Connect(v): Connect) -> Self { + Self::ConnectTo(v) + } + } + pub fn connect>( + value: star_system::UniqueWhereParam, + ) -> T { + Connect(value).into() + } + pub fn is(value: Vec) -> WhereParam { + WhereParam::ToIs(value) + } + pub fn is_not(value: Vec) -> WhereParam { + WhereParam::ToIsNot(value) + } + pub enum Include { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::To(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = < star_system :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < star_system :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; + ::prisma_client_rust::Selection::new("to", None, [], selections) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include( + nested_selections: Vec, + ) -> Self { + Self::Include(nested_selections) + } + } + pub enum Select { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::To(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < star_system :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; + ::prisma_client_rust::Selection::new("to", None, [], selections) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include( + nested_selections: Vec, + ) -> Self { + Self::Include(nested_selections) + } + } + } + pub fn universe_id_from_system_id_to_system_id>( + universe_id: i32, + from_system_id: i32, + to_system_id: i32, + ) -> T { + UniqueWhereParam::UniverseIdFromSystemIdToSystemIdEquals( + universe_id, + from_system_id, + to_system_id, + ) + .into() + } + pub fn create( + universe: super::universe::UniqueWhereParam, + from: super::star_system::UniqueWhereParam, + to: super::star_system::UniqueWhereParam, + _params: Vec, + ) -> ( + super::universe::UniqueWhereParam, + super::star_system::UniqueWhereParam, + super::star_system::UniqueWhereParam, + Vec, + ) { + (universe, from, to, _params) + } + pub fn create_unchecked( + universe_id: i32, + from_system_id: i32, + to_system_id: i32, + _params: Vec, + ) -> (i32, i32, i32, Vec) { + (universe_id, from_system_id, to_system_id, _params) + } + #[macro_export] + macro_rules ! _select_star_system_edges { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: star_system_edges :: select ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: star_system_edges :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: star_system_edges :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: star_system_edges :: select ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: star_system_edges :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: star_system_edges :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { universe_id , universe , from_system_id , from , to_system_id , to } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } const SPECTA_TYPE_NAME : & 'static str = prisma_client_rust :: macros :: to_pascal_case ! ($ ($ module_name) ?) ; crate :: prisma :: star_system_edges :: select ! (@ specta_data_struct ; pub struct Data { $ (# [specta (rename_from_path = crate :: prisma :: star_system_edges :: $ field :: NAME)] pub $ field : crate :: prisma :: star_system_edges :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } ; $ ($ module_name) ?) ; impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) +] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: star_system_edges :: $ field :: NAME , & self . $ field) ? ;) * state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: star_system_edges :: $ field :: NAME) , + ,] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: star_system_edges :: $ field :: NAME => Ok (Field :: $ field)) , * , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * while let Some (key) = map . next_key () ? { match key { $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: star_system_edges :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: star_system_edges :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["universeId" , "universe" , "fromSystemId" , "from" , "toSystemId" , "to"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: star_system_edges :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; universe_id) => { i32 } ; (@ field_type ; universe : $ selection_mode : ident { $ ($ selections : tt) + }) => { universe :: Data } ; (@ field_type ; universe) => { crate :: prisma :: universe :: Data } ; (@ field_type ; from_system_id) => { i32 } ; (@ field_type ; from : $ selection_mode : ident { $ ($ selections : tt) + }) => { from :: Data } ; (@ field_type ; from) => { crate :: prisma :: star_system :: Data } ; (@ field_type ; to_system_id) => { i32 } ; (@ field_type ; to : $ selection_mode : ident { $ ($ selections : tt) + }) => { to :: Data } ; (@ field_type ; to) => { crate :: prisma :: star_system :: Data } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "StarSystemEdges" , available relations are "universe_id, universe, from_system_id, from, to_system_id, to")) } ; (@ field_module ; universe : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: universe :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; from : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: star_system :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; to : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: star_system :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; universe_id) => { Into :: < crate :: prisma :: star_system_edges :: SelectParam > :: into (crate :: prisma :: star_system_edges :: universe_id :: Select) } ; (@ selection_field_to_selection_param ; universe $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: star_system_edges :: SelectParam > :: into (crate :: prisma :: star_system_edges :: universe :: Select :: $ selection_mode (crate :: prisma :: universe :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; universe $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: star_system_edges :: SelectParam > :: into (crate :: prisma :: star_system_edges :: universe :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; from_system_id) => { Into :: < crate :: prisma :: star_system_edges :: SelectParam > :: into (crate :: prisma :: star_system_edges :: from_system_id :: Select) } ; (@ selection_field_to_selection_param ; from $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: star_system_edges :: SelectParam > :: into (crate :: prisma :: star_system_edges :: from :: Select :: $ selection_mode (crate :: prisma :: star_system :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; from $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: star_system_edges :: SelectParam > :: into (crate :: prisma :: star_system_edges :: from :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; to_system_id) => { Into :: < crate :: prisma :: star_system_edges :: SelectParam > :: into (crate :: prisma :: star_system_edges :: to_system_id :: Select) } ; (@ selection_field_to_selection_param ; to $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: star_system_edges :: SelectParam > :: into (crate :: prisma :: star_system_edges :: to :: Select :: $ selection_mode (crate :: prisma :: star_system :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; to $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: star_system_edges :: SelectParam > :: into (crate :: prisma :: star_system_edges :: to :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: star_system_edges :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; universe_id) => { "universeId" } ; (@ field_serde_name ; universe) => { "universe" } ; (@ field_serde_name ; from_system_id) => { "fromSystemId" } ; (@ field_serde_name ; from) => { "from" } ; (@ field_serde_name ; to_system_id) => { "toSystemId" } ; (@ field_serde_name ; to) => { "to" } ; (@ specta_data_struct ; $ struct : item ;) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] # [specta (inline)] $ struct } ; (@ specta_data_struct ; $ struct : item ; $ name : ident) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] $ struct } ; } + pub use _select_star_system_edges as select; + pub enum SelectParam { + UniverseId(universe_id::Select), + Universe(universe::Select), + FromSystemId(from_system_id::Select), + From(from::Select), + ToSystemId(to_system_id::Select), + To(to::Select), + } + impl SelectParam { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + match self { + Self::UniverseId(data) => data.to_selection(), + Self::Universe(data) => data.to_selection(), + Self::FromSystemId(data) => data.to_selection(), + Self::From(data) => data.to_selection(), + Self::ToSystemId(data) => data.to_selection(), + Self::To(data) => data.to_selection(), + } + } + } + #[macro_export] + macro_rules ! _include_star_system_edges { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: star_system_edges :: include ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: star_system_edges :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: star_system_edges :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: star_system_edges :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: star_system_edges :: include ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: star_system_edges :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: star_system_edges :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: star_system_edges :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { universe , from , to } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } const SPECTA_TYPE_NAME : & 'static str = prisma_client_rust :: macros :: to_pascal_case ! ($ ($ module_name) ?) ; crate :: prisma :: star_system_edges :: include ! (@ specta_data_struct ; pub struct Data { # [specta (rename_from_path = crate :: prisma :: star_system_edges :: universe_id :: NAME)] pub universe_id : i32 , # [specta (rename_from_path = crate :: prisma :: star_system_edges :: from_system_id :: NAME)] pub from_system_id : i32 , # [specta (rename_from_path = crate :: prisma :: star_system_edges :: to_system_id :: NAME)] pub to_system_id : i32 , $ (# [specta (rename_from_path = crate :: prisma :: star_system_edges :: $ field :: NAME)] pub $ field : crate :: prisma :: star_system_edges :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } ; $ ($ module_name) ?) ; impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) + stringify ! (universe_id) , stringify ! (from_system_id) , stringify ! (to_system_id)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: star_system_edges :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: star_system_edges :: universe_id :: NAME , & self . universe_id) ? ; state . serialize_field (crate :: prisma :: star_system_edges :: from_system_id :: NAME , & self . from_system_id) ? ; state . serialize_field (crate :: prisma :: star_system_edges :: to_system_id :: NAME , & self . to_system_id) ? ; state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , universe_id , from_system_id , to_system_id } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: star_system_edges :: $ field :: NAME) , + , crate :: prisma :: star_system_edges :: universe_id :: NAME , crate :: prisma :: star_system_edges :: from_system_id :: NAME , crate :: prisma :: star_system_edges :: to_system_id :: NAME] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: star_system_edges :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: star_system_edges :: universe_id :: NAME => Ok (Field :: universe_id) , crate :: prisma :: star_system_edges :: from_system_id :: NAME => Ok (Field :: from_system_id) , crate :: prisma :: star_system_edges :: to_system_id :: NAME => Ok (Field :: to_system_id) , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * let mut universe_id = None ; let mut from_system_id = None ; let mut to_system_id = None ; while let Some (key) = map . next_key () ? { match key { Field :: universe_id => { if universe_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: star_system_edges :: universe_id :: NAME)) ; } universe_id = Some (map . next_value () ?) ; } Field :: from_system_id => { if from_system_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: star_system_edges :: from_system_id :: NAME)) ; } from_system_id = Some (map . next_value () ?) ; } Field :: to_system_id => { if to_system_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: star_system_edges :: to_system_id :: NAME)) ; } to_system_id = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: star_system_edges :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: star_system_edges :: $ field :: NAME)) ? ;) * let universe_id = universe_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: star_system_edges :: universe_id :: NAME)) ? ; let from_system_id = from_system_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: star_system_edges :: from_system_id :: NAME)) ? ; let to_system_id = to_system_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: star_system_edges :: to_system_id :: NAME)) ? ; Ok (Data { universe_id , from_system_id , to_system_id , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["universeId" , "universe" , "fromSystemId" , "from" , "toSystemId" , "to"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: star_system_edges :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; universe : $ selection_mode : ident { $ ($ selections : tt) + }) => { universe :: Data } ; (@ field_type ; universe) => { crate :: prisma :: universe :: Data } ; (@ field_type ; from : $ selection_mode : ident { $ ($ selections : tt) + }) => { from :: Data } ; (@ field_type ; from) => { crate :: prisma :: star_system :: Data } ; (@ field_type ; to : $ selection_mode : ident { $ ($ selections : tt) + }) => { to :: Data } ; (@ field_type ; to) => { crate :: prisma :: star_system :: Data } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "StarSystemEdges" , available relations are "universe, from, to")) } ; (@ field_module ; universe : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: universe :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; from : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: star_system :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; to : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: star_system :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; universe $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: star_system_edges :: IncludeParam > :: into (crate :: prisma :: star_system_edges :: universe :: Include :: $ selection_mode (crate :: prisma :: universe :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; universe $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: star_system_edges :: IncludeParam > :: into (crate :: prisma :: star_system_edges :: universe :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; from $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: star_system_edges :: IncludeParam > :: into (crate :: prisma :: star_system_edges :: from :: Include :: $ selection_mode (crate :: prisma :: star_system :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; from $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: star_system_edges :: IncludeParam > :: into (crate :: prisma :: star_system_edges :: from :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; to $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: star_system_edges :: IncludeParam > :: into (crate :: prisma :: star_system_edges :: to :: Include :: $ selection_mode (crate :: prisma :: star_system :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; to $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: star_system_edges :: IncludeParam > :: into (crate :: prisma :: star_system_edges :: to :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: star_system_edges :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; universe_id) => { "universeId" } ; (@ field_serde_name ; universe) => { "universe" } ; (@ field_serde_name ; from_system_id) => { "fromSystemId" } ; (@ field_serde_name ; from) => { "from" } ; (@ field_serde_name ; to_system_id) => { "toSystemId" } ; (@ field_serde_name ; to) => { "to" } ; (@ specta_data_struct ; $ struct : item ;) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] # [specta (inline)] $ struct } ; (@ specta_data_struct ; $ struct : item ; $ name : ident) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] $ struct } ; } + pub use _include_star_system_edges as include; + pub enum IncludeParam { + UniverseId(universe_id::Include), + Universe(universe::Include), + FromSystemId(from_system_id::Include), + From(from::Include), + ToSystemId(to_system_id::Include), + To(to::Include), + } + impl IncludeParam { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + match self { + Self::UniverseId(data) => data.to_selection(), + Self::Universe(data) => data.to_selection(), + Self::FromSystemId(data) => data.to_selection(), + Self::From(data) => data.to_selection(), + Self::ToSystemId(data) => data.to_selection(), + Self::To(data) => data.to_selection(), + } + } + } + #[macro_export] + macro_rules ! _partial_unchecked_star_system_edges { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: star_system_edges struct $ struct_name { # [serde (rename = "universeId")] pub universe_id : i32 , # [serde (rename = "fromSystemId")] pub from_system_id : i32 , # [serde (rename = "toSystemId")] pub to_system_id : i32 } [$ ($ scalar_field) , +] } } ; } + pub use _partial_unchecked_star_system_edges as partial_unchecked; + #[derive( + Debug, + Clone, + :: serde :: Serialize, + :: serde :: Deserialize, + :: prisma_client_rust :: specta :: Type, + )] + #[specta(rename = "StarSystemEdges", crate = "prisma_client_rust::specta")] + pub struct Data { + #[serde(rename = "universeId")] + pub universe_id: i32, + #[serde(rename = "universe")] + #[specta(skip)] + pub universe: Option>, + #[serde(rename = "fromSystemId")] + pub from_system_id: i32, + #[serde(rename = "from")] + #[specta(skip)] + pub from: Option>, + #[serde(rename = "toSystemId")] + pub to_system_id: i32, + #[serde(rename = "to")] + #[specta(skip)] + pub to: Option>, + } + impl Data { + pub fn universe( + &self, + ) -> Result< + &super::universe::Data, + ::prisma_client_rust::RelationNotFetchedError, + > { + self + .universe + .as_ref() + .ok_or(::prisma_client_rust::RelationNotFetchedError::new( + stringify!(universe), + )) + .map(|v| v.as_ref()) + } + pub fn from( + &self, + ) -> Result< + &super::star_system::Data, + ::prisma_client_rust::RelationNotFetchedError, + > { + self + .from + .as_ref() + .ok_or(::prisma_client_rust::RelationNotFetchedError::new( + stringify!(from), + )) + .map(|v| v.as_ref()) + } + pub fn to( + &self, + ) -> Result< + &super::star_system::Data, + ::prisma_client_rust::RelationNotFetchedError, + > { + self + .to + .as_ref() + .ok_or(::prisma_client_rust::RelationNotFetchedError::new( + stringify!(to), + )) + .map(|v| v.as_ref()) + } + } + #[derive(Clone)] + pub enum WithParam { + Universe(super::universe::UniqueArgs), + From(super::star_system::UniqueArgs), + To(super::star_system::UniqueArgs), + } + impl Into<::prisma_client_rust::Selection> for WithParam { + fn into(self) -> ::prisma_client_rust::Selection { + match self { + Self::Universe(args) => { + let mut selections = < super :: universe :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; + selections.extend( + args + .with_params + .into_iter() + .map(Into::<::prisma_client_rust::Selection>::into), + ); + ::prisma_client_rust::Selection::new( + universe::NAME, + None, + [], + selections, + ) + } + Self::From(args) => { + let mut selections = < super :: star_system :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; + selections.extend( + args + .with_params + .into_iter() + .map(Into::<::prisma_client_rust::Selection>::into), + ); + ::prisma_client_rust::Selection::new(from::NAME, None, [], selections) + } + Self::To(args) => { + let mut selections = < super :: star_system :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; + selections.extend( + args + .with_params + .into_iter() + .map(Into::<::prisma_client_rust::Selection>::into), + ); + ::prisma_client_rust::Selection::new(to::NAME, None, [], selections) + } + } + } + } + #[derive(Clone)] + pub enum SetParam { + SetUniverseId(i32), + IncrementUniverseId(i32), + DecrementUniverseId(i32), + MultiplyUniverseId(i32), + DivideUniverseId(i32), + ConnectUniverse(super::universe::UniqueWhereParam), + SetFromSystemId(i32), + IncrementFromSystemId(i32), + DecrementFromSystemId(i32), + MultiplyFromSystemId(i32), + DivideFromSystemId(i32), + ConnectFrom(super::star_system::UniqueWhereParam), + SetToSystemId(i32), + IncrementToSystemId(i32), + DecrementToSystemId(i32), + MultiplyToSystemId(i32), + DivideToSystemId(i32), + ConnectTo(super::star_system::UniqueWhereParam), + } + impl From for (String, ::prisma_client_rust::PrismaValue) { + fn from(param: SetParam) -> Self { + match param { + SetParam::SetUniverseId(value) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + ), + SetParam::IncrementUniverseId(value) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "increment".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::DecrementUniverseId(value) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "decrement".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::MultiplyUniverseId(value) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "multiply".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::DivideUniverseId(value) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "divide".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::ConnectUniverse(where_param) => ( + universe::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "connect".to_string(), + ::prisma_client_rust::PrismaValue::Object( + [where_param] + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + SetParam::SetFromSystemId(value) => ( + from_system_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + ), + SetParam::IncrementFromSystemId(value) => ( + from_system_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "increment".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::DecrementFromSystemId(value) => ( + from_system_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "decrement".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::MultiplyFromSystemId(value) => ( + from_system_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "multiply".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::DivideFromSystemId(value) => ( + from_system_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "divide".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::ConnectFrom(where_param) => ( + from::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "connect".to_string(), + ::prisma_client_rust::PrismaValue::Object( + [where_param] + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + SetParam::SetToSystemId(value) => ( + to_system_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + ), + SetParam::IncrementToSystemId(value) => ( + to_system_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "increment".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::DecrementToSystemId(value) => ( + to_system_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "decrement".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::MultiplyToSystemId(value) => ( + to_system_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "multiply".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::DivideToSystemId(value) => ( + to_system_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "divide".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::ConnectTo(where_param) => ( + to::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "connect".to_string(), + ::prisma_client_rust::PrismaValue::Object( + [where_param] + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + } + } + } + #[derive(Clone)] + pub enum UncheckedSetParam { + UniverseId(i32), + FromSystemId(i32), + ToSystemId(i32), + } + impl From for SetParam { + fn from(param: UncheckedSetParam) -> Self { + match param { + UncheckedSetParam::UniverseId(value) => Self::SetUniverseId(value), + UncheckedSetParam::FromSystemId(value) => Self::SetFromSystemId(value), + UncheckedSetParam::ToSystemId(value) => Self::SetToSystemId(value), + } + } + } + #[derive(Clone)] + pub enum OrderByParam { + UniverseId(::prisma_client_rust::Direction), + FromSystemId(::prisma_client_rust::Direction), + ToSystemId(::prisma_client_rust::Direction), + } + impl Into<(String, ::prisma_client_rust::PrismaValue)> for OrderByParam { + fn into(self) -> (String, ::prisma_client_rust::PrismaValue) { + match self { + Self::UniverseId(direction) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::FromSystemId(direction) => ( + from_system_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::ToSystemId(direction) => ( + to_system_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + } + } + } + #[derive(Clone)] + pub enum WhereParam { + Not(Vec), + Or(Vec), + And(Vec), + UniverseIdFromSystemIdToSystemIdEquals(i32, i32, i32), + UniverseId(_prisma::read_filters::IntFilter), + UniverseIs(Vec), + UniverseIsNot(Vec), + FromSystemId(_prisma::read_filters::IntFilter), + FromIs(Vec), + FromIsNot(Vec), + ToSystemId(_prisma::read_filters::IntFilter), + ToIs(Vec), + ToIsNot(Vec), + } + impl ::prisma_client_rust::WhereInput for WhereParam { + fn serialize(self) -> ::prisma_client_rust::SerializedWhereInput { + let (name, value) = match self { + Self::Not(value) => ( + "NOT", + ::prisma_client_rust::SerializedWhereValue::Object( + ::prisma_client_rust::merge_fields( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .collect(), + ), + ), + ), + Self::Or(value) => ( + "OR", + ::prisma_client_rust::SerializedWhereValue::List( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .map(|v| vec![v]) + .map(::prisma_client_rust::PrismaValue::Object) + .collect(), + ), + ), + Self::And(value) => ( + "AND", + ::prisma_client_rust::SerializedWhereValue::Object( + ::prisma_client_rust::merge_fields( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .collect(), + ), + ), + ), + Self::UniverseIdFromSystemIdToSystemIdEquals( + universe_id, + from_system_id, + to_system_id, + ) => ( + "universeId_fromSystemId_toSystemId", + ::prisma_client_rust::SerializedWhereValue::Object(vec![ + ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Int(universe_id as i64), + ), + ( + from_system_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Int(from_system_id as i64), + ), + ( + to_system_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Int(to_system_id as i64), + ), + ]), + ), + Self::UniverseId(value) => (universe_id::NAME, value.into()), + Self::UniverseIs(where_params) => ( + universe::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "is".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::UniverseIsNot(where_params) => ( + universe::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "isNot".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::FromSystemId(value) => (from_system_id::NAME, value.into()), + Self::FromIs(where_params) => ( + from::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "is".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::FromIsNot(where_params) => ( + from::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "isNot".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::ToSystemId(value) => (to_system_id::NAME, value.into()), + Self::ToIs(where_params) => ( + to::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "is".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::ToIsNot(where_params) => ( + to::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "isNot".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + }; + ::prisma_client_rust::SerializedWhereInput::new(name, value.into()) + } + } + #[derive(Clone)] + pub enum UniqueWhereParam { + UniverseIdFromSystemIdToSystemIdEquals(i32, i32, i32), + } + impl From for WhereParam { + fn from(value: UniqueWhereParam) -> Self { + match value { + UniqueWhereParam::UniverseIdFromSystemIdToSystemIdEquals( + universe_id, + from_system_id, + to_system_id, + ) => Self::UniverseIdFromSystemIdToSystemIdEquals( + universe_id, + from_system_id, + to_system_id, + ), + } + } + } + impl From<::prisma_client_rust::Operator> for WhereParam { + fn from(op: ::prisma_client_rust::Operator) -> Self { + match op { + ::prisma_client_rust::Operator::Not(value) => Self::Not(value), + ::prisma_client_rust::Operator::And(value) => Self::And(value), + ::prisma_client_rust::Operator::Or(value) => Self::Or(value), + } + } + } + #[derive(Clone)] + pub struct Types; + impl ::prisma_client_rust::ModelTypes for Types { + type Data = Data; + type Where = WhereParam; + type UncheckedSet = UncheckedSetParam; + type Set = SetParam; + type With = WithParam; + type OrderBy = OrderByParam; + type Cursor = UniqueWhereParam; + const MODEL: &'static str = NAME; + fn scalar_selections() -> Vec<::prisma_client_rust::Selection> { + vec![ + ::prisma_client_rust::sel(universe_id::NAME), + ::prisma_client_rust::sel(from_system_id::NAME), + ::prisma_client_rust::sel(to_system_id::NAME), + ] + } + } + pub type UniqueArgs = ::prisma_client_rust::UniqueArgs; + pub type ManyArgs = ::prisma_client_rust::ManyArgs; + pub type Count<'a> = ::prisma_client_rust::Count<'a, Types>; + pub type Create<'a> = ::prisma_client_rust::Create<'a, Types>; + pub type CreateMany<'a> = ::prisma_client_rust::CreateMany<'a, Types>; + pub type FindUnique<'a> = ::prisma_client_rust::FindUnique<'a, Types>; + pub type FindMany<'a> = ::prisma_client_rust::FindMany<'a, Types>; + pub type FindFirst<'a> = ::prisma_client_rust::FindFirst<'a, Types>; + pub type Update<'a> = ::prisma_client_rust::Update<'a, Types>; + pub type UpdateMany<'a> = ::prisma_client_rust::UpdateMany<'a, Types>; + pub type Upsert<'a> = ::prisma_client_rust::Upsert<'a, Types>; + pub type Delete<'a> = ::prisma_client_rust::Delete<'a, Types>; + pub type DeleteMany<'a> = ::prisma_client_rust::DeleteMany<'a, Types>; + #[derive(Clone)] + pub struct Actions<'a> { + pub client: &'a ::prisma_client_rust::PrismaClientInternals, + } + impl<'a> Actions<'a> { + pub fn find_unique(self, _where: UniqueWhereParam) -> FindUnique<'a> { + FindUnique::new(self.client, _where.into()) + } + pub fn find_first(self, _where: Vec) -> FindFirst<'a> { + FindFirst::new(self.client, _where) + } + pub fn find_many(self, _where: Vec) -> FindMany<'a> { + FindMany::new(self.client, _where) + } + pub fn create( + self, + universe: super::universe::UniqueWhereParam, + from: super::star_system::UniqueWhereParam, + to: super::star_system::UniqueWhereParam, + mut _params: Vec, + ) -> Create<'a> { + _params.extend([ + universe::connect(universe), + from::connect(from), + to::connect(to), + ]); + Create::new(self.client, _params) + } + pub fn create_unchecked( + self, + universe_id: i32, + from_system_id: i32, + to_system_id: i32, + mut _params: Vec, + ) -> Create<'a> { + _params.extend([ + universe_id::set(universe_id), + from_system_id::set(from_system_id), + to_system_id::set(to_system_id), + ]); + Create::new(self.client, _params.into_iter().map(Into::into).collect()) + } + pub fn create_many( + self, + data: Vec<(i32, i32, i32, Vec)>, + ) -> CreateMany<'a> { + let data = data + .into_iter() + .map(|(universe_id, from_system_id, to_system_id, mut _params)| { + _params.extend([ + universe_id::set(universe_id), + from_system_id::set(from_system_id), + to_system_id::set(to_system_id), + ]); + _params + }) + .collect(); + CreateMany::new(self.client, data) + } + pub fn update( + self, + _where: UniqueWhereParam, + _params: Vec, + ) -> Update<'a> { + Update::new(self.client, _where.into(), _params, vec![]) + } + pub fn update_unchecked( + self, + _where: UniqueWhereParam, + _params: Vec, + ) -> Update<'a> { + Update::new( + self.client, + _where.into(), + _params.into_iter().map(Into::into).collect(), + vec![], + ) + } + pub fn update_many( + self, + _where: Vec, + _params: Vec, + ) -> UpdateMany<'a> { + UpdateMany::new(self.client, _where, _params) + } + pub fn upsert( + self, + _where: UniqueWhereParam, + (universe, from, to, mut _params): ( + super::universe::UniqueWhereParam, + super::star_system::UniqueWhereParam, + super::star_system::UniqueWhereParam, + Vec, + ), + _update: Vec, + ) -> Upsert<'a> { + _params.extend([ + universe::connect(universe), + from::connect(from), + to::connect(to), + ]); + Upsert::new(self.client, _where.into(), _params, _update) + } + pub fn delete(self, _where: UniqueWhereParam) -> Delete<'a> { + Delete::new(self.client, _where.into(), vec![]) + } + pub fn delete_many(self, _where: Vec) -> DeleteMany<'a> { + DeleteMany::new(self.client, _where) + } + pub fn count(self, _where: Vec) -> Count<'a> { + Count::new(self.client, _where) + } + pub fn find_raw( + self, + ) -> ::prisma_client_rust::FindRaw<'a, Types, T> { + ::prisma_client_rust::FindRaw::new(self.client) + } + pub fn aggregate_raw( + self, + ) -> ::prisma_client_rust::AggregateRaw<'a, Types, T> { + ::prisma_client_rust::AggregateRaw::new(self.client) + } + } +} +pub mod starbase { + use super::_prisma::*; + use super::*; + pub const NAME: &str = "Starbase"; + pub mod id { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "id"; + pub struct Set(pub i32); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetId(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::Id(v) + } + } + pub fn set>(value: i32) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::Id(direction) + } + pub fn equals(value: i32) -> WhereParam { + WhereParam::Id(_prisma::read_filters::IntFilter::Equals(value)) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::IntFilter, + Id, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: i32) -> Lt; + fn lte(_: i32) -> Lte; + fn gt(_: i32) -> Gt; + fn gte(_: i32) -> Gte; + fn not(_: i32) -> Not; + } + ); + pub fn increment(value: i32) -> SetParam { + SetParam::IncrementId(value) + } + pub fn decrement(value: i32) -> SetParam { + SetParam::DecrementId(value) + } + pub fn multiply(value: i32) -> SetParam { + SetParam::MultiplyId(value) + } + pub fn divide(value: i32) -> SetParam { + SetParam::DivideId(value) + } + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Id(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Id(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod universe_id { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "universeId"; + pub struct Set(pub i32); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetUniverseId(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::UniverseId(v) + } + } + pub fn set>(value: i32) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::UniverseId(direction) + } + pub fn equals(value: i32) -> WhereParam { + WhereParam::UniverseId(_prisma::read_filters::IntFilter::Equals(value)) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::IntFilter, + UniverseId, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: i32) -> Lt; + fn lte(_: i32) -> Lte; + fn gt(_: i32) -> Gt; + fn gte(_: i32) -> Gte; + fn not(_: i32) -> Not; + } + ); + pub fn increment(value: i32) -> SetParam { + SetParam::IncrementUniverseId(value) + } + pub fn decrement(value: i32) -> SetParam { + SetParam::DecrementUniverseId(value) + } + pub fn multiply(value: i32) -> SetParam { + SetParam::MultiplyUniverseId(value) + } + pub fn divide(value: i32) -> SetParam { + SetParam::DivideUniverseId(value) + } + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::UniverseId(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::UniverseId(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod universe { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "universe"; + pub struct Fetch(pub universe::UniqueArgs); + impl Fetch { + pub fn with(mut self, params: impl Into) -> Self { + self.0 = self.0.with(params.into()); + self + } + } + impl From for WithParam { + fn from(Fetch(v): Fetch) -> Self { + WithParam::Universe(v) + } + } + pub fn fetch() -> Fetch { + Fetch(universe::UniqueArgs::new()) + } + pub struct Connect(universe::UniqueWhereParam); + impl From for SetParam { + fn from(Connect(v): Connect) -> Self { + Self::ConnectUniverse(v) + } + } + pub fn connect>(value: universe::UniqueWhereParam) -> T { + Connect(value).into() + } + pub fn is(value: Vec) -> WhereParam { + WhereParam::UniverseIs(value) + } + pub fn is_not(value: Vec) -> WhereParam { + WhereParam::UniverseIsNot(value) + } + pub enum Include { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Universe(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = < universe :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < universe :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; + ::prisma_client_rust::Selection::new("universe", None, [], selections) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include(nested_selections: Vec) -> Self { + Self::Include(nested_selections) + } + } + pub enum Select { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Universe(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < universe :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; + ::prisma_client_rust::Selection::new("universe", None, [], selections) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include(nested_selections: Vec) -> Self { + Self::Include(nested_selections) + } + } + } + pub mod star_system_id { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "starSystemId"; + pub struct Set(pub i32); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetStarSystemId(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::StarSystemId(v) + } + } + pub fn set>(value: i32) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::StarSystemId(direction) + } + pub fn equals(value: i32) -> WhereParam { + WhereParam::StarSystemId(_prisma::read_filters::IntFilter::Equals(value)) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::IntFilter, + StarSystemId, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: i32) -> Lt; + fn lte(_: i32) -> Lte; + fn gt(_: i32) -> Gt; + fn gte(_: i32) -> Gte; + fn not(_: i32) -> Not; + } + ); + pub fn increment(value: i32) -> SetParam { + SetParam::IncrementStarSystemId(value) + } + pub fn decrement(value: i32) -> SetParam { + SetParam::DecrementStarSystemId(value) + } + pub fn multiply(value: i32) -> SetParam { + SetParam::MultiplyStarSystemId(value) + } + pub fn divide(value: i32) -> SetParam { + SetParam::DivideStarSystemId(value) + } + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::StarSystemId(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::StarSystemId(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod star_system { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "starSystem"; + pub struct Fetch(pub star_system::UniqueArgs); + impl Fetch { + pub fn with(mut self, params: impl Into) -> Self { + self.0 = self.0.with(params.into()); + self + } + } + impl From for WithParam { + fn from(Fetch(v): Fetch) -> Self { + WithParam::StarSystem(v) + } + } + pub fn fetch() -> Fetch { + Fetch(star_system::UniqueArgs::new()) + } + pub struct Connect(star_system::UniqueWhereParam); + impl From for SetParam { + fn from(Connect(v): Connect) -> Self { + Self::ConnectStarSystem(v) + } + } + pub fn connect>( + value: star_system::UniqueWhereParam, + ) -> T { + Connect(value).into() + } + pub fn is(value: Vec) -> WhereParam { + WhereParam::StarSystemIs(value) + } + pub fn is_not(value: Vec) -> WhereParam { + WhereParam::StarSystemIsNot(value) + } + pub enum Include { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::StarSystem(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = < star_system :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < star_system :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; + ::prisma_client_rust::Selection::new("starSystem", None, [], selections) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include( + nested_selections: Vec, + ) -> Self { + Self::Include(nested_selections) + } + } + pub enum Select { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::StarSystem(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < star_system :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; + ::prisma_client_rust::Selection::new("starSystem", None, [], selections) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include( + nested_selections: Vec, + ) -> Self { + Self::Include(nested_selections) + } + } + } + pub fn universe_id_star_system_id>( + universe_id: i32, + star_system_id: i32, + ) -> T { + UniqueWhereParam::UniverseIdStarSystemIdEquals(universe_id, star_system_id) + .into() + } + pub fn universe_id_id>( + universe_id: i32, + id: i32, + ) -> T { + UniqueWhereParam::UniverseIdIdEquals(universe_id, id).into() + } + pub fn create( + universe: super::universe::UniqueWhereParam, + star_system: super::star_system::UniqueWhereParam, + _params: Vec, + ) -> ( + super::universe::UniqueWhereParam, + super::star_system::UniqueWhereParam, + Vec, + ) { + (universe, star_system, _params) + } + pub fn create_unchecked( + universe_id: i32, + star_system_id: i32, + _params: Vec, + ) -> (i32, i32, Vec) { + (universe_id, star_system_id, _params) + } + #[macro_export] + macro_rules ! _select_starbase { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: starbase :: select ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: starbase :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: starbase :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: starbase :: select ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: starbase :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: starbase :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { id , universe_id , universe , star_system_id , star_system } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } const SPECTA_TYPE_NAME : & 'static str = prisma_client_rust :: macros :: to_pascal_case ! ($ ($ module_name) ?) ; crate :: prisma :: starbase :: select ! (@ specta_data_struct ; pub struct Data { $ (# [specta (rename_from_path = crate :: prisma :: starbase :: $ field :: NAME)] pub $ field : crate :: prisma :: starbase :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } ; $ ($ module_name) ?) ; impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) +] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: starbase :: $ field :: NAME , & self . $ field) ? ;) * state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: starbase :: $ field :: NAME) , + ,] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: starbase :: $ field :: NAME => Ok (Field :: $ field)) , * , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * while let Some (key) = map . next_key () ? { match key { $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: starbase :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: starbase :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "universeId" , "universe" , "starSystemId" , "starSystem"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: starbase :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { i32 } ; (@ field_type ; universe_id) => { i32 } ; (@ field_type ; universe : $ selection_mode : ident { $ ($ selections : tt) + }) => { universe :: Data } ; (@ field_type ; universe) => { crate :: prisma :: universe :: Data } ; (@ field_type ; star_system_id) => { i32 } ; (@ field_type ; star_system : $ selection_mode : ident { $ ($ selections : tt) + }) => { star_system :: Data } ; (@ field_type ; star_system) => { crate :: prisma :: star_system :: Data } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Starbase" , available relations are "id, universe_id, universe, star_system_id, star_system")) } ; (@ field_module ; universe : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: universe :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; star_system : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: star_system :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: starbase :: SelectParam > :: into (crate :: prisma :: starbase :: id :: Select) } ; (@ selection_field_to_selection_param ; universe_id) => { Into :: < crate :: prisma :: starbase :: SelectParam > :: into (crate :: prisma :: starbase :: universe_id :: Select) } ; (@ selection_field_to_selection_param ; universe $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: starbase :: SelectParam > :: into (crate :: prisma :: starbase :: universe :: Select :: $ selection_mode (crate :: prisma :: universe :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; universe $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: starbase :: SelectParam > :: into (crate :: prisma :: starbase :: universe :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; star_system_id) => { Into :: < crate :: prisma :: starbase :: SelectParam > :: into (crate :: prisma :: starbase :: star_system_id :: Select) } ; (@ selection_field_to_selection_param ; star_system $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: starbase :: SelectParam > :: into (crate :: prisma :: starbase :: star_system :: Select :: $ selection_mode (crate :: prisma :: star_system :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; star_system $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: starbase :: SelectParam > :: into (crate :: prisma :: starbase :: star_system :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: starbase :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; universe_id) => { "universeId" } ; (@ field_serde_name ; universe) => { "universe" } ; (@ field_serde_name ; star_system_id) => { "starSystemId" } ; (@ field_serde_name ; star_system) => { "starSystem" } ; (@ specta_data_struct ; $ struct : item ;) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] # [specta (inline)] $ struct } ; (@ specta_data_struct ; $ struct : item ; $ name : ident) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] $ struct } ; } + pub use _select_starbase as select; + pub enum SelectParam { + Id(id::Select), + UniverseId(universe_id::Select), + Universe(universe::Select), + StarSystemId(star_system_id::Select), + StarSystem(star_system::Select), + } + impl SelectParam { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + match self { + Self::Id(data) => data.to_selection(), + Self::UniverseId(data) => data.to_selection(), + Self::Universe(data) => data.to_selection(), + Self::StarSystemId(data) => data.to_selection(), + Self::StarSystem(data) => data.to_selection(), + } + } + } + #[macro_export] + macro_rules ! _include_starbase { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: starbase :: include ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: starbase :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: starbase :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: starbase :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: starbase :: include ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: starbase :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: starbase :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: starbase :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { universe , star_system } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } const SPECTA_TYPE_NAME : & 'static str = prisma_client_rust :: macros :: to_pascal_case ! ($ ($ module_name) ?) ; crate :: prisma :: starbase :: include ! (@ specta_data_struct ; pub struct Data { # [specta (rename_from_path = crate :: prisma :: starbase :: id :: NAME)] pub id : i32 , # [specta (rename_from_path = crate :: prisma :: starbase :: universe_id :: NAME)] pub universe_id : i32 , # [specta (rename_from_path = crate :: prisma :: starbase :: star_system_id :: NAME)] pub star_system_id : i32 , $ (# [specta (rename_from_path = crate :: prisma :: starbase :: $ field :: NAME)] pub $ field : crate :: prisma :: starbase :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } ; $ ($ module_name) ?) ; impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) + stringify ! (id) , stringify ! (universe_id) , stringify ! (star_system_id)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: starbase :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: starbase :: id :: NAME , & self . id) ? ; state . serialize_field (crate :: prisma :: starbase :: universe_id :: NAME , & self . universe_id) ? ; state . serialize_field (crate :: prisma :: starbase :: star_system_id :: NAME , & self . star_system_id) ? ; state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , id , universe_id , star_system_id } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: starbase :: $ field :: NAME) , + , crate :: prisma :: starbase :: id :: NAME , crate :: prisma :: starbase :: universe_id :: NAME , crate :: prisma :: starbase :: star_system_id :: NAME] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: starbase :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: starbase :: id :: NAME => Ok (Field :: id) , crate :: prisma :: starbase :: universe_id :: NAME => Ok (Field :: universe_id) , crate :: prisma :: starbase :: star_system_id :: NAME => Ok (Field :: star_system_id) , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * let mut id = None ; let mut universe_id = None ; let mut star_system_id = None ; while let Some (key) = map . next_key () ? { match key { Field :: id => { if id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: starbase :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } Field :: universe_id => { if universe_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: starbase :: universe_id :: NAME)) ; } universe_id = Some (map . next_value () ?) ; } Field :: star_system_id => { if star_system_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: starbase :: star_system_id :: NAME)) ; } star_system_id = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: starbase :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: starbase :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: starbase :: id :: NAME)) ? ; let universe_id = universe_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: starbase :: universe_id :: NAME)) ? ; let star_system_id = star_system_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: starbase :: star_system_id :: NAME)) ? ; Ok (Data { id , universe_id , star_system_id , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "universeId" , "universe" , "starSystemId" , "starSystem"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: starbase :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; universe : $ selection_mode : ident { $ ($ selections : tt) + }) => { universe :: Data } ; (@ field_type ; universe) => { crate :: prisma :: universe :: Data } ; (@ field_type ; star_system : $ selection_mode : ident { $ ($ selections : tt) + }) => { star_system :: Data } ; (@ field_type ; star_system) => { crate :: prisma :: star_system :: Data } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Starbase" , available relations are "universe, star_system")) } ; (@ field_module ; universe : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: universe :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; star_system : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: star_system :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; universe $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: starbase :: IncludeParam > :: into (crate :: prisma :: starbase :: universe :: Include :: $ selection_mode (crate :: prisma :: universe :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; universe $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: starbase :: IncludeParam > :: into (crate :: prisma :: starbase :: universe :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; star_system $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: starbase :: IncludeParam > :: into (crate :: prisma :: starbase :: star_system :: Include :: $ selection_mode (crate :: prisma :: star_system :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; star_system $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: starbase :: IncludeParam > :: into (crate :: prisma :: starbase :: star_system :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: starbase :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; universe_id) => { "universeId" } ; (@ field_serde_name ; universe) => { "universe" } ; (@ field_serde_name ; star_system_id) => { "starSystemId" } ; (@ field_serde_name ; star_system) => { "starSystem" } ; (@ specta_data_struct ; $ struct : item ;) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] # [specta (inline)] $ struct } ; (@ specta_data_struct ; $ struct : item ; $ name : ident) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] $ struct } ; } + pub use _include_starbase as include; + pub enum IncludeParam { + Id(id::Include), + UniverseId(universe_id::Include), + Universe(universe::Include), + StarSystemId(star_system_id::Include), + StarSystem(star_system::Include), + } + impl IncludeParam { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + match self { + Self::Id(data) => data.to_selection(), + Self::UniverseId(data) => data.to_selection(), + Self::Universe(data) => data.to_selection(), + Self::StarSystemId(data) => data.to_selection(), + Self::StarSystem(data) => data.to_selection(), + } + } + } + #[macro_export] + macro_rules ! _partial_unchecked_starbase { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: starbase struct $ struct_name { # [serde (rename = "id")] pub id : i32 , # [serde (rename = "universeId")] pub universe_id : i32 , # [serde (rename = "starSystemId")] pub star_system_id : i32 } [$ ($ scalar_field) , +] } } ; } + pub use _partial_unchecked_starbase as partial_unchecked; + #[derive( + Debug, + Clone, + :: serde :: Serialize, + :: serde :: Deserialize, + :: prisma_client_rust :: specta :: Type, + )] + #[specta(rename = "Starbase", crate = "prisma_client_rust::specta")] + pub struct Data { + #[serde(rename = "id")] + pub id: i32, + #[serde(rename = "universeId")] + pub universe_id: i32, + #[serde(rename = "universe")] + #[specta(skip)] + pub universe: Option>, + #[serde(rename = "starSystemId")] + pub star_system_id: i32, + #[serde(rename = "starSystem")] + #[specta(skip)] + pub star_system: Option>, + } + impl Data { + pub fn universe( + &self, + ) -> Result< + &super::universe::Data, + ::prisma_client_rust::RelationNotFetchedError, + > { + self + .universe + .as_ref() + .ok_or(::prisma_client_rust::RelationNotFetchedError::new( + stringify!(universe), + )) + .map(|v| v.as_ref()) + } + pub fn star_system( + &self, + ) -> Result< + &super::star_system::Data, + ::prisma_client_rust::RelationNotFetchedError, + > { + self + .star_system + .as_ref() + .ok_or(::prisma_client_rust::RelationNotFetchedError::new( + stringify!(star_system), + )) + .map(|v| v.as_ref()) + } + } + #[derive(Clone)] + pub enum WithParam { + Universe(super::universe::UniqueArgs), + StarSystem(super::star_system::UniqueArgs), + } + impl Into<::prisma_client_rust::Selection> for WithParam { + fn into(self) -> ::prisma_client_rust::Selection { + match self { + Self::Universe(args) => { + let mut selections = < super :: universe :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; + selections.extend( + args + .with_params + .into_iter() + .map(Into::<::prisma_client_rust::Selection>::into), + ); + ::prisma_client_rust::Selection::new( + universe::NAME, + None, + [], + selections, + ) + } + Self::StarSystem(args) => { + let mut selections = < super :: star_system :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; + selections.extend( + args + .with_params + .into_iter() + .map(Into::<::prisma_client_rust::Selection>::into), + ); + ::prisma_client_rust::Selection::new( + star_system::NAME, + None, + [], + selections, + ) + } + } + } + } + #[derive(Clone)] + pub enum SetParam { + SetId(i32), + IncrementId(i32), + DecrementId(i32), + MultiplyId(i32), + DivideId(i32), + SetUniverseId(i32), + IncrementUniverseId(i32), + DecrementUniverseId(i32), + MultiplyUniverseId(i32), + DivideUniverseId(i32), + ConnectUniverse(super::universe::UniqueWhereParam), + SetStarSystemId(i32), + IncrementStarSystemId(i32), + DecrementStarSystemId(i32), + MultiplyStarSystemId(i32), + DivideStarSystemId(i32), + ConnectStarSystem(super::star_system::UniqueWhereParam), + } + impl From for (String, ::prisma_client_rust::PrismaValue) { + fn from(param: SetParam) -> Self { + match param { + SetParam::SetId(value) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + ), + SetParam::IncrementId(value) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "increment".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::DecrementId(value) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "decrement".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::MultiplyId(value) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "multiply".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::DivideId(value) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "divide".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::SetUniverseId(value) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + ), + SetParam::IncrementUniverseId(value) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "increment".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::DecrementUniverseId(value) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "decrement".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::MultiplyUniverseId(value) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "multiply".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::DivideUniverseId(value) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "divide".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::ConnectUniverse(where_param) => ( + universe::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "connect".to_string(), + ::prisma_client_rust::PrismaValue::Object( + [where_param] + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + SetParam::SetStarSystemId(value) => ( + star_system_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + ), + SetParam::IncrementStarSystemId(value) => ( + star_system_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "increment".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::DecrementStarSystemId(value) => ( + star_system_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "decrement".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::MultiplyStarSystemId(value) => ( + star_system_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "multiply".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::DivideStarSystemId(value) => ( + star_system_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "divide".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::ConnectStarSystem(where_param) => ( + star_system::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "connect".to_string(), + ::prisma_client_rust::PrismaValue::Object( + [where_param] + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + } + } + } + #[derive(Clone)] + pub enum UncheckedSetParam { + Id(i32), + UniverseId(i32), + StarSystemId(i32), + } + impl From for SetParam { + fn from(param: UncheckedSetParam) -> Self { + match param { + UncheckedSetParam::Id(value) => Self::SetId(value), + UncheckedSetParam::UniverseId(value) => Self::SetUniverseId(value), + UncheckedSetParam::StarSystemId(value) => Self::SetStarSystemId(value), + } + } + } + #[derive(Clone)] + pub enum OrderByParam { + Id(::prisma_client_rust::Direction), + UniverseId(::prisma_client_rust::Direction), + StarSystemId(::prisma_client_rust::Direction), + } + impl Into<(String, ::prisma_client_rust::PrismaValue)> for OrderByParam { + fn into(self) -> (String, ::prisma_client_rust::PrismaValue) { + match self { + Self::Id(direction) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::UniverseId(direction) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::StarSystemId(direction) => ( + star_system_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + } + } + } + #[derive(Clone)] + pub enum WhereParam { + Not(Vec), + Or(Vec), + And(Vec), + UniverseIdStarSystemIdEquals(i32, i32), + UniverseIdIdEquals(i32, i32), + Id(_prisma::read_filters::IntFilter), + UniverseId(_prisma::read_filters::IntFilter), + UniverseIs(Vec), + UniverseIsNot(Vec), + StarSystemId(_prisma::read_filters::IntFilter), + StarSystemIs(Vec), + StarSystemIsNot(Vec), + } + impl ::prisma_client_rust::WhereInput for WhereParam { + fn serialize(self) -> ::prisma_client_rust::SerializedWhereInput { + let (name, value) = match self { + Self::Not(value) => ( + "NOT", + ::prisma_client_rust::SerializedWhereValue::Object( + ::prisma_client_rust::merge_fields( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .collect(), + ), + ), + ), + Self::Or(value) => ( + "OR", + ::prisma_client_rust::SerializedWhereValue::List( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .map(|v| vec![v]) + .map(::prisma_client_rust::PrismaValue::Object) + .collect(), + ), + ), + Self::And(value) => ( + "AND", + ::prisma_client_rust::SerializedWhereValue::Object( + ::prisma_client_rust::merge_fields( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .collect(), + ), + ), + ), + Self::UniverseIdStarSystemIdEquals(universe_id, star_system_id) => ( + "universeId_starSystemId", + ::prisma_client_rust::SerializedWhereValue::Object(vec![ + ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Int(universe_id as i64), + ), + ( + star_system_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Int(star_system_id as i64), + ), + ]), + ), + Self::UniverseIdIdEquals(universe_id, id) => ( + "universeId_id", + ::prisma_client_rust::SerializedWhereValue::Object(vec![ + ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Int(universe_id as i64), + ), + ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Int(id as i64), + ), + ]), + ), + Self::Id(value) => (id::NAME, value.into()), + Self::UniverseId(value) => (universe_id::NAME, value.into()), + Self::UniverseIs(where_params) => ( + universe::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "is".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::UniverseIsNot(where_params) => ( + universe::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "isNot".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::StarSystemId(value) => (star_system_id::NAME, value.into()), + Self::StarSystemIs(where_params) => ( + star_system::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "is".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::StarSystemIsNot(where_params) => ( + star_system::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "isNot".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + }; + ::prisma_client_rust::SerializedWhereInput::new(name, value.into()) + } + } + #[derive(Clone)] + pub enum UniqueWhereParam { + UniverseIdStarSystemIdEquals(i32, i32), + UniverseIdIdEquals(i32, i32), + } + impl From for WhereParam { + fn from(value: UniqueWhereParam) -> Self { + match value { + UniqueWhereParam::UniverseIdStarSystemIdEquals( + universe_id, + star_system_id, + ) => Self::UniverseIdStarSystemIdEquals(universe_id, star_system_id), + UniqueWhereParam::UniverseIdIdEquals(universe_id, id) => { + Self::UniverseIdIdEquals(universe_id, id) + } + } + } + } + impl From<::prisma_client_rust::Operator> for WhereParam { + fn from(op: ::prisma_client_rust::Operator) -> Self { + match op { + ::prisma_client_rust::Operator::Not(value) => Self::Not(value), + ::prisma_client_rust::Operator::And(value) => Self::And(value), + ::prisma_client_rust::Operator::Or(value) => Self::Or(value), + } + } + } + #[derive(Clone)] + pub struct Types; + impl ::prisma_client_rust::ModelTypes for Types { + type Data = Data; + type Where = WhereParam; + type UncheckedSet = UncheckedSetParam; + type Set = SetParam; + type With = WithParam; + type OrderBy = OrderByParam; + type Cursor = UniqueWhereParam; + const MODEL: &'static str = NAME; + fn scalar_selections() -> Vec<::prisma_client_rust::Selection> { + vec![ + ::prisma_client_rust::sel(id::NAME), + ::prisma_client_rust::sel(universe_id::NAME), + ::prisma_client_rust::sel(star_system_id::NAME), + ] + } + } + pub type UniqueArgs = ::prisma_client_rust::UniqueArgs; + pub type ManyArgs = ::prisma_client_rust::ManyArgs; + pub type Count<'a> = ::prisma_client_rust::Count<'a, Types>; + pub type Create<'a> = ::prisma_client_rust::Create<'a, Types>; + pub type CreateMany<'a> = ::prisma_client_rust::CreateMany<'a, Types>; + pub type FindUnique<'a> = ::prisma_client_rust::FindUnique<'a, Types>; + pub type FindMany<'a> = ::prisma_client_rust::FindMany<'a, Types>; + pub type FindFirst<'a> = ::prisma_client_rust::FindFirst<'a, Types>; + pub type Update<'a> = ::prisma_client_rust::Update<'a, Types>; + pub type UpdateMany<'a> = ::prisma_client_rust::UpdateMany<'a, Types>; + pub type Upsert<'a> = ::prisma_client_rust::Upsert<'a, Types>; + pub type Delete<'a> = ::prisma_client_rust::Delete<'a, Types>; + pub type DeleteMany<'a> = ::prisma_client_rust::DeleteMany<'a, Types>; + #[derive(Clone)] + pub struct Actions<'a> { + pub client: &'a ::prisma_client_rust::PrismaClientInternals, + } + impl<'a> Actions<'a> { + pub fn find_unique(self, _where: UniqueWhereParam) -> FindUnique<'a> { + FindUnique::new(self.client, _where.into()) + } + pub fn find_first(self, _where: Vec) -> FindFirst<'a> { + FindFirst::new(self.client, _where) + } + pub fn find_many(self, _where: Vec) -> FindMany<'a> { + FindMany::new(self.client, _where) + } + pub fn create( + self, + universe: super::universe::UniqueWhereParam, + star_system: super::star_system::UniqueWhereParam, + mut _params: Vec, + ) -> Create<'a> { + _params.extend([ + universe::connect(universe), + star_system::connect(star_system), + ]); + Create::new(self.client, _params) + } + pub fn create_unchecked( + self, + universe_id: i32, + star_system_id: i32, + mut _params: Vec, + ) -> Create<'a> { + _params.extend([ + universe_id::set(universe_id), + star_system_id::set(star_system_id), + ]); + Create::new(self.client, _params.into_iter().map(Into::into).collect()) + } + pub fn create_many( + self, + data: Vec<(i32, i32, Vec)>, + ) -> CreateMany<'a> { + let data = data + .into_iter() + .map(|(universe_id, star_system_id, mut _params)| { + _params.extend([ + universe_id::set(universe_id), + star_system_id::set(star_system_id), + ]); + _params + }) + .collect(); + CreateMany::new(self.client, data) + } + pub fn update( + self, + _where: UniqueWhereParam, + _params: Vec, + ) -> Update<'a> { + Update::new(self.client, _where.into(), _params, vec![]) + } + pub fn update_unchecked( + self, + _where: UniqueWhereParam, + _params: Vec, + ) -> Update<'a> { + Update::new( + self.client, + _where.into(), + _params.into_iter().map(Into::into).collect(), + vec![], + ) + } + pub fn update_many( + self, + _where: Vec, + _params: Vec, + ) -> UpdateMany<'a> { + UpdateMany::new(self.client, _where, _params) + } + pub fn upsert( + self, + _where: UniqueWhereParam, + (universe, star_system, mut _params): ( + super::universe::UniqueWhereParam, + super::star_system::UniqueWhereParam, + Vec, + ), + _update: Vec, + ) -> Upsert<'a> { + _params.extend([ + universe::connect(universe), + star_system::connect(star_system), + ]); + Upsert::new(self.client, _where.into(), _params, _update) + } + pub fn delete(self, _where: UniqueWhereParam) -> Delete<'a> { + Delete::new(self.client, _where.into(), vec![]) + } + pub fn delete_many(self, _where: Vec) -> DeleteMany<'a> { + DeleteMany::new(self.client, _where) + } + pub fn count(self, _where: Vec) -> Count<'a> { + Count::new(self.client, _where) + } + pub fn find_raw( + self, + ) -> ::prisma_client_rust::FindRaw<'a, Types, T> { + ::prisma_client_rust::FindRaw::new(self.client) + } + pub fn aggregate_raw( + self, + ) -> ::prisma_client_rust::AggregateRaw<'a, Types, T> { + ::prisma_client_rust::AggregateRaw::new(self.client) + } + } +} +pub mod planet { + use super::_prisma::*; + use super::*; + pub const NAME: &str = "Planet"; + pub mod id { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "id"; + pub struct Set(pub i32); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetId(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::Id(v) + } + } + pub fn set>(value: i32) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::Id(direction) + } + pub fn equals(value: i32) -> WhereParam { + WhereParam::Id(_prisma::read_filters::IntFilter::Equals(value)) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::IntFilter, + Id, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: i32) -> Lt; + fn lte(_: i32) -> Lte; + fn gt(_: i32) -> Gt; + fn gte(_: i32) -> Gte; + fn not(_: i32) -> Not; + } + ); + pub fn increment(value: i32) -> SetParam { + SetParam::IncrementId(value) + } + pub fn decrement(value: i32) -> SetParam { + SetParam::DecrementId(value) + } + pub fn multiply(value: i32) -> SetParam { + SetParam::MultiplyId(value) + } + pub fn divide(value: i32) -> SetParam { + SetParam::DivideId(value) + } + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Id(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Id(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod universe_id { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "universeId"; + pub struct Set(pub i32); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetUniverseId(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::UniverseId(v) + } + } + pub fn set>(value: i32) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::UniverseId(direction) + } + pub fn equals(value: i32) -> WhereParam { + WhereParam::UniverseId(_prisma::read_filters::IntFilter::Equals(value)) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::IntFilter, + UniverseId, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: i32) -> Lt; + fn lte(_: i32) -> Lte; + fn gt(_: i32) -> Gt; + fn gte(_: i32) -> Gte; + fn not(_: i32) -> Not; + } + ); + pub fn increment(value: i32) -> SetParam { + SetParam::IncrementUniverseId(value) + } + pub fn decrement(value: i32) -> SetParam { + SetParam::DecrementUniverseId(value) + } + pub fn multiply(value: i32) -> SetParam { + SetParam::MultiplyUniverseId(value) + } + pub fn divide(value: i32) -> SetParam { + SetParam::DivideUniverseId(value) + } + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::UniverseId(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::UniverseId(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod universe { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "universe"; + pub struct Fetch(pub universe::UniqueArgs); + impl Fetch { + pub fn with(mut self, params: impl Into) -> Self { + self.0 = self.0.with(params.into()); + self + } + } + impl From for WithParam { + fn from(Fetch(v): Fetch) -> Self { + WithParam::Universe(v) + } + } + pub fn fetch() -> Fetch { + Fetch(universe::UniqueArgs::new()) + } + pub struct Connect(universe::UniqueWhereParam); + impl From for SetParam { + fn from(Connect(v): Connect) -> Self { + Self::ConnectUniverse(v) + } + } + pub fn connect>(value: universe::UniqueWhereParam) -> T { + Connect(value).into() + } + pub fn is(value: Vec) -> WhereParam { + WhereParam::UniverseIs(value) + } + pub fn is_not(value: Vec) -> WhereParam { + WhereParam::UniverseIsNot(value) + } + pub enum Include { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Universe(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = < universe :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < universe :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; + ::prisma_client_rust::Selection::new("universe", None, [], selections) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include(nested_selections: Vec) -> Self { + Self::Include(nested_selections) + } + } + pub enum Select { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Universe(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < universe :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; + ::prisma_client_rust::Selection::new("universe", None, [], selections) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include(nested_selections: Vec) -> Self { + Self::Include(nested_selections) + } + } + } + pub mod buildings { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "buildings"; + pub struct Set(pub ::prisma_client_rust::serde_json::Value); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetBuildings(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::Buildings(v) + } + } + pub fn set>( + value: ::prisma_client_rust::serde_json::Value, + ) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::Buildings(direction) + } + pub fn equals( + value: ::prisma_client_rust::serde_json::Value, + ) -> WhereParam { + WhereParam::Buildings(_prisma::read_filters::JsonFilter::Equals(value)) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::JsonFilter, + Buildings, + { + fn path(_: Vec) -> Path; + fn string_contains(_: String) -> StringContains; + fn string_starts_with(_: String) -> StringStartsWith; + fn string_ends_with(_: String) -> StringEndsWith; + fn array_contains( + _: Option<::prisma_client_rust::serde_json::Value>, + ) -> ArrayContains; + fn array_starts_with( + _: Option<::prisma_client_rust::serde_json::Value>, + ) -> ArrayStartsWith; + fn array_ends_with( + _: Option<::prisma_client_rust::serde_json::Value>, + ) -> ArrayEndsWith; + fn lt(_: ::prisma_client_rust::serde_json::Value) -> Lt; + fn lte(_: ::prisma_client_rust::serde_json::Value) -> Lte; + fn gt(_: ::prisma_client_rust::serde_json::Value) -> Gt; + fn gte(_: ::prisma_client_rust::serde_json::Value) -> Gte; + fn not(_: ::prisma_client_rust::serde_json::Value) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Buildings(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Buildings(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod surrounding_star_system_id { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "surroundingStarSystemId"; + pub struct Set(pub i32); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetSurroundingStarSystemId(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::SurroundingStarSystemId(v) + } + } + pub fn set>(value: i32) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::SurroundingStarSystemId(direction) + } + pub fn equals(value: i32) -> WhereParam { + WhereParam::SurroundingStarSystemId( + _prisma::read_filters::IntFilter::Equals(value), + ) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::IntFilter, + SurroundingStarSystemId, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: i32) -> Lt; + fn lte(_: i32) -> Lte; + fn gt(_: i32) -> Gt; + fn gte(_: i32) -> Gte; + fn not(_: i32) -> Not; + } + ); + pub fn increment(value: i32) -> SetParam { + SetParam::IncrementSurroundingStarSystemId(value) + } + pub fn decrement(value: i32) -> SetParam { + SetParam::DecrementSurroundingStarSystemId(value) + } + pub fn multiply(value: i32) -> SetParam { + SetParam::MultiplySurroundingStarSystemId(value) + } + pub fn divide(value: i32) -> SetParam { + SetParam::DivideSurroundingStarSystemId(value) + } + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::SurroundingStarSystemId(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::SurroundingStarSystemId(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod surrounding_star_system { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "surroundingStarSystem"; + pub struct Fetch(pub star_system::UniqueArgs); + impl Fetch { + pub fn with(mut self, params: impl Into) -> Self { + self.0 = self.0.with(params.into()); + self + } + } + impl From for WithParam { + fn from(Fetch(v): Fetch) -> Self { + WithParam::SurroundingStarSystem(v) + } + } + pub fn fetch() -> Fetch { + Fetch(star_system::UniqueArgs::new()) + } + pub struct Connect(star_system::UniqueWhereParam); + impl From for SetParam { + fn from(Connect(v): Connect) -> Self { + Self::ConnectSurroundingStarSystem(v) + } + } + pub fn connect>( + value: star_system::UniqueWhereParam, + ) -> T { + Connect(value).into() + } + pub fn is(value: Vec) -> WhereParam { + WhereParam::SurroundingStarSystemIs(value) + } + pub fn is_not(value: Vec) -> WhereParam { + WhereParam::SurroundingStarSystemIsNot(value) + } + pub enum Include { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::SurroundingStarSystem(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = < star_system :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < star_system :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; + ::prisma_client_rust::Selection::new( + "surroundingStarSystem", + None, + [], + selections, + ) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include( + nested_selections: Vec, + ) -> Self { + Self::Include(nested_selections) + } + } + pub enum Select { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::SurroundingStarSystem(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < star_system :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; + ::prisma_client_rust::Selection::new( + "surroundingStarSystem", + None, + [], + selections, + ) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include( + nested_selections: Vec, + ) -> Self { + Self::Include(nested_selections) + } + } + } + pub fn universe_id_id>( + universe_id: i32, + id: i32, + ) -> T { + UniqueWhereParam::UniverseIdIdEquals(universe_id, id).into() + } + pub fn create( + universe: super::universe::UniqueWhereParam, + buildings: ::prisma_client_rust::serde_json::Value, + surrounding_star_system: super::star_system::UniqueWhereParam, + _params: Vec, + ) -> ( + super::universe::UniqueWhereParam, + ::prisma_client_rust::serde_json::Value, + super::star_system::UniqueWhereParam, + Vec, + ) { + (universe, buildings, surrounding_star_system, _params) + } + pub fn create_unchecked( + universe_id: i32, + buildings: ::prisma_client_rust::serde_json::Value, + surrounding_star_system_id: i32, + _params: Vec, + ) -> ( + i32, + ::prisma_client_rust::serde_json::Value, + i32, + Vec, + ) { + (universe_id, buildings, surrounding_star_system_id, _params) + } + #[macro_export] + macro_rules ! _select_planet { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: planet :: select ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: planet :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: planet :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: planet :: select ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: planet :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: planet :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { id , universe_id , universe , buildings , surrounding_star_system_id , surrounding_star_system } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } const SPECTA_TYPE_NAME : & 'static str = prisma_client_rust :: macros :: to_pascal_case ! ($ ($ module_name) ?) ; crate :: prisma :: planet :: select ! (@ specta_data_struct ; pub struct Data { $ (# [specta (rename_from_path = crate :: prisma :: planet :: $ field :: NAME)] pub $ field : crate :: prisma :: planet :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } ; $ ($ module_name) ?) ; impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) +] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: planet :: $ field :: NAME , & self . $ field) ? ;) * state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: planet :: $ field :: NAME) , + ,] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: planet :: $ field :: NAME => Ok (Field :: $ field)) , * , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * while let Some (key) = map . next_key () ? { match key { $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: planet :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: planet :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "universeId" , "universe" , "buildings" , "surroundingStarSystemId" , "surroundingStarSystem"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: planet :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { i32 } ; (@ field_type ; universe_id) => { i32 } ; (@ field_type ; universe : $ selection_mode : ident { $ ($ selections : tt) + }) => { universe :: Data } ; (@ field_type ; universe) => { crate :: prisma :: universe :: Data } ; (@ field_type ; buildings) => { :: prisma_client_rust :: serde_json :: Value } ; (@ field_type ; surrounding_star_system_id) => { i32 } ; (@ field_type ; surrounding_star_system : $ selection_mode : ident { $ ($ selections : tt) + }) => { surrounding_star_system :: Data } ; (@ field_type ; surrounding_star_system) => { crate :: prisma :: star_system :: Data } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Planet" , available relations are "id, universe_id, universe, buildings, surrounding_star_system_id, surrounding_star_system")) } ; (@ field_module ; universe : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: universe :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; surrounding_star_system : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: star_system :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: planet :: SelectParam > :: into (crate :: prisma :: planet :: id :: Select) } ; (@ selection_field_to_selection_param ; universe_id) => { Into :: < crate :: prisma :: planet :: SelectParam > :: into (crate :: prisma :: planet :: universe_id :: Select) } ; (@ selection_field_to_selection_param ; universe $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: planet :: SelectParam > :: into (crate :: prisma :: planet :: universe :: Select :: $ selection_mode (crate :: prisma :: universe :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; universe $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: planet :: SelectParam > :: into (crate :: prisma :: planet :: universe :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; buildings) => { Into :: < crate :: prisma :: planet :: SelectParam > :: into (crate :: prisma :: planet :: buildings :: Select) } ; (@ selection_field_to_selection_param ; surrounding_star_system_id) => { Into :: < crate :: prisma :: planet :: SelectParam > :: into (crate :: prisma :: planet :: surrounding_star_system_id :: Select) } ; (@ selection_field_to_selection_param ; surrounding_star_system $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: planet :: SelectParam > :: into (crate :: prisma :: planet :: surrounding_star_system :: Select :: $ selection_mode (crate :: prisma :: star_system :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; surrounding_star_system $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: planet :: SelectParam > :: into (crate :: prisma :: planet :: surrounding_star_system :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: planet :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; universe_id) => { "universeId" } ; (@ field_serde_name ; universe) => { "universe" } ; (@ field_serde_name ; buildings) => { "buildings" } ; (@ field_serde_name ; surrounding_star_system_id) => { "surroundingStarSystemId" } ; (@ field_serde_name ; surrounding_star_system) => { "surroundingStarSystem" } ; (@ specta_data_struct ; $ struct : item ;) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] # [specta (inline)] $ struct } ; (@ specta_data_struct ; $ struct : item ; $ name : ident) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] $ struct } ; } + pub use _select_planet as select; + pub enum SelectParam { + Id(id::Select), + UniverseId(universe_id::Select), + Universe(universe::Select), + Buildings(buildings::Select), + SurroundingStarSystemId(surrounding_star_system_id::Select), + SurroundingStarSystem(surrounding_star_system::Select), + } + impl SelectParam { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + match self { + Self::Id(data) => data.to_selection(), + Self::UniverseId(data) => data.to_selection(), + Self::Universe(data) => data.to_selection(), + Self::Buildings(data) => data.to_selection(), + Self::SurroundingStarSystemId(data) => data.to_selection(), + Self::SurroundingStarSystem(data) => data.to_selection(), + } + } + } + #[macro_export] + macro_rules ! _include_planet { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: planet :: include ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: planet :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: planet :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: planet :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: planet :: include ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: planet :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: planet :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: planet :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { universe , surrounding_star_system } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } const SPECTA_TYPE_NAME : & 'static str = prisma_client_rust :: macros :: to_pascal_case ! ($ ($ module_name) ?) ; crate :: prisma :: planet :: include ! (@ specta_data_struct ; pub struct Data { # [specta (rename_from_path = crate :: prisma :: planet :: id :: NAME)] pub id : i32 , # [specta (rename_from_path = crate :: prisma :: planet :: universe_id :: NAME)] pub universe_id : i32 , # [specta (rename_from_path = crate :: prisma :: planet :: buildings :: NAME)] pub buildings : :: prisma_client_rust :: serde_json :: Value , # [specta (rename_from_path = crate :: prisma :: planet :: surrounding_star_system_id :: NAME)] pub surrounding_star_system_id : i32 , $ (# [specta (rename_from_path = crate :: prisma :: planet :: $ field :: NAME)] pub $ field : crate :: prisma :: planet :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } ; $ ($ module_name) ?) ; impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) + stringify ! (id) , stringify ! (universe_id) , stringify ! (buildings) , stringify ! (surrounding_star_system_id)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: planet :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: planet :: id :: NAME , & self . id) ? ; state . serialize_field (crate :: prisma :: planet :: universe_id :: NAME , & self . universe_id) ? ; state . serialize_field (crate :: prisma :: planet :: buildings :: NAME , & self . buildings) ? ; state . serialize_field (crate :: prisma :: planet :: surrounding_star_system_id :: NAME , & self . surrounding_star_system_id) ? ; state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , id , universe_id , buildings , surrounding_star_system_id } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: planet :: $ field :: NAME) , + , crate :: prisma :: planet :: id :: NAME , crate :: prisma :: planet :: universe_id :: NAME , crate :: prisma :: planet :: buildings :: NAME , crate :: prisma :: planet :: surrounding_star_system_id :: NAME] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: planet :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: planet :: id :: NAME => Ok (Field :: id) , crate :: prisma :: planet :: universe_id :: NAME => Ok (Field :: universe_id) , crate :: prisma :: planet :: buildings :: NAME => Ok (Field :: buildings) , crate :: prisma :: planet :: surrounding_star_system_id :: NAME => Ok (Field :: surrounding_star_system_id) , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * let mut id = None ; let mut universe_id = None ; let mut buildings = None ; let mut surrounding_star_system_id = None ; while let Some (key) = map . next_key () ? { match key { Field :: id => { if id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: planet :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } Field :: universe_id => { if universe_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: planet :: universe_id :: NAME)) ; } universe_id = Some (map . next_value () ?) ; } Field :: buildings => { if buildings . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: planet :: buildings :: NAME)) ; } buildings = Some (map . next_value () ?) ; } Field :: surrounding_star_system_id => { if surrounding_star_system_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: planet :: surrounding_star_system_id :: NAME)) ; } surrounding_star_system_id = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: planet :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: planet :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: planet :: id :: NAME)) ? ; let universe_id = universe_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: planet :: universe_id :: NAME)) ? ; let buildings = buildings . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: planet :: buildings :: NAME)) ? ; let surrounding_star_system_id = surrounding_star_system_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: planet :: surrounding_star_system_id :: NAME)) ? ; Ok (Data { id , universe_id , buildings , surrounding_star_system_id , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "universeId" , "universe" , "buildings" , "surroundingStarSystemId" , "surroundingStarSystem"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: planet :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; universe : $ selection_mode : ident { $ ($ selections : tt) + }) => { universe :: Data } ; (@ field_type ; universe) => { crate :: prisma :: universe :: Data } ; (@ field_type ; surrounding_star_system : $ selection_mode : ident { $ ($ selections : tt) + }) => { surrounding_star_system :: Data } ; (@ field_type ; surrounding_star_system) => { crate :: prisma :: star_system :: Data } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Planet" , available relations are "universe, surrounding_star_system")) } ; (@ field_module ; universe : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: universe :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; surrounding_star_system : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: star_system :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; universe $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: planet :: IncludeParam > :: into (crate :: prisma :: planet :: universe :: Include :: $ selection_mode (crate :: prisma :: universe :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; universe $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: planet :: IncludeParam > :: into (crate :: prisma :: planet :: universe :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; surrounding_star_system $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: planet :: IncludeParam > :: into (crate :: prisma :: planet :: surrounding_star_system :: Include :: $ selection_mode (crate :: prisma :: star_system :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; surrounding_star_system $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: planet :: IncludeParam > :: into (crate :: prisma :: planet :: surrounding_star_system :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: planet :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; universe_id) => { "universeId" } ; (@ field_serde_name ; universe) => { "universe" } ; (@ field_serde_name ; buildings) => { "buildings" } ; (@ field_serde_name ; surrounding_star_system_id) => { "surroundingStarSystemId" } ; (@ field_serde_name ; surrounding_star_system) => { "surroundingStarSystem" } ; (@ specta_data_struct ; $ struct : item ;) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] # [specta (inline)] $ struct } ; (@ specta_data_struct ; $ struct : item ; $ name : ident) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] $ struct } ; } + pub use _include_planet as include; + pub enum IncludeParam { + Id(id::Include), + UniverseId(universe_id::Include), + Universe(universe::Include), + Buildings(buildings::Include), + SurroundingStarSystemId(surrounding_star_system_id::Include), + SurroundingStarSystem(surrounding_star_system::Include), + } + impl IncludeParam { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + match self { + Self::Id(data) => data.to_selection(), + Self::UniverseId(data) => data.to_selection(), + Self::Universe(data) => data.to_selection(), + Self::Buildings(data) => data.to_selection(), + Self::SurroundingStarSystemId(data) => data.to_selection(), + Self::SurroundingStarSystem(data) => data.to_selection(), + } + } + } + #[macro_export] + macro_rules ! _partial_unchecked_planet { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: planet struct $ struct_name { # [serde (rename = "id")] pub id : i32 , # [serde (rename = "universeId")] pub universe_id : i32 , # [serde (rename = "buildings")] pub buildings : :: prisma_client_rust :: serde_json :: Value , # [serde (rename = "surroundingStarSystemId")] pub surrounding_star_system_id : i32 } [$ ($ scalar_field) , +] } } ; } + pub use _partial_unchecked_planet as partial_unchecked; + #[derive( + Debug, + Clone, + :: serde :: Serialize, + :: serde :: Deserialize, + :: prisma_client_rust :: specta :: Type, + )] + #[specta(rename = "Planet", crate = "prisma_client_rust::specta")] + pub struct Data { + #[serde(rename = "id")] + pub id: i32, + #[serde(rename = "universeId")] + pub universe_id: i32, + #[serde(rename = "universe")] + #[specta(skip)] + pub universe: Option>, + #[serde(rename = "buildings")] + pub buildings: ::prisma_client_rust::serde_json::Value, + #[serde(rename = "surroundingStarSystemId")] + pub surrounding_star_system_id: i32, + #[serde(rename = "surroundingStarSystem")] + #[specta(skip)] + pub surrounding_star_system: Option>, + } + impl Data { + pub fn universe( + &self, + ) -> Result< + &super::universe::Data, + ::prisma_client_rust::RelationNotFetchedError, + > { + self + .universe + .as_ref() + .ok_or(::prisma_client_rust::RelationNotFetchedError::new( + stringify!(universe), + )) + .map(|v| v.as_ref()) + } + pub fn surrounding_star_system( + &self, + ) -> Result< + &super::star_system::Data, + ::prisma_client_rust::RelationNotFetchedError, + > { + self + .surrounding_star_system + .as_ref() + .ok_or(::prisma_client_rust::RelationNotFetchedError::new( + stringify!(surrounding_star_system), + )) + .map(|v| v.as_ref()) + } + } + #[derive(Clone)] + pub enum WithParam { + Universe(super::universe::UniqueArgs), + SurroundingStarSystem(super::star_system::UniqueArgs), + } + impl Into<::prisma_client_rust::Selection> for WithParam { + fn into(self) -> ::prisma_client_rust::Selection { + match self { + Self::Universe(args) => { + let mut selections = < super :: universe :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; + selections.extend( + args + .with_params + .into_iter() + .map(Into::<::prisma_client_rust::Selection>::into), + ); + ::prisma_client_rust::Selection::new( + universe::NAME, + None, + [], + selections, + ) + } + Self::SurroundingStarSystem(args) => { + let mut selections = < super :: star_system :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; + selections.extend( + args + .with_params + .into_iter() + .map(Into::<::prisma_client_rust::Selection>::into), + ); + ::prisma_client_rust::Selection::new( + surrounding_star_system::NAME, + None, + [], + selections, + ) + } + } + } + } + #[derive(Clone)] + pub enum SetParam { + SetId(i32), + IncrementId(i32), + DecrementId(i32), + MultiplyId(i32), + DivideId(i32), + SetUniverseId(i32), + IncrementUniverseId(i32), + DecrementUniverseId(i32), + MultiplyUniverseId(i32), + DivideUniverseId(i32), + ConnectUniverse(super::universe::UniqueWhereParam), + SetBuildings(::prisma_client_rust::serde_json::Value), + SetSurroundingStarSystemId(i32), + IncrementSurroundingStarSystemId(i32), + DecrementSurroundingStarSystemId(i32), + MultiplySurroundingStarSystemId(i32), + DivideSurroundingStarSystemId(i32), + ConnectSurroundingStarSystem(super::star_system::UniqueWhereParam), + } + impl From for (String, ::prisma_client_rust::PrismaValue) { + fn from(param: SetParam) -> Self { + match param { + SetParam::SetId(value) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + ), + SetParam::IncrementId(value) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "increment".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::DecrementId(value) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "decrement".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::MultiplyId(value) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "multiply".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::DivideId(value) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "divide".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::SetUniverseId(value) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + ), + SetParam::IncrementUniverseId(value) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "increment".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::DecrementUniverseId(value) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "decrement".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::MultiplyUniverseId(value) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "multiply".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::DivideUniverseId(value) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "divide".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::ConnectUniverse(where_param) => ( + universe::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "connect".to_string(), + ::prisma_client_rust::PrismaValue::Object( + [where_param] + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + SetParam::SetBuildings(value) => ( + buildings::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Json( + ::prisma_client_rust::serde_json::to_string(&value).unwrap(), + ), + ), + SetParam::SetSurroundingStarSystemId(value) => ( + surrounding_star_system_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + ), + SetParam::IncrementSurroundingStarSystemId(value) => ( + surrounding_star_system_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "increment".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::DecrementSurroundingStarSystemId(value) => ( + surrounding_star_system_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "decrement".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::MultiplySurroundingStarSystemId(value) => ( + surrounding_star_system_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "multiply".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::DivideSurroundingStarSystemId(value) => ( + surrounding_star_system_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "divide".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::ConnectSurroundingStarSystem(where_param) => ( + surrounding_star_system::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "connect".to_string(), + ::prisma_client_rust::PrismaValue::Object( + [where_param] + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + } + } + } + #[derive(Clone)] + pub enum UncheckedSetParam { + Id(i32), + UniverseId(i32), + Buildings(::prisma_client_rust::serde_json::Value), + SurroundingStarSystemId(i32), + } + impl From for SetParam { + fn from(param: UncheckedSetParam) -> Self { + match param { + UncheckedSetParam::Id(value) => Self::SetId(value), + UncheckedSetParam::UniverseId(value) => Self::SetUniverseId(value), + UncheckedSetParam::Buildings(value) => Self::SetBuildings(value), + UncheckedSetParam::SurroundingStarSystemId(value) => { + Self::SetSurroundingStarSystemId(value) + } + } + } + } + #[derive(Clone)] + pub enum OrderByParam { + Id(::prisma_client_rust::Direction), + UniverseId(::prisma_client_rust::Direction), + Buildings(::prisma_client_rust::Direction), + SurroundingStarSystemId(::prisma_client_rust::Direction), + } + impl Into<(String, ::prisma_client_rust::PrismaValue)> for OrderByParam { + fn into(self) -> (String, ::prisma_client_rust::PrismaValue) { + match self { + Self::Id(direction) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::UniverseId(direction) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::Buildings(direction) => ( + buildings::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::SurroundingStarSystemId(direction) => ( + surrounding_star_system_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + } + } + } + #[derive(Clone)] + pub enum WhereParam { + Not(Vec), + Or(Vec), + And(Vec), + UniverseIdIdEquals(i32, i32), + Id(_prisma::read_filters::IntFilter), + UniverseId(_prisma::read_filters::IntFilter), + UniverseIs(Vec), + UniverseIsNot(Vec), + Buildings(_prisma::read_filters::JsonFilter), + SurroundingStarSystemId(_prisma::read_filters::IntFilter), + SurroundingStarSystemIs(Vec), + SurroundingStarSystemIsNot(Vec), + } + impl ::prisma_client_rust::WhereInput for WhereParam { + fn serialize(self) -> ::prisma_client_rust::SerializedWhereInput { + let (name, value) = match self { + Self::Not(value) => ( + "NOT", + ::prisma_client_rust::SerializedWhereValue::Object( + ::prisma_client_rust::merge_fields( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .collect(), + ), + ), + ), + Self::Or(value) => ( + "OR", + ::prisma_client_rust::SerializedWhereValue::List( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .map(|v| vec![v]) + .map(::prisma_client_rust::PrismaValue::Object) + .collect(), + ), + ), + Self::And(value) => ( + "AND", + ::prisma_client_rust::SerializedWhereValue::Object( + ::prisma_client_rust::merge_fields( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .collect(), + ), + ), + ), + Self::UniverseIdIdEquals(universe_id, id) => ( + "universeId_id", + ::prisma_client_rust::SerializedWhereValue::Object(vec![ + ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Int(universe_id as i64), + ), + ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Int(id as i64), + ), + ]), + ), + Self::Id(value) => (id::NAME, value.into()), + Self::UniverseId(value) => (universe_id::NAME, value.into()), + Self::UniverseIs(where_params) => ( + universe::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "is".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::UniverseIsNot(where_params) => ( + universe::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "isNot".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::Buildings(value) => (buildings::NAME, value.into()), + Self::SurroundingStarSystemId(value) => { + (surrounding_star_system_id::NAME, value.into()) + } + Self::SurroundingStarSystemIs(where_params) => ( + surrounding_star_system::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "is".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::SurroundingStarSystemIsNot(where_params) => ( + surrounding_star_system::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "isNot".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + }; + ::prisma_client_rust::SerializedWhereInput::new(name, value.into()) + } + } + #[derive(Clone)] + pub enum UniqueWhereParam { + UniverseIdIdEquals(i32, i32), + } + impl From for WhereParam { + fn from(value: UniqueWhereParam) -> Self { + match value { + UniqueWhereParam::UniverseIdIdEquals(universe_id, id) => { + Self::UniverseIdIdEquals(universe_id, id) + } + } + } + } + impl From<::prisma_client_rust::Operator> for WhereParam { + fn from(op: ::prisma_client_rust::Operator) -> Self { + match op { + ::prisma_client_rust::Operator::Not(value) => Self::Not(value), + ::prisma_client_rust::Operator::And(value) => Self::And(value), + ::prisma_client_rust::Operator::Or(value) => Self::Or(value), + } + } + } + #[derive(Clone)] + pub struct Types; + impl ::prisma_client_rust::ModelTypes for Types { + type Data = Data; + type Where = WhereParam; + type UncheckedSet = UncheckedSetParam; + type Set = SetParam; + type With = WithParam; + type OrderBy = OrderByParam; + type Cursor = UniqueWhereParam; + const MODEL: &'static str = NAME; + fn scalar_selections() -> Vec<::prisma_client_rust::Selection> { + vec![ + ::prisma_client_rust::sel(id::NAME), + ::prisma_client_rust::sel(universe_id::NAME), + ::prisma_client_rust::sel(buildings::NAME), + ::prisma_client_rust::sel(surrounding_star_system_id::NAME), + ] + } + } + pub type UniqueArgs = ::prisma_client_rust::UniqueArgs; + pub type ManyArgs = ::prisma_client_rust::ManyArgs; + pub type Count<'a> = ::prisma_client_rust::Count<'a, Types>; + pub type Create<'a> = ::prisma_client_rust::Create<'a, Types>; + pub type CreateMany<'a> = ::prisma_client_rust::CreateMany<'a, Types>; + pub type FindUnique<'a> = ::prisma_client_rust::FindUnique<'a, Types>; + pub type FindMany<'a> = ::prisma_client_rust::FindMany<'a, Types>; + pub type FindFirst<'a> = ::prisma_client_rust::FindFirst<'a, Types>; + pub type Update<'a> = ::prisma_client_rust::Update<'a, Types>; + pub type UpdateMany<'a> = ::prisma_client_rust::UpdateMany<'a, Types>; + pub type Upsert<'a> = ::prisma_client_rust::Upsert<'a, Types>; + pub type Delete<'a> = ::prisma_client_rust::Delete<'a, Types>; + pub type DeleteMany<'a> = ::prisma_client_rust::DeleteMany<'a, Types>; + #[derive(Clone)] + pub struct Actions<'a> { + pub client: &'a ::prisma_client_rust::PrismaClientInternals, + } + impl<'a> Actions<'a> { + pub fn find_unique(self, _where: UniqueWhereParam) -> FindUnique<'a> { + FindUnique::new(self.client, _where.into()) + } + pub fn find_first(self, _where: Vec) -> FindFirst<'a> { + FindFirst::new(self.client, _where) + } + pub fn find_many(self, _where: Vec) -> FindMany<'a> { + FindMany::new(self.client, _where) + } + pub fn create( + self, + universe: super::universe::UniqueWhereParam, + buildings: ::prisma_client_rust::serde_json::Value, + surrounding_star_system: super::star_system::UniqueWhereParam, + mut _params: Vec, + ) -> Create<'a> { + _params.extend([ + universe::connect(universe), + buildings::set(buildings), + surrounding_star_system::connect(surrounding_star_system), + ]); + Create::new(self.client, _params) + } + pub fn create_unchecked( + self, + universe_id: i32, + buildings: ::prisma_client_rust::serde_json::Value, + surrounding_star_system_id: i32, + mut _params: Vec, + ) -> Create<'a> { + _params.extend([ + universe_id::set(universe_id), + buildings::set(buildings), + surrounding_star_system_id::set(surrounding_star_system_id), + ]); + Create::new(self.client, _params.into_iter().map(Into::into).collect()) + } + pub fn create_many( + self, + data: Vec<( + i32, + ::prisma_client_rust::serde_json::Value, + i32, + Vec, + )>, + ) -> CreateMany<'a> { + let data = data + .into_iter() + .map( + |( + universe_id, + buildings, + surrounding_star_system_id, + mut _params, + )| { + _params.extend([ + universe_id::set(universe_id), + buildings::set(buildings), + surrounding_star_system_id::set(surrounding_star_system_id), + ]); + _params + }, + ) + .collect(); + CreateMany::new(self.client, data) + } + pub fn update( + self, + _where: UniqueWhereParam, + _params: Vec, + ) -> Update<'a> { + Update::new(self.client, _where.into(), _params, vec![]) + } + pub fn update_unchecked( + self, + _where: UniqueWhereParam, + _params: Vec, + ) -> Update<'a> { + Update::new( + self.client, + _where.into(), + _params.into_iter().map(Into::into).collect(), + vec![], + ) + } + pub fn update_many( + self, + _where: Vec, + _params: Vec, + ) -> UpdateMany<'a> { + UpdateMany::new(self.client, _where, _params) + } + pub fn upsert( + self, + _where: UniqueWhereParam, + (universe, buildings, surrounding_star_system, mut _params): ( + super::universe::UniqueWhereParam, + ::prisma_client_rust::serde_json::Value, + super::star_system::UniqueWhereParam, + Vec, + ), + _update: Vec, + ) -> Upsert<'a> { + _params.extend([ + universe::connect(universe), + buildings::set(buildings), + surrounding_star_system::connect(surrounding_star_system), + ]); + Upsert::new(self.client, _where.into(), _params, _update) + } + pub fn delete(self, _where: UniqueWhereParam) -> Delete<'a> { + Delete::new(self.client, _where.into(), vec![]) + } + pub fn delete_many(self, _where: Vec) -> DeleteMany<'a> { + DeleteMany::new(self.client, _where) + } + pub fn count(self, _where: Vec) -> Count<'a> { + Count::new(self.client, _where) + } + pub fn find_raw( + self, + ) -> ::prisma_client_rust::FindRaw<'a, Types, T> { + ::prisma_client_rust::FindRaw::new(self.client) + } + pub fn aggregate_raw( + self, + ) -> ::prisma_client_rust::AggregateRaw<'a, Types, T> { + ::prisma_client_rust::AggregateRaw::new(self.client) + } + } +} +pub mod fleet { + use super::_prisma::*; + use super::*; + pub const NAME: &str = "Fleet"; + pub mod id { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "id"; + pub struct Set(pub String); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetId(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::Id(v) + } + } + pub fn set>(value: String) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::Id(direction) + } + pub fn equals>(value: String) -> T { + UniqueWhereParam::IdEquals(value).into() + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::StringFilter, + Id, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: String) -> Lt; + fn lte(_: String) -> Lte; + fn gt(_: String) -> Gt; + fn gte(_: String) -> Gte; + fn contains(_: String) -> Contains; + fn starts_with(_: String) -> StartsWith; + fn ends_with(_: String) -> EndsWith; + fn mode(_: super::super::QueryMode) -> Mode; + fn not(_: String) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Id(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Id(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod universe_id { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "universeId"; + pub struct Set(pub i32); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetUniverseId(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::UniverseId(v) + } + } + pub fn set>(value: i32) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::UniverseId(direction) + } + pub fn equals(value: i32) -> WhereParam { + WhereParam::UniverseId(_prisma::read_filters::IntFilter::Equals(value)) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::IntFilter, + UniverseId, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: i32) -> Lt; + fn lte(_: i32) -> Lte; + fn gt(_: i32) -> Gt; + fn gte(_: i32) -> Gte; + fn not(_: i32) -> Not; + } + ); + pub fn increment(value: i32) -> SetParam { + SetParam::IncrementUniverseId(value) + } + pub fn decrement(value: i32) -> SetParam { + SetParam::DecrementUniverseId(value) + } + pub fn multiply(value: i32) -> SetParam { + SetParam::MultiplyUniverseId(value) + } + pub fn divide(value: i32) -> SetParam { + SetParam::DivideUniverseId(value) + } + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::UniverseId(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::UniverseId(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod universe { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "universe"; + pub struct Fetch(pub universe::UniqueArgs); + impl Fetch { + pub fn with(mut self, params: impl Into) -> Self { + self.0 = self.0.with(params.into()); + self + } + } + impl From for WithParam { + fn from(Fetch(v): Fetch) -> Self { + WithParam::Universe(v) + } + } + pub fn fetch() -> Fetch { + Fetch(universe::UniqueArgs::new()) + } + pub struct Connect(universe::UniqueWhereParam); + impl From for SetParam { + fn from(Connect(v): Connect) -> Self { + Self::ConnectUniverse(v) + } + } + pub fn connect>(value: universe::UniqueWhereParam) -> T { + Connect(value).into() + } + pub fn is(value: Vec) -> WhereParam { + WhereParam::UniverseIs(value) + } + pub fn is_not(value: Vec) -> WhereParam { + WhereParam::UniverseIsNot(value) + } + pub enum Include { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Universe(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = < universe :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < universe :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; + ::prisma_client_rust::Selection::new("universe", None, [], selections) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include(nested_selections: Vec) -> Self { + Self::Include(nested_selections) + } + } + pub enum Select { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Universe(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < universe :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; + ::prisma_client_rust::Selection::new("universe", None, [], selections) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include(nested_selections: Vec) -> Self { + Self::Include(nested_selections) + } + } + } + pub fn create( + universe: super::universe::UniqueWhereParam, + _params: Vec, + ) -> (super::universe::UniqueWhereParam, Vec) { + (universe, _params) + } + pub fn create_unchecked( + universe_id: i32, + _params: Vec, + ) -> (i32, Vec) { + (universe_id, _params) + } + #[macro_export] + macro_rules ! _select_fleet { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: fleet :: select ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: fleet :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: fleet :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: fleet :: select ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: fleet :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: fleet :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { id , universe_id , universe } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } const SPECTA_TYPE_NAME : & 'static str = prisma_client_rust :: macros :: to_pascal_case ! ($ ($ module_name) ?) ; crate :: prisma :: fleet :: select ! (@ specta_data_struct ; pub struct Data { $ (# [specta (rename_from_path = crate :: prisma :: fleet :: $ field :: NAME)] pub $ field : crate :: prisma :: fleet :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } ; $ ($ module_name) ?) ; impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) +] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: fleet :: $ field :: NAME , & self . $ field) ? ;) * state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: fleet :: $ field :: NAME) , + ,] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: fleet :: $ field :: NAME => Ok (Field :: $ field)) , * , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * while let Some (key) = map . next_key () ? { match key { $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: fleet :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: fleet :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "universeId" , "universe"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: fleet :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { String } ; (@ field_type ; universe_id) => { i32 } ; (@ field_type ; universe : $ selection_mode : ident { $ ($ selections : tt) + }) => { universe :: Data } ; (@ field_type ; universe) => { crate :: prisma :: universe :: Data } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Fleet" , available relations are "id, universe_id, universe")) } ; (@ field_module ; universe : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: universe :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: fleet :: SelectParam > :: into (crate :: prisma :: fleet :: id :: Select) } ; (@ selection_field_to_selection_param ; universe_id) => { Into :: < crate :: prisma :: fleet :: SelectParam > :: into (crate :: prisma :: fleet :: universe_id :: Select) } ; (@ selection_field_to_selection_param ; universe $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: fleet :: SelectParam > :: into (crate :: prisma :: fleet :: universe :: Select :: $ selection_mode (crate :: prisma :: universe :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; universe $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: fleet :: SelectParam > :: into (crate :: prisma :: fleet :: universe :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: fleet :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; universe_id) => { "universeId" } ; (@ field_serde_name ; universe) => { "universe" } ; (@ specta_data_struct ; $ struct : item ;) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] # [specta (inline)] $ struct } ; (@ specta_data_struct ; $ struct : item ; $ name : ident) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] $ struct } ; } + pub use _select_fleet as select; + pub enum SelectParam { + Id(id::Select), + UniverseId(universe_id::Select), + Universe(universe::Select), + } + impl SelectParam { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + match self { + Self::Id(data) => data.to_selection(), + Self::UniverseId(data) => data.to_selection(), + Self::Universe(data) => data.to_selection(), + } + } + } + #[macro_export] + macro_rules ! _include_fleet { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: fleet :: include ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: fleet :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: fleet :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: fleet :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: fleet :: include ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: fleet :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: fleet :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: fleet :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { universe } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } const SPECTA_TYPE_NAME : & 'static str = prisma_client_rust :: macros :: to_pascal_case ! ($ ($ module_name) ?) ; crate :: prisma :: fleet :: include ! (@ specta_data_struct ; pub struct Data { # [specta (rename_from_path = crate :: prisma :: fleet :: id :: NAME)] pub id : String , # [specta (rename_from_path = crate :: prisma :: fleet :: universe_id :: NAME)] pub universe_id : i32 , $ (# [specta (rename_from_path = crate :: prisma :: fleet :: $ field :: NAME)] pub $ field : crate :: prisma :: fleet :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } ; $ ($ module_name) ?) ; impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) + stringify ! (id) , stringify ! (universe_id)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: fleet :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: fleet :: id :: NAME , & self . id) ? ; state . serialize_field (crate :: prisma :: fleet :: universe_id :: NAME , & self . universe_id) ? ; state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , id , universe_id } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: fleet :: $ field :: NAME) , + , crate :: prisma :: fleet :: id :: NAME , crate :: prisma :: fleet :: universe_id :: NAME] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: fleet :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: fleet :: id :: NAME => Ok (Field :: id) , crate :: prisma :: fleet :: universe_id :: NAME => Ok (Field :: universe_id) , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * let mut id = None ; let mut universe_id = None ; while let Some (key) = map . next_key () ? { match key { Field :: id => { if id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: fleet :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } Field :: universe_id => { if universe_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: fleet :: universe_id :: NAME)) ; } universe_id = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: fleet :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: fleet :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: fleet :: id :: NAME)) ? ; let universe_id = universe_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: fleet :: universe_id :: NAME)) ? ; Ok (Data { id , universe_id , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "universeId" , "universe"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: fleet :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; universe : $ selection_mode : ident { $ ($ selections : tt) + }) => { universe :: Data } ; (@ field_type ; universe) => { crate :: prisma :: universe :: Data } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Fleet" , available relations are "universe")) } ; (@ field_module ; universe : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: universe :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; universe $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: fleet :: IncludeParam > :: into (crate :: prisma :: fleet :: universe :: Include :: $ selection_mode (crate :: prisma :: universe :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; universe $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: fleet :: IncludeParam > :: into (crate :: prisma :: fleet :: universe :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: fleet :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; universe_id) => { "universeId" } ; (@ field_serde_name ; universe) => { "universe" } ; (@ specta_data_struct ; $ struct : item ;) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] # [specta (inline)] $ struct } ; (@ specta_data_struct ; $ struct : item ; $ name : ident) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] $ struct } ; } + pub use _include_fleet as include; + pub enum IncludeParam { + Id(id::Include), + UniverseId(universe_id::Include), + Universe(universe::Include), + } + impl IncludeParam { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + match self { + Self::Id(data) => data.to_selection(), + Self::UniverseId(data) => data.to_selection(), + Self::Universe(data) => data.to_selection(), + } + } + } + #[macro_export] + macro_rules ! _partial_unchecked_fleet { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: fleet struct $ struct_name { # [serde (rename = "id")] pub id : String , # [serde (rename = "universeId")] pub universe_id : i32 } [$ ($ scalar_field) , +] } } ; } + pub use _partial_unchecked_fleet as partial_unchecked; + #[derive( + Debug, + Clone, + :: serde :: Serialize, + :: serde :: Deserialize, + :: prisma_client_rust :: specta :: Type, + )] + #[specta(rename = "Fleet", crate = "prisma_client_rust::specta")] + pub struct Data { + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "universeId")] + pub universe_id: i32, + #[serde(rename = "universe")] + #[specta(skip)] + pub universe: Option>, + } + impl Data { + pub fn universe( + &self, + ) -> Result< + &super::universe::Data, + ::prisma_client_rust::RelationNotFetchedError, + > { + self + .universe + .as_ref() + .ok_or(::prisma_client_rust::RelationNotFetchedError::new( + stringify!(universe), + )) + .map(|v| v.as_ref()) + } + } + #[derive(Clone)] + pub enum WithParam { + Universe(super::universe::UniqueArgs), + } + impl Into<::prisma_client_rust::Selection> for WithParam { + fn into(self) -> ::prisma_client_rust::Selection { + match self { + Self::Universe(args) => { + let mut selections = < super :: universe :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; + selections.extend( + args + .with_params + .into_iter() + .map(Into::<::prisma_client_rust::Selection>::into), + ); + ::prisma_client_rust::Selection::new( + universe::NAME, + None, + [], + selections, + ) + } + } + } + } + #[derive(Clone)] + pub enum SetParam { + SetId(String), + SetUniverseId(i32), + IncrementUniverseId(i32), + DecrementUniverseId(i32), + MultiplyUniverseId(i32), + DivideUniverseId(i32), + ConnectUniverse(super::universe::UniqueWhereParam), + } + impl From for (String, ::prisma_client_rust::PrismaValue) { + fn from(param: SetParam) -> Self { + match param { + SetParam::SetId(value) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(value), + ), + SetParam::SetUniverseId(value) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + ), + SetParam::IncrementUniverseId(value) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "increment".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::DecrementUniverseId(value) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "decrement".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::MultiplyUniverseId(value) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "multiply".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::DivideUniverseId(value) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "divide".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::ConnectUniverse(where_param) => ( + universe::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "connect".to_string(), + ::prisma_client_rust::PrismaValue::Object( + [where_param] + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + } + } + } + #[derive(Clone)] + pub enum UncheckedSetParam { + Id(String), + UniverseId(i32), + } + impl From for SetParam { + fn from(param: UncheckedSetParam) -> Self { + match param { + UncheckedSetParam::Id(value) => Self::SetId(value), + UncheckedSetParam::UniverseId(value) => Self::SetUniverseId(value), + } + } + } + #[derive(Clone)] + pub enum OrderByParam { + Id(::prisma_client_rust::Direction), + UniverseId(::prisma_client_rust::Direction), + } + impl Into<(String, ::prisma_client_rust::PrismaValue)> for OrderByParam { + fn into(self) -> (String, ::prisma_client_rust::PrismaValue) { + match self { + Self::Id(direction) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::UniverseId(direction) => ( + universe_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + } + } + } + #[derive(Clone)] + pub enum WhereParam { + Not(Vec), + Or(Vec), + And(Vec), + Id(_prisma::read_filters::StringFilter), + UniverseId(_prisma::read_filters::IntFilter), + UniverseIs(Vec), + UniverseIsNot(Vec), + } + impl ::prisma_client_rust::WhereInput for WhereParam { + fn serialize(self) -> ::prisma_client_rust::SerializedWhereInput { + let (name, value) = match self { + Self::Not(value) => ( + "NOT", + ::prisma_client_rust::SerializedWhereValue::Object( + ::prisma_client_rust::merge_fields( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .collect(), + ), + ), + ), + Self::Or(value) => ( + "OR", + ::prisma_client_rust::SerializedWhereValue::List( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .map(|v| vec![v]) + .map(::prisma_client_rust::PrismaValue::Object) + .collect(), + ), + ), + Self::And(value) => ( + "AND", + ::prisma_client_rust::SerializedWhereValue::Object( + ::prisma_client_rust::merge_fields( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .collect(), + ), + ), + ), + Self::Id(value) => (id::NAME, value.into()), + Self::UniverseId(value) => (universe_id::NAME, value.into()), + Self::UniverseIs(where_params) => ( + universe::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "is".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::UniverseIsNot(where_params) => ( + universe::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "isNot".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + }; + ::prisma_client_rust::SerializedWhereInput::new(name, value.into()) + } + } + #[derive(Clone)] + pub enum UniqueWhereParam { + IdEquals(String), + } + impl From for WhereParam { + fn from(value: UniqueWhereParam) -> Self { + match value { + UniqueWhereParam::IdEquals(value) => { + Self::Id(_prisma::read_filters::StringFilter::Equals(value)) + } + } + } + } + impl From<::prisma_client_rust::Operator> for WhereParam { + fn from(op: ::prisma_client_rust::Operator) -> Self { + match op { + ::prisma_client_rust::Operator::Not(value) => Self::Not(value), + ::prisma_client_rust::Operator::And(value) => Self::And(value), + ::prisma_client_rust::Operator::Or(value) => Self::Or(value), + } + } + } + #[derive(Clone)] + pub struct Types; + impl ::prisma_client_rust::ModelTypes for Types { + type Data = Data; + type Where = WhereParam; + type UncheckedSet = UncheckedSetParam; + type Set = SetParam; + type With = WithParam; + type OrderBy = OrderByParam; + type Cursor = UniqueWhereParam; + const MODEL: &'static str = NAME; + fn scalar_selections() -> Vec<::prisma_client_rust::Selection> { + vec![ + ::prisma_client_rust::sel(id::NAME), + ::prisma_client_rust::sel(universe_id::NAME), + ] + } + } + pub type UniqueArgs = ::prisma_client_rust::UniqueArgs; + pub type ManyArgs = ::prisma_client_rust::ManyArgs; + pub type Count<'a> = ::prisma_client_rust::Count<'a, Types>; + pub type Create<'a> = ::prisma_client_rust::Create<'a, Types>; + pub type CreateMany<'a> = ::prisma_client_rust::CreateMany<'a, Types>; + pub type FindUnique<'a> = ::prisma_client_rust::FindUnique<'a, Types>; + pub type FindMany<'a> = ::prisma_client_rust::FindMany<'a, Types>; + pub type FindFirst<'a> = ::prisma_client_rust::FindFirst<'a, Types>; + pub type Update<'a> = ::prisma_client_rust::Update<'a, Types>; + pub type UpdateMany<'a> = ::prisma_client_rust::UpdateMany<'a, Types>; + pub type Upsert<'a> = ::prisma_client_rust::Upsert<'a, Types>; + pub type Delete<'a> = ::prisma_client_rust::Delete<'a, Types>; + pub type DeleteMany<'a> = ::prisma_client_rust::DeleteMany<'a, Types>; + #[derive(Clone)] + pub struct Actions<'a> { + pub client: &'a ::prisma_client_rust::PrismaClientInternals, + } + impl<'a> Actions<'a> { + pub fn find_unique(self, _where: UniqueWhereParam) -> FindUnique<'a> { + FindUnique::new(self.client, _where.into()) + } + pub fn find_first(self, _where: Vec) -> FindFirst<'a> { + FindFirst::new(self.client, _where) + } + pub fn find_many(self, _where: Vec) -> FindMany<'a> { + FindMany::new(self.client, _where) + } + pub fn create( + self, + universe: super::universe::UniqueWhereParam, + mut _params: Vec, + ) -> Create<'a> { + _params.extend([universe::connect(universe)]); + Create::new(self.client, _params) + } + pub fn create_unchecked( + self, + universe_id: i32, + mut _params: Vec, + ) -> Create<'a> { + _params.extend([universe_id::set(universe_id)]); + Create::new(self.client, _params.into_iter().map(Into::into).collect()) + } + pub fn create_many( + self, + data: Vec<(i32, Vec)>, + ) -> CreateMany<'a> { + let data = data + .into_iter() + .map(|(universe_id, mut _params)| { + _params.extend([universe_id::set(universe_id)]); + _params + }) + .collect(); + CreateMany::new(self.client, data) + } + pub fn update( + self, + _where: UniqueWhereParam, + _params: Vec, + ) -> Update<'a> { + Update::new(self.client, _where.into(), _params, vec![]) + } + pub fn update_unchecked( + self, + _where: UniqueWhereParam, + _params: Vec, + ) -> Update<'a> { + Update::new( + self.client, + _where.into(), + _params.into_iter().map(Into::into).collect(), + vec![], + ) + } + pub fn update_many( + self, + _where: Vec, + _params: Vec, + ) -> UpdateMany<'a> { + UpdateMany::new(self.client, _where, _params) + } + pub fn upsert( + self, + _where: UniqueWhereParam, + (universe, mut _params): ( + super::universe::UniqueWhereParam, + Vec, + ), + _update: Vec, + ) -> Upsert<'a> { + _params.extend([universe::connect(universe)]); + Upsert::new(self.client, _where.into(), _params, _update) + } + pub fn delete(self, _where: UniqueWhereParam) -> Delete<'a> { + Delete::new(self.client, _where.into(), vec![]) + } + pub fn delete_many(self, _where: Vec) -> DeleteMany<'a> { + DeleteMany::new(self.client, _where) + } + pub fn count(self, _where: Vec) -> Count<'a> { + Count::new(self.client, _where) + } + pub fn find_raw( + self, + ) -> ::prisma_client_rust::FindRaw<'a, Types, T> { + ::prisma_client_rust::FindRaw::new(self.client) + } + pub fn aggregate_raw( + self, + ) -> ::prisma_client_rust::AggregateRaw<'a, Types, T> { + ::prisma_client_rust::AggregateRaw::new(self.client) + } + } +} +pub mod technology { + use super::_prisma::*; + use super::*; + pub const NAME: &str = "Technology"; + pub mod name { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "name"; + pub struct Set(pub String); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetName(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::Name(v) + } + } + pub fn set>(value: String) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::Name(direction) + } + pub fn equals>(value: String) -> T { + UniqueWhereParam::NameEquals(value).into() + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::StringFilter, + Name, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: String) -> Lt; + fn lte(_: String) -> Lte; + fn gt(_: String) -> Gt; + fn gte(_: String) -> Gte; + fn contains(_: String) -> Contains; + fn starts_with(_: String) -> StartsWith; + fn ends_with(_: String) -> EndsWith; + fn mode(_: super::super::QueryMode) -> Mode; + fn not(_: String) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Name(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Name(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod description { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "description"; + pub struct Set(pub String); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetDescription(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::Description(v) + } + } + pub fn set>(value: String) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::Description(direction) + } + pub fn equals(value: String) -> WhereParam { + WhereParam::Description(_prisma::read_filters::StringFilter::Equals( + value, + )) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::StringFilter, + Description, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: String) -> Lt; + fn lte(_: String) -> Lte; + fn gt(_: String) -> Gt; + fn gte(_: String) -> Gte; + fn contains(_: String) -> Contains; + fn starts_with(_: String) -> StartsWith; + fn ends_with(_: String) -> EndsWith; + fn mode(_: super::super::QueryMode) -> Mode; + fn not(_: String) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Description(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Description(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod effects { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "effects"; + pub struct Set(pub ::prisma_client_rust::serde_json::Value); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetEffects(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::Effects(v) + } + } + pub fn set>( + value: ::prisma_client_rust::serde_json::Value, + ) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::Effects(direction) + } + pub fn equals( + value: ::prisma_client_rust::serde_json::Value, + ) -> WhereParam { + WhereParam::Effects(_prisma::read_filters::JsonFilter::Equals(value)) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::JsonFilter, + Effects, + { + fn path(_: Vec) -> Path; + fn string_contains(_: String) -> StringContains; + fn string_starts_with(_: String) -> StringStartsWith; + fn string_ends_with(_: String) -> StringEndsWith; + fn array_contains( + _: Option<::prisma_client_rust::serde_json::Value>, + ) -> ArrayContains; + fn array_starts_with( + _: Option<::prisma_client_rust::serde_json::Value>, + ) -> ArrayStartsWith; + fn array_ends_with( + _: Option<::prisma_client_rust::serde_json::Value>, + ) -> ArrayEndsWith; + fn lt(_: ::prisma_client_rust::serde_json::Value) -> Lt; + fn lte(_: ::prisma_client_rust::serde_json::Value) -> Lte; + fn gt(_: ::prisma_client_rust::serde_json::Value) -> Gt; + fn gte(_: ::prisma_client_rust::serde_json::Value) -> Gte; + fn not(_: ::prisma_client_rust::serde_json::Value) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Effects(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Effects(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub fn create( + name: String, + description: String, + effects: ::prisma_client_rust::serde_json::Value, + _params: Vec, + ) -> ( + String, + String, + ::prisma_client_rust::serde_json::Value, + Vec, + ) { + (name, description, effects, _params) + } + pub fn create_unchecked( + name: String, + description: String, + effects: ::prisma_client_rust::serde_json::Value, + _params: Vec, + ) -> ( + String, + String, + ::prisma_client_rust::serde_json::Value, + Vec, + ) { + (name, description, effects, _params) + } + #[macro_export] + macro_rules ! _select_technology { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: technology :: select ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: technology :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: technology :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: technology :: select ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: technology :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: technology :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { name , description , effects } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } const SPECTA_TYPE_NAME : & 'static str = prisma_client_rust :: macros :: to_pascal_case ! ($ ($ module_name) ?) ; crate :: prisma :: technology :: select ! (@ specta_data_struct ; pub struct Data { $ (# [specta (rename_from_path = crate :: prisma :: technology :: $ field :: NAME)] pub $ field : crate :: prisma :: technology :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } ; $ ($ module_name) ?) ; impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) +] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: technology :: $ field :: NAME , & self . $ field) ? ;) * state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: technology :: $ field :: NAME) , + ,] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: technology :: $ field :: NAME => Ok (Field :: $ field)) , * , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * while let Some (key) = map . next_key () ? { match key { $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: technology :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: technology :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["name" , "description" , "effects"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: technology :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; name) => { String } ; (@ field_type ; description) => { String } ; (@ field_type ; effects) => { :: prisma_client_rust :: serde_json :: Value } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Technology" , available relations are "name, description, effects")) } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; name) => { Into :: < crate :: prisma :: technology :: SelectParam > :: into (crate :: prisma :: technology :: name :: Select) } ; (@ selection_field_to_selection_param ; description) => { Into :: < crate :: prisma :: technology :: SelectParam > :: into (crate :: prisma :: technology :: description :: Select) } ; (@ selection_field_to_selection_param ; effects) => { Into :: < crate :: prisma :: technology :: SelectParam > :: into (crate :: prisma :: technology :: effects :: Select) } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: technology :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; name) => { "name" } ; (@ field_serde_name ; description) => { "description" } ; (@ field_serde_name ; effects) => { "effects" } ; (@ specta_data_struct ; $ struct : item ;) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] # [specta (inline)] $ struct } ; (@ specta_data_struct ; $ struct : item ; $ name : ident) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] $ struct } ; } + pub use _select_technology as select; + pub enum SelectParam { + Name(name::Select), + Description(description::Select), + Effects(effects::Select), + } + impl SelectParam { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + match self { + Self::Name(data) => data.to_selection(), + Self::Description(data) => data.to_selection(), + Self::Effects(data) => data.to_selection(), + } + } + } + #[macro_export] + macro_rules ! _include_technology { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: technology :: include ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: technology :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: technology :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: technology :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: technology :: include ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: technology :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: technology :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: technology :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } const SPECTA_TYPE_NAME : & 'static str = prisma_client_rust :: macros :: to_pascal_case ! ($ ($ module_name) ?) ; crate :: prisma :: technology :: include ! (@ specta_data_struct ; pub struct Data { # [specta (rename_from_path = crate :: prisma :: technology :: name :: NAME)] pub name : String , # [specta (rename_from_path = crate :: prisma :: technology :: description :: NAME)] pub description : String , # [specta (rename_from_path = crate :: prisma :: technology :: effects :: NAME)] pub effects : :: prisma_client_rust :: serde_json :: Value , $ (# [specta (rename_from_path = crate :: prisma :: technology :: $ field :: NAME)] pub $ field : crate :: prisma :: technology :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } ; $ ($ module_name) ?) ; impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) + stringify ! (name) , stringify ! (description) , stringify ! (effects)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: technology :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: technology :: name :: NAME , & self . name) ? ; state . serialize_field (crate :: prisma :: technology :: description :: NAME , & self . description) ? ; state . serialize_field (crate :: prisma :: technology :: effects :: NAME , & self . effects) ? ; state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , name , description , effects } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: technology :: $ field :: NAME) , + , crate :: prisma :: technology :: name :: NAME , crate :: prisma :: technology :: description :: NAME , crate :: prisma :: technology :: effects :: NAME] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: technology :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: technology :: name :: NAME => Ok (Field :: name) , crate :: prisma :: technology :: description :: NAME => Ok (Field :: description) , crate :: prisma :: technology :: effects :: NAME => Ok (Field :: effects) , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * let mut name = None ; let mut description = None ; let mut effects = None ; while let Some (key) = map . next_key () ? { match key { Field :: name => { if name . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: technology :: name :: NAME)) ; } name = Some (map . next_value () ?) ; } Field :: description => { if description . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: technology :: description :: NAME)) ; } description = Some (map . next_value () ?) ; } Field :: effects => { if effects . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: technology :: effects :: NAME)) ; } effects = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: technology :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: technology :: $ field :: NAME)) ? ;) * let name = name . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: technology :: name :: NAME)) ? ; let description = description . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: technology :: description :: NAME)) ? ; let effects = effects . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: technology :: effects :: NAME)) ? ; Ok (Data { name , description , effects , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["name" , "description" , "effects"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: technology :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Technology" , available relations are "")) } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: technology :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; name) => { "name" } ; (@ field_serde_name ; description) => { "description" } ; (@ field_serde_name ; effects) => { "effects" } ; (@ specta_data_struct ; $ struct : item ;) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] # [specta (inline)] $ struct } ; (@ specta_data_struct ; $ struct : item ; $ name : ident) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] $ struct } ; } + pub use _include_technology as include; + pub enum IncludeParam { + Name(name::Include), + Description(description::Include), + Effects(effects::Include), + } + impl IncludeParam { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + match self { + Self::Name(data) => data.to_selection(), + Self::Description(data) => data.to_selection(), + Self::Effects(data) => data.to_selection(), + } + } + } + #[macro_export] + macro_rules ! _partial_unchecked_technology { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: technology struct $ struct_name { # [serde (rename = "name")] pub name : String , # [serde (rename = "description")] pub description : String , # [serde (rename = "effects")] pub effects : :: prisma_client_rust :: serde_json :: Value } [$ ($ scalar_field) , +] } } ; } + pub use _partial_unchecked_technology as partial_unchecked; + #[derive( + Debug, + Clone, + :: serde :: Serialize, + :: serde :: Deserialize, + :: prisma_client_rust :: specta :: Type, + )] + #[specta(rename = "Technology", crate = "prisma_client_rust::specta")] + pub struct Data { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "description")] + pub description: String, + #[serde(rename = "effects")] + pub effects: ::prisma_client_rust::serde_json::Value, + } + impl Data {} + #[derive(Clone)] + pub enum WithParam {} + impl Into<::prisma_client_rust::Selection> for WithParam { + fn into(self) -> ::prisma_client_rust::Selection { + match self {} + } + } + #[derive(Clone)] + pub enum SetParam { + SetName(String), + SetDescription(String), + SetEffects(::prisma_client_rust::serde_json::Value), + } + impl From for (String, ::prisma_client_rust::PrismaValue) { + fn from(param: SetParam) -> Self { + match param { + SetParam::SetName(value) => ( + name::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(value), + ), + SetParam::SetDescription(value) => ( + description::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(value), + ), + SetParam::SetEffects(value) => ( + effects::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Json( + ::prisma_client_rust::serde_json::to_string(&value).unwrap(), + ), + ), + } + } + } + #[derive(Clone)] + pub enum UncheckedSetParam { + Name(String), + Description(String), + Effects(::prisma_client_rust::serde_json::Value), + } + impl From for SetParam { + fn from(param: UncheckedSetParam) -> Self { + match param { + UncheckedSetParam::Name(value) => Self::SetName(value), + UncheckedSetParam::Description(value) => Self::SetDescription(value), + UncheckedSetParam::Effects(value) => Self::SetEffects(value), + } + } + } + #[derive(Clone)] + pub enum OrderByParam { + Name(::prisma_client_rust::Direction), + Description(::prisma_client_rust::Direction), + Effects(::prisma_client_rust::Direction), + } + impl Into<(String, ::prisma_client_rust::PrismaValue)> for OrderByParam { + fn into(self) -> (String, ::prisma_client_rust::PrismaValue) { + match self { + Self::Name(direction) => ( + name::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::Description(direction) => ( + description::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::Effects(direction) => ( + effects::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + } + } + } + #[derive(Clone)] + pub enum WhereParam { + Not(Vec), + Or(Vec), + And(Vec), + Name(_prisma::read_filters::StringFilter), + Description(_prisma::read_filters::StringFilter), + Effects(_prisma::read_filters::JsonFilter), + } + impl ::prisma_client_rust::WhereInput for WhereParam { + fn serialize(self) -> ::prisma_client_rust::SerializedWhereInput { + let (name, value) = match self { + Self::Not(value) => ( + "NOT", + ::prisma_client_rust::SerializedWhereValue::Object( + ::prisma_client_rust::merge_fields( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .collect(), + ), + ), + ), + Self::Or(value) => ( + "OR", + ::prisma_client_rust::SerializedWhereValue::List( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .map(|v| vec![v]) + .map(::prisma_client_rust::PrismaValue::Object) + .collect(), + ), + ), + Self::And(value) => ( + "AND", + ::prisma_client_rust::SerializedWhereValue::Object( + ::prisma_client_rust::merge_fields( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .collect(), + ), + ), + ), + Self::Name(value) => (name::NAME, value.into()), + Self::Description(value) => (description::NAME, value.into()), + Self::Effects(value) => (effects::NAME, value.into()), + }; + ::prisma_client_rust::SerializedWhereInput::new(name, value.into()) + } + } + #[derive(Clone)] + pub enum UniqueWhereParam { + NameEquals(String), + } + impl From for WhereParam { + fn from(value: UniqueWhereParam) -> Self { + match value { + UniqueWhereParam::NameEquals(value) => { + Self::Name(_prisma::read_filters::StringFilter::Equals(value)) + } + } + } + } + impl From<::prisma_client_rust::Operator> for WhereParam { + fn from(op: ::prisma_client_rust::Operator) -> Self { + match op { + ::prisma_client_rust::Operator::Not(value) => Self::Not(value), + ::prisma_client_rust::Operator::And(value) => Self::And(value), + ::prisma_client_rust::Operator::Or(value) => Self::Or(value), + } + } + } + #[derive(Clone)] + pub struct Types; + impl ::prisma_client_rust::ModelTypes for Types { + type Data = Data; + type Where = WhereParam; + type UncheckedSet = UncheckedSetParam; + type Set = SetParam; + type With = WithParam; + type OrderBy = OrderByParam; + type Cursor = UniqueWhereParam; + const MODEL: &'static str = NAME; + fn scalar_selections() -> Vec<::prisma_client_rust::Selection> { + vec![ + ::prisma_client_rust::sel(name::NAME), + ::prisma_client_rust::sel(description::NAME), + ::prisma_client_rust::sel(effects::NAME), + ] + } + } + pub type UniqueArgs = ::prisma_client_rust::UniqueArgs; + pub type ManyArgs = ::prisma_client_rust::ManyArgs; + pub type Count<'a> = ::prisma_client_rust::Count<'a, Types>; + pub type Create<'a> = ::prisma_client_rust::Create<'a, Types>; + pub type CreateMany<'a> = ::prisma_client_rust::CreateMany<'a, Types>; + pub type FindUnique<'a> = ::prisma_client_rust::FindUnique<'a, Types>; + pub type FindMany<'a> = ::prisma_client_rust::FindMany<'a, Types>; + pub type FindFirst<'a> = ::prisma_client_rust::FindFirst<'a, Types>; + pub type Update<'a> = ::prisma_client_rust::Update<'a, Types>; + pub type UpdateMany<'a> = ::prisma_client_rust::UpdateMany<'a, Types>; + pub type Upsert<'a> = ::prisma_client_rust::Upsert<'a, Types>; + pub type Delete<'a> = ::prisma_client_rust::Delete<'a, Types>; + pub type DeleteMany<'a> = ::prisma_client_rust::DeleteMany<'a, Types>; + #[derive(Clone)] + pub struct Actions<'a> { + pub client: &'a ::prisma_client_rust::PrismaClientInternals, + } + impl<'a> Actions<'a> { + pub fn find_unique(self, _where: UniqueWhereParam) -> FindUnique<'a> { + FindUnique::new(self.client, _where.into()) + } + pub fn find_first(self, _where: Vec) -> FindFirst<'a> { + FindFirst::new(self.client, _where) + } + pub fn find_many(self, _where: Vec) -> FindMany<'a> { + FindMany::new(self.client, _where) + } + pub fn create( + self, + name: String, + description: String, + effects: ::prisma_client_rust::serde_json::Value, + mut _params: Vec, + ) -> Create<'a> { + _params.extend([ + name::set(name), + description::set(description), + effects::set(effects), + ]); + Create::new(self.client, _params) + } + pub fn create_unchecked( + self, + name: String, + description: String, + effects: ::prisma_client_rust::serde_json::Value, + mut _params: Vec, + ) -> Create<'a> { + _params.extend([ + name::set(name), + description::set(description), + effects::set(effects), + ]); + Create::new(self.client, _params.into_iter().map(Into::into).collect()) + } + pub fn create_many( + self, + data: Vec<( + String, + String, + ::prisma_client_rust::serde_json::Value, + Vec, + )>, + ) -> CreateMany<'a> { + let data = data + .into_iter() + .map(|(name, description, effects, mut _params)| { + _params.extend([ + name::set(name), + description::set(description), + effects::set(effects), + ]); + _params + }) + .collect(); + CreateMany::new(self.client, data) + } + pub fn update( + self, + _where: UniqueWhereParam, + _params: Vec, + ) -> Update<'a> { + Update::new(self.client, _where.into(), _params, vec![]) + } + pub fn update_unchecked( + self, + _where: UniqueWhereParam, + _params: Vec, + ) -> Update<'a> { + Update::new( + self.client, + _where.into(), + _params.into_iter().map(Into::into).collect(), + vec![], + ) + } + pub fn update_many( + self, + _where: Vec, + _params: Vec, + ) -> UpdateMany<'a> { + UpdateMany::new(self.client, _where, _params) + } + pub fn upsert( + self, + _where: UniqueWhereParam, + (name, description, effects, mut _params): ( + String, + String, + ::prisma_client_rust::serde_json::Value, + Vec, + ), + _update: Vec, + ) -> Upsert<'a> { + _params.extend([ + name::set(name), + description::set(description), + effects::set(effects), + ]); + Upsert::new(self.client, _where.into(), _params, _update) + } + pub fn delete(self, _where: UniqueWhereParam) -> Delete<'a> { + Delete::new(self.client, _where.into(), vec![]) + } + pub fn delete_many(self, _where: Vec) -> DeleteMany<'a> { + DeleteMany::new(self.client, _where) + } + pub fn count(self, _where: Vec) -> Count<'a> { + Count::new(self.client, _where) + } + pub fn find_raw( + self, + ) -> ::prisma_client_rust::FindRaw<'a, Types, T> { + ::prisma_client_rust::FindRaw::new(self.client) + } + pub fn aggregate_raw( + self, + ) -> ::prisma_client_rust::AggregateRaw<'a, Types, T> { + ::prisma_client_rust::AggregateRaw::new(self.client) + } + } +} +pub mod account { + use super::_prisma::*; + use super::*; + pub const NAME: &str = "Account"; + pub mod id { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "id"; + pub struct Set(pub String); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetId(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::Id(v) + } + } + pub fn set>(value: String) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::Id(direction) + } + pub fn equals>(value: String) -> T { + UniqueWhereParam::IdEquals(value).into() + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::StringFilter, + Id, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: String) -> Lt; + fn lte(_: String) -> Lte; + fn gt(_: String) -> Gt; + fn gte(_: String) -> Gte; + fn contains(_: String) -> Contains; + fn starts_with(_: String) -> StartsWith; + fn ends_with(_: String) -> EndsWith; + fn mode(_: super::super::QueryMode) -> Mode; + fn not(_: String) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Id(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Id(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod user_id { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "userId"; + pub struct Set(pub String); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetUserId(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::UserId(v) + } + } + pub fn set>(value: String) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::UserId(direction) + } + pub fn equals(value: String) -> WhereParam { + WhereParam::UserId(_prisma::read_filters::StringFilter::Equals(value)) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::StringFilter, + UserId, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: String) -> Lt; + fn lte(_: String) -> Lte; + fn gt(_: String) -> Gt; + fn gte(_: String) -> Gte; + fn contains(_: String) -> Contains; + fn starts_with(_: String) -> StartsWith; + fn ends_with(_: String) -> EndsWith; + fn mode(_: super::super::QueryMode) -> Mode; + fn not(_: String) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::UserId(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::UserId(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod r#type { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "type"; + pub struct Set(pub String); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetType(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::Type(v) + } + } + pub fn set>(value: String) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::Type(direction) + } + pub fn equals(value: String) -> WhereParam { + WhereParam::Type(_prisma::read_filters::StringFilter::Equals(value)) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::StringFilter, + Type, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: String) -> Lt; + fn lte(_: String) -> Lte; + fn gt(_: String) -> Gt; + fn gte(_: String) -> Gte; + fn contains(_: String) -> Contains; + fn starts_with(_: String) -> StartsWith; + fn ends_with(_: String) -> EndsWith; + fn mode(_: super::super::QueryMode) -> Mode; + fn not(_: String) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Type(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Type(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod provider { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "provider"; + pub struct Set(pub String); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetProvider(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::Provider(v) + } + } + pub fn set>(value: String) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::Provider(direction) + } + pub fn equals(value: String) -> WhereParam { + WhereParam::Provider(_prisma::read_filters::StringFilter::Equals(value)) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::StringFilter, + Provider, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: String) -> Lt; + fn lte(_: String) -> Lte; + fn gt(_: String) -> Gt; + fn gte(_: String) -> Gte; + fn contains(_: String) -> Contains; + fn starts_with(_: String) -> StartsWith; + fn ends_with(_: String) -> EndsWith; + fn mode(_: super::super::QueryMode) -> Mode; + fn not(_: String) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Provider(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Provider(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod provider_account_id { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "providerAccountId"; + pub struct Set(pub String); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetProviderAccountId(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::ProviderAccountId(v) + } + } + pub fn set>(value: String) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::ProviderAccountId(direction) + } + pub fn equals(value: String) -> WhereParam { + WhereParam::ProviderAccountId( + _prisma::read_filters::StringFilter::Equals(value), + ) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::StringFilter, + ProviderAccountId, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: String) -> Lt; + fn lte(_: String) -> Lte; + fn gt(_: String) -> Gt; + fn gte(_: String) -> Gte; + fn contains(_: String) -> Contains; + fn starts_with(_: String) -> StartsWith; + fn ends_with(_: String) -> EndsWith; + fn mode(_: super::super::QueryMode) -> Mode; + fn not(_: String) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::ProviderAccountId(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::ProviderAccountId(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod refresh_token { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "refresh_token"; + pub struct Set(pub Option); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetRefreshToken(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::RefreshToken(v) + } + } + pub fn set>(value: Option) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::RefreshToken(direction) + } + pub fn equals(value: Option) -> WhereParam { + WhereParam::RefreshToken( + _prisma::read_filters::StringNullableFilter::Equals(value), + ) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::StringNullableFilter, + RefreshToken, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: String) -> Lt; + fn lte(_: String) -> Lte; + fn gt(_: String) -> Gt; + fn gte(_: String) -> Gte; + fn contains(_: String) -> Contains; + fn starts_with(_: String) -> StartsWith; + fn ends_with(_: String) -> EndsWith; + fn mode(_: super::super::QueryMode) -> Mode; + fn not(_: Option) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::RefreshToken(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::RefreshToken(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod access_token { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "access_token"; + pub struct Set(pub Option); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetAccessToken(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::AccessToken(v) + } + } + pub fn set>(value: Option) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::AccessToken(direction) + } + pub fn equals(value: Option) -> WhereParam { + WhereParam::AccessToken( + _prisma::read_filters::StringNullableFilter::Equals(value), + ) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::StringNullableFilter, + AccessToken, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: String) -> Lt; + fn lte(_: String) -> Lte; + fn gt(_: String) -> Gt; + fn gte(_: String) -> Gte; + fn contains(_: String) -> Contains; + fn starts_with(_: String) -> StartsWith; + fn ends_with(_: String) -> EndsWith; + fn mode(_: super::super::QueryMode) -> Mode; + fn not(_: Option) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::AccessToken(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::AccessToken(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod expires_at { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "expires_at"; + pub struct Set(pub Option); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetExpiresAt(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::ExpiresAt(v) + } + } + pub fn set>(value: Option) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::ExpiresAt(direction) + } + pub fn equals(value: Option) -> WhereParam { + WhereParam::ExpiresAt(_prisma::read_filters::IntNullableFilter::Equals( + value, + )) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::IntNullableFilter, + ExpiresAt, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: i32) -> Lt; + fn lte(_: i32) -> Lte; + fn gt(_: i32) -> Gt; + fn gte(_: i32) -> Gte; + fn not(_: Option) -> Not; + } + ); + pub fn increment(value: i32) -> SetParam { + SetParam::IncrementExpiresAt(value) + } + pub fn decrement(value: i32) -> SetParam { + SetParam::DecrementExpiresAt(value) + } + pub fn multiply(value: i32) -> SetParam { + SetParam::MultiplyExpiresAt(value) + } + pub fn divide(value: i32) -> SetParam { + SetParam::DivideExpiresAt(value) + } + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::ExpiresAt(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::ExpiresAt(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod token_type { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "token_type"; + pub struct Set(pub Option); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetTokenType(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::TokenType(v) + } + } + pub fn set>(value: Option) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::TokenType(direction) + } + pub fn equals(value: Option) -> WhereParam { + WhereParam::TokenType( + _prisma::read_filters::StringNullableFilter::Equals(value), + ) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::StringNullableFilter, + TokenType, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: String) -> Lt; + fn lte(_: String) -> Lte; + fn gt(_: String) -> Gt; + fn gte(_: String) -> Gte; + fn contains(_: String) -> Contains; + fn starts_with(_: String) -> StartsWith; + fn ends_with(_: String) -> EndsWith; + fn mode(_: super::super::QueryMode) -> Mode; + fn not(_: Option) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::TokenType(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::TokenType(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod scope { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "scope"; + pub struct Set(pub Option); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetScope(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::Scope(v) + } + } + pub fn set>(value: Option) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::Scope(direction) + } + pub fn equals(value: Option) -> WhereParam { + WhereParam::Scope(_prisma::read_filters::StringNullableFilter::Equals( + value, + )) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::StringNullableFilter, + Scope, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: String) -> Lt; + fn lte(_: String) -> Lte; + fn gt(_: String) -> Gt; + fn gte(_: String) -> Gte; + fn contains(_: String) -> Contains; + fn starts_with(_: String) -> StartsWith; + fn ends_with(_: String) -> EndsWith; + fn mode(_: super::super::QueryMode) -> Mode; + fn not(_: Option) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Scope(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Scope(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod id_token { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "id_token"; + pub struct Set(pub Option); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetIdToken(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::IdToken(v) + } + } + pub fn set>(value: Option) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::IdToken(direction) + } + pub fn equals(value: Option) -> WhereParam { + WhereParam::IdToken(_prisma::read_filters::StringNullableFilter::Equals( + value, + )) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::StringNullableFilter, + IdToken, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: String) -> Lt; + fn lte(_: String) -> Lte; + fn gt(_: String) -> Gt; + fn gte(_: String) -> Gte; + fn contains(_: String) -> Contains; + fn starts_with(_: String) -> StartsWith; + fn ends_with(_: String) -> EndsWith; + fn mode(_: super::super::QueryMode) -> Mode; + fn not(_: Option) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::IdToken(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::IdToken(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod session_state { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "session_state"; + pub struct Set(pub Option); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetSessionState(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::SessionState(v) + } + } + pub fn set>(value: Option) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::SessionState(direction) + } + pub fn equals(value: Option) -> WhereParam { + WhereParam::SessionState( + _prisma::read_filters::StringNullableFilter::Equals(value), + ) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::StringNullableFilter, + SessionState, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: String) -> Lt; + fn lte(_: String) -> Lte; + fn gt(_: String) -> Gt; + fn gte(_: String) -> Gte; + fn contains(_: String) -> Contains; + fn starts_with(_: String) -> StartsWith; + fn ends_with(_: String) -> EndsWith; + fn mode(_: super::super::QueryMode) -> Mode; + fn not(_: Option) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::SessionState(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::SessionState(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod user { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "user"; + pub struct Fetch(pub user::UniqueArgs); + impl Fetch { + pub fn with(mut self, params: impl Into) -> Self { + self.0 = self.0.with(params.into()); + self + } + } + impl From for WithParam { + fn from(Fetch(v): Fetch) -> Self { + WithParam::User(v) + } + } + pub fn fetch() -> Fetch { + Fetch(user::UniqueArgs::new()) + } + pub struct Connect(user::UniqueWhereParam); + impl From for SetParam { + fn from(Connect(v): Connect) -> Self { + Self::ConnectUser(v) + } + } + pub fn connect>(value: user::UniqueWhereParam) -> T { + Connect(value).into() + } + pub fn is(value: Vec) -> WhereParam { + WhereParam::UserIs(value) + } + pub fn is_not(value: Vec) -> WhereParam { + WhereParam::UserIsNot(value) + } + pub enum Include { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::User(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { + Self::Select(selections) => { + selections.into_iter().map(|s| s.to_selection()).collect() + } + Self::Include(selections) => { + let mut nested_selections = < user :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; + nested_selections + .extend(selections.into_iter().map(|s| s.to_selection())); + nested_selections + } + Self::Fetch => { + ::scalar_selections( + ) + } + }; + ::prisma_client_rust::Selection::new("user", None, [], selections) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include(nested_selections: Vec) -> Self { + Self::Include(nested_selections) + } + } + pub enum Select { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::User(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { + Self::Select(selections) => { + selections.into_iter().map(|s| s.to_selection()).collect() + } + Self::Include(selections) => { + let mut nested_selections = vec![]; + nested_selections + .extend(selections.into_iter().map(|s| s.to_selection())); + nested_selections + } + Self::Fetch => { + ::scalar_selections( + ) + } + }; + ::prisma_client_rust::Selection::new("user", None, [], selections) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include(nested_selections: Vec) -> Self { + Self::Include(nested_selections) + } + } + } + pub fn provider_provider_account_id>( + provider: String, + provider_account_id: String, + ) -> T { + UniqueWhereParam::ProviderProviderAccountIdEquals( + provider, + provider_account_id, + ) + .into() + } + pub fn create( + r#type: String, + provider: String, + provider_account_id: String, + user: super::user::UniqueWhereParam, + _params: Vec, + ) -> ( + String, + String, + String, + super::user::UniqueWhereParam, + Vec, + ) { + (r#type, provider, provider_account_id, user, _params) + } + pub fn create_unchecked( + user_id: String, + r#type: String, + provider: String, + provider_account_id: String, + _params: Vec, + ) -> (String, String, String, String, Vec) { + (user_id, r#type, provider, provider_account_id, _params) + } + #[macro_export] + macro_rules ! _select_account { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: account :: select ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: account :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: account :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: account :: select ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: account :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: account :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { id , user_id , r#type , provider , provider_account_id , refresh_token , access_token , expires_at , token_type , scope , id_token , session_state , user } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } const SPECTA_TYPE_NAME : & 'static str = prisma_client_rust :: macros :: to_pascal_case ! ($ ($ module_name) ?) ; crate :: prisma :: account :: select ! (@ specta_data_struct ; pub struct Data { $ (# [specta (rename_from_path = crate :: prisma :: account :: $ field :: NAME)] pub $ field : crate :: prisma :: account :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } ; $ ($ module_name) ?) ; impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) +] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: account :: $ field :: NAME , & self . $ field) ? ;) * state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: account :: $ field :: NAME) , + ,] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: account :: $ field :: NAME => Ok (Field :: $ field)) , * , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * while let Some (key) = map . next_key () ? { match key { $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: account :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: account :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "userId" , "type" , "provider" , "providerAccountId" , "refresh_token" , "access_token" , "expires_at" , "token_type" , "scope" , "id_token" , "session_state" , "user"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: account :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { String } ; (@ field_type ; user_id) => { String } ; (@ field_type ; r#type) => { String } ; (@ field_type ; provider) => { String } ; (@ field_type ; provider_account_id) => { String } ; (@ field_type ; refresh_token) => { Option < String > } ; (@ field_type ; access_token) => { Option < String > } ; (@ field_type ; expires_at) => { Option < i32 > } ; (@ field_type ; token_type) => { Option < String > } ; (@ field_type ; scope) => { Option < String > } ; (@ field_type ; id_token) => { Option < String > } ; (@ field_type ; session_state) => { Option < String > } ; (@ field_type ; user : $ selection_mode : ident { $ ($ selections : tt) + }) => { user :: Data } ; (@ field_type ; user) => { crate :: prisma :: user :: Data } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Account" , available relations are "id, user_id, r#type, provider, provider_account_id, refresh_token, access_token, expires_at, token_type, scope, id_token, session_state, user")) } ; (@ field_module ; user : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: user :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: account :: SelectParam > :: into (crate :: prisma :: account :: id :: Select) } ; (@ selection_field_to_selection_param ; user_id) => { Into :: < crate :: prisma :: account :: SelectParam > :: into (crate :: prisma :: account :: user_id :: Select) } ; (@ selection_field_to_selection_param ; r#type) => { Into :: < crate :: prisma :: account :: SelectParam > :: into (crate :: prisma :: account :: r#type :: Select) } ; (@ selection_field_to_selection_param ; provider) => { Into :: < crate :: prisma :: account :: SelectParam > :: into (crate :: prisma :: account :: provider :: Select) } ; (@ selection_field_to_selection_param ; provider_account_id) => { Into :: < crate :: prisma :: account :: SelectParam > :: into (crate :: prisma :: account :: provider_account_id :: Select) } ; (@ selection_field_to_selection_param ; refresh_token) => { Into :: < crate :: prisma :: account :: SelectParam > :: into (crate :: prisma :: account :: refresh_token :: Select) } ; (@ selection_field_to_selection_param ; access_token) => { Into :: < crate :: prisma :: account :: SelectParam > :: into (crate :: prisma :: account :: access_token :: Select) } ; (@ selection_field_to_selection_param ; expires_at) => { Into :: < crate :: prisma :: account :: SelectParam > :: into (crate :: prisma :: account :: expires_at :: Select) } ; (@ selection_field_to_selection_param ; token_type) => { Into :: < crate :: prisma :: account :: SelectParam > :: into (crate :: prisma :: account :: token_type :: Select) } ; (@ selection_field_to_selection_param ; scope) => { Into :: < crate :: prisma :: account :: SelectParam > :: into (crate :: prisma :: account :: scope :: Select) } ; (@ selection_field_to_selection_param ; id_token) => { Into :: < crate :: prisma :: account :: SelectParam > :: into (crate :: prisma :: account :: id_token :: Select) } ; (@ selection_field_to_selection_param ; session_state) => { Into :: < crate :: prisma :: account :: SelectParam > :: into (crate :: prisma :: account :: session_state :: Select) } ; (@ selection_field_to_selection_param ; user $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: account :: SelectParam > :: into (crate :: prisma :: account :: user :: Select :: $ selection_mode (crate :: prisma :: user :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; user $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: account :: SelectParam > :: into (crate :: prisma :: account :: user :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: account :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; user_id) => { "userId" } ; (@ field_serde_name ; r#type) => { "type" } ; (@ field_serde_name ; provider) => { "provider" } ; (@ field_serde_name ; provider_account_id) => { "providerAccountId" } ; (@ field_serde_name ; refresh_token) => { "refresh_token" } ; (@ field_serde_name ; access_token) => { "access_token" } ; (@ field_serde_name ; expires_at) => { "expires_at" } ; (@ field_serde_name ; token_type) => { "token_type" } ; (@ field_serde_name ; scope) => { "scope" } ; (@ field_serde_name ; id_token) => { "id_token" } ; (@ field_serde_name ; session_state) => { "session_state" } ; (@ field_serde_name ; user) => { "user" } ; (@ specta_data_struct ; $ struct : item ;) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] # [specta (inline)] $ struct } ; (@ specta_data_struct ; $ struct : item ; $ name : ident) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] $ struct } ; } + pub use _select_account as select; + pub enum SelectParam { + Id(id::Select), + UserId(user_id::Select), + Type(r#type::Select), + Provider(provider::Select), + ProviderAccountId(provider_account_id::Select), + RefreshToken(refresh_token::Select), + AccessToken(access_token::Select), + ExpiresAt(expires_at::Select), + TokenType(token_type::Select), + Scope(scope::Select), + IdToken(id_token::Select), + SessionState(session_state::Select), + User(user::Select), + } + impl SelectParam { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + match self { + Self::Id(data) => data.to_selection(), + Self::UserId(data) => data.to_selection(), + Self::Type(data) => data.to_selection(), + Self::Provider(data) => data.to_selection(), + Self::ProviderAccountId(data) => data.to_selection(), + Self::RefreshToken(data) => data.to_selection(), + Self::AccessToken(data) => data.to_selection(), + Self::ExpiresAt(data) => data.to_selection(), + Self::TokenType(data) => data.to_selection(), + Self::Scope(data) => data.to_selection(), + Self::IdToken(data) => data.to_selection(), + Self::SessionState(data) => data.to_selection(), + Self::User(data) => data.to_selection(), + } + } + } + #[macro_export] + macro_rules ! _include_account { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: account :: include ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: account :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: account :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: account :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: account :: include ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: account :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: account :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: account :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { user } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } const SPECTA_TYPE_NAME : & 'static str = prisma_client_rust :: macros :: to_pascal_case ! ($ ($ module_name) ?) ; crate :: prisma :: account :: include ! (@ specta_data_struct ; pub struct Data { # [specta (rename_from_path = crate :: prisma :: account :: id :: NAME)] pub id : String , # [specta (rename_from_path = crate :: prisma :: account :: user_id :: NAME)] pub user_id : String , # [specta (rename_from_path = crate :: prisma :: account :: r#type :: NAME)] pub r#type : String , # [specta (rename_from_path = crate :: prisma :: account :: provider :: NAME)] pub provider : String , # [specta (rename_from_path = crate :: prisma :: account :: provider_account_id :: NAME)] pub provider_account_id : String , # [specta (rename_from_path = crate :: prisma :: account :: refresh_token :: NAME)] pub refresh_token : Option < String > , # [specta (rename_from_path = crate :: prisma :: account :: access_token :: NAME)] pub access_token : Option < String > , # [specta (rename_from_path = crate :: prisma :: account :: expires_at :: NAME)] pub expires_at : Option < i32 > , # [specta (rename_from_path = crate :: prisma :: account :: token_type :: NAME)] pub token_type : Option < String > , # [specta (rename_from_path = crate :: prisma :: account :: scope :: NAME)] pub scope : Option < String > , # [specta (rename_from_path = crate :: prisma :: account :: id_token :: NAME)] pub id_token : Option < String > , # [specta (rename_from_path = crate :: prisma :: account :: session_state :: NAME)] pub session_state : Option < String > , $ (# [specta (rename_from_path = crate :: prisma :: account :: $ field :: NAME)] pub $ field : crate :: prisma :: account :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } ; $ ($ module_name) ?) ; impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) + stringify ! (id) , stringify ! (user_id) , stringify ! (r#type) , stringify ! (provider) , stringify ! (provider_account_id) , stringify ! (refresh_token) , stringify ! (access_token) , stringify ! (expires_at) , stringify ! (token_type) , stringify ! (scope) , stringify ! (id_token) , stringify ! (session_state)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: account :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: account :: id :: NAME , & self . id) ? ; state . serialize_field (crate :: prisma :: account :: user_id :: NAME , & self . user_id) ? ; state . serialize_field (crate :: prisma :: account :: r#type :: NAME , & self . r#type) ? ; state . serialize_field (crate :: prisma :: account :: provider :: NAME , & self . provider) ? ; state . serialize_field (crate :: prisma :: account :: provider_account_id :: NAME , & self . provider_account_id) ? ; state . serialize_field (crate :: prisma :: account :: refresh_token :: NAME , & self . refresh_token) ? ; state . serialize_field (crate :: prisma :: account :: access_token :: NAME , & self . access_token) ? ; state . serialize_field (crate :: prisma :: account :: expires_at :: NAME , & self . expires_at) ? ; state . serialize_field (crate :: prisma :: account :: token_type :: NAME , & self . token_type) ? ; state . serialize_field (crate :: prisma :: account :: scope :: NAME , & self . scope) ? ; state . serialize_field (crate :: prisma :: account :: id_token :: NAME , & self . id_token) ? ; state . serialize_field (crate :: prisma :: account :: session_state :: NAME , & self . session_state) ? ; state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , id , user_id , r#type , provider , provider_account_id , refresh_token , access_token , expires_at , token_type , scope , id_token , session_state } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: account :: $ field :: NAME) , + , crate :: prisma :: account :: id :: NAME , crate :: prisma :: account :: user_id :: NAME , crate :: prisma :: account :: r#type :: NAME , crate :: prisma :: account :: provider :: NAME , crate :: prisma :: account :: provider_account_id :: NAME , crate :: prisma :: account :: refresh_token :: NAME , crate :: prisma :: account :: access_token :: NAME , crate :: prisma :: account :: expires_at :: NAME , crate :: prisma :: account :: token_type :: NAME , crate :: prisma :: account :: scope :: NAME , crate :: prisma :: account :: id_token :: NAME , crate :: prisma :: account :: session_state :: NAME] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: account :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: account :: id :: NAME => Ok (Field :: id) , crate :: prisma :: account :: user_id :: NAME => Ok (Field :: user_id) , crate :: prisma :: account :: r#type :: NAME => Ok (Field :: r#type) , crate :: prisma :: account :: provider :: NAME => Ok (Field :: provider) , crate :: prisma :: account :: provider_account_id :: NAME => Ok (Field :: provider_account_id) , crate :: prisma :: account :: refresh_token :: NAME => Ok (Field :: refresh_token) , crate :: prisma :: account :: access_token :: NAME => Ok (Field :: access_token) , crate :: prisma :: account :: expires_at :: NAME => Ok (Field :: expires_at) , crate :: prisma :: account :: token_type :: NAME => Ok (Field :: token_type) , crate :: prisma :: account :: scope :: NAME => Ok (Field :: scope) , crate :: prisma :: account :: id_token :: NAME => Ok (Field :: id_token) , crate :: prisma :: account :: session_state :: NAME => Ok (Field :: session_state) , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * let mut id = None ; let mut user_id = None ; let mut r#type = None ; let mut provider = None ; let mut provider_account_id = None ; let mut refresh_token = None ; let mut access_token = None ; let mut expires_at = None ; let mut token_type = None ; let mut scope = None ; let mut id_token = None ; let mut session_state = None ; while let Some (key) = map . next_key () ? { match key { Field :: id => { if id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: account :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } Field :: user_id => { if user_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: account :: user_id :: NAME)) ; } user_id = Some (map . next_value () ?) ; } Field :: r#type => { if r#type . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: account :: r#type :: NAME)) ; } r#type = Some (map . next_value () ?) ; } Field :: provider => { if provider . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: account :: provider :: NAME)) ; } provider = Some (map . next_value () ?) ; } Field :: provider_account_id => { if provider_account_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: account :: provider_account_id :: NAME)) ; } provider_account_id = Some (map . next_value () ?) ; } Field :: refresh_token => { if refresh_token . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: account :: refresh_token :: NAME)) ; } refresh_token = Some (map . next_value () ?) ; } Field :: access_token => { if access_token . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: account :: access_token :: NAME)) ; } access_token = Some (map . next_value () ?) ; } Field :: expires_at => { if expires_at . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: account :: expires_at :: NAME)) ; } expires_at = Some (map . next_value () ?) ; } Field :: token_type => { if token_type . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: account :: token_type :: NAME)) ; } token_type = Some (map . next_value () ?) ; } Field :: scope => { if scope . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: account :: scope :: NAME)) ; } scope = Some (map . next_value () ?) ; } Field :: id_token => { if id_token . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: account :: id_token :: NAME)) ; } id_token = Some (map . next_value () ?) ; } Field :: session_state => { if session_state . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: account :: session_state :: NAME)) ; } session_state = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: account :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: account :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: account :: id :: NAME)) ? ; let user_id = user_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: account :: user_id :: NAME)) ? ; let r#type = r#type . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: account :: r#type :: NAME)) ? ; let provider = provider . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: account :: provider :: NAME)) ? ; let provider_account_id = provider_account_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: account :: provider_account_id :: NAME)) ? ; let refresh_token = refresh_token . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: account :: refresh_token :: NAME)) ? ; let access_token = access_token . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: account :: access_token :: NAME)) ? ; let expires_at = expires_at . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: account :: expires_at :: NAME)) ? ; let token_type = token_type . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: account :: token_type :: NAME)) ? ; let scope = scope . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: account :: scope :: NAME)) ? ; let id_token = id_token . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: account :: id_token :: NAME)) ? ; let session_state = session_state . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: account :: session_state :: NAME)) ? ; Ok (Data { id , user_id , r#type , provider , provider_account_id , refresh_token , access_token , expires_at , token_type , scope , id_token , session_state , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "userId" , "type" , "provider" , "providerAccountId" , "refresh_token" , "access_token" , "expires_at" , "token_type" , "scope" , "id_token" , "session_state" , "user"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: account :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; user : $ selection_mode : ident { $ ($ selections : tt) + }) => { user :: Data } ; (@ field_type ; user) => { crate :: prisma :: user :: Data } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Account" , available relations are "user")) } ; (@ field_module ; user : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: user :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; user $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: account :: IncludeParam > :: into (crate :: prisma :: account :: user :: Include :: $ selection_mode (crate :: prisma :: user :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; user $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: account :: IncludeParam > :: into (crate :: prisma :: account :: user :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: account :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; user_id) => { "userId" } ; (@ field_serde_name ; r#type) => { "type" } ; (@ field_serde_name ; provider) => { "provider" } ; (@ field_serde_name ; provider_account_id) => { "providerAccountId" } ; (@ field_serde_name ; refresh_token) => { "refresh_token" } ; (@ field_serde_name ; access_token) => { "access_token" } ; (@ field_serde_name ; expires_at) => { "expires_at" } ; (@ field_serde_name ; token_type) => { "token_type" } ; (@ field_serde_name ; scope) => { "scope" } ; (@ field_serde_name ; id_token) => { "id_token" } ; (@ field_serde_name ; session_state) => { "session_state" } ; (@ field_serde_name ; user) => { "user" } ; (@ specta_data_struct ; $ struct : item ;) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] # [specta (inline)] $ struct } ; (@ specta_data_struct ; $ struct : item ; $ name : ident) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] $ struct } ; } + pub use _include_account as include; + pub enum IncludeParam { + Id(id::Include), + UserId(user_id::Include), + Type(r#type::Include), + Provider(provider::Include), + ProviderAccountId(provider_account_id::Include), + RefreshToken(refresh_token::Include), + AccessToken(access_token::Include), + ExpiresAt(expires_at::Include), + TokenType(token_type::Include), + Scope(scope::Include), + IdToken(id_token::Include), + SessionState(session_state::Include), + User(user::Include), + } + impl IncludeParam { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + match self { + Self::Id(data) => data.to_selection(), + Self::UserId(data) => data.to_selection(), + Self::Type(data) => data.to_selection(), + Self::Provider(data) => data.to_selection(), + Self::ProviderAccountId(data) => data.to_selection(), + Self::RefreshToken(data) => data.to_selection(), + Self::AccessToken(data) => data.to_selection(), + Self::ExpiresAt(data) => data.to_selection(), + Self::TokenType(data) => data.to_selection(), + Self::Scope(data) => data.to_selection(), + Self::IdToken(data) => data.to_selection(), + Self::SessionState(data) => data.to_selection(), + Self::User(data) => data.to_selection(), + } + } + } + #[macro_export] + macro_rules ! _partial_unchecked_account { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: account struct $ struct_name { # [serde (rename = "id")] pub id : String , # [serde (rename = "userId")] pub user_id : String , # [serde (rename = "type")] pub r#type : String , # [serde (rename = "provider")] pub provider : String , # [serde (rename = "providerAccountId")] pub provider_account_id : String , # [serde (rename = "refresh_token")] # [serde (default , with = "::prisma_client_rust::serde::double_option")] pub refresh_token : Option < String > , # [serde (rename = "access_token")] # [serde (default , with = "::prisma_client_rust::serde::double_option")] pub access_token : Option < String > , # [serde (rename = "expires_at")] # [serde (default , with = "::prisma_client_rust::serde::double_option")] pub expires_at : Option < i32 > , # [serde (rename = "token_type")] # [serde (default , with = "::prisma_client_rust::serde::double_option")] pub token_type : Option < String > , # [serde (rename = "scope")] # [serde (default , with = "::prisma_client_rust::serde::double_option")] pub scope : Option < String > , # [serde (rename = "id_token")] # [serde (default , with = "::prisma_client_rust::serde::double_option")] pub id_token : Option < String > , # [serde (rename = "session_state")] # [serde (default , with = "::prisma_client_rust::serde::double_option")] pub session_state : Option < String > } [$ ($ scalar_field) , +] } } ; } + pub use _partial_unchecked_account as partial_unchecked; + #[derive( + Debug, + Clone, + :: serde :: Serialize, + :: serde :: Deserialize, + :: prisma_client_rust :: specta :: Type, + )] + #[specta(rename = "Account", crate = "prisma_client_rust::specta")] + pub struct Data { + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "userId")] + pub user_id: String, + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "provider")] + pub provider: String, + #[serde(rename = "providerAccountId")] + pub provider_account_id: String, + #[serde(rename = "refresh_token")] + pub refresh_token: Option, + #[serde(rename = "access_token")] + pub access_token: Option, + #[serde(rename = "expires_at")] + pub expires_at: Option, + #[serde(rename = "token_type")] + pub token_type: Option, + #[serde(rename = "scope")] + pub scope: Option, + #[serde(rename = "id_token")] + pub id_token: Option, + #[serde(rename = "session_state")] + pub session_state: Option, + #[serde(rename = "user")] + #[specta(skip)] + pub user: Option>, + } + impl Data { + pub fn user( + &self, + ) -> Result<&super::user::Data, ::prisma_client_rust::RelationNotFetchedError> + { + self + .user + .as_ref() + .ok_or(::prisma_client_rust::RelationNotFetchedError::new( + stringify!(user), + )) + .map(|v| v.as_ref()) + } + } + #[derive(Clone)] + pub enum WithParam { + User(super::user::UniqueArgs), + } + impl Into<::prisma_client_rust::Selection> for WithParam { + fn into(self) -> ::prisma_client_rust::Selection { + match self { + Self::User(args) => { + let mut selections = < super :: user :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; + selections.extend( + args + .with_params + .into_iter() + .map(Into::<::prisma_client_rust::Selection>::into), + ); + ::prisma_client_rust::Selection::new(user::NAME, None, [], selections) + } + } + } + } + #[derive(Clone)] + pub enum SetParam { + SetId(String), + SetUserId(String), + SetType(String), + SetProvider(String), + SetProviderAccountId(String), + SetRefreshToken(Option), + SetAccessToken(Option), + SetExpiresAt(Option), + IncrementExpiresAt(i32), + DecrementExpiresAt(i32), + MultiplyExpiresAt(i32), + DivideExpiresAt(i32), + SetTokenType(Option), + SetScope(Option), + SetIdToken(Option), + SetSessionState(Option), + ConnectUser(super::user::UniqueWhereParam), + } + impl From for (String, ::prisma_client_rust::PrismaValue) { + fn from(param: SetParam) -> Self { + match param { + SetParam::SetId(value) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(value), + ), + SetParam::SetUserId(value) => ( + user_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(value), + ), + SetParam::SetType(value) => ( + r#type::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(value), + ), + SetParam::SetProvider(value) => ( + provider::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(value), + ), + SetParam::SetProviderAccountId(value) => ( + provider_account_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(value), + ), + SetParam::SetRefreshToken(value) => ( + refresh_token::NAME.to_string(), + value + .map(|value| ::prisma_client_rust::PrismaValue::String(value)) + .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), + ), + SetParam::SetAccessToken(value) => ( + access_token::NAME.to_string(), + value + .map(|value| ::prisma_client_rust::PrismaValue::String(value)) + .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), + ), + SetParam::SetExpiresAt(value) => ( + expires_at::NAME.to_string(), + value + .map(|value| ::prisma_client_rust::PrismaValue::Int(value as i64)) + .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), + ), + SetParam::IncrementExpiresAt(value) => ( + expires_at::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "increment".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::DecrementExpiresAt(value) => ( + expires_at::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "decrement".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::MultiplyExpiresAt(value) => ( + expires_at::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "multiply".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::DivideExpiresAt(value) => ( + expires_at::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "divide".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]), + ), + SetParam::SetTokenType(value) => ( + token_type::NAME.to_string(), + value + .map(|value| ::prisma_client_rust::PrismaValue::String(value)) + .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), + ), + SetParam::SetScope(value) => ( + scope::NAME.to_string(), + value + .map(|value| ::prisma_client_rust::PrismaValue::String(value)) + .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), + ), + SetParam::SetIdToken(value) => ( + id_token::NAME.to_string(), + value + .map(|value| ::prisma_client_rust::PrismaValue::String(value)) + .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), + ), + SetParam::SetSessionState(value) => ( + session_state::NAME.to_string(), + value + .map(|value| ::prisma_client_rust::PrismaValue::String(value)) + .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), + ), + SetParam::ConnectUser(where_param) => ( + user::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "connect".to_string(), + ::prisma_client_rust::PrismaValue::Object( + [where_param] + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + } + } + } + #[derive(Clone)] + pub enum UncheckedSetParam { + Id(String), + UserId(String), + Type(String), + Provider(String), + ProviderAccountId(String), + RefreshToken(Option), + AccessToken(Option), + ExpiresAt(Option), + TokenType(Option), + Scope(Option), + IdToken(Option), + SessionState(Option), + } + impl From for SetParam { + fn from(param: UncheckedSetParam) -> Self { + match param { + UncheckedSetParam::Id(value) => Self::SetId(value), + UncheckedSetParam::UserId(value) => Self::SetUserId(value), + UncheckedSetParam::Type(value) => Self::SetType(value), + UncheckedSetParam::Provider(value) => Self::SetProvider(value), + UncheckedSetParam::ProviderAccountId(value) => { + Self::SetProviderAccountId(value) + } + UncheckedSetParam::RefreshToken(value) => Self::SetRefreshToken(value), + UncheckedSetParam::AccessToken(value) => Self::SetAccessToken(value), + UncheckedSetParam::ExpiresAt(value) => Self::SetExpiresAt(value), + UncheckedSetParam::TokenType(value) => Self::SetTokenType(value), + UncheckedSetParam::Scope(value) => Self::SetScope(value), + UncheckedSetParam::IdToken(value) => Self::SetIdToken(value), + UncheckedSetParam::SessionState(value) => Self::SetSessionState(value), + } + } + } + #[derive(Clone)] + pub enum OrderByParam { + Id(::prisma_client_rust::Direction), + UserId(::prisma_client_rust::Direction), + Type(::prisma_client_rust::Direction), + Provider(::prisma_client_rust::Direction), + ProviderAccountId(::prisma_client_rust::Direction), + RefreshToken(::prisma_client_rust::Direction), + AccessToken(::prisma_client_rust::Direction), + ExpiresAt(::prisma_client_rust::Direction), + TokenType(::prisma_client_rust::Direction), + Scope(::prisma_client_rust::Direction), + IdToken(::prisma_client_rust::Direction), + SessionState(::prisma_client_rust::Direction), + } + impl Into<(String, ::prisma_client_rust::PrismaValue)> for OrderByParam { + fn into(self) -> (String, ::prisma_client_rust::PrismaValue) { + match self { + Self::Id(direction) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::UserId(direction) => ( + user_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::Type(direction) => ( + r#type::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::Provider(direction) => ( + provider::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::ProviderAccountId(direction) => ( + provider_account_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::RefreshToken(direction) => ( + refresh_token::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::AccessToken(direction) => ( + access_token::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::ExpiresAt(direction) => ( + expires_at::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::TokenType(direction) => ( + token_type::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::Scope(direction) => ( + scope::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::IdToken(direction) => ( + id_token::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::SessionState(direction) => ( + session_state::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + } + } + } + #[derive(Clone)] + pub enum WhereParam { + Not(Vec), + Or(Vec), + And(Vec), + ProviderProviderAccountIdEquals(String, String), + Id(_prisma::read_filters::StringFilter), + UserId(_prisma::read_filters::StringFilter), + Type(_prisma::read_filters::StringFilter), + Provider(_prisma::read_filters::StringFilter), + ProviderAccountId(_prisma::read_filters::StringFilter), + RefreshToken(_prisma::read_filters::StringNullableFilter), + AccessToken(_prisma::read_filters::StringNullableFilter), + ExpiresAt(_prisma::read_filters::IntNullableFilter), + TokenType(_prisma::read_filters::StringNullableFilter), + Scope(_prisma::read_filters::StringNullableFilter), + IdToken(_prisma::read_filters::StringNullableFilter), + SessionState(_prisma::read_filters::StringNullableFilter), + UserIs(Vec), + UserIsNot(Vec), + } + impl ::prisma_client_rust::WhereInput for WhereParam { + fn serialize(self) -> ::prisma_client_rust::SerializedWhereInput { + let (name, value) = match self { + Self::Not(value) => ( + "NOT", + ::prisma_client_rust::SerializedWhereValue::Object( + ::prisma_client_rust::merge_fields( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .collect(), + ), + ), + ), + Self::Or(value) => ( + "OR", + ::prisma_client_rust::SerializedWhereValue::List( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .map(|v| vec![v]) + .map(::prisma_client_rust::PrismaValue::Object) + .collect(), + ), + ), + Self::And(value) => ( + "AND", + ::prisma_client_rust::SerializedWhereValue::Object( + ::prisma_client_rust::merge_fields( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .collect(), + ), + ), + ), + Self::ProviderProviderAccountIdEquals( + provider, + provider_account_id, + ) => ( + "provider_providerAccountId", + ::prisma_client_rust::SerializedWhereValue::Object(vec![ + ( + provider::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(provider), + ), + ( + provider_account_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(provider_account_id), + ), + ]), + ), + Self::Id(value) => (id::NAME, value.into()), + Self::UserId(value) => (user_id::NAME, value.into()), + Self::Type(value) => (r#type::NAME, value.into()), + Self::Provider(value) => (provider::NAME, value.into()), + Self::ProviderAccountId(value) => { + (provider_account_id::NAME, value.into()) + } + Self::RefreshToken(value) => (refresh_token::NAME, value.into()), + Self::AccessToken(value) => (access_token::NAME, value.into()), + Self::ExpiresAt(value) => (expires_at::NAME, value.into()), + Self::TokenType(value) => (token_type::NAME, value.into()), + Self::Scope(value) => (scope::NAME, value.into()), + Self::IdToken(value) => (id_token::NAME, value.into()), + Self::SessionState(value) => (session_state::NAME, value.into()), + Self::UserIs(where_params) => ( + user::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "is".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::UserIsNot(where_params) => ( + user::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "isNot".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + }; + ::prisma_client_rust::SerializedWhereInput::new(name, value.into()) + } + } + #[derive(Clone)] + pub enum UniqueWhereParam { + ProviderProviderAccountIdEquals(String, String), + IdEquals(String), + } + impl From for WhereParam { + fn from(value: UniqueWhereParam) -> Self { + match value { + UniqueWhereParam::ProviderProviderAccountIdEquals( + provider, + provider_account_id, + ) => { + Self::ProviderProviderAccountIdEquals(provider, provider_account_id) + } + UniqueWhereParam::IdEquals(value) => { + Self::Id(_prisma::read_filters::StringFilter::Equals(value)) + } + } + } + } + impl From<::prisma_client_rust::Operator> for WhereParam { + fn from(op: ::prisma_client_rust::Operator) -> Self { + match op { + ::prisma_client_rust::Operator::Not(value) => Self::Not(value), + ::prisma_client_rust::Operator::And(value) => Self::And(value), + ::prisma_client_rust::Operator::Or(value) => Self::Or(value), + } + } + } + #[derive(Clone)] + pub struct Types; + impl ::prisma_client_rust::ModelTypes for Types { + type Data = Data; + type Where = WhereParam; + type UncheckedSet = UncheckedSetParam; + type Set = SetParam; + type With = WithParam; + type OrderBy = OrderByParam; + type Cursor = UniqueWhereParam; + const MODEL: &'static str = NAME; + fn scalar_selections() -> Vec<::prisma_client_rust::Selection> { + vec![ + ::prisma_client_rust::sel(id::NAME), + ::prisma_client_rust::sel(user_id::NAME), + ::prisma_client_rust::sel(r#type::NAME), + ::prisma_client_rust::sel(provider::NAME), + ::prisma_client_rust::sel(provider_account_id::NAME), + ::prisma_client_rust::sel(refresh_token::NAME), + ::prisma_client_rust::sel(access_token::NAME), + ::prisma_client_rust::sel(expires_at::NAME), + ::prisma_client_rust::sel(token_type::NAME), + ::prisma_client_rust::sel(scope::NAME), + ::prisma_client_rust::sel(id_token::NAME), + ::prisma_client_rust::sel(session_state::NAME), + ] + } + } + pub type UniqueArgs = ::prisma_client_rust::UniqueArgs; + pub type ManyArgs = ::prisma_client_rust::ManyArgs; + pub type Count<'a> = ::prisma_client_rust::Count<'a, Types>; + pub type Create<'a> = ::prisma_client_rust::Create<'a, Types>; + pub type CreateMany<'a> = ::prisma_client_rust::CreateMany<'a, Types>; + pub type FindUnique<'a> = ::prisma_client_rust::FindUnique<'a, Types>; + pub type FindMany<'a> = ::prisma_client_rust::FindMany<'a, Types>; + pub type FindFirst<'a> = ::prisma_client_rust::FindFirst<'a, Types>; + pub type Update<'a> = ::prisma_client_rust::Update<'a, Types>; + pub type UpdateMany<'a> = ::prisma_client_rust::UpdateMany<'a, Types>; + pub type Upsert<'a> = ::prisma_client_rust::Upsert<'a, Types>; + pub type Delete<'a> = ::prisma_client_rust::Delete<'a, Types>; + pub type DeleteMany<'a> = ::prisma_client_rust::DeleteMany<'a, Types>; + #[derive(Clone)] + pub struct Actions<'a> { + pub client: &'a ::prisma_client_rust::PrismaClientInternals, + } + impl<'a> Actions<'a> { + pub fn find_unique(self, _where: UniqueWhereParam) -> FindUnique<'a> { + FindUnique::new(self.client, _where.into()) + } + pub fn find_first(self, _where: Vec) -> FindFirst<'a> { + FindFirst::new(self.client, _where) + } + pub fn find_many(self, _where: Vec) -> FindMany<'a> { + FindMany::new(self.client, _where) + } + pub fn create( + self, + r#type: String, + provider: String, + provider_account_id: String, + user: super::user::UniqueWhereParam, + mut _params: Vec, + ) -> Create<'a> { + _params.extend([ + r#type::set(r#type), + provider::set(provider), + provider_account_id::set(provider_account_id), + user::connect(user), + ]); + Create::new(self.client, _params) + } + pub fn create_unchecked( + self, + user_id: String, + r#type: String, + provider: String, + provider_account_id: String, + mut _params: Vec, + ) -> Create<'a> { + _params.extend([ + user_id::set(user_id), + r#type::set(r#type), + provider::set(provider), + provider_account_id::set(provider_account_id), + ]); + Create::new(self.client, _params.into_iter().map(Into::into).collect()) + } + pub fn create_many( + self, + data: Vec<(String, String, String, String, Vec)>, + ) -> CreateMany<'a> { + let data = data + .into_iter() + .map( + |(user_id, r#type, provider, provider_account_id, mut _params)| { + _params.extend([ + user_id::set(user_id), + r#type::set(r#type), + provider::set(provider), + provider_account_id::set(provider_account_id), + ]); + _params + }, + ) + .collect(); + CreateMany::new(self.client, data) + } + pub fn update( + self, + _where: UniqueWhereParam, + _params: Vec, + ) -> Update<'a> { + Update::new(self.client, _where.into(), _params, vec![]) + } + pub fn update_unchecked( + self, + _where: UniqueWhereParam, + _params: Vec, + ) -> Update<'a> { + Update::new( + self.client, + _where.into(), + _params.into_iter().map(Into::into).collect(), + vec![], + ) + } + pub fn update_many( + self, + _where: Vec, + _params: Vec, + ) -> UpdateMany<'a> { + UpdateMany::new(self.client, _where, _params) + } + pub fn upsert( + self, + _where: UniqueWhereParam, + (r#type, provider, provider_account_id, user, mut _params): ( + String, + String, + String, + super::user::UniqueWhereParam, + Vec, + ), + _update: Vec, + ) -> Upsert<'a> { + _params.extend([ + r#type::set(r#type), + provider::set(provider), + provider_account_id::set(provider_account_id), + user::connect(user), + ]); + Upsert::new(self.client, _where.into(), _params, _update) + } + pub fn delete(self, _where: UniqueWhereParam) -> Delete<'a> { + Delete::new(self.client, _where.into(), vec![]) + } + pub fn delete_many(self, _where: Vec) -> DeleteMany<'a> { + DeleteMany::new(self.client, _where) + } + pub fn count(self, _where: Vec) -> Count<'a> { + Count::new(self.client, _where) + } + pub fn find_raw( + self, + ) -> ::prisma_client_rust::FindRaw<'a, Types, T> { + ::prisma_client_rust::FindRaw::new(self.client) + } + pub fn aggregate_raw( + self, + ) -> ::prisma_client_rust::AggregateRaw<'a, Types, T> { + ::prisma_client_rust::AggregateRaw::new(self.client) + } + } +} +pub mod session { + use super::_prisma::*; + use super::*; + pub const NAME: &str = "Session"; + pub mod id { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "id"; + pub struct Set(pub String); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetId(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::Id(v) + } + } + pub fn set>(value: String) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::Id(direction) + } + pub fn equals>(value: String) -> T { + UniqueWhereParam::IdEquals(value).into() + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::StringFilter, + Id, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: String) -> Lt; + fn lte(_: String) -> Lte; + fn gt(_: String) -> Gt; + fn gte(_: String) -> Gte; + fn contains(_: String) -> Contains; + fn starts_with(_: String) -> StartsWith; + fn ends_with(_: String) -> EndsWith; + fn mode(_: super::super::QueryMode) -> Mode; + fn not(_: String) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Id(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Id(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod session_token { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "sessionToken"; + pub struct Set(pub String); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetSessionToken(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::SessionToken(v) + } + } + pub fn set>(value: String) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::SessionToken(direction) + } + pub fn equals>(value: String) -> T { + UniqueWhereParam::SessionTokenEquals(value).into() + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::StringFilter, + SessionToken, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: String) -> Lt; + fn lte(_: String) -> Lte; + fn gt(_: String) -> Gt; + fn gte(_: String) -> Gte; + fn contains(_: String) -> Contains; + fn starts_with(_: String) -> StartsWith; + fn ends_with(_: String) -> EndsWith; + fn mode(_: super::super::QueryMode) -> Mode; + fn not(_: String) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::SessionToken(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::SessionToken(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod user_id { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "userId"; + pub struct Set(pub String); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetUserId(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::UserId(v) + } + } + pub fn set>(value: String) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::UserId(direction) + } + pub fn equals(value: String) -> WhereParam { + WhereParam::UserId(_prisma::read_filters::StringFilter::Equals(value)) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::StringFilter, + UserId, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: String) -> Lt; + fn lte(_: String) -> Lte; + fn gt(_: String) -> Gt; + fn gte(_: String) -> Gte; + fn contains(_: String) -> Contains; + fn starts_with(_: String) -> StartsWith; + fn ends_with(_: String) -> EndsWith; + fn mode(_: super::super::QueryMode) -> Mode; + fn not(_: String) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::UserId(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::UserId(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod expires { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "expires"; + pub struct Set( + pub ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetExpires(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::Expires(v) + } + } + pub fn set>( + value: ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::Expires(direction) + } + pub fn equals( + value: ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ) -> WhereParam { + WhereParam::Expires(_prisma::read_filters::DateTimeFilter::Equals(value)) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::DateTimeFilter, + Expires, + { + fn in_vec( + _: Vec< + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + >, + ) -> InVec; + fn not_in_vec( + _: Vec< + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + >, + ) -> NotInVec; + fn lt( + _: ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ) -> Lt; + fn lte( + _: ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ) -> Lte; + fn gt( + _: ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ) -> Gt; + fn gte( + _: ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ) -> Gte; + fn not( + _: ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Expires(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Expires(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod user { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "user"; + pub struct Fetch(pub user::UniqueArgs); + impl Fetch { + pub fn with(mut self, params: impl Into) -> Self { + self.0 = self.0.with(params.into()); + self + } + } + impl From for WithParam { + fn from(Fetch(v): Fetch) -> Self { + WithParam::User(v) + } + } + pub fn fetch() -> Fetch { + Fetch(user::UniqueArgs::new()) + } + pub struct Connect(user::UniqueWhereParam); + impl From for SetParam { + fn from(Connect(v): Connect) -> Self { + Self::ConnectUser(v) + } + } + pub fn connect>(value: user::UniqueWhereParam) -> T { + Connect(value).into() + } + pub fn is(value: Vec) -> WhereParam { + WhereParam::UserIs(value) + } + pub fn is_not(value: Vec) -> WhereParam { + WhereParam::UserIsNot(value) + } + pub enum Include { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::User(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { + Self::Select(selections) => { + selections.into_iter().map(|s| s.to_selection()).collect() + } + Self::Include(selections) => { + let mut nested_selections = < user :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; + nested_selections + .extend(selections.into_iter().map(|s| s.to_selection())); + nested_selections + } + Self::Fetch => { + ::scalar_selections( + ) + } + }; + ::prisma_client_rust::Selection::new("user", None, [], selections) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include(nested_selections: Vec) -> Self { + Self::Include(nested_selections) + } + } + pub enum Select { + Select(Vec), + Include(Vec), + Fetch, + } + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::User(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + let selections = match self { + Self::Select(selections) => { + selections.into_iter().map(|s| s.to_selection()).collect() + } + Self::Include(selections) => { + let mut nested_selections = vec![]; + nested_selections + .extend(selections.into_iter().map(|s| s.to_selection())); + nested_selections + } + Self::Fetch => { + ::scalar_selections( + ) + } + }; + ::prisma_client_rust::Selection::new("user", None, [], selections) + } + pub fn select(nested_selections: Vec) -> Self { + Self::Select(nested_selections) + } + pub fn include(nested_selections: Vec) -> Self { + Self::Include(nested_selections) + } + } + } + pub fn create( + session_token: String, + expires: ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + user: super::user::UniqueWhereParam, + _params: Vec, + ) -> ( + String, + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + super::user::UniqueWhereParam, + Vec, + ) { + (session_token, expires, user, _params) + } + pub fn create_unchecked( + session_token: String, + user_id: String, + expires: ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + _params: Vec, + ) -> ( + String, + String, + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + Vec, + ) { + (session_token, user_id, expires, _params) + } + #[macro_export] + macro_rules ! _select_session { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: session :: select ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: session :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: session :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: session :: select ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: session :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: session :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { id , session_token , user_id , expires , user } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } const SPECTA_TYPE_NAME : & 'static str = prisma_client_rust :: macros :: to_pascal_case ! ($ ($ module_name) ?) ; crate :: prisma :: session :: select ! (@ specta_data_struct ; pub struct Data { $ (# [specta (rename_from_path = crate :: prisma :: session :: $ field :: NAME)] pub $ field : crate :: prisma :: session :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } ; $ ($ module_name) ?) ; impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) +] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: session :: $ field :: NAME , & self . $ field) ? ;) * state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: session :: $ field :: NAME) , + ,] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: session :: $ field :: NAME => Ok (Field :: $ field)) , * , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * while let Some (key) = map . next_key () ? { match key { $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: session :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: session :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "sessionToken" , "userId" , "expires" , "user"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: session :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { String } ; (@ field_type ; session_token) => { String } ; (@ field_type ; user_id) => { String } ; (@ field_type ; expires) => { :: prisma_client_rust :: chrono :: DateTime < :: prisma_client_rust :: chrono :: FixedOffset , > } ; (@ field_type ; user : $ selection_mode : ident { $ ($ selections : tt) + }) => { user :: Data } ; (@ field_type ; user) => { crate :: prisma :: user :: Data } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Session" , available relations are "id, session_token, user_id, expires, user")) } ; (@ field_module ; user : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: user :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: session :: SelectParam > :: into (crate :: prisma :: session :: id :: Select) } ; (@ selection_field_to_selection_param ; session_token) => { Into :: < crate :: prisma :: session :: SelectParam > :: into (crate :: prisma :: session :: session_token :: Select) } ; (@ selection_field_to_selection_param ; user_id) => { Into :: < crate :: prisma :: session :: SelectParam > :: into (crate :: prisma :: session :: user_id :: Select) } ; (@ selection_field_to_selection_param ; expires) => { Into :: < crate :: prisma :: session :: SelectParam > :: into (crate :: prisma :: session :: expires :: Select) } ; (@ selection_field_to_selection_param ; user $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: session :: SelectParam > :: into (crate :: prisma :: session :: user :: Select :: $ selection_mode (crate :: prisma :: user :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; user $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: session :: SelectParam > :: into (crate :: prisma :: session :: user :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: session :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; session_token) => { "sessionToken" } ; (@ field_serde_name ; user_id) => { "userId" } ; (@ field_serde_name ; expires) => { "expires" } ; (@ field_serde_name ; user) => { "user" } ; (@ specta_data_struct ; $ struct : item ;) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] # [specta (inline)] $ struct } ; (@ specta_data_struct ; $ struct : item ; $ name : ident) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] $ struct } ; } + pub use _select_session as select; + pub enum SelectParam { + Id(id::Select), + SessionToken(session_token::Select), + UserId(user_id::Select), + Expires(expires::Select), + User(user::Select), + } + impl SelectParam { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + match self { + Self::Id(data) => data.to_selection(), + Self::SessionToken(data) => data.to_selection(), + Self::UserId(data) => data.to_selection(), + Self::Expires(data) => data.to_selection(), + Self::User(data) => data.to_selection(), + } + } + } + #[macro_export] + macro_rules ! _include_session { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: session :: include ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: session :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: session :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: session :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: session :: include ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: session :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: session :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: session :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { user } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } const SPECTA_TYPE_NAME : & 'static str = prisma_client_rust :: macros :: to_pascal_case ! ($ ($ module_name) ?) ; crate :: prisma :: session :: include ! (@ specta_data_struct ; pub struct Data { # [specta (rename_from_path = crate :: prisma :: session :: id :: NAME)] pub id : String , # [specta (rename_from_path = crate :: prisma :: session :: session_token :: NAME)] pub session_token : String , # [specta (rename_from_path = crate :: prisma :: session :: user_id :: NAME)] pub user_id : String , # [specta (rename_from_path = crate :: prisma :: session :: expires :: NAME)] pub expires : :: prisma_client_rust :: chrono :: DateTime < :: prisma_client_rust :: chrono :: FixedOffset , > , $ (# [specta (rename_from_path = crate :: prisma :: session :: $ field :: NAME)] pub $ field : crate :: prisma :: session :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } ; $ ($ module_name) ?) ; impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) + stringify ! (id) , stringify ! (session_token) , stringify ! (user_id) , stringify ! (expires)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: session :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: session :: id :: NAME , & self . id) ? ; state . serialize_field (crate :: prisma :: session :: session_token :: NAME , & self . session_token) ? ; state . serialize_field (crate :: prisma :: session :: user_id :: NAME , & self . user_id) ? ; state . serialize_field (crate :: prisma :: session :: expires :: NAME , & self . expires) ? ; state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , id , session_token , user_id , expires } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: session :: $ field :: NAME) , + , crate :: prisma :: session :: id :: NAME , crate :: prisma :: session :: session_token :: NAME , crate :: prisma :: session :: user_id :: NAME , crate :: prisma :: session :: expires :: NAME] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: session :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: session :: id :: NAME => Ok (Field :: id) , crate :: prisma :: session :: session_token :: NAME => Ok (Field :: session_token) , crate :: prisma :: session :: user_id :: NAME => Ok (Field :: user_id) , crate :: prisma :: session :: expires :: NAME => Ok (Field :: expires) , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * let mut id = None ; let mut session_token = None ; let mut user_id = None ; let mut expires = None ; while let Some (key) = map . next_key () ? { match key { Field :: id => { if id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: session :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } Field :: session_token => { if session_token . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: session :: session_token :: NAME)) ; } session_token = Some (map . next_value () ?) ; } Field :: user_id => { if user_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: session :: user_id :: NAME)) ; } user_id = Some (map . next_value () ?) ; } Field :: expires => { if expires . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: session :: expires :: NAME)) ; } expires = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: session :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: session :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: session :: id :: NAME)) ? ; let session_token = session_token . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: session :: session_token :: NAME)) ? ; let user_id = user_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: session :: user_id :: NAME)) ? ; let expires = expires . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: session :: expires :: NAME)) ? ; Ok (Data { id , session_token , user_id , expires , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "sessionToken" , "userId" , "expires" , "user"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: session :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; user : $ selection_mode : ident { $ ($ selections : tt) + }) => { user :: Data } ; (@ field_type ; user) => { crate :: prisma :: user :: Data } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Session" , available relations are "user")) } ; (@ field_module ; user : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: user :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; user $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: session :: IncludeParam > :: into (crate :: prisma :: session :: user :: Include :: $ selection_mode (crate :: prisma :: user :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; user $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: session :: IncludeParam > :: into (crate :: prisma :: session :: user :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: session :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; session_token) => { "sessionToken" } ; (@ field_serde_name ; user_id) => { "userId" } ; (@ field_serde_name ; expires) => { "expires" } ; (@ field_serde_name ; user) => { "user" } ; (@ specta_data_struct ; $ struct : item ;) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] # [specta (inline)] $ struct } ; (@ specta_data_struct ; $ struct : item ; $ name : ident) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] $ struct } ; } + pub use _include_session as include; + pub enum IncludeParam { + Id(id::Include), + SessionToken(session_token::Include), + UserId(user_id::Include), + Expires(expires::Include), + User(user::Include), + } + impl IncludeParam { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + match self { + Self::Id(data) => data.to_selection(), + Self::SessionToken(data) => data.to_selection(), + Self::UserId(data) => data.to_selection(), + Self::Expires(data) => data.to_selection(), + Self::User(data) => data.to_selection(), + } + } + } + #[macro_export] + macro_rules ! _partial_unchecked_session { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: session struct $ struct_name { # [serde (rename = "id")] pub id : String , # [serde (rename = "sessionToken")] pub session_token : String , # [serde (rename = "userId")] pub user_id : String , # [serde (rename = "expires")] pub expires : :: prisma_client_rust :: chrono :: DateTime < :: prisma_client_rust :: chrono :: FixedOffset , > } [$ ($ scalar_field) , +] } } ; } + pub use _partial_unchecked_session as partial_unchecked; + #[derive( + Debug, + Clone, + :: serde :: Serialize, + :: serde :: Deserialize, + :: prisma_client_rust :: specta :: Type, + )] + #[specta(rename = "Session", crate = "prisma_client_rust::specta")] + pub struct Data { + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "sessionToken")] + pub session_token: String, + #[serde(rename = "userId")] + pub user_id: String, + #[serde(rename = "expires")] + pub expires: ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + #[serde(rename = "user")] + #[specta(skip)] + pub user: Option>, + } + impl Data { + pub fn user( + &self, + ) -> Result<&super::user::Data, ::prisma_client_rust::RelationNotFetchedError> + { + self + .user + .as_ref() + .ok_or(::prisma_client_rust::RelationNotFetchedError::new( + stringify!(user), + )) + .map(|v| v.as_ref()) + } + } + #[derive(Clone)] + pub enum WithParam { + User(super::user::UniqueArgs), + } + impl Into<::prisma_client_rust::Selection> for WithParam { + fn into(self) -> ::prisma_client_rust::Selection { + match self { + Self::User(args) => { + let mut selections = < super :: user :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; + selections.extend( + args + .with_params + .into_iter() + .map(Into::<::prisma_client_rust::Selection>::into), + ); + ::prisma_client_rust::Selection::new(user::NAME, None, [], selections) + } + } + } + } + #[derive(Clone)] + pub enum SetParam { + SetId(String), + SetSessionToken(String), + SetUserId(String), + SetExpires( + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ), + ConnectUser(super::user::UniqueWhereParam), + } + impl From for (String, ::prisma_client_rust::PrismaValue) { + fn from(param: SetParam) -> Self { + match param { + SetParam::SetId(value) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(value), + ), + SetParam::SetSessionToken(value) => ( + session_token::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(value), + ), + SetParam::SetUserId(value) => ( + user_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(value), + ), + SetParam::SetExpires(value) => ( + expires::NAME.to_string(), + ::prisma_client_rust::PrismaValue::DateTime(value), + ), + SetParam::ConnectUser(where_param) => ( + user::NAME.to_string(), + ::prisma_client_rust::PrismaValue::Object(vec![( + "connect".to_string(), + ::prisma_client_rust::PrismaValue::Object( + [where_param] + .into_iter() + .map(Into::::into) + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + } + } + } + #[derive(Clone)] + pub enum UncheckedSetParam { + Id(String), + SessionToken(String), + UserId(String), + Expires( + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ), + } + impl From for SetParam { + fn from(param: UncheckedSetParam) -> Self { + match param { + UncheckedSetParam::Id(value) => Self::SetId(value), + UncheckedSetParam::SessionToken(value) => Self::SetSessionToken(value), + UncheckedSetParam::UserId(value) => Self::SetUserId(value), + UncheckedSetParam::Expires(value) => Self::SetExpires(value), + } + } + } + #[derive(Clone)] + pub enum OrderByParam { + Id(::prisma_client_rust::Direction), + SessionToken(::prisma_client_rust::Direction), + UserId(::prisma_client_rust::Direction), + Expires(::prisma_client_rust::Direction), + } + impl Into<(String, ::prisma_client_rust::PrismaValue)> for OrderByParam { + fn into(self) -> (String, ::prisma_client_rust::PrismaValue) { + match self { + Self::Id(direction) => ( + id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::SessionToken(direction) => ( + session_token::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::UserId(direction) => ( + user_id::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::Expires(direction) => ( + expires::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + } + } + } + #[derive(Clone)] + pub enum WhereParam { + Not(Vec), + Or(Vec), + And(Vec), + Id(_prisma::read_filters::StringFilter), + SessionToken(_prisma::read_filters::StringFilter), + UserId(_prisma::read_filters::StringFilter), + Expires(_prisma::read_filters::DateTimeFilter), + UserIs(Vec), + UserIsNot(Vec), + } + impl ::prisma_client_rust::WhereInput for WhereParam { + fn serialize(self) -> ::prisma_client_rust::SerializedWhereInput { + let (name, value) = match self { + Self::Not(value) => ( + "NOT", + ::prisma_client_rust::SerializedWhereValue::Object( + ::prisma_client_rust::merge_fields( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .collect(), + ), + ), + ), + Self::Or(value) => ( + "OR", + ::prisma_client_rust::SerializedWhereValue::List( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .map(|v| vec![v]) + .map(::prisma_client_rust::PrismaValue::Object) + .collect(), + ), + ), + Self::And(value) => ( + "AND", + ::prisma_client_rust::SerializedWhereValue::Object( + ::prisma_client_rust::merge_fields( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .collect(), + ), + ), + ), + Self::Id(value) => (id::NAME, value.into()), + Self::SessionToken(value) => (session_token::NAME, value.into()), + Self::UserId(value) => (user_id::NAME, value.into()), + Self::Expires(value) => (expires::NAME, value.into()), + Self::UserIs(where_params) => ( + user::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "is".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + Self::UserIsNot(where_params) => ( + user::NAME, + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "isNot".to_string(), + ::prisma_client_rust::PrismaValue::Object( + where_params + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map( + ::prisma_client_rust::SerializedWhereInput::transform_equals, + ) + .collect(), + ), + )]), + ), + }; + ::prisma_client_rust::SerializedWhereInput::new(name, value.into()) + } + } + #[derive(Clone)] + pub enum UniqueWhereParam { + SessionTokenEquals(String), + IdEquals(String), + } + impl From for WhereParam { + fn from(value: UniqueWhereParam) -> Self { + match value { + UniqueWhereParam::SessionTokenEquals(value) => { + Self::SessionToken(_prisma::read_filters::StringFilter::Equals(value)) + } + UniqueWhereParam::IdEquals(value) => { + Self::Id(_prisma::read_filters::StringFilter::Equals(value)) + } + } + } + } + impl From<::prisma_client_rust::Operator> for WhereParam { + fn from(op: ::prisma_client_rust::Operator) -> Self { + match op { + ::prisma_client_rust::Operator::Not(value) => Self::Not(value), + ::prisma_client_rust::Operator::And(value) => Self::And(value), + ::prisma_client_rust::Operator::Or(value) => Self::Or(value), + } + } + } + #[derive(Clone)] + pub struct Types; + impl ::prisma_client_rust::ModelTypes for Types { + type Data = Data; + type Where = WhereParam; + type UncheckedSet = UncheckedSetParam; + type Set = SetParam; + type With = WithParam; + type OrderBy = OrderByParam; + type Cursor = UniqueWhereParam; + const MODEL: &'static str = NAME; + fn scalar_selections() -> Vec<::prisma_client_rust::Selection> { + vec![ + ::prisma_client_rust::sel(id::NAME), + ::prisma_client_rust::sel(session_token::NAME), + ::prisma_client_rust::sel(user_id::NAME), + ::prisma_client_rust::sel(expires::NAME), + ] + } + } + pub type UniqueArgs = ::prisma_client_rust::UniqueArgs; + pub type ManyArgs = ::prisma_client_rust::ManyArgs; + pub type Count<'a> = ::prisma_client_rust::Count<'a, Types>; + pub type Create<'a> = ::prisma_client_rust::Create<'a, Types>; + pub type CreateMany<'a> = ::prisma_client_rust::CreateMany<'a, Types>; + pub type FindUnique<'a> = ::prisma_client_rust::FindUnique<'a, Types>; + pub type FindMany<'a> = ::prisma_client_rust::FindMany<'a, Types>; + pub type FindFirst<'a> = ::prisma_client_rust::FindFirst<'a, Types>; + pub type Update<'a> = ::prisma_client_rust::Update<'a, Types>; + pub type UpdateMany<'a> = ::prisma_client_rust::UpdateMany<'a, Types>; + pub type Upsert<'a> = ::prisma_client_rust::Upsert<'a, Types>; + pub type Delete<'a> = ::prisma_client_rust::Delete<'a, Types>; + pub type DeleteMany<'a> = ::prisma_client_rust::DeleteMany<'a, Types>; + #[derive(Clone)] + pub struct Actions<'a> { + pub client: &'a ::prisma_client_rust::PrismaClientInternals, + } + impl<'a> Actions<'a> { + pub fn find_unique(self, _where: UniqueWhereParam) -> FindUnique<'a> { + FindUnique::new(self.client, _where.into()) + } + pub fn find_first(self, _where: Vec) -> FindFirst<'a> { + FindFirst::new(self.client, _where) + } + pub fn find_many(self, _where: Vec) -> FindMany<'a> { + FindMany::new(self.client, _where) + } + pub fn create( + self, + session_token: String, + expires: ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + user: super::user::UniqueWhereParam, + mut _params: Vec, + ) -> Create<'a> { + _params.extend([ + session_token::set(session_token), + expires::set(expires), + user::connect(user), + ]); + Create::new(self.client, _params) + } + pub fn create_unchecked( + self, + session_token: String, + user_id: String, + expires: ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + mut _params: Vec, + ) -> Create<'a> { + _params.extend([ + session_token::set(session_token), + user_id::set(user_id), + expires::set(expires), + ]); + Create::new(self.client, _params.into_iter().map(Into::into).collect()) + } + pub fn create_many( + self, + data: Vec<( + String, + String, + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + Vec, + )>, + ) -> CreateMany<'a> { + let data = data + .into_iter() + .map(|(session_token, user_id, expires, mut _params)| { + _params.extend([ + session_token::set(session_token), + user_id::set(user_id), + expires::set(expires), + ]); + _params + }) + .collect(); + CreateMany::new(self.client, data) + } + pub fn update( + self, + _where: UniqueWhereParam, + _params: Vec, + ) -> Update<'a> { + Update::new(self.client, _where.into(), _params, vec![]) + } + pub fn update_unchecked( + self, + _where: UniqueWhereParam, + _params: Vec, + ) -> Update<'a> { + Update::new( + self.client, + _where.into(), + _params.into_iter().map(Into::into).collect(), + vec![], + ) + } + pub fn update_many( + self, + _where: Vec, + _params: Vec, + ) -> UpdateMany<'a> { + UpdateMany::new(self.client, _where, _params) + } + pub fn upsert( + self, + _where: UniqueWhereParam, + (session_token, expires, user, mut _params): ( + String, + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + super::user::UniqueWhereParam, + Vec, + ), + _update: Vec, + ) -> Upsert<'a> { + _params.extend([ + session_token::set(session_token), + expires::set(expires), + user::connect(user), + ]); + Upsert::new(self.client, _where.into(), _params, _update) + } + pub fn delete(self, _where: UniqueWhereParam) -> Delete<'a> { + Delete::new(self.client, _where.into(), vec![]) + } + pub fn delete_many(self, _where: Vec) -> DeleteMany<'a> { + DeleteMany::new(self.client, _where) + } + pub fn count(self, _where: Vec) -> Count<'a> { + Count::new(self.client, _where) + } + pub fn find_raw( + self, + ) -> ::prisma_client_rust::FindRaw<'a, Types, T> { + ::prisma_client_rust::FindRaw::new(self.client) + } + pub fn aggregate_raw( + self, + ) -> ::prisma_client_rust::AggregateRaw<'a, Types, T> { + ::prisma_client_rust::AggregateRaw::new(self.client) + } + } +} +pub mod verification_token { + use super::_prisma::*; + use super::*; + pub const NAME: &str = "VerificationToken"; + pub mod identifier { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "identifier"; + pub struct Set(pub String); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetIdentifier(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::Identifier(v) + } + } + pub fn set>(value: String) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::Identifier(direction) + } + pub fn equals(value: String) -> WhereParam { + WhereParam::Identifier(_prisma::read_filters::StringFilter::Equals(value)) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::StringFilter, + Identifier, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: String) -> Lt; + fn lte(_: String) -> Lte; + fn gt(_: String) -> Gt; + fn gte(_: String) -> Gte; + fn contains(_: String) -> Contains; + fn starts_with(_: String) -> StartsWith; + fn ends_with(_: String) -> EndsWith; + fn mode(_: super::super::QueryMode) -> Mode; + fn not(_: String) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Identifier(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Identifier(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod token { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "token"; + pub struct Set(pub String); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetToken(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::Token(v) + } + } + pub fn set>(value: String) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::Token(direction) + } + pub fn equals>(value: String) -> T { + UniqueWhereParam::TokenEquals(value).into() + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::StringFilter, + Token, + { + fn in_vec(_: Vec) -> InVec; + fn not_in_vec(_: Vec) -> NotInVec; + fn lt(_: String) -> Lt; + fn lte(_: String) -> Lte; + fn gt(_: String) -> Gt; + fn gte(_: String) -> Gte; + fn contains(_: String) -> Contains; + fn starts_with(_: String) -> StartsWith; + fn ends_with(_: String) -> EndsWith; + fn mode(_: super::super::QueryMode) -> Mode; + fn not(_: String) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Token(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Token(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub mod expires { + use super::super::*; + use super::_prisma::*; + use super::{ + OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, + WithParam, + }; + pub const NAME: &str = "expires"; + pub struct Set( + pub ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ); + impl From for SetParam { + fn from(Set(v): Set) -> Self { + Self::SetExpires(v) + } + } + impl From for UncheckedSetParam { + fn from(Set(v): Set) -> Self { + Self::Expires(v) + } + } + pub fn set>( + value: ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ) -> T { + Set(value).into() + } + pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { + OrderByParam::Expires(direction) + } + pub fn equals( + value: ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ) -> WhereParam { + WhereParam::Expires(_prisma::read_filters::DateTimeFilter::Equals(value)) + } + ::prisma_client_rust::scalar_where_param_fns!( + _prisma::read_filters::DateTimeFilter, + Expires, + { + fn in_vec( + _: Vec< + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + >, + ) -> InVec; + fn not_in_vec( + _: Vec< + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + >, + ) -> NotInVec; + fn lt( + _: ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ) -> Lt; + fn lte( + _: ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ) -> Lte; + fn gt( + _: ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ) -> Gt; + fn gte( + _: ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ) -> Gte; + fn not( + _: ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ) -> Not; + } + ); + pub struct Include; + impl Into for Include { + fn into(self) -> super::IncludeParam { + super::IncludeParam::Expires(self) + } + } + impl Include { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + pub struct Select; + impl Into for Select { + fn into(self) -> super::SelectParam { + super::SelectParam::Expires(self) + } + } + impl Select { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + ::prisma_client_rust::sel(NAME) + } + } + } + pub fn identifier_token>( + identifier: String, + token: String, + ) -> T { + UniqueWhereParam::IdentifierTokenEquals(identifier, token).into() + } + pub fn create( + identifier: String, + token: String, + expires: ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + _params: Vec, + ) -> ( + String, + String, + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + Vec, + ) { + (identifier, token, expires, _params) + } + pub fn create_unchecked( + identifier: String, + token: String, + expires: ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + _params: Vec, + ) -> ( + String, + String, + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + Vec, + ) { + (identifier, token, expires, _params) + } + #[macro_export] + macro_rules ! _select_verification_token { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: verification_token :: select ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: verification_token :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: verification_token :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: verification_token :: select ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: verification_token :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: verification_token :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { identifier , token , expires } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } const SPECTA_TYPE_NAME : & 'static str = prisma_client_rust :: macros :: to_pascal_case ! ($ ($ module_name) ?) ; crate :: prisma :: verification_token :: select ! (@ specta_data_struct ; pub struct Data { $ (# [specta (rename_from_path = crate :: prisma :: verification_token :: $ field :: NAME)] pub $ field : crate :: prisma :: verification_token :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } ; $ ($ module_name) ?) ; impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) +] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: verification_token :: $ field :: NAME , & self . $ field) ? ;) * state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: verification_token :: $ field :: NAME) , + ,] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: verification_token :: $ field :: NAME => Ok (Field :: $ field)) , * , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * while let Some (key) = map . next_key () ? { match key { $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: verification_token :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: verification_token :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["identifier" , "token" , "expires"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: verification_token :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; identifier) => { String } ; (@ field_type ; token) => { String } ; (@ field_type ; expires) => { :: prisma_client_rust :: chrono :: DateTime < :: prisma_client_rust :: chrono :: FixedOffset , > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "VerificationToken" , available relations are "identifier, token, expires")) } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; identifier) => { Into :: < crate :: prisma :: verification_token :: SelectParam > :: into (crate :: prisma :: verification_token :: identifier :: Select) } ; (@ selection_field_to_selection_param ; token) => { Into :: < crate :: prisma :: verification_token :: SelectParam > :: into (crate :: prisma :: verification_token :: token :: Select) } ; (@ selection_field_to_selection_param ; expires) => { Into :: < crate :: prisma :: verification_token :: SelectParam > :: into (crate :: prisma :: verification_token :: expires :: Select) } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: verification_token :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; identifier) => { "identifier" } ; (@ field_serde_name ; token) => { "token" } ; (@ field_serde_name ; expires) => { "expires" } ; (@ specta_data_struct ; $ struct : item ;) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] # [specta (inline)] $ struct } ; (@ specta_data_struct ; $ struct : item ; $ name : ident) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] $ struct } ; } + pub use _select_verification_token as select; + pub enum SelectParam { + Identifier(identifier::Select), + Token(token::Select), + Expires(expires::Select), + } + impl SelectParam { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + match self { + Self::Identifier(data) => data.to_selection(), + Self::Token(data) => data.to_selection(), + Self::Expires(data) => data.to_selection(), + } + } + } + #[macro_export] + macro_rules ! _include_verification_token { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: verification_token :: include ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: verification_token :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: verification_token :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: verification_token :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: verification_token :: include ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: verification_token :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: verification_token :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: verification_token :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } const SPECTA_TYPE_NAME : & 'static str = prisma_client_rust :: macros :: to_pascal_case ! ($ ($ module_name) ?) ; crate :: prisma :: verification_token :: include ! (@ specta_data_struct ; pub struct Data { # [specta (rename_from_path = crate :: prisma :: verification_token :: identifier :: NAME)] pub identifier : String , # [specta (rename_from_path = crate :: prisma :: verification_token :: token :: NAME)] pub token : String , # [specta (rename_from_path = crate :: prisma :: verification_token :: expires :: NAME)] pub expires : :: prisma_client_rust :: chrono :: DateTime < :: prisma_client_rust :: chrono :: FixedOffset , > , $ (# [specta (rename_from_path = crate :: prisma :: verification_token :: $ field :: NAME)] pub $ field : crate :: prisma :: verification_token :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } ; $ ($ module_name) ?) ; impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) + stringify ! (identifier) , stringify ! (token) , stringify ! (expires)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: verification_token :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: verification_token :: identifier :: NAME , & self . identifier) ? ; state . serialize_field (crate :: prisma :: verification_token :: token :: NAME , & self . token) ? ; state . serialize_field (crate :: prisma :: verification_token :: expires :: NAME , & self . expires) ? ; state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , identifier , token , expires } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: verification_token :: $ field :: NAME) , + , crate :: prisma :: verification_token :: identifier :: NAME , crate :: prisma :: verification_token :: token :: NAME , crate :: prisma :: verification_token :: expires :: NAME] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: verification_token :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: verification_token :: identifier :: NAME => Ok (Field :: identifier) , crate :: prisma :: verification_token :: token :: NAME => Ok (Field :: token) , crate :: prisma :: verification_token :: expires :: NAME => Ok (Field :: expires) , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * let mut identifier = None ; let mut token = None ; let mut expires = None ; while let Some (key) = map . next_key () ? { match key { Field :: identifier => { if identifier . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: verification_token :: identifier :: NAME)) ; } identifier = Some (map . next_value () ?) ; } Field :: token => { if token . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: verification_token :: token :: NAME)) ; } token = Some (map . next_value () ?) ; } Field :: expires => { if expires . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: verification_token :: expires :: NAME)) ; } expires = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: verification_token :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: verification_token :: $ field :: NAME)) ? ;) * let identifier = identifier . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: verification_token :: identifier :: NAME)) ? ; let token = token . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: verification_token :: token :: NAME)) ? ; let expires = expires . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: verification_token :: expires :: NAME)) ? ; Ok (Data { identifier , token , expires , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["identifier" , "token" , "expires"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: verification_token :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "VerificationToken" , available relations are "")) } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: verification_token :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; identifier) => { "identifier" } ; (@ field_serde_name ; token) => { "token" } ; (@ field_serde_name ; expires) => { "expires" } ; (@ specta_data_struct ; $ struct : item ;) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] # [specta (inline)] $ struct } ; (@ specta_data_struct ; $ struct : item ; $ name : ident) => { # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] # [derive (:: prisma_client_rust :: specta :: Type)] # [specta (rename_from_path = SPECTA_TYPE_NAME , crate = "prisma_client_rust::specta")] $ struct } ; } + pub use _include_verification_token as include; + pub enum IncludeParam { + Identifier(identifier::Include), + Token(token::Include), + Expires(expires::Include), + } + impl IncludeParam { + pub fn to_selection(self) -> ::prisma_client_rust::Selection { + match self { + Self::Identifier(data) => data.to_selection(), + Self::Token(data) => data.to_selection(), + Self::Expires(data) => data.to_selection(), + } + } + } + #[macro_export] + macro_rules ! _partial_unchecked_verification_token { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: verification_token struct $ struct_name { # [serde (rename = "identifier")] pub identifier : String , # [serde (rename = "token")] pub token : String , # [serde (rename = "expires")] pub expires : :: prisma_client_rust :: chrono :: DateTime < :: prisma_client_rust :: chrono :: FixedOffset , > } [$ ($ scalar_field) , +] } } ; } + pub use _partial_unchecked_verification_token as partial_unchecked; + #[derive( + Debug, + Clone, + :: serde :: Serialize, + :: serde :: Deserialize, + :: prisma_client_rust :: specta :: Type, + )] + #[specta(rename = "VerificationToken", crate = "prisma_client_rust::specta")] + pub struct Data { + #[serde(rename = "identifier")] + pub identifier: String, + #[serde(rename = "token")] + pub token: String, + #[serde(rename = "expires")] + pub expires: ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + } + impl Data {} + #[derive(Clone)] + pub enum WithParam {} + impl Into<::prisma_client_rust::Selection> for WithParam { + fn into(self) -> ::prisma_client_rust::Selection { + match self {} + } + } + #[derive(Clone)] + pub enum SetParam { + SetIdentifier(String), + SetToken(String), + SetExpires( + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ), + } + impl From for (String, ::prisma_client_rust::PrismaValue) { + fn from(param: SetParam) -> Self { + match param { + SetParam::SetIdentifier(value) => ( + identifier::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(value), + ), + SetParam::SetToken(value) => ( + token::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(value), + ), + SetParam::SetExpires(value) => ( + expires::NAME.to_string(), + ::prisma_client_rust::PrismaValue::DateTime(value), + ), + } + } + } + #[derive(Clone)] + pub enum UncheckedSetParam { + Identifier(String), + Token(String), + Expires( + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ), + } + impl From for SetParam { + fn from(param: UncheckedSetParam) -> Self { + match param { + UncheckedSetParam::Identifier(value) => Self::SetIdentifier(value), + UncheckedSetParam::Token(value) => Self::SetToken(value), + UncheckedSetParam::Expires(value) => Self::SetExpires(value), + } + } + } + #[derive(Clone)] + pub enum OrderByParam { + Identifier(::prisma_client_rust::Direction), + Token(::prisma_client_rust::Direction), + Expires(::prisma_client_rust::Direction), + } + impl Into<(String, ::prisma_client_rust::PrismaValue)> for OrderByParam { + fn into(self) -> (String, ::prisma_client_rust::PrismaValue) { + match self { + Self::Identifier(direction) => ( + identifier::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::Token(direction) => ( + token::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + Self::Expires(direction) => ( + expires::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(direction.to_string()), + ), + } + } + } + #[derive(Clone)] + pub enum WhereParam { + Not(Vec), + Or(Vec), + And(Vec), + IdentifierTokenEquals(String, String), + Identifier(_prisma::read_filters::StringFilter), + Token(_prisma::read_filters::StringFilter), + Expires(_prisma::read_filters::DateTimeFilter), + } + impl ::prisma_client_rust::WhereInput for WhereParam { + fn serialize(self) -> ::prisma_client_rust::SerializedWhereInput { + let (name, value) = match self { + Self::Not(value) => ( + "NOT", + ::prisma_client_rust::SerializedWhereValue::Object( + ::prisma_client_rust::merge_fields( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .collect(), + ), + ), + ), + Self::Or(value) => ( + "OR", + ::prisma_client_rust::SerializedWhereValue::List( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .map(|v| vec![v]) + .map(::prisma_client_rust::PrismaValue::Object) + .collect(), + ), + ), + Self::And(value) => ( + "AND", + ::prisma_client_rust::SerializedWhereValue::Object( + ::prisma_client_rust::merge_fields( + value + .into_iter() + .map(::prisma_client_rust::WhereInput::serialize) + .map(Into::into) + .collect(), + ), + ), + ), + Self::IdentifierTokenEquals(identifier, token) => ( + "identifier_token", + ::prisma_client_rust::SerializedWhereValue::Object(vec![ + ( + identifier::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(identifier), + ), + ( + token::NAME.to_string(), + ::prisma_client_rust::PrismaValue::String(token), + ), + ]), + ), + Self::Identifier(value) => (identifier::NAME, value.into()), + Self::Token(value) => (token::NAME, value.into()), + Self::Expires(value) => (expires::NAME, value.into()), + }; + ::prisma_client_rust::SerializedWhereInput::new(name, value.into()) + } + } + #[derive(Clone)] + pub enum UniqueWhereParam { + TokenEquals(String), + IdentifierTokenEquals(String, String), + } + impl From for WhereParam { + fn from(value: UniqueWhereParam) -> Self { + match value { + UniqueWhereParam::TokenEquals(value) => { + Self::Token(_prisma::read_filters::StringFilter::Equals(value)) + } + UniqueWhereParam::IdentifierTokenEquals(identifier, token) => { + Self::IdentifierTokenEquals(identifier, token) + } + } + } + } + impl From<::prisma_client_rust::Operator> for WhereParam { + fn from(op: ::prisma_client_rust::Operator) -> Self { + match op { + ::prisma_client_rust::Operator::Not(value) => Self::Not(value), + ::prisma_client_rust::Operator::And(value) => Self::And(value), + ::prisma_client_rust::Operator::Or(value) => Self::Or(value), + } + } + } + #[derive(Clone)] + pub struct Types; + impl ::prisma_client_rust::ModelTypes for Types { + type Data = Data; + type Where = WhereParam; + type UncheckedSet = UncheckedSetParam; + type Set = SetParam; + type With = WithParam; + type OrderBy = OrderByParam; + type Cursor = UniqueWhereParam; + const MODEL: &'static str = NAME; + fn scalar_selections() -> Vec<::prisma_client_rust::Selection> { + vec![ + ::prisma_client_rust::sel(identifier::NAME), + ::prisma_client_rust::sel(token::NAME), + ::prisma_client_rust::sel(expires::NAME), + ] + } + } + pub type UniqueArgs = ::prisma_client_rust::UniqueArgs; + pub type ManyArgs = ::prisma_client_rust::ManyArgs; + pub type Count<'a> = ::prisma_client_rust::Count<'a, Types>; + pub type Create<'a> = ::prisma_client_rust::Create<'a, Types>; + pub type CreateMany<'a> = ::prisma_client_rust::CreateMany<'a, Types>; + pub type FindUnique<'a> = ::prisma_client_rust::FindUnique<'a, Types>; + pub type FindMany<'a> = ::prisma_client_rust::FindMany<'a, Types>; + pub type FindFirst<'a> = ::prisma_client_rust::FindFirst<'a, Types>; + pub type Update<'a> = ::prisma_client_rust::Update<'a, Types>; + pub type UpdateMany<'a> = ::prisma_client_rust::UpdateMany<'a, Types>; + pub type Upsert<'a> = ::prisma_client_rust::Upsert<'a, Types>; + pub type Delete<'a> = ::prisma_client_rust::Delete<'a, Types>; + pub type DeleteMany<'a> = ::prisma_client_rust::DeleteMany<'a, Types>; + #[derive(Clone)] + pub struct Actions<'a> { + pub client: &'a ::prisma_client_rust::PrismaClientInternals, + } + impl<'a> Actions<'a> { + pub fn find_unique(self, _where: UniqueWhereParam) -> FindUnique<'a> { + FindUnique::new(self.client, _where.into()) + } + pub fn find_first(self, _where: Vec) -> FindFirst<'a> { + FindFirst::new(self.client, _where) + } + pub fn find_many(self, _where: Vec) -> FindMany<'a> { + FindMany::new(self.client, _where) + } + pub fn create( + self, + identifier: String, + token: String, + expires: ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + mut _params: Vec, + ) -> Create<'a> { + _params.extend([ + identifier::set(identifier), + token::set(token), + expires::set(expires), + ]); + Create::new(self.client, _params) + } + pub fn create_unchecked( + self, + identifier: String, + token: String, + expires: ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + mut _params: Vec, + ) -> Create<'a> { + _params.extend([ + identifier::set(identifier), + token::set(token), + expires::set(expires), + ]); + Create::new(self.client, _params.into_iter().map(Into::into).collect()) + } + pub fn create_many( + self, + data: Vec<( + String, + String, + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + Vec, + )>, + ) -> CreateMany<'a> { + let data = data + .into_iter() + .map(|(identifier, token, expires, mut _params)| { + _params.extend([ + identifier::set(identifier), + token::set(token), + expires::set(expires), + ]); + _params + }) + .collect(); + CreateMany::new(self.client, data) + } + pub fn update( + self, + _where: UniqueWhereParam, + _params: Vec, + ) -> Update<'a> { + Update::new(self.client, _where.into(), _params, vec![]) + } + pub fn update_unchecked( + self, + _where: UniqueWhereParam, + _params: Vec, + ) -> Update<'a> { + Update::new( + self.client, + _where.into(), + _params.into_iter().map(Into::into).collect(), + vec![], + ) + } + pub fn update_many( + self, + _where: Vec, + _params: Vec, + ) -> UpdateMany<'a> { + UpdateMany::new(self.client, _where, _params) + } + pub fn upsert( + self, + _where: UniqueWhereParam, + (identifier, token, expires, mut _params): ( + String, + String, + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + Vec, + ), + _update: Vec, + ) -> Upsert<'a> { + _params.extend([ + identifier::set(identifier), + token::set(token), + expires::set(expires), + ]); + Upsert::new(self.client, _where.into(), _params, _update) + } + pub fn delete(self, _where: UniqueWhereParam) -> Delete<'a> { + Delete::new(self.client, _where.into(), vec![]) + } + pub fn delete_many(self, _where: Vec) -> DeleteMany<'a> { + DeleteMany::new(self.client, _where) + } + pub fn count(self, _where: Vec) -> Count<'a> { + Count::new(self.client, _where) + } + pub fn find_raw( + self, + ) -> ::prisma_client_rust::FindRaw<'a, Types, T> { + ::prisma_client_rust::FindRaw::new(self.client) + } + pub fn aggregate_raw( + self, + ) -> ::prisma_client_rust::AggregateRaw<'a, Types, T> { + ::prisma_client_rust::AggregateRaw::new(self.client) + } + } +} +pub mod _prisma { + pub struct PrismaClientBuilder { + url: Option, + action_notifier: ::prisma_client_rust::ActionNotifier, + } + impl PrismaClientBuilder { + fn new() -> Self { + Self { + url: None, + action_notifier: ::prisma_client_rust::ActionNotifier::new(), + } + } + pub fn with_url(mut self, url: String) -> Self { + self.url = Some(url); + self + } + pub async fn build( + self, + ) -> Result { + let internals = ::prisma_client_rust::PrismaClientInternals::new( + self.url, + self.action_notifier, + super::DATAMODEL_STR, + ) + .await?; + Ok(PrismaClient(internals)) + } + } + pub struct PrismaClient(::prisma_client_rust::PrismaClientInternals); + impl ::std::fmt::Debug for PrismaClient { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + f.debug_struct("PrismaClient").finish() + } + } + impl PrismaClient { + pub fn _builder() -> PrismaClientBuilder { + PrismaClientBuilder::new() + } + pub fn _query_raw( + &self, + query: ::prisma_client_rust::Raw, + ) -> ::prisma_client_rust::QueryRaw { + ::prisma_client_rust::QueryRaw::new(&self.0, query, super::DATABASE_STR) + } + pub fn _execute_raw( + &self, + query: ::prisma_client_rust::Raw, + ) -> ::prisma_client_rust::ExecuteRaw { + ::prisma_client_rust::ExecuteRaw::new(&self.0, query, super::DATABASE_STR) + } + pub async fn _batch< + 'batch, + T: ::prisma_client_rust::BatchContainer<'batch, Marker>, + Marker, + >( + &self, + queries: T, + ) -> ::prisma_client_rust::Result< + >::ReturnType, + > { + ::prisma_client_rust::batch(queries, &self.0).await + } + pub fn _transaction( + &self, + ) -> ::prisma_client_rust::TransactionBuilder { + ::prisma_client_rust::TransactionBuilder::_new(self, &self.0) + } + pub fn universe(&self) -> super::universe::Actions { + super::universe::Actions { client: &self.0 } + } + pub fn user(&self) -> super::user::Actions { + super::user::Actions { client: &self.0 } + } + pub fn player(&self) -> super::player::Actions { + super::player::Actions { client: &self.0 } + } + pub fn empire(&self) -> super::empire::Actions { + super::empire::Actions { client: &self.0 } + } + pub fn star_system(&self) -> super::star_system::Actions { + super::star_system::Actions { client: &self.0 } + } + pub fn star_system_edges(&self) -> super::star_system_edges::Actions { + super::star_system_edges::Actions { client: &self.0 } + } + pub fn starbase(&self) -> super::starbase::Actions { + super::starbase::Actions { client: &self.0 } + } + pub fn planet(&self) -> super::planet::Actions { + super::planet::Actions { client: &self.0 } + } + pub fn fleet(&self) -> super::fleet::Actions { + super::fleet::Actions { client: &self.0 } + } + pub fn technology(&self) -> super::technology::Actions { + super::technology::Actions { client: &self.0 } + } + pub fn account(&self) -> super::account::Actions { + super::account::Actions { client: &self.0 } + } + pub fn session(&self) -> super::session::Actions { + super::session::Actions { client: &self.0 } + } + pub fn verification_token(&self) -> super::verification_token::Actions { + super::verification_token::Actions { client: &self.0 } + } + } + impl ::prisma_client_rust::PrismaClient for PrismaClient { + fn internals(&self) -> &::prisma_client_rust::PrismaClientInternals { + &self.0 + } + fn internals_mut( + &mut self, + ) -> &mut ::prisma_client_rust::PrismaClientInternals { + &mut self.0 + } + fn with_tx_id( + &self, + tx_id: Option<::prisma_client_rust::query_core::TxId>, + ) -> Self { + Self(self.0.with_tx_id(tx_id)) + } + } + #[derive( + Debug, + Clone, + Copy, + :: serde :: Serialize, + :: serde :: Deserialize, + PartialEq, + Eq, + )] + pub enum AccountScalarFieldEnum { + #[serde(rename = "id")] + Id, + #[serde(rename = "userId")] + UserId, + #[serde(rename = "type")] + Type, + #[serde(rename = "provider")] + Provider, + #[serde(rename = "providerAccountId")] + ProviderAccountId, + #[serde(rename = "refresh_token")] + RefreshToken, + #[serde(rename = "access_token")] + AccessToken, + #[serde(rename = "expires_at")] + ExpiresAt, + #[serde(rename = "token_type")] + TokenType, + #[serde(rename = "scope")] + Scope, + #[serde(rename = "id_token")] + IdToken, + #[serde(rename = "session_state")] + SessionState, + } + impl ToString for AccountScalarFieldEnum { + fn to_string(&self) -> String { + match self { + Self::Id => "id".to_string(), + Self::UserId => "userId".to_string(), + Self::Type => "type".to_string(), + Self::Provider => "provider".to_string(), + Self::ProviderAccountId => "providerAccountId".to_string(), + Self::RefreshToken => "refresh_token".to_string(), + Self::AccessToken => "access_token".to_string(), + Self::ExpiresAt => "expires_at".to_string(), + Self::TokenType => "token_type".to_string(), + Self::Scope => "scope".to_string(), + Self::IdToken => "id_token".to_string(), + Self::SessionState => "session_state".to_string(), + } + } + } + #[derive( + Debug, + Clone, + Copy, + :: serde :: Serialize, + :: serde :: Deserialize, + PartialEq, + Eq, + )] + pub enum EmpireScalarFieldEnum { + #[serde(rename = "id")] + Id, + #[serde(rename = "universeId")] + UniverseId, + #[serde(rename = "name")] + Name, + #[serde(rename = "color")] + Color, + #[serde(rename = "playerId")] + PlayerId, + #[serde(rename = "resources")] + Resources, + } + impl ToString for EmpireScalarFieldEnum { + fn to_string(&self) -> String { + match self { + Self::Id => "id".to_string(), + Self::UniverseId => "universeId".to_string(), + Self::Name => "name".to_string(), + Self::Color => "color".to_string(), + Self::PlayerId => "playerId".to_string(), + Self::Resources => "resources".to_string(), + } + } + } + #[derive( + Debug, + Clone, + Copy, + :: serde :: Serialize, + :: serde :: Deserialize, + PartialEq, + Eq, + )] + pub enum FleetScalarFieldEnum { + #[serde(rename = "id")] + Id, + #[serde(rename = "universeId")] + UniverseId, + } + impl ToString for FleetScalarFieldEnum { + fn to_string(&self) -> String { + match self { + Self::Id => "id".to_string(), + Self::UniverseId => "universeId".to_string(), + } + } + } + #[derive( + Debug, + Clone, + Copy, + :: serde :: Serialize, + :: serde :: Deserialize, + PartialEq, + Eq, + )] + pub enum JsonNullValueFilter { + #[serde(rename = "DbNull")] + DbNull, + #[serde(rename = "JsonNull")] + JsonNull, + #[serde(rename = "AnyNull")] + AnyNull, + } + impl ToString for JsonNullValueFilter { + fn to_string(&self) -> String { + match self { + Self::DbNull => "DbNull".to_string(), + Self::JsonNull => "JsonNull".to_string(), + Self::AnyNull => "AnyNull".to_string(), + } + } + } + #[derive( + Debug, + Clone, + Copy, + :: serde :: Serialize, + :: serde :: Deserialize, + PartialEq, + Eq, + )] + pub enum JsonNullValueInput { + #[serde(rename = "JsonNull")] + JsonNull, + } + impl ToString for JsonNullValueInput { + fn to_string(&self) -> String { + match self { + Self::JsonNull => "JsonNull".to_string(), + } + } + } + #[derive( + Debug, + Clone, + Copy, + :: serde :: Serialize, + :: serde :: Deserialize, + PartialEq, + Eq, + )] + pub enum PlanetScalarFieldEnum { + #[serde(rename = "id")] + Id, + #[serde(rename = "universeId")] + UniverseId, + #[serde(rename = "buildings")] + Buildings, + #[serde(rename = "surroundingStarSystemId")] + SurroundingStarSystemId, + } + impl ToString for PlanetScalarFieldEnum { + fn to_string(&self) -> String { + match self { + Self::Id => "id".to_string(), + Self::UniverseId => "universeId".to_string(), + Self::Buildings => "buildings".to_string(), + Self::SurroundingStarSystemId => "surroundingStarSystemId".to_string(), + } + } + } + #[derive( + Debug, + Clone, + Copy, + :: serde :: Serialize, + :: serde :: Deserialize, + PartialEq, + Eq, + )] + pub enum PlayerScalarFieldEnum { + #[serde(rename = "id")] + Id, + #[serde(rename = "universeId")] + UniverseId, + } + impl ToString for PlayerScalarFieldEnum { + fn to_string(&self) -> String { + match self { + Self::Id => "id".to_string(), + Self::UniverseId => "universeId".to_string(), + } + } + } + #[derive( + Debug, + Clone, + Copy, + :: serde :: Serialize, + :: serde :: Deserialize, + PartialEq, + Eq, + )] + pub enum QueryMode { + #[serde(rename = "default")] + Default, + #[serde(rename = "insensitive")] + Insensitive, + } + impl ToString for QueryMode { + fn to_string(&self) -> String { + match self { + Self::Default => "default".to_string(), + Self::Insensitive => "insensitive".to_string(), + } + } + } + #[derive( + Debug, + Clone, + Copy, + :: serde :: Serialize, + :: serde :: Deserialize, + PartialEq, + Eq, + )] + pub enum SessionScalarFieldEnum { + #[serde(rename = "id")] + Id, + #[serde(rename = "sessionToken")] + SessionToken, + #[serde(rename = "userId")] + UserId, + #[serde(rename = "expires")] + Expires, + } + impl ToString for SessionScalarFieldEnum { + fn to_string(&self) -> String { + match self { + Self::Id => "id".to_string(), + Self::SessionToken => "sessionToken".to_string(), + Self::UserId => "userId".to_string(), + Self::Expires => "expires".to_string(), + } + } + } + #[derive( + Debug, + Clone, + Copy, + :: serde :: Serialize, + :: serde :: Deserialize, + PartialEq, + Eq, + )] + pub enum SortOrder { + #[serde(rename = "asc")] + Asc, + #[serde(rename = "desc")] + Desc, + } + impl ToString for SortOrder { + fn to_string(&self) -> String { + match self { + Self::Asc => "asc".to_string(), + Self::Desc => "desc".to_string(), + } + } + } + #[derive( + Debug, + Clone, + Copy, + :: serde :: Serialize, + :: serde :: Deserialize, + PartialEq, + Eq, + )] + pub enum StarSystemEdgesScalarFieldEnum { + #[serde(rename = "universeId")] + UniverseId, + #[serde(rename = "fromSystemId")] + FromSystemId, + #[serde(rename = "toSystemId")] + ToSystemId, + } + impl ToString for StarSystemEdgesScalarFieldEnum { + fn to_string(&self) -> String { + match self { + Self::UniverseId => "universeId".to_string(), + Self::FromSystemId => "fromSystemId".to_string(), + Self::ToSystemId => "toSystemId".to_string(), + } + } + } + #[derive( + Debug, + Clone, + Copy, + :: serde :: Serialize, + :: serde :: Deserialize, + PartialEq, + Eq, + )] + pub enum StarSystemScalarFieldEnum { + #[serde(rename = "index")] + Index, + #[serde(rename = "universeId")] + UniverseId, + #[serde(rename = "coordX")] + CoordX, + #[serde(rename = "coordY")] + CoordY, + #[serde(rename = "ownedByEmpireId")] + OwnedByEmpireId, + } + impl ToString for StarSystemScalarFieldEnum { + fn to_string(&self) -> String { + match self { + Self::Index => "index".to_string(), + Self::UniverseId => "universeId".to_string(), + Self::CoordX => "coordX".to_string(), + Self::CoordY => "coordY".to_string(), + Self::OwnedByEmpireId => "ownedByEmpireId".to_string(), + } + } + } + #[derive( + Debug, + Clone, + Copy, + :: serde :: Serialize, + :: serde :: Deserialize, + PartialEq, + Eq, + )] + pub enum StarbaseScalarFieldEnum { + #[serde(rename = "id")] + Id, + #[serde(rename = "universeId")] + UniverseId, + #[serde(rename = "starSystemId")] + StarSystemId, + } + impl ToString for StarbaseScalarFieldEnum { + fn to_string(&self) -> String { + match self { + Self::Id => "id".to_string(), + Self::UniverseId => "universeId".to_string(), + Self::StarSystemId => "starSystemId".to_string(), + } + } + } + #[derive( + Debug, + Clone, + Copy, + :: serde :: Serialize, + :: serde :: Deserialize, + PartialEq, + Eq, + )] + pub enum TechnologyScalarFieldEnum { + #[serde(rename = "name")] + Name, + #[serde(rename = "description")] + Description, + #[serde(rename = "effects")] + Effects, + } + impl ToString for TechnologyScalarFieldEnum { + fn to_string(&self) -> String { + match self { + Self::Name => "name".to_string(), + Self::Description => "description".to_string(), + Self::Effects => "effects".to_string(), + } + } + } + #[derive( + Debug, + Clone, + Copy, + :: serde :: Serialize, + :: serde :: Deserialize, + PartialEq, + Eq, + )] + pub enum TransactionIsolationLevel { + #[serde(rename = "ReadUncommitted")] + ReadUncommitted, + #[serde(rename = "ReadCommitted")] + ReadCommitted, + #[serde(rename = "RepeatableRead")] + RepeatableRead, + #[serde(rename = "Serializable")] + Serializable, + } + impl ToString for TransactionIsolationLevel { + fn to_string(&self) -> String { + match self { + Self::ReadUncommitted => "ReadUncommitted".to_string(), + Self::ReadCommitted => "ReadCommitted".to_string(), + Self::RepeatableRead => "RepeatableRead".to_string(), + Self::Serializable => "Serializable".to_string(), + } + } + } + impl ::prisma_client_rust::TransactionIsolationLevel + for TransactionIsolationLevel + { + } + #[derive( + Debug, + Clone, + Copy, + :: serde :: Serialize, + :: serde :: Deserialize, + PartialEq, + Eq, + )] + pub enum UniverseScalarFieldEnum { + #[serde(rename = "id")] + Id, + #[serde(rename = "config")] + Config, + } + impl ToString for UniverseScalarFieldEnum { + fn to_string(&self) -> String { + match self { + Self::Id => "id".to_string(), + Self::Config => "config".to_string(), + } + } + } + #[derive( + Debug, + Clone, + Copy, + :: serde :: Serialize, + :: serde :: Deserialize, + PartialEq, + Eq, + )] + pub enum UserScalarFieldEnum { + #[serde(rename = "id")] + Id, + #[serde(rename = "email")] + Email, + #[serde(rename = "emailVerified")] + EmailVerified, + #[serde(rename = "name")] + Name, + #[serde(rename = "image")] + Image, + } + impl ToString for UserScalarFieldEnum { + fn to_string(&self) -> String { + match self { + Self::Id => "id".to_string(), + Self::Email => "email".to_string(), + Self::EmailVerified => "emailVerified".to_string(), + Self::Name => "name".to_string(), + Self::Image => "image".to_string(), + } + } + } + #[derive( + Debug, + Clone, + Copy, + :: serde :: Serialize, + :: serde :: Deserialize, + PartialEq, + Eq, + )] + pub enum VerificationTokenScalarFieldEnum { + #[serde(rename = "identifier")] + Identifier, + #[serde(rename = "token")] + Token, + #[serde(rename = "expires")] + Expires, + } + impl ToString for VerificationTokenScalarFieldEnum { + fn to_string(&self) -> String { + match self { + Self::Identifier => "identifier".to_string(), + Self::Token => "token".to_string(), + Self::Expires => "expires".to_string(), + } + } + } + pub mod read_filters { + #[derive(Clone)] + pub enum IntFilter { + Equals(i32), + InVec(Vec), + NotInVec(Vec), + Lt(i32), + Lte(i32), + Gt(i32), + Gte(i32), + Not(i32), + } + impl Into<::prisma_client_rust::SerializedWhereValue> for IntFilter { + fn into(self) -> ::prisma_client_rust::SerializedWhereValue { + match self { + Self::Equals(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "equals".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]) + } + Self::InVec(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "in".to_string(), + ::prisma_client_rust::PrismaValue::List( + value + .into_iter() + .map(|value| { + ::prisma_client_rust::PrismaValue::Int(value as i64) + }) + .collect(), + ), + )]) + } + Self::NotInVec(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "notIn".to_string(), + ::prisma_client_rust::PrismaValue::List( + value + .into_iter() + .map(|value| { + ::prisma_client_rust::PrismaValue::Int(value as i64) + }) + .collect(), + ), + )]) + } + Self::Lt(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "lt".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]) + } + Self::Lte(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "lte".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]) + } + Self::Gt(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "gt".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]) + } + Self::Gte(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "gte".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]) + } + Self::Not(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "not".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]) + } + } + } + } + #[derive(Clone)] + pub enum IntNullableFilter { + Equals(Option), + InVec(Vec), + NotInVec(Vec), + Lt(i32), + Lte(i32), + Gt(i32), + Gte(i32), + Not(Option), + } + impl Into<::prisma_client_rust::SerializedWhereValue> for IntNullableFilter { + fn into(self) -> ::prisma_client_rust::SerializedWhereValue { + match self { + Self::Equals(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "equals".to_string(), + value + .map(|value| { + ::prisma_client_rust::PrismaValue::Int(value as i64) + }) + .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), + )]) + } + Self::InVec(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "in".to_string(), + ::prisma_client_rust::PrismaValue::List( + value + .into_iter() + .map(|value| { + ::prisma_client_rust::PrismaValue::Int(value as i64) + }) + .collect(), + ), + )]) + } + Self::NotInVec(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "notIn".to_string(), + ::prisma_client_rust::PrismaValue::List( + value + .into_iter() + .map(|value| { + ::prisma_client_rust::PrismaValue::Int(value as i64) + }) + .collect(), + ), + )]) + } + Self::Lt(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "lt".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]) + } + Self::Lte(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "lte".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]) + } + Self::Gt(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "gt".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]) + } + Self::Gte(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "gte".to_string(), + ::prisma_client_rust::PrismaValue::Int(value as i64), + )]) + } + Self::Not(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "not".to_string(), + value + .map(|value| { + ::prisma_client_rust::PrismaValue::Int(value as i64) + }) + .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), + )]) + } + } + } + } + #[derive(Clone)] + pub enum StringFilter { + Equals(String), + InVec(Vec), + NotInVec(Vec), + Lt(String), + Lte(String), + Gt(String), + Gte(String), + Contains(String), + StartsWith(String), + EndsWith(String), + Mode(super::super::QueryMode), + Not(String), + } + impl Into<::prisma_client_rust::SerializedWhereValue> for StringFilter { + fn into(self) -> ::prisma_client_rust::SerializedWhereValue { + match self { + Self::Equals(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "equals".to_string(), + ::prisma_client_rust::PrismaValue::String(value), + )]) + } + Self::InVec(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "in".to_string(), + ::prisma_client_rust::PrismaValue::List( + value + .into_iter() + .map(|value| ::prisma_client_rust::PrismaValue::String(value)) + .collect(), + ), + )]) + } + Self::NotInVec(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "notIn".to_string(), + ::prisma_client_rust::PrismaValue::List( + value + .into_iter() + .map(|value| ::prisma_client_rust::PrismaValue::String(value)) + .collect(), + ), + )]) + } + Self::Lt(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "lt".to_string(), + ::prisma_client_rust::PrismaValue::String(value), + )]) + } + Self::Lte(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "lte".to_string(), + ::prisma_client_rust::PrismaValue::String(value), + )]) + } + Self::Gt(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "gt".to_string(), + ::prisma_client_rust::PrismaValue::String(value), + )]) + } + Self::Gte(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "gte".to_string(), + ::prisma_client_rust::PrismaValue::String(value), + )]) + } + Self::Contains(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "contains".to_string(), + ::prisma_client_rust::PrismaValue::String(value), + )]) + } + Self::StartsWith(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "startsWith".to_string(), + ::prisma_client_rust::PrismaValue::String(value), + )]) + } + Self::EndsWith(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "endsWith".to_string(), + ::prisma_client_rust::PrismaValue::String(value), + )]) + } + Self::Mode(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "mode".to_string(), + ::prisma_client_rust::PrismaValue::Enum(value.to_string()), + )]) + } + Self::Not(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "not".to_string(), + ::prisma_client_rust::PrismaValue::String(value), + )]) + } + } + } + } + #[derive(Clone)] + pub enum StringNullableFilter { + Equals(Option), + InVec(Vec), + NotInVec(Vec), + Lt(String), + Lte(String), + Gt(String), + Gte(String), + Contains(String), + StartsWith(String), + EndsWith(String), + Mode(super::super::QueryMode), + Not(Option), + } + impl Into<::prisma_client_rust::SerializedWhereValue> for StringNullableFilter { + fn into(self) -> ::prisma_client_rust::SerializedWhereValue { + match self { + Self::Equals(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "equals".to_string(), + value + .map(|value| ::prisma_client_rust::PrismaValue::String(value)) + .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), + )]) + } + Self::InVec(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "in".to_string(), + ::prisma_client_rust::PrismaValue::List( + value + .into_iter() + .map(|value| ::prisma_client_rust::PrismaValue::String(value)) + .collect(), + ), + )]) + } + Self::NotInVec(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "notIn".to_string(), + ::prisma_client_rust::PrismaValue::List( + value + .into_iter() + .map(|value| ::prisma_client_rust::PrismaValue::String(value)) + .collect(), + ), + )]) + } + Self::Lt(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "lt".to_string(), + ::prisma_client_rust::PrismaValue::String(value), + )]) + } + Self::Lte(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "lte".to_string(), + ::prisma_client_rust::PrismaValue::String(value), + )]) + } + Self::Gt(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "gt".to_string(), + ::prisma_client_rust::PrismaValue::String(value), + )]) + } + Self::Gte(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "gte".to_string(), + ::prisma_client_rust::PrismaValue::String(value), + )]) + } + Self::Contains(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "contains".to_string(), + ::prisma_client_rust::PrismaValue::String(value), + )]) + } + Self::StartsWith(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "startsWith".to_string(), + ::prisma_client_rust::PrismaValue::String(value), + )]) + } + Self::EndsWith(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "endsWith".to_string(), + ::prisma_client_rust::PrismaValue::String(value), + )]) + } + Self::Mode(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "mode".to_string(), + ::prisma_client_rust::PrismaValue::Enum(value.to_string()), + )]) + } + Self::Not(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "not".to_string(), + value + .map(|value| ::prisma_client_rust::PrismaValue::String(value)) + .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), + )]) + } + } + } + } + #[derive(Clone)] + pub enum DateTimeFilter { + Equals( + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ), + InVec( + Vec< + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + >, + ), + NotInVec( + Vec< + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + >, + ), + Lt( + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ), + Lte( + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ), + Gt( + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ), + Gte( + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ), + Not( + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ), + } + impl Into<::prisma_client_rust::SerializedWhereValue> for DateTimeFilter { + fn into(self) -> ::prisma_client_rust::SerializedWhereValue { + match self { + Self::Equals(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "equals".to_string(), + ::prisma_client_rust::PrismaValue::DateTime(value), + )]) + } + Self::InVec(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "in".to_string(), + ::prisma_client_rust::PrismaValue::List( + value + .into_iter() + .map(|value| { + ::prisma_client_rust::PrismaValue::DateTime(value) + }) + .collect(), + ), + )]) + } + Self::NotInVec(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "notIn".to_string(), + ::prisma_client_rust::PrismaValue::List( + value + .into_iter() + .map(|value| { + ::prisma_client_rust::PrismaValue::DateTime(value) + }) + .collect(), + ), + )]) + } + Self::Lt(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "lt".to_string(), + ::prisma_client_rust::PrismaValue::DateTime(value), + )]) + } + Self::Lte(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "lte".to_string(), + ::prisma_client_rust::PrismaValue::DateTime(value), + )]) + } + Self::Gt(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "gt".to_string(), + ::prisma_client_rust::PrismaValue::DateTime(value), + )]) + } + Self::Gte(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "gte".to_string(), + ::prisma_client_rust::PrismaValue::DateTime(value), + )]) + } + Self::Not(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "not".to_string(), + ::prisma_client_rust::PrismaValue::DateTime(value), + )]) + } + } + } + } + #[derive(Clone)] + pub enum DateTimeNullableFilter { + Equals( + Option< + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + >, + ), + InVec( + Vec< + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + >, + ), + NotInVec( + Vec< + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + >, + ), + Lt( + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ), + Lte( + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ), + Gt( + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ), + Gte( + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + ), + Not( + Option< + ::prisma_client_rust::chrono::DateTime< + ::prisma_client_rust::chrono::FixedOffset, + >, + >, + ), + } + impl Into<::prisma_client_rust::SerializedWhereValue> + for DateTimeNullableFilter + { + fn into(self) -> ::prisma_client_rust::SerializedWhereValue { + match self { + Self::Equals(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "equals".to_string(), + value + .map(|value| ::prisma_client_rust::PrismaValue::DateTime(value)) + .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), + )]) + } + Self::InVec(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "in".to_string(), + ::prisma_client_rust::PrismaValue::List( + value + .into_iter() + .map(|value| { + ::prisma_client_rust::PrismaValue::DateTime(value) + }) + .collect(), + ), + )]) + } + Self::NotInVec(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "notIn".to_string(), + ::prisma_client_rust::PrismaValue::List( + value + .into_iter() + .map(|value| { + ::prisma_client_rust::PrismaValue::DateTime(value) + }) + .collect(), + ), + )]) + } + Self::Lt(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "lt".to_string(), + ::prisma_client_rust::PrismaValue::DateTime(value), + )]) + } + Self::Lte(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "lte".to_string(), + ::prisma_client_rust::PrismaValue::DateTime(value), + )]) + } + Self::Gt(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "gt".to_string(), + ::prisma_client_rust::PrismaValue::DateTime(value), + )]) + } + Self::Gte(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "gte".to_string(), + ::prisma_client_rust::PrismaValue::DateTime(value), + )]) + } + Self::Not(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "not".to_string(), + value + .map(|value| ::prisma_client_rust::PrismaValue::DateTime(value)) + .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), + )]) + } + } + } + } + #[derive(Clone)] + pub enum FloatFilter { + Equals(f64), + InVec(Vec), + NotInVec(Vec), + Lt(f64), + Lte(f64), + Gt(f64), + Gte(f64), + Not(f64), + } + impl Into<::prisma_client_rust::SerializedWhereValue> for FloatFilter { + fn into(self) -> ::prisma_client_rust::SerializedWhereValue { + match self { Self :: Equals (value) => :: prisma_client_rust :: SerializedWhereValue :: Object (vec ! [("equals" . to_string () , :: prisma_client_rust :: PrismaValue :: Float (< :: prisma_client_rust :: bigdecimal :: BigDecimal as :: prisma_client_rust :: bigdecimal :: FromPrimitive > :: from_f64 (value) . unwrap () . normalized ()))]) , Self :: InVec (value) => :: prisma_client_rust :: SerializedWhereValue :: Object (vec ! [("in" . to_string () , :: prisma_client_rust :: PrismaValue :: List (value . into_iter () . map (| value | :: prisma_client_rust :: PrismaValue :: Float (< :: prisma_client_rust :: bigdecimal :: BigDecimal as :: prisma_client_rust :: bigdecimal :: FromPrimitive > :: from_f64 (value) . unwrap () . normalized ())) . collect ()))]) , Self :: NotInVec (value) => :: prisma_client_rust :: SerializedWhereValue :: Object (vec ! [("notIn" . to_string () , :: prisma_client_rust :: PrismaValue :: List (value . into_iter () . map (| value | :: prisma_client_rust :: PrismaValue :: Float (< :: prisma_client_rust :: bigdecimal :: BigDecimal as :: prisma_client_rust :: bigdecimal :: FromPrimitive > :: from_f64 (value) . unwrap () . normalized ())) . collect ()))]) , Self :: Lt (value) => :: prisma_client_rust :: SerializedWhereValue :: Object (vec ! [("lt" . to_string () , :: prisma_client_rust :: PrismaValue :: Float (< :: prisma_client_rust :: bigdecimal :: BigDecimal as :: prisma_client_rust :: bigdecimal :: FromPrimitive > :: from_f64 (value) . unwrap () . normalized ()))]) , Self :: Lte (value) => :: prisma_client_rust :: SerializedWhereValue :: Object (vec ! [("lte" . to_string () , :: prisma_client_rust :: PrismaValue :: Float (< :: prisma_client_rust :: bigdecimal :: BigDecimal as :: prisma_client_rust :: bigdecimal :: FromPrimitive > :: from_f64 (value) . unwrap () . normalized ()))]) , Self :: Gt (value) => :: prisma_client_rust :: SerializedWhereValue :: Object (vec ! [("gt" . to_string () , :: prisma_client_rust :: PrismaValue :: Float (< :: prisma_client_rust :: bigdecimal :: BigDecimal as :: prisma_client_rust :: bigdecimal :: FromPrimitive > :: from_f64 (value) . unwrap () . normalized ()))]) , Self :: Gte (value) => :: prisma_client_rust :: SerializedWhereValue :: Object (vec ! [("gte" . to_string () , :: prisma_client_rust :: PrismaValue :: Float (< :: prisma_client_rust :: bigdecimal :: BigDecimal as :: prisma_client_rust :: bigdecimal :: FromPrimitive > :: from_f64 (value) . unwrap () . normalized ()))]) , Self :: Not (value) => :: prisma_client_rust :: SerializedWhereValue :: Object (vec ! [("not" . to_string () , :: prisma_client_rust :: PrismaValue :: Float (< :: prisma_client_rust :: bigdecimal :: BigDecimal as :: prisma_client_rust :: bigdecimal :: FromPrimitive > :: from_f64 (value) . unwrap () . normalized ()))]) } + } + } + #[derive(Clone)] + pub enum JsonFilter { + Equals(::prisma_client_rust::serde_json::Value), + Path(Vec), + StringContains(String), + StringStartsWith(String), + StringEndsWith(String), + ArrayContains(Option<::prisma_client_rust::serde_json::Value>), + ArrayStartsWith(Option<::prisma_client_rust::serde_json::Value>), + ArrayEndsWith(Option<::prisma_client_rust::serde_json::Value>), + Lt(::prisma_client_rust::serde_json::Value), + Lte(::prisma_client_rust::serde_json::Value), + Gt(::prisma_client_rust::serde_json::Value), + Gte(::prisma_client_rust::serde_json::Value), + Not(::prisma_client_rust::serde_json::Value), + } + impl Into<::prisma_client_rust::SerializedWhereValue> for JsonFilter { + fn into(self) -> ::prisma_client_rust::SerializedWhereValue { + match self { + Self::Equals(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "equals".to_string(), + ::prisma_client_rust::PrismaValue::Json( + ::prisma_client_rust::serde_json::to_string(&value).unwrap(), + ), + )]) + } + Self::Path(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "path".to_string(), + ::prisma_client_rust::PrismaValue::List( + value + .into_iter() + .map(|value| ::prisma_client_rust::PrismaValue::String(value)) + .collect(), + ), + )]) + } + Self::StringContains(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "string_contains".to_string(), + ::prisma_client_rust::PrismaValue::String(value), + )]) + } + Self::StringStartsWith(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "string_starts_with".to_string(), + ::prisma_client_rust::PrismaValue::String(value), + )]) + } + Self::StringEndsWith(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "string_ends_with".to_string(), + ::prisma_client_rust::PrismaValue::String(value), + )]) + } + Self::ArrayContains(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "array_contains".to_string(), + value + .map(|value| { + ::prisma_client_rust::PrismaValue::Json( + ::prisma_client_rust::serde_json::to_string(&value) + .unwrap(), + ) + }) + .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), + )]) + } + Self::ArrayStartsWith(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "array_starts_with".to_string(), + value + .map(|value| { + ::prisma_client_rust::PrismaValue::Json( + ::prisma_client_rust::serde_json::to_string(&value) + .unwrap(), + ) + }) + .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), + )]) + } + Self::ArrayEndsWith(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "array_ends_with".to_string(), + value + .map(|value| { + ::prisma_client_rust::PrismaValue::Json( + ::prisma_client_rust::serde_json::to_string(&value) + .unwrap(), + ) + }) + .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), + )]) + } + Self::Lt(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "lt".to_string(), + ::prisma_client_rust::PrismaValue::Json( + ::prisma_client_rust::serde_json::to_string(&value).unwrap(), + ), + )]) + } + Self::Lte(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "lte".to_string(), + ::prisma_client_rust::PrismaValue::Json( + ::prisma_client_rust::serde_json::to_string(&value).unwrap(), + ), + )]) + } + Self::Gt(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "gt".to_string(), + ::prisma_client_rust::PrismaValue::Json( + ::prisma_client_rust::serde_json::to_string(&value).unwrap(), + ), + )]) + } + Self::Gte(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "gte".to_string(), + ::prisma_client_rust::PrismaValue::Json( + ::prisma_client_rust::serde_json::to_string(&value).unwrap(), + ), + )]) + } + Self::Not(value) => { + ::prisma_client_rust::SerializedWhereValue::Object(vec![( + "not".to_string(), + ::prisma_client_rust::PrismaValue::Json( + ::prisma_client_rust::serde_json::to_string(&value).unwrap(), + ), + )]) + } + } + } + } + } +} +pub use _prisma::*; diff --git a/backend/src/state/empire.rs b/common/src/state/empire.rs similarity index 100% rename from backend/src/state/empire.rs rename to common/src/state/empire.rs diff --git a/backend/src/state/fleet.rs b/common/src/state/fleet.rs similarity index 100% rename from backend/src/state/fleet.rs rename to common/src/state/fleet.rs diff --git a/backend/src/state/game.rs b/common/src/state/game.rs similarity index 95% rename from backend/src/state/game.rs rename to common/src/state/game.rs index 6987071..30d4b80 100644 --- a/backend/src/state/game.rs +++ b/common/src/state/game.rs @@ -4,9 +4,11 @@ use anyhow::Result; use chrono::{DateTime, Utc}; use petgraph::graphmap::UnGraphMap; -use crate::{ - prisma::{empire, planet, star_system, star_system_edges, PrismaClient}, - utils::format_color, +use crate::utils::format_color; + +#[cfg(feature = "db")] +use crate::prisma::{ + empire, planet, star_system, star_system_edges, PrismaClient, }; use super::{EmpireCoreState, EmpireId, StarSystemCoreState, StarSystemId}; @@ -29,6 +31,7 @@ pub struct GameDerivedState<'a> { } impl GameCoreState { + #[cfg(feature = "db")] pub async fn save_to_database(&self, client: &PrismaClient) -> Result<()> { // Save star systems to database let mut owned_systems = HashMap::new(); diff --git a/backend/src/state/macros.rs b/common/src/state/macros.rs similarity index 100% rename from backend/src/state/macros.rs rename to common/src/state/macros.rs diff --git a/backend/src/state/mod.rs b/common/src/state/mod.rs similarity index 100% rename from backend/src/state/mod.rs rename to common/src/state/mod.rs diff --git a/backend/src/state/planet.rs b/common/src/state/planet.rs similarity index 100% rename from backend/src/state/planet.rs rename to common/src/state/planet.rs diff --git a/backend/src/state/starsystem.rs b/common/src/state/starsystem.rs similarity index 100% rename from backend/src/state/starsystem.rs rename to common/src/state/starsystem.rs diff --git a/backend/src/utils.rs b/common/src/utils.rs similarity index 100% rename from backend/src/utils.rs rename to common/src/utils.rs diff --git a/frontend/.eslintrc.cjs b/frontend/.eslintrc.cjs index d6c9537..6e8698b 100644 --- a/frontend/.eslintrc.cjs +++ b/frontend/.eslintrc.cjs @@ -2,17 +2,17 @@ module.exports = { root: true, env: { browser: true, es2020: true }, extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - 'plugin:react-hooks/recommended', + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:react-hooks/recommended", ], - ignorePatterns: ['dist', '.eslintrc.cjs'], - parser: '@typescript-eslint/parser', - plugins: ['react-refresh'], + ignorePatterns: ["dist", ".eslintrc.cjs"], + parser: "@typescript-eslint/parser", + plugins: ["react-refresh"], rules: { - 'react-refresh/only-export-components': [ - 'warn', + "react-refresh/only-export-components": [ + "warn", { allowConstantExport: true }, ], }, -} +}; diff --git a/frontend/package.json b/frontend/package.json index 3c7e417..aeb54b7 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -26,6 +26,7 @@ "leva": "^0.9.35", "normalize.css": "^8.0.1", "react": "^18.2.0", + "react-beautiful-dnd": "^13.1.1", "react-dom": "^18.2.0", "react-draggable": "^4.4.6", "react-query": "^3.39.3", @@ -35,6 +36,7 @@ }, "devDependencies": { "@types/react": "^18.2.43", + "@types/react-beautiful-dnd": "^13.1.8", "@types/react-dom": "^18.2.17", "@typescript-eslint/eslint-plugin": "^6.14.0", "@typescript-eslint/parser": "^6.14.0", @@ -44,6 +46,8 @@ "eslint-plugin-react-refresh": "^0.4.5", "sass": "^1.69.6", "typescript": "^5.2.2", - "vite": "^5.0.8" + "vite": "^5.0.8", + "vite-plugin-top-level-await": "^1.4.1", + "vite-plugin-wasm": "^3.3.0" } } diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml index 15adf1b..c7b7fc5 100644 --- a/frontend/pnpm-lock.yaml +++ b/frontend/pnpm-lock.yaml @@ -44,6 +44,9 @@ dependencies: react: specifier: ^18.2.0 version: 18.2.0 + react-beautiful-dnd: + specifier: ^13.1.1 + version: 13.1.1(react-dom@18.2.0)(react@18.2.0) react-dom: specifier: ^18.2.0 version: 18.2.0(react@18.2.0) @@ -67,6 +70,9 @@ devDependencies: '@types/react': specifier: ^18.2.43 version: 18.2.46 + '@types/react-beautiful-dnd': + specifier: ^13.1.8 + version: 13.1.8 '@types/react-dom': specifier: ^18.2.17 version: 18.2.18 @@ -97,6 +103,12 @@ devDependencies: vite: specifier: ^5.0.8 version: 5.0.10(sass@1.69.6) + vite-plugin-top-level-await: + specifier: ^1.4.1 + version: 1.4.1(vite@5.0.10) + vite-plugin-wasm: + specifier: ^3.3.0 + version: 3.3.0(vite@5.0.10) packages: @@ -1047,6 +1059,16 @@ packages: engines: {node: '>=14.0.0'} dev: false + /@rollup/plugin-virtual@3.0.2: + resolution: {integrity: sha512-10monEYsBp3scM4/ND4LNH5Rxvh3e/cVeL3jWTgZ2SrQ+BmUoQcopVQvnaMcOnykb1VkxUFuDAN+0FnpTFRy2A==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + dev: true + /@rollup/rollup-android-arm-eabi@4.9.1: resolution: {integrity: sha512-6vMdBZqtq1dVQ4CWdhFwhKZL6E4L1dV6jUjuBvsavvNJSppzi6dLBbuV+3+IyUREaj9ZFvQefnQm28v4OCXlig==} cpu: [arm] @@ -1286,6 +1308,13 @@ packages: resolution: {integrity: sha512-4MMUjMQb4yA5fJ4osXx+QxGHt0/ZSy4spT6jL1HM7Tn8OJEC35siqdnpOo+HxPhYjqEFumKfGVF9hJfdyKBIBA==} dev: false + /@types/hoist-non-react-statics@3.3.5: + resolution: {integrity: sha512-SbcrWzkKBw2cdwRTwQAswfpB9g9LJWfjtUeW/jvNwbhC8cpmmNYVePa+ncbUe0rGTQ7G3Ff6mYUN2VMfLVr+Sg==} + dependencies: + '@types/react': 18.2.46 + hoist-non-react-statics: 3.3.2 + dev: false + /@types/json-schema@7.0.15: resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} dev: true @@ -1297,6 +1326,12 @@ packages: /@types/prop-types@15.7.11: resolution: {integrity: sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng==} + /@types/react-beautiful-dnd@13.1.8: + resolution: {integrity: sha512-E3TyFsro9pQuK4r8S/OL6G99eq7p8v29sX0PM7oT8Z+PJfZvSQTx4zTQbUJ+QZXioAF0e7TGBEcA1XhYhCweyQ==} + dependencies: + '@types/react': 18.2.46 + dev: true + /@types/react-dom@18.2.18: resolution: {integrity: sha512-TJxDm6OfAX2KJWJdMEVTwWke5Sc/E/RlnPGvGfS0W7+6ocy2xhDVQVh/KvC2Uf7kACs+gDytdusDSdWfWkaNzw==} dependencies: @@ -1314,6 +1349,15 @@ packages: '@types/react': 18.2.46 dev: false + /@types/react-redux@7.1.33: + resolution: {integrity: sha512-NF8m5AjWCkert+fosDsN3hAlHzpjSiXlVy9EgQEmLoBhaNXbmyeGs/aj5dQzKuF+/q+S7JQagorGDW8pJ28Hmg==} + dependencies: + '@types/hoist-non-react-statics': 3.3.5 + '@types/react': 18.2.46 + hoist-non-react-statics: 3.3.2 + redux: 4.2.1 + dev: false + /@types/react@18.2.46: resolution: {integrity: sha512-nNCvVBcZlvX4NU1nRRNV/mFl1nNRuTuslAJglQsq+8ldXe5Xv0Wd2f7WTE3jOxhLH2BFfiZGC6GCp+kHQbgG+w==} dependencies: @@ -1752,6 +1796,12 @@ packages: shebang-command: 2.0.0 which: 2.0.2 + /css-box-model@1.2.1: + resolution: {integrity: sha512-a7Vr4Q/kd/aw96bnJG332W9V9LkJO69JRcaCYDUqjp6/z0w6VcZjgAcTbgFxEPfBgdnAwlh3iwu+hLopa+flJw==} + dependencies: + tiny-invariant: 1.3.1 + dev: false + /csstype@3.1.3: resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} @@ -2142,6 +2192,12 @@ packages: tslib: 2.6.2 dev: false + /hoist-non-react-statics@3.3.2: + resolution: {integrity: sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==} + dependencies: + react-is: 16.13.1 + dev: false + /ieee754@1.2.1: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} dev: false @@ -2381,6 +2437,10 @@ packages: remove-accents: 0.4.2 dev: false + /memoize-one@5.2.1: + resolution: {integrity: sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==} + dev: false + /merge-value@1.0.0: resolution: {integrity: sha512-fJMmvat4NeKz63Uv9iHWcPDjCWcCkoiRoajRTEO8hlhUC6rwaHg0QCF9hBOTjZmm4JuglPckPSTtcuJL5kp0TQ==} engines: {node: '>=0.10.0'} @@ -2625,6 +2685,29 @@ packages: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} dev: true + /raf-schd@4.0.3: + resolution: {integrity: sha512-tQkJl2GRWh83ui2DiPTJz9wEiMN20syf+5oKfB03yYP7ioZcJwsIK8FjrtLwH1m7C7e+Tt2yYBlrOpdT+dyeIQ==} + dev: false + + /react-beautiful-dnd@13.1.1(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-0Lvs4tq2VcrEjEgDXHjT98r+63drkKEgqyxdA7qD3mvKwga6a5SscbdLPO2IExotU1jW8L0Ksdl0Cj2AF67nPQ==} + peerDependencies: + react: ^16.8.5 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.5 || ^17.0.0 || ^18.0.0 + dependencies: + '@babel/runtime': 7.23.7 + css-box-model: 1.2.1 + memoize-one: 5.2.1 + raf-schd: 4.0.3 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + react-redux: 7.2.9(react-dom@18.2.0)(react@18.2.0) + redux: 4.2.1 + use-memo-one: 1.1.3(react@18.2.0) + transitivePeerDependencies: + - react-native + dev: false + /react-colorful@5.6.1(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-1exovf0uGTGyq5mXQT0zgQ80uvj2PCwvF8zY1RN9/vbJVSjSo3fsB/4L3ObbF7u70NduSiK4xu4Y6q1MHoUGEw==} peerDependencies: @@ -2696,6 +2779,10 @@ packages: resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} dev: false + /react-is@17.0.2: + resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} + dev: false + /react-merge-refs@1.1.0: resolution: {integrity: sha512-alTKsjEL0dKH/ru1Iyn7vliS2QRcBp9zZPGoWxUOvRGWPUYgjo+V01is7p04It6KhgrzhJGnIj9GgX8W4bZoCQ==} dev: false @@ -2744,6 +2831,28 @@ packages: scheduler: 0.21.0 dev: false + /react-redux@7.2.9(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-Gx4L3uM182jEEayZfRbI/G11ZpYdNAnBs70lFVMNdHJI76XYtR+7m0MN+eAs7UHBPhWXcnFPaS+9owSCJQHNpQ==} + peerDependencies: + react: ^16.8.3 || ^17 || ^18 + react-dom: '*' + react-native: '*' + peerDependenciesMeta: + react-dom: + optional: true + react-native: + optional: true + dependencies: + '@babel/runtime': 7.23.7 + '@types/react-redux': 7.1.33 + hoist-non-react-statics: 3.3.2 + loose-envify: 1.4.0 + prop-types: 15.8.1 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + react-is: 17.0.2 + dev: false + /react-redux@9.0.4(@types/react@18.2.46)(react@18.2.0)(redux@5.0.1): resolution: {integrity: sha512-9J1xh8sWO0vYq2sCxK2My/QO7MzUMRi3rpiILP/+tDr8krBHixC6JMM17fMK88+Oh3e4Ae6/sHIhNBgkUivwFA==} peerDependencies: @@ -2836,6 +2945,12 @@ packages: redux: 5.0.1 dev: false + /redux@4.2.1: + resolution: {integrity: sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w==} + dependencies: + '@babel/runtime': 7.23.7 + dev: false + /redux@5.0.1: resolution: {integrity: sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w==} dev: false @@ -3051,6 +3166,10 @@ packages: resolution: {integrity: sha512-DLU8lc0zNIPkM7rH5/e1Ks1Z8tWCGRq6g8mPowdDJpw1CFBJMU7UoJjC6PefXW7z//SSl0b2+GCw14LB+uDhng==} dev: false + /tiny-invariant@1.3.1: + resolution: {integrity: sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==} + dev: false + /to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} @@ -3138,6 +3257,14 @@ packages: punycode: 2.3.1 dev: true + /use-memo-one@1.1.3(react@18.2.0): + resolution: {integrity: sha512-g66/K7ZQGYrI6dy8GLpVcMsBp4s17xNkYJVSMvTEevGy3nDxHOfE6z8BVE22+5G5x7t3+bhzrlTDB7ObrEE0cQ==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + dependencies: + react: 18.2.0 + dev: false + /use-sync-external-store@1.2.0(react@18.2.0): resolution: {integrity: sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==} peerDependencies: @@ -3154,12 +3281,33 @@ packages: /uuid@9.0.1: resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} hasBin: true - dev: false /v8n@1.5.1: resolution: {integrity: sha512-LdabyT4OffkyXFCe9UT+uMkxNBs5rcTVuZClvxQr08D5TUgo1OFKkoT65qYRCsiKBl/usHjpXvP4hHMzzDRj3A==} dev: false + /vite-plugin-top-level-await@1.4.1(vite@5.0.10): + resolution: {integrity: sha512-hogbZ6yT7+AqBaV6lK9JRNvJDn4/IJvHLu6ET06arNfo0t2IsyCaon7el9Xa8OumH+ESuq//SDf8xscZFE0rWw==} + peerDependencies: + vite: '>=2.8' + dependencies: + '@rollup/plugin-virtual': 3.0.2 + '@swc/core': 1.3.101 + uuid: 9.0.1 + vite: 5.0.10(sass@1.69.6) + transitivePeerDependencies: + - '@swc/helpers' + - rollup + dev: true + + /vite-plugin-wasm@3.3.0(vite@5.0.10): + resolution: {integrity: sha512-tVhz6w+W9MVsOCHzxo6SSMSswCeIw4HTrXEi6qL3IRzATl83jl09JVO1djBqPSwfjgnpVHNLYcaMbaDX5WB/pg==} + peerDependencies: + vite: ^2 || ^3 || ^4 || ^5 + dependencies: + vite: 5.0.10(sass@1.69.6) + dev: true + /vite@5.0.10(sass@1.69.6): resolution: {integrity: sha512-2P8J7WWgmc355HUMlFrwofacvr98DAjoE52BfdbwQtyLH06XKwaL/FMnmKM2crF0iX4MpmMKoDlNCB1ok7zHCw==} engines: {node: ^18.0.0 || >=20.0.0} diff --git a/frontend/src/App.css b/frontend/src/App.css index a98e59d..28b262b 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -1,15 +1,17 @@ -html,body,#root { - width: 100%; - height: 100%; +html, +body, +#root { + width: 100%; + height: 100%; } #root { - display: flex; - flex-direction: column; + display: flex; + flex-direction: column; } #root > main { - min-height: 0; - flex-shrink: 1; - flex-grow: 1; -} \ No newline at end of file + min-height: 0; + flex-shrink: 1; + flex-grow: 1; +} diff --git a/frontend/src/routes/MapView.tsx b/frontend/src/routes/MapView.tsx index 8afb5c2..ac82189 100644 --- a/frontend/src/routes/MapView.tsx +++ b/frontend/src/routes/MapView.tsx @@ -6,9 +6,9 @@ import { useParams } from "react-router-dom"; import { MapControls, Text } from "@react-three/drei"; import { ColorRepresentation, DoubleSide, TextureLoader } from "three"; import { Bloom, EffectComposer } from "@react-three/postprocessing"; -import Windows from "./Windows"; import { useAppDispatch } from "../store"; import { addWindow } from "../store/someShit"; +import { DragDropContext } from "react-beautiful-dnd"; export default function MapView({}) { const { universeId } = useParams(); @@ -35,46 +35,60 @@ export default function MapView({}) { return (
- - - + { + console.log("evt", event); + }} + > + + + - - - + + + - - - - + + + + - {mapData.points.map((point) => { - return ( - - ); - })} + {mapData.points.map((point) => { + return ( + + ); + })} - {mapData.edges.map((edge) => { - return ( - - ); - })} - - - + {mapData.edges.map((edge) => { + return ( + + ); + })} + +
); } -function StarSystem({ system, position, empires, ...props }: MeshProps) { +function StarSystem({ + system, + position, + empires, + mapData, + ...props +}: MeshProps) { const dispatch = useAppDispatch(); - const meshRef = useRef(); const [hovered, setHover] = useState(false); - const [active, setActive] = useState(false); + const active = false; const x = system.coordX / 80; const y = system.coordY / 80; @@ -88,18 +102,7 @@ function StarSystem({ system, position, empires, ...props }: MeshProps) { return ( <> - { - setActive(!active); - dispatch(addWindow(["planet", { type: "planet" }])); - }} - onPointerOver={(_event) => setHover(true)} - onPointerOut={(_event) => setHover(false)} - > + + { + dispatch(addWindow(["planet", { type: "planet" }])); + event.stopPropagation(); + }} + onPointerOver={(event) => { + setHover(true); + event.stopPropagation(); + }} + onPointerOut={(event) => { + setHover(false); + event.stopPropagation(); + }} + > + + + + {owner && ( {owner.name} diff --git a/frontend/src/routes/Windows.module.scss b/frontend/src/routes/Windows.module.scss deleted file mode 100644 index eb0b3b1..0000000 --- a/frontend/src/routes/Windows.module.scss +++ /dev/null @@ -1,3 +0,0 @@ -.draggableHeader { - cursor: move; -} diff --git a/frontend/src/routes/Windows.tsx b/frontend/src/routes/Windows.tsx deleted file mode 100644 index 25f01ff..0000000 --- a/frontend/src/routes/Windows.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import { createPlugin, Components } from "leva/plugin"; -import { useControls } from "leva"; -import { useAppDispatch, useAppSelector } from "../store"; -import styles from "./Windows.module.scss"; -import classNames from "classnames"; -import Draggable from "react-draggable"; -import { closeWindow } from "../store/someShit"; -import { Tab, Tabs, TabsExpander } from "@blueprintjs/core"; - -const { Row, Label } = Components; - -export default function Windows() { - const windowsRaw = useAppSelector((state) => state.someShit.windows); - const windows = Object.fromEntries( - Object.entries(windowsRaw).map(([name, windowDef]) => { - return [name, windowDef]; - }), - ); - - return Object.entries(windows).map(([name, windowDef]) => { - return ; - }); -} - -function Window({ name }) { - const dispatch = useAppDispatch(); - - return ( - -
-
- -
Planet
-
-
- - - Helloge} /> - Helloge} /> - Helloge} /> - - -
- {/*
-
- - -
-
*/} -
-
- ); -} diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index e0c62e9..019d2a0 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -1,9 +1,11 @@ import { defineConfig } from "vite"; -import react from "@vitejs/plugin-react-swc"; +import reactPlugin from "@vitejs/plugin-react-swc"; +import wasmPlugin from "vite-plugin-wasm"; +import topLevelAwait from "vite-plugin-top-level-await"; // https://vitejs.dev/config/ export default defineConfig({ - plugins: [react()], + plugins: [reactPlugin(), wasmPlugin(), topLevelAwait()], server: { proxy: { "/api": { diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 6da41d5..4b88a6f 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -1,6 +1,6 @@ generator client { provider = "cargo prisma" - output = "../backend/src/prisma.rs" + output = "../common/src/prisma.rs" } datasource db {