Created
May 22, 2023 20:01
-
-
Save marko911/55fd5adde61f3d0b25d194786641befd to your computer and use it in GitHub Desktop.
Sample prisma client
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Code generated by Prisma Client Rust. DO NOT EDIT | |
| pub static DATAMODEL_STR: &'static str = | |
| include_str!("../prisma/schema.prisma"); | |
| static DATABASE_STR: &'static str = "postgresql"; | |
| pub async fn new_client() -> Result<PrismaClient, ::prisma_client_rust::NewClientError> { | |
| PrismaClient::_builder().build().await | |
| } | |
| pub async fn new_client_with_url( | |
| url: &str, | |
| ) -> Result<PrismaClient, ::prisma_client_rust::NewClientError> { | |
| PrismaClient::_builder() | |
| .with_url(url.to_string()) | |
| .build() | |
| .await | |
| } | |
| pub mod item { | |
| use super::_prisma::*; | |
| use super::*; | |
| pub const NAME: &str = "Item"; | |
| 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<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetId(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::Id(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: String) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::Id(direction) | |
| } | |
| pub fn equals<T: From<UniqueWhereParam>>(value: String) -> T { | |
| UniqueWhereParam::IdEquals(value).into() | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::StringFilter, Id, { | |
| fn in_vec(_: Vec<String>) -> InVec; | |
| fn not_in_vec(_: Vec<String>) -> 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<super::IncludeParam> 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<super::SelectParam> 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 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<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetName(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::Name(v) | |
| } | |
| } | |
| pub fn set<T: From<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<String>) -> InVec; | |
| fn not_in_vec(_: Vec<String>) -> 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<super::IncludeParam> 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<super::SelectParam> 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 weight { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "weight"; | |
| pub struct Set(pub i32); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetWeight(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::Weight(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: i32) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::Weight(direction) | |
| } | |
| pub fn equals(value: i32) -> WhereParam { | |
| WhereParam::Weight(_prisma::read_filters::IntFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::IntFilter, Weight, { | |
| fn in_vec(_: Vec<i32>) -> InVec; | |
| fn not_in_vec(_: Vec<i32>) -> 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::IncrementWeight(value) | |
| } | |
| pub fn decrement(value: i32) -> SetParam { | |
| SetParam::DecrementWeight(value) | |
| } | |
| pub fn multiply(value: i32) -> SetParam { | |
| SetParam::MultiplyWeight(value) | |
| } | |
| pub fn divide(value: i32) -> SetParam { | |
| SetParam::DivideWeight(value) | |
| } | |
| pub struct Include; | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Weight(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Weight(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod value { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "value"; | |
| pub struct Set(pub i32); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetValue(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::Value(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: i32) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::Value(direction) | |
| } | |
| pub fn equals(value: i32) -> WhereParam { | |
| WhereParam::Value(_prisma::read_filters::IntFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::IntFilter, Value, { | |
| fn in_vec(_: Vec<i32>) -> InVec; | |
| fn not_in_vec(_: Vec<i32>) -> 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::IncrementValue(value) | |
| } | |
| pub fn decrement(value: i32) -> SetParam { | |
| SetParam::DecrementValue(value) | |
| } | |
| pub fn multiply(value: i32) -> SetParam { | |
| SetParam::MultiplyValue(value) | |
| } | |
| pub fn divide(value: i32) -> SetParam { | |
| SetParam::DivideValue(value) | |
| } | |
| pub struct Include; | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Value(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Value(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod active_inventory_id { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "activeInventoryId"; | |
| pub struct Set(pub Option<String>); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetActiveInventoryId(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::ActiveInventoryId(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: Option<String>) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::ActiveInventoryId(direction) | |
| } | |
| pub fn equals(value: Option<String>) -> WhereParam { | |
| WhereParam::ActiveInventoryId(_prisma::read_filters::StringNullableFilter::Equals( | |
| value, | |
| )) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!( | |
| _prisma::read_filters::StringNullableFilter, | |
| ActiveInventoryId, | |
| { | |
| fn in_vec(_: Vec<String>) -> InVec; | |
| fn not_in_vec(_: Vec<String>) -> 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<String>) -> Not; | |
| } | |
| ); | |
| pub struct Include; | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::ActiveInventoryId(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::ActiveInventoryId(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod active_inventory { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "activeInventory"; | |
| pub struct Fetch(pub inventory::UniqueArgs); | |
| impl Fetch { | |
| pub fn with(mut self, params: impl Into<inventory::WithParam>) -> Self { | |
| self.0 = self.0.with(params.into()); | |
| self | |
| } | |
| } | |
| impl From<Fetch> for WithParam { | |
| fn from(Fetch(v): Fetch) -> Self { | |
| WithParam::ActiveInventory(v) | |
| } | |
| } | |
| pub fn fetch() -> Fetch { | |
| Fetch(inventory::UniqueArgs::new()) | |
| } | |
| pub struct Connect(inventory::UniqueWhereParam); | |
| impl From<Connect> for SetParam { | |
| fn from(Connect(v): Connect) -> Self { | |
| Self::ConnectActiveInventory(v) | |
| } | |
| } | |
| pub fn connect<T: From<Connect>>(value: inventory::UniqueWhereParam) -> T { | |
| Connect(value).into() | |
| } | |
| pub fn disconnect() -> SetParam { | |
| SetParam::DisconnectActiveInventory | |
| } | |
| pub fn is_null() -> WhereParam { | |
| WhereParam::ActiveInventoryIsNull | |
| } | |
| pub fn is(value: Vec<inventory::WhereParam>) -> WhereParam { | |
| WhereParam::ActiveInventoryIs(value) | |
| } | |
| pub fn is_not(value: Vec<inventory::WhereParam>) -> WhereParam { | |
| WhereParam::ActiveInventoryIsNot(value) | |
| } | |
| pub enum Include { | |
| Select(Vec<inventory::SelectParam>), | |
| Include(Vec<inventory::IncludeParam>), | |
| Fetch, | |
| } | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::ActiveInventory(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 = < inventory :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; | |
| nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); | |
| nested_selections | |
| } | |
| Self::Fetch => { | |
| <inventory::Types as ::prisma_client_rust::ModelTypes>::scalar_selections() | |
| } | |
| }; | |
| ::prisma_client_rust::Selection::new("activeInventory", None, [], selections) | |
| } | |
| pub fn select(nested_selections: Vec<inventory::SelectParam>) -> Self { | |
| Self::Select(nested_selections) | |
| } | |
| pub fn include(nested_selections: Vec<inventory::IncludeParam>) -> Self { | |
| Self::Include(nested_selections) | |
| } | |
| } | |
| pub enum Select { | |
| Select(Vec<inventory::SelectParam>), | |
| Include(Vec<inventory::IncludeParam>), | |
| Fetch, | |
| } | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::ActiveInventory(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 => { | |
| <inventory::Types as ::prisma_client_rust::ModelTypes>::scalar_selections() | |
| } | |
| }; | |
| ::prisma_client_rust::Selection::new("activeInventory", None, [], selections) | |
| } | |
| pub fn select(nested_selections: Vec<inventory::SelectParam>) -> Self { | |
| Self::Select(nested_selections) | |
| } | |
| pub fn include(nested_selections: Vec<inventory::IncludeParam>) -> Self { | |
| Self::Include(nested_selections) | |
| } | |
| } | |
| } | |
| pub mod backpack_inventory_id { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "backpackInventoryId"; | |
| pub struct Set(pub Option<String>); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetBackpackInventoryId(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::BackpackInventoryId(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: Option<String>) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::BackpackInventoryId(direction) | |
| } | |
| pub fn equals(value: Option<String>) -> WhereParam { | |
| WhereParam::BackpackInventoryId(_prisma::read_filters::StringNullableFilter::Equals( | |
| value, | |
| )) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!( | |
| _prisma::read_filters::StringNullableFilter, | |
| BackpackInventoryId, | |
| { | |
| fn in_vec(_: Vec<String>) -> InVec; | |
| fn not_in_vec(_: Vec<String>) -> 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<String>) -> Not; | |
| } | |
| ); | |
| pub struct Include; | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::BackpackInventoryId(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::BackpackInventoryId(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod backpack_inventory { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "backpackInventory"; | |
| pub struct Fetch(pub inventory::UniqueArgs); | |
| impl Fetch { | |
| pub fn with(mut self, params: impl Into<inventory::WithParam>) -> Self { | |
| self.0 = self.0.with(params.into()); | |
| self | |
| } | |
| } | |
| impl From<Fetch> for WithParam { | |
| fn from(Fetch(v): Fetch) -> Self { | |
| WithParam::BackpackInventory(v) | |
| } | |
| } | |
| pub fn fetch() -> Fetch { | |
| Fetch(inventory::UniqueArgs::new()) | |
| } | |
| pub struct Connect(inventory::UniqueWhereParam); | |
| impl From<Connect> for SetParam { | |
| fn from(Connect(v): Connect) -> Self { | |
| Self::ConnectBackpackInventory(v) | |
| } | |
| } | |
| pub fn connect<T: From<Connect>>(value: inventory::UniqueWhereParam) -> T { | |
| Connect(value).into() | |
| } | |
| pub fn disconnect() -> SetParam { | |
| SetParam::DisconnectBackpackInventory | |
| } | |
| pub fn is_null() -> WhereParam { | |
| WhereParam::BackpackInventoryIsNull | |
| } | |
| pub fn is(value: Vec<inventory::WhereParam>) -> WhereParam { | |
| WhereParam::BackpackInventoryIs(value) | |
| } | |
| pub fn is_not(value: Vec<inventory::WhereParam>) -> WhereParam { | |
| WhereParam::BackpackInventoryIsNot(value) | |
| } | |
| pub enum Include { | |
| Select(Vec<inventory::SelectParam>), | |
| Include(Vec<inventory::IncludeParam>), | |
| Fetch, | |
| } | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::BackpackInventory(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 = < inventory :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; | |
| nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); | |
| nested_selections | |
| } | |
| Self::Fetch => { | |
| <inventory::Types as ::prisma_client_rust::ModelTypes>::scalar_selections() | |
| } | |
| }; | |
| ::prisma_client_rust::Selection::new("backpackInventory", None, [], selections) | |
| } | |
| pub fn select(nested_selections: Vec<inventory::SelectParam>) -> Self { | |
| Self::Select(nested_selections) | |
| } | |
| pub fn include(nested_selections: Vec<inventory::IncludeParam>) -> Self { | |
| Self::Include(nested_selections) | |
| } | |
| } | |
| pub enum Select { | |
| Select(Vec<inventory::SelectParam>), | |
| Include(Vec<inventory::IncludeParam>), | |
| Fetch, | |
| } | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::BackpackInventory(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 => { | |
| <inventory::Types as ::prisma_client_rust::ModelTypes>::scalar_selections() | |
| } | |
| }; | |
| ::prisma_client_rust::Selection::new("backpackInventory", None, [], selections) | |
| } | |
| pub fn select(nested_selections: Vec<inventory::SelectParam>) -> Self { | |
| Self::Select(nested_selections) | |
| } | |
| pub fn include(nested_selections: Vec<inventory::IncludeParam>) -> Self { | |
| Self::Include(nested_selections) | |
| } | |
| } | |
| } | |
| pub fn create( | |
| name: String, | |
| weight: i32, | |
| value: i32, | |
| _params: Vec<SetParam>, | |
| ) -> (String, i32, i32, Vec<SetParam>) { | |
| (name, weight, value, _params) | |
| } | |
| pub fn create_unchecked( | |
| name: String, | |
| weight: i32, | |
| value: i32, | |
| _params: Vec<SetParam>, | |
| ) -> (String, i32, i32, Vec<SetParam>) { | |
| (name, weight, value, _params) | |
| } | |
| #[macro_export] | |
| macro_rules ! _select_item { ($ (($ ($ 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 :: item :: 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 :: item :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: item :: 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 :: item :: 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 :: item :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: item :: 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 , name , weight , value , active_inventory_id , active_inventory , backpack_inventory_id , backpack_inventory } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { $ (pub $ field : crate :: prisma :: item :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } 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 :: item :: $ 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 :: item :: $ 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 :: item :: $ 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 :: item :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: item :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "name" , "weight" , "value" , "activeInventoryId" , "activeInventory" , "backpackInventoryId" , "backpackInventory"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: item :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { String } ; (@ field_type ; name) => { String } ; (@ field_type ; weight) => { i32 } ; (@ field_type ; value) => { i32 } ; (@ field_type ; active_inventory_id) => { Option < String > } ; (@ field_type ; active_inventory : $ selection_mode : ident { $ ($ selections : tt) + }) => { Option < active_inventory :: Data > } ; (@ field_type ; active_inventory) => { Option < crate :: prisma :: inventory :: Data > } ; (@ field_type ; backpack_inventory_id) => { Option < String > } ; (@ field_type ; backpack_inventory : $ selection_mode : ident { $ ($ selections : tt) + }) => { Option < backpack_inventory :: Data > } ; (@ field_type ; backpack_inventory) => { Option < crate :: prisma :: inventory :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Item" , available relations are "id, name, weight, value, active_inventory_id, active_inventory, backpack_inventory_id, backpack_inventory")) } ; (@ field_module ; active_inventory : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: inventory :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; backpack_inventory : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: inventory :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: item :: SelectParam > :: into (crate :: prisma :: item :: id :: Select) } ; (@ selection_field_to_selection_param ; name) => { Into :: < crate :: prisma :: item :: SelectParam > :: into (crate :: prisma :: item :: name :: Select) } ; (@ selection_field_to_selection_param ; weight) => { Into :: < crate :: prisma :: item :: SelectParam > :: into (crate :: prisma :: item :: weight :: Select) } ; (@ selection_field_to_selection_param ; value) => { Into :: < crate :: prisma :: item :: SelectParam > :: into (crate :: prisma :: item :: value :: Select) } ; (@ selection_field_to_selection_param ; active_inventory_id) => { Into :: < crate :: prisma :: item :: SelectParam > :: into (crate :: prisma :: item :: active_inventory_id :: Select) } ; (@ selection_field_to_selection_param ; active_inventory $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: item :: SelectParam > :: into (crate :: prisma :: item :: active_inventory :: Select :: $ selection_mode (crate :: prisma :: inventory :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; active_inventory $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: item :: SelectParam > :: into (crate :: prisma :: item :: active_inventory :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; backpack_inventory_id) => { Into :: < crate :: prisma :: item :: SelectParam > :: into (crate :: prisma :: item :: backpack_inventory_id :: Select) } ; (@ selection_field_to_selection_param ; backpack_inventory $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: item :: SelectParam > :: into (crate :: prisma :: item :: backpack_inventory :: Select :: $ selection_mode (crate :: prisma :: inventory :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; backpack_inventory $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: item :: SelectParam > :: into (crate :: prisma :: item :: backpack_inventory :: 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 :: item :: $ 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 ; name) => { "name" } ; (@ field_serde_name ; weight) => { "weight" } ; (@ field_serde_name ; value) => { "value" } ; (@ field_serde_name ; active_inventory_id) => { "activeInventoryId" } ; (@ field_serde_name ; active_inventory) => { "activeInventory" } ; (@ field_serde_name ; backpack_inventory_id) => { "backpackInventoryId" } ; (@ field_serde_name ; backpack_inventory) => { "backpackInventory" } ; } | |
| pub use _select_item as select; | |
| pub enum SelectParam { | |
| Id(id::Select), | |
| Name(name::Select), | |
| Weight(weight::Select), | |
| Value(value::Select), | |
| ActiveInventoryId(active_inventory_id::Select), | |
| ActiveInventory(active_inventory::Select), | |
| BackpackInventoryId(backpack_inventory_id::Select), | |
| BackpackInventory(backpack_inventory::Select), | |
| } | |
| impl SelectParam { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::Id(data) => data.to_selection(), | |
| Self::Name(data) => data.to_selection(), | |
| Self::Weight(data) => data.to_selection(), | |
| Self::Value(data) => data.to_selection(), | |
| Self::ActiveInventoryId(data) => data.to_selection(), | |
| Self::ActiveInventory(data) => data.to_selection(), | |
| Self::BackpackInventoryId(data) => data.to_selection(), | |
| Self::BackpackInventory(data) => data.to_selection(), | |
| } | |
| } | |
| } | |
| #[macro_export] | |
| macro_rules ! _include_item { ($ (($ ($ 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 :: item :: 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 :: item :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: item :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: item :: 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 :: item :: 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 :: item :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: item :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: item :: 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 { active_inventory , backpack_inventory } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { pub id : String , pub name : String , pub weight : i32 , pub value : i32 , pub active_inventory_id : Option < String > , pub backpack_inventory_id : Option < String > , $ (pub $ field : crate :: prisma :: item :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } 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 ! (name) , stringify ! (weight) , stringify ! (value) , stringify ! (active_inventory_id) , stringify ! (backpack_inventory_id)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: item :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: item :: id :: NAME , & self . id) ? ; state . serialize_field (crate :: prisma :: item :: name :: NAME , & self . name) ? ; state . serialize_field (crate :: prisma :: item :: weight :: NAME , & self . weight) ? ; state . serialize_field (crate :: prisma :: item :: value :: NAME , & self . value) ? ; state . serialize_field (crate :: prisma :: item :: active_inventory_id :: NAME , & self . active_inventory_id) ? ; state . serialize_field (crate :: prisma :: item :: backpack_inventory_id :: NAME , & self . backpack_inventory_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 , name , weight , value , active_inventory_id , backpack_inventory_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 :: item :: $ field :: NAME) , + , crate :: prisma :: item :: id :: NAME , crate :: prisma :: item :: name :: NAME , crate :: prisma :: item :: weight :: NAME , crate :: prisma :: item :: value :: NAME , crate :: prisma :: item :: active_inventory_id :: NAME , crate :: prisma :: item :: backpack_inventory_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 :: item :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: item :: id :: NAME => Ok (Field :: id) , crate :: prisma :: item :: name :: NAME => Ok (Field :: name) , crate :: prisma :: item :: weight :: NAME => Ok (Field :: weight) , crate :: prisma :: item :: value :: NAME => Ok (Field :: value) , crate :: prisma :: item :: active_inventory_id :: NAME => Ok (Field :: active_inventory_id) , crate :: prisma :: item :: backpack_inventory_id :: NAME => Ok (Field :: backpack_inventory_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 name = None ; let mut weight = None ; let mut value = None ; let mut active_inventory_id = None ; let mut backpack_inventory_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 :: item :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } Field :: name => { if name . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: item :: name :: NAME)) ; } name = Some (map . next_value () ?) ; } Field :: weight => { if weight . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: item :: weight :: NAME)) ; } weight = Some (map . next_value () ?) ; } Field :: value => { if value . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: item :: value :: NAME)) ; } value = Some (map . next_value () ?) ; } Field :: active_inventory_id => { if active_inventory_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: item :: active_inventory_id :: NAME)) ; } active_inventory_id = Some (map . next_value () ?) ; } Field :: backpack_inventory_id => { if backpack_inventory_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: item :: backpack_inventory_id :: NAME)) ; } backpack_inventory_id = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: item :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: item :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: item :: id :: NAME)) ? ; let name = name . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: item :: name :: NAME)) ? ; let weight = weight . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: item :: weight :: NAME)) ? ; let value = value . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: item :: value :: NAME)) ? ; let active_inventory_id = active_inventory_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: item :: active_inventory_id :: NAME)) ? ; let backpack_inventory_id = backpack_inventory_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: item :: backpack_inventory_id :: NAME)) ? ; Ok (Data { id , name , weight , value , active_inventory_id , backpack_inventory_id , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "name" , "weight" , "value" , "activeInventoryId" , "activeInventory" , "backpackInventoryId" , "backpackInventory"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: item :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; active_inventory : $ selection_mode : ident { $ ($ selections : tt) + }) => { Option < active_inventory :: Data > } ; (@ field_type ; active_inventory) => { Option < crate :: prisma :: inventory :: Data > } ; (@ field_type ; backpack_inventory : $ selection_mode : ident { $ ($ selections : tt) + }) => { Option < backpack_inventory :: Data > } ; (@ field_type ; backpack_inventory) => { Option < crate :: prisma :: inventory :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Item" , available relations are "active_inventory, backpack_inventory")) } ; (@ field_module ; active_inventory : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: inventory :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; backpack_inventory : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: inventory :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; active_inventory $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: item :: IncludeParam > :: into (crate :: prisma :: item :: active_inventory :: Include :: $ selection_mode (crate :: prisma :: inventory :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; active_inventory $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: item :: IncludeParam > :: into (crate :: prisma :: item :: active_inventory :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; backpack_inventory $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: item :: IncludeParam > :: into (crate :: prisma :: item :: backpack_inventory :: Include :: $ selection_mode (crate :: prisma :: inventory :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; backpack_inventory $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: item :: IncludeParam > :: into (crate :: prisma :: item :: backpack_inventory :: 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 :: item :: $ 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 ; name) => { "name" } ; (@ field_serde_name ; weight) => { "weight" } ; (@ field_serde_name ; value) => { "value" } ; (@ field_serde_name ; active_inventory_id) => { "activeInventoryId" } ; (@ field_serde_name ; active_inventory) => { "activeInventory" } ; (@ field_serde_name ; backpack_inventory_id) => { "backpackInventoryId" } ; (@ field_serde_name ; backpack_inventory) => { "backpackInventory" } ; } | |
| pub use _include_item as include; | |
| pub enum IncludeParam { | |
| Id(id::Include), | |
| Name(name::Include), | |
| Weight(weight::Include), | |
| Value(value::Include), | |
| ActiveInventoryId(active_inventory_id::Include), | |
| ActiveInventory(active_inventory::Include), | |
| BackpackInventoryId(backpack_inventory_id::Include), | |
| BackpackInventory(backpack_inventory::Include), | |
| } | |
| impl IncludeParam { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::Id(data) => data.to_selection(), | |
| Self::Name(data) => data.to_selection(), | |
| Self::Weight(data) => data.to_selection(), | |
| Self::Value(data) => data.to_selection(), | |
| Self::ActiveInventoryId(data) => data.to_selection(), | |
| Self::ActiveInventory(data) => data.to_selection(), | |
| Self::BackpackInventoryId(data) => data.to_selection(), | |
| Self::BackpackInventory(data) => data.to_selection(), | |
| } | |
| } | |
| } | |
| #[macro_export] | |
| macro_rules ! _partial_unchecked_item { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: item struct $ struct_name { # [serde (rename = "id")] pub id : String , # [serde (rename = "name")] pub name : String , # [serde (rename = "weight")] pub weight : i32 , # [serde (rename = "value")] pub value : i32 , # [serde (rename = "activeInventoryId")] # [serde (default , with = "::prisma_client_rust::serde::double_option")] pub active_inventory_id : Option < String > , # [serde (rename = "backpackInventoryId")] # [serde (default , with = "::prisma_client_rust::serde::double_option")] pub backpack_inventory_id : Option < String > } [$ ($ scalar_field) , +] } } ; } | |
| pub use _partial_unchecked_item as partial_unchecked; | |
| #[derive(Debug, Clone, :: serde :: Serialize, :: serde :: Deserialize)] | |
| pub struct Data { | |
| #[serde(rename = "id")] | |
| pub id: String, | |
| #[serde(rename = "name")] | |
| pub name: String, | |
| #[serde(rename = "weight")] | |
| pub weight: i32, | |
| #[serde(rename = "value")] | |
| pub value: i32, | |
| #[serde(rename = "activeInventoryId")] | |
| pub active_inventory_id: Option<String>, | |
| #[serde( | |
| rename = "activeInventory", | |
| default, | |
| skip_serializing_if = "Option::is_none", | |
| with = "prisma_client_rust::serde::double_option" | |
| )] | |
| pub active_inventory: Option<Option<Box<super::inventory::Data>>>, | |
| #[serde(rename = "backpackInventoryId")] | |
| pub backpack_inventory_id: Option<String>, | |
| #[serde( | |
| rename = "backpackInventory", | |
| default, | |
| skip_serializing_if = "Option::is_none", | |
| with = "prisma_client_rust::serde::double_option" | |
| )] | |
| pub backpack_inventory: Option<Option<Box<super::inventory::Data>>>, | |
| } | |
| impl Data { | |
| pub fn active_inventory( | |
| &self, | |
| ) -> Result<Option<&super::inventory::Data>, ::prisma_client_rust::RelationNotFetchedError> | |
| { | |
| self.active_inventory | |
| .as_ref() | |
| .ok_or(::prisma_client_rust::RelationNotFetchedError::new( | |
| stringify!(active_inventory), | |
| )) | |
| .map(|v| v.as_ref().map(|v| v.as_ref())) | |
| } | |
| pub fn backpack_inventory( | |
| &self, | |
| ) -> Result<Option<&super::inventory::Data>, ::prisma_client_rust::RelationNotFetchedError> | |
| { | |
| self.backpack_inventory | |
| .as_ref() | |
| .ok_or(::prisma_client_rust::RelationNotFetchedError::new( | |
| stringify!(backpack_inventory), | |
| )) | |
| .map(|v| v.as_ref().map(|v| v.as_ref())) | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum WithParam { | |
| ActiveInventory(super::inventory::UniqueArgs), | |
| BackpackInventory(super::inventory::UniqueArgs), | |
| } | |
| impl Into<::prisma_client_rust::Selection> for WithParam { | |
| fn into(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::ActiveInventory(args) => { | |
| let mut selections = < super :: inventory :: 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( | |
| active_inventory::NAME, | |
| None, | |
| [], | |
| selections, | |
| ) | |
| } | |
| Self::BackpackInventory(args) => { | |
| let mut selections = < super :: inventory :: 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( | |
| backpack_inventory::NAME, | |
| None, | |
| [], | |
| selections, | |
| ) | |
| } | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum SetParam { | |
| SetId(String), | |
| SetName(String), | |
| SetWeight(i32), | |
| IncrementWeight(i32), | |
| DecrementWeight(i32), | |
| MultiplyWeight(i32), | |
| DivideWeight(i32), | |
| SetValue(i32), | |
| IncrementValue(i32), | |
| DecrementValue(i32), | |
| MultiplyValue(i32), | |
| DivideValue(i32), | |
| SetActiveInventoryId(Option<String>), | |
| ConnectActiveInventory(super::inventory::UniqueWhereParam), | |
| DisconnectActiveInventory, | |
| SetBackpackInventoryId(Option<String>), | |
| ConnectBackpackInventory(super::inventory::UniqueWhereParam), | |
| DisconnectBackpackInventory, | |
| } | |
| impl From<SetParam> 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::SetName(value) => ( | |
| name::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(value), | |
| ), | |
| SetParam::SetWeight(value) => ( | |
| weight::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| ), | |
| SetParam::IncrementWeight(value) => ( | |
| weight::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "increment".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DecrementWeight(value) => ( | |
| weight::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "decrement".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::MultiplyWeight(value) => ( | |
| weight::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "multiply".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DivideWeight(value) => ( | |
| weight::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "divide".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::SetValue(value) => ( | |
| value::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| ), | |
| SetParam::IncrementValue(value) => ( | |
| value::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "increment".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DecrementValue(value) => ( | |
| value::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "decrement".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::MultiplyValue(value) => ( | |
| value::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "multiply".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DivideValue(value) => ( | |
| value::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "divide".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::SetActiveInventoryId(value) => ( | |
| active_inventory_id::NAME.to_string(), | |
| value | |
| .map(|value| ::prisma_client_rust::PrismaValue::String(value)) | |
| .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), | |
| ), | |
| SetParam::ConnectActiveInventory(where_param) => ( | |
| active_inventory::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "connect".to_string(), | |
| ::prisma_client_rust::PrismaValue::Object( | |
| [where_param] | |
| .into_iter() | |
| .map(Into::<super::inventory::WhereParam>::into) | |
| .map(::prisma_client_rust::WhereInput::serialize) | |
| .map(::prisma_client_rust::SerializedWhereInput::transform_equals) | |
| .collect(), | |
| ), | |
| )]), | |
| ), | |
| SetParam::DisconnectActiveInventory => ( | |
| active_inventory::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "disconnect".to_string(), | |
| ::prisma_client_rust::PrismaValue::Boolean(true), | |
| )]), | |
| ), | |
| SetParam::SetBackpackInventoryId(value) => ( | |
| backpack_inventory_id::NAME.to_string(), | |
| value | |
| .map(|value| ::prisma_client_rust::PrismaValue::String(value)) | |
| .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), | |
| ), | |
| SetParam::ConnectBackpackInventory(where_param) => ( | |
| backpack_inventory::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "connect".to_string(), | |
| ::prisma_client_rust::PrismaValue::Object( | |
| [where_param] | |
| .into_iter() | |
| .map(Into::<super::inventory::WhereParam>::into) | |
| .map(::prisma_client_rust::WhereInput::serialize) | |
| .map(::prisma_client_rust::SerializedWhereInput::transform_equals) | |
| .collect(), | |
| ), | |
| )]), | |
| ), | |
| SetParam::DisconnectBackpackInventory => ( | |
| backpack_inventory::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), | |
| Name(String), | |
| Weight(i32), | |
| Value(i32), | |
| ActiveInventoryId(Option<String>), | |
| BackpackInventoryId(Option<String>), | |
| } | |
| impl From<UncheckedSetParam> for SetParam { | |
| fn from(param: UncheckedSetParam) -> Self { | |
| match param { | |
| UncheckedSetParam::Id(value) => Self::SetId(value), | |
| UncheckedSetParam::Name(value) => Self::SetName(value), | |
| UncheckedSetParam::Weight(value) => Self::SetWeight(value), | |
| UncheckedSetParam::Value(value) => Self::SetValue(value), | |
| UncheckedSetParam::ActiveInventoryId(value) => Self::SetActiveInventoryId(value), | |
| UncheckedSetParam::BackpackInventoryId(value) => { | |
| Self::SetBackpackInventoryId(value) | |
| } | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum OrderByParam { | |
| Id(::prisma_client_rust::Direction), | |
| Name(::prisma_client_rust::Direction), | |
| Weight(::prisma_client_rust::Direction), | |
| Value(::prisma_client_rust::Direction), | |
| ActiveInventoryId(::prisma_client_rust::Direction), | |
| BackpackInventoryId(::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::Name(direction) => ( | |
| name::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| Self::Weight(direction) => ( | |
| weight::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| Self::Value(direction) => ( | |
| value::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| Self::ActiveInventoryId(direction) => ( | |
| active_inventory_id::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| Self::BackpackInventoryId(direction) => ( | |
| backpack_inventory_id::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum WhereParam { | |
| Not(Vec<WhereParam>), | |
| Or(Vec<WhereParam>), | |
| And(Vec<WhereParam>), | |
| Id(_prisma::read_filters::StringFilter), | |
| Name(_prisma::read_filters::StringFilter), | |
| Weight(_prisma::read_filters::IntFilter), | |
| Value(_prisma::read_filters::IntFilter), | |
| ActiveInventoryId(_prisma::read_filters::StringNullableFilter), | |
| ActiveInventoryIsNull, | |
| ActiveInventoryIs(Vec<super::inventory::WhereParam>), | |
| ActiveInventoryIsNot(Vec<super::inventory::WhereParam>), | |
| BackpackInventoryId(_prisma::read_filters::StringNullableFilter), | |
| BackpackInventoryIsNull, | |
| BackpackInventoryIs(Vec<super::inventory::WhereParam>), | |
| BackpackInventoryIsNot(Vec<super::inventory::WhereParam>), | |
| } | |
| 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::Name(value) => (name::NAME, value.into()), | |
| Self::Weight(value) => (weight::NAME, value.into()), | |
| Self::Value(value) => (value::NAME, value.into()), | |
| Self::ActiveInventoryId(value) => (active_inventory_id::NAME, value.into()), | |
| Self::ActiveInventoryIsNull => ( | |
| active_inventory::NAME, | |
| ::prisma_client_rust::SerializedWhereValue::Value( | |
| ::prisma_client_rust::PrismaValue::Null, | |
| ), | |
| ), | |
| Self::ActiveInventoryIs(where_params) => ( | |
| active_inventory::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::ActiveInventoryIsNot(where_params) => ( | |
| active_inventory::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::BackpackInventoryId(value) => (backpack_inventory_id::NAME, value.into()), | |
| Self::BackpackInventoryIsNull => ( | |
| backpack_inventory::NAME, | |
| ::prisma_client_rust::SerializedWhereValue::Value( | |
| ::prisma_client_rust::PrismaValue::Null, | |
| ), | |
| ), | |
| Self::BackpackInventoryIs(where_params) => ( | |
| backpack_inventory::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::BackpackInventoryIsNot(where_params) => ( | |
| backpack_inventory::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<UniqueWhereParam> 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<Self>> for WhereParam { | |
| fn from(op: ::prisma_client_rust::Operator<Self>) -> 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(name::NAME), | |
| ::prisma_client_rust::sel(weight::NAME), | |
| ::prisma_client_rust::sel(value::NAME), | |
| ::prisma_client_rust::sel(active_inventory_id::NAME), | |
| ::prisma_client_rust::sel(backpack_inventory_id::NAME), | |
| ] | |
| } | |
| } | |
| pub type UniqueArgs = ::prisma_client_rust::UniqueArgs<Types>; | |
| pub type ManyArgs = ::prisma_client_rust::ManyArgs<Types>; | |
| 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<WhereParam>) -> FindFirst<'a> { | |
| FindFirst::new(self.client, _where) | |
| } | |
| pub fn find_many(self, _where: Vec<WhereParam>) -> FindMany<'a> { | |
| FindMany::new(self.client, _where) | |
| } | |
| pub fn create( | |
| self, | |
| name: String, | |
| weight: i32, | |
| value: i32, | |
| mut _params: Vec<SetParam>, | |
| ) -> Create<'a> { | |
| _params.extend([name::set(name), weight::set(weight), value::set(value)]); | |
| Create::new(self.client, _params) | |
| } | |
| pub fn create_unchecked( | |
| self, | |
| name: String, | |
| weight: i32, | |
| value: i32, | |
| mut _params: Vec<UncheckedSetParam>, | |
| ) -> Create<'a> { | |
| _params.extend([name::set(name), weight::set(weight), value::set(value)]); | |
| Create::new(self.client, _params.into_iter().map(Into::into).collect()) | |
| } | |
| pub fn create_many(self, data: Vec<(String, i32, i32, Vec<SetParam>)>) -> CreateMany<'a> { | |
| let data = data | |
| .into_iter() | |
| .map(|(name, weight, value, mut _params)| { | |
| _params.extend([name::set(name), weight::set(weight), value::set(value)]); | |
| _params | |
| }) | |
| .collect(); | |
| CreateMany::new(self.client, data) | |
| } | |
| pub fn update(self, _where: UniqueWhereParam, _params: Vec<SetParam>) -> Update<'a> { | |
| Update::new(self.client, _where.into(), _params, vec![]) | |
| } | |
| pub fn update_unchecked( | |
| self, | |
| _where: UniqueWhereParam, | |
| _params: Vec<UncheckedSetParam>, | |
| ) -> Update<'a> { | |
| Update::new( | |
| self.client, | |
| _where.into(), | |
| _params.into_iter().map(Into::into).collect(), | |
| vec![], | |
| ) | |
| } | |
| pub fn update_many( | |
| self, | |
| _where: Vec<WhereParam>, | |
| _params: Vec<SetParam>, | |
| ) -> UpdateMany<'a> { | |
| UpdateMany::new(self.client, _where, _params) | |
| } | |
| pub fn upsert( | |
| self, | |
| _where: UniqueWhereParam, | |
| (name, weight, value, mut _params): (String, i32, i32, Vec<SetParam>), | |
| _update: Vec<SetParam>, | |
| ) -> Upsert<'a> { | |
| _params.extend([name::set(name), weight::set(weight), value::set(value)]); | |
| 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<WhereParam>) -> DeleteMany<'a> { | |
| DeleteMany::new(self.client, _where) | |
| } | |
| pub fn count(self, _where: Vec<WhereParam>) -> Count<'a> { | |
| Count::new(self.client, _where) | |
| } | |
| } | |
| } | |
| pub mod inventory { | |
| use super::_prisma::*; | |
| use super::*; | |
| pub const NAME: &str = "Inventory"; | |
| 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<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetId(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::Id(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: String) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::Id(direction) | |
| } | |
| pub fn equals<T: From<UniqueWhereParam>>(value: String) -> T { | |
| UniqueWhereParam::IdEquals(value).into() | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::StringFilter, Id, { | |
| fn in_vec(_: Vec<String>) -> InVec; | |
| fn not_in_vec(_: Vec<String>) -> 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<super::IncludeParam> 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<super::SelectParam> 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 active { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "active"; | |
| pub struct Fetch(pub item::ManyArgs); | |
| impl Fetch { | |
| pub fn with(mut self, params: impl Into<item::WithParam>) -> Self { | |
| self.0 = self.0.with(params.into()); | |
| self | |
| } | |
| pub fn order_by(mut self, param: item::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: item::UniqueWhereParam) -> Self { | |
| self.0 = self.0.cursor(value.into()); | |
| self | |
| } | |
| } | |
| impl From<Fetch> for WithParam { | |
| fn from(Fetch(v): Fetch) -> Self { | |
| WithParam::Active(v) | |
| } | |
| } | |
| pub fn fetch(params: Vec<item::WhereParam>) -> Fetch { | |
| Fetch(item::ManyArgs::new(params)) | |
| } | |
| pub struct Connect(pub Vec<item::UniqueWhereParam>); | |
| impl From<Connect> for SetParam { | |
| fn from(Connect(v): Connect) -> Self { | |
| Self::ConnectActive(v) | |
| } | |
| } | |
| pub fn connect<T: From<Connect>>(params: Vec<item::UniqueWhereParam>) -> T { | |
| Connect(params).into() | |
| } | |
| pub fn disconnect(params: Vec<item::UniqueWhereParam>) -> SetParam { | |
| SetParam::DisconnectActive(params) | |
| } | |
| pub fn set(params: Vec<item::UniqueWhereParam>) -> SetParam { | |
| SetParam::SetActive(params) | |
| } | |
| pub fn some(value: Vec<item::WhereParam>) -> WhereParam { | |
| WhereParam::ActiveSome(value) | |
| } | |
| pub fn every(value: Vec<item::WhereParam>) -> WhereParam { | |
| WhereParam::ActiveEvery(value) | |
| } | |
| pub fn none(value: Vec<item::WhereParam>) -> WhereParam { | |
| WhereParam::ActiveNone(value) | |
| } | |
| pub enum Include { | |
| Select(item::ManyArgs, Vec<item::SelectParam>), | |
| Include(item::ManyArgs, Vec<item::IncludeParam>), | |
| Fetch(item::ManyArgs), | |
| } | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Active(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 = | |
| <item::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, | |
| <item::Types as ::prisma_client_rust::ModelTypes>::scalar_selections(), | |
| ), | |
| }; | |
| ::prisma_client_rust::Selection::new(NAME, None, args, selections) | |
| } | |
| pub fn select(args: item::ManyArgs, nested_selections: Vec<item::SelectParam>) -> Self { | |
| Self::Select(args, nested_selections) | |
| } | |
| pub fn include( | |
| args: item::ManyArgs, | |
| nested_selections: Vec<item::IncludeParam>, | |
| ) -> Self { | |
| Self::Include(args, nested_selections) | |
| } | |
| } | |
| pub enum Select { | |
| Select(item::ManyArgs, Vec<item::SelectParam>), | |
| Include(item::ManyArgs, Vec<item::IncludeParam>), | |
| Fetch(item::ManyArgs), | |
| } | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Active(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, | |
| <item::Types as ::prisma_client_rust::ModelTypes>::scalar_selections(), | |
| ), | |
| }; | |
| ::prisma_client_rust::Selection::new(NAME, None, args, selections) | |
| } | |
| pub fn select(args: item::ManyArgs, nested_selections: Vec<item::SelectParam>) -> Self { | |
| Self::Select(args, nested_selections) | |
| } | |
| pub fn include( | |
| args: item::ManyArgs, | |
| nested_selections: Vec<item::IncludeParam>, | |
| ) -> Self { | |
| Self::Include(args, nested_selections) | |
| } | |
| } | |
| } | |
| pub mod backpack { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "backpack"; | |
| pub struct Fetch(pub item::ManyArgs); | |
| impl Fetch { | |
| pub fn with(mut self, params: impl Into<item::WithParam>) -> Self { | |
| self.0 = self.0.with(params.into()); | |
| self | |
| } | |
| pub fn order_by(mut self, param: item::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: item::UniqueWhereParam) -> Self { | |
| self.0 = self.0.cursor(value.into()); | |
| self | |
| } | |
| } | |
| impl From<Fetch> for WithParam { | |
| fn from(Fetch(v): Fetch) -> Self { | |
| WithParam::Backpack(v) | |
| } | |
| } | |
| pub fn fetch(params: Vec<item::WhereParam>) -> Fetch { | |
| Fetch(item::ManyArgs::new(params)) | |
| } | |
| pub struct Connect(pub Vec<item::UniqueWhereParam>); | |
| impl From<Connect> for SetParam { | |
| fn from(Connect(v): Connect) -> Self { | |
| Self::ConnectBackpack(v) | |
| } | |
| } | |
| pub fn connect<T: From<Connect>>(params: Vec<item::UniqueWhereParam>) -> T { | |
| Connect(params).into() | |
| } | |
| pub fn disconnect(params: Vec<item::UniqueWhereParam>) -> SetParam { | |
| SetParam::DisconnectBackpack(params) | |
| } | |
| pub fn set(params: Vec<item::UniqueWhereParam>) -> SetParam { | |
| SetParam::SetBackpack(params) | |
| } | |
| pub fn some(value: Vec<item::WhereParam>) -> WhereParam { | |
| WhereParam::BackpackSome(value) | |
| } | |
| pub fn every(value: Vec<item::WhereParam>) -> WhereParam { | |
| WhereParam::BackpackEvery(value) | |
| } | |
| pub fn none(value: Vec<item::WhereParam>) -> WhereParam { | |
| WhereParam::BackpackNone(value) | |
| } | |
| pub enum Include { | |
| Select(item::ManyArgs, Vec<item::SelectParam>), | |
| Include(item::ManyArgs, Vec<item::IncludeParam>), | |
| Fetch(item::ManyArgs), | |
| } | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Backpack(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 = | |
| <item::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, | |
| <item::Types as ::prisma_client_rust::ModelTypes>::scalar_selections(), | |
| ), | |
| }; | |
| ::prisma_client_rust::Selection::new(NAME, None, args, selections) | |
| } | |
| pub fn select(args: item::ManyArgs, nested_selections: Vec<item::SelectParam>) -> Self { | |
| Self::Select(args, nested_selections) | |
| } | |
| pub fn include( | |
| args: item::ManyArgs, | |
| nested_selections: Vec<item::IncludeParam>, | |
| ) -> Self { | |
| Self::Include(args, nested_selections) | |
| } | |
| } | |
| pub enum Select { | |
| Select(item::ManyArgs, Vec<item::SelectParam>), | |
| Include(item::ManyArgs, Vec<item::IncludeParam>), | |
| Fetch(item::ManyArgs), | |
| } | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Backpack(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, | |
| <item::Types as ::prisma_client_rust::ModelTypes>::scalar_selections(), | |
| ), | |
| }; | |
| ::prisma_client_rust::Selection::new(NAME, None, args, selections) | |
| } | |
| pub fn select(args: item::ManyArgs, nested_selections: Vec<item::SelectParam>) -> Self { | |
| Self::Select(args, nested_selections) | |
| } | |
| pub fn include( | |
| args: item::ManyArgs, | |
| nested_selections: Vec<item::IncludeParam>, | |
| ) -> Self { | |
| Self::Include(args, nested_selections) | |
| } | |
| } | |
| } | |
| pub mod hero { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "hero"; | |
| pub struct Fetch(pub hero::UniqueArgs); | |
| impl Fetch { | |
| pub fn with(mut self, params: impl Into<hero::WithParam>) -> Self { | |
| self.0 = self.0.with(params.into()); | |
| self | |
| } | |
| } | |
| impl From<Fetch> for WithParam { | |
| fn from(Fetch(v): Fetch) -> Self { | |
| WithParam::Hero(v) | |
| } | |
| } | |
| pub fn fetch() -> Fetch { | |
| Fetch(hero::UniqueArgs::new()) | |
| } | |
| pub struct Connect(hero::UniqueWhereParam); | |
| impl From<Connect> for SetParam { | |
| fn from(Connect(v): Connect) -> Self { | |
| Self::ConnectHero(v) | |
| } | |
| } | |
| pub fn connect<T: From<Connect>>(value: hero::UniqueWhereParam) -> T { | |
| Connect(value).into() | |
| } | |
| pub fn disconnect() -> SetParam { | |
| SetParam::DisconnectHero | |
| } | |
| pub fn is_null() -> WhereParam { | |
| WhereParam::HeroIsNull | |
| } | |
| pub fn is(value: Vec<hero::WhereParam>) -> WhereParam { | |
| WhereParam::HeroIs(value) | |
| } | |
| pub fn is_not(value: Vec<hero::WhereParam>) -> WhereParam { | |
| WhereParam::HeroIsNot(value) | |
| } | |
| pub enum Include { | |
| Select(Vec<hero::SelectParam>), | |
| Include(Vec<hero::IncludeParam>), | |
| Fetch, | |
| } | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Hero(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 = | |
| <hero::Types as ::prisma_client_rust::ModelTypes>::scalar_selections(); | |
| nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); | |
| nested_selections | |
| } | |
| Self::Fetch => { | |
| <hero::Types as ::prisma_client_rust::ModelTypes>::scalar_selections() | |
| } | |
| }; | |
| ::prisma_client_rust::Selection::new("hero", None, [], selections) | |
| } | |
| pub fn select(nested_selections: Vec<hero::SelectParam>) -> Self { | |
| Self::Select(nested_selections) | |
| } | |
| pub fn include(nested_selections: Vec<hero::IncludeParam>) -> Self { | |
| Self::Include(nested_selections) | |
| } | |
| } | |
| pub enum Select { | |
| Select(Vec<hero::SelectParam>), | |
| Include(Vec<hero::IncludeParam>), | |
| Fetch, | |
| } | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Hero(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 => { | |
| <hero::Types as ::prisma_client_rust::ModelTypes>::scalar_selections() | |
| } | |
| }; | |
| ::prisma_client_rust::Selection::new("hero", None, [], selections) | |
| } | |
| pub fn select(nested_selections: Vec<hero::SelectParam>) -> Self { | |
| Self::Select(nested_selections) | |
| } | |
| pub fn include(nested_selections: Vec<hero::IncludeParam>) -> Self { | |
| Self::Include(nested_selections) | |
| } | |
| } | |
| } | |
| pub fn create(_params: Vec<SetParam>) -> (Vec<SetParam>) { | |
| (_params) | |
| } | |
| pub fn create_unchecked(_params: Vec<SetParam>) -> (Vec<SetParam>) { | |
| (_params) | |
| } | |
| #[macro_export] | |
| macro_rules ! _select_inventory { ($ (($ ($ 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 :: inventory :: 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 :: inventory :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: inventory :: 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 :: inventory :: 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 :: inventory :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: inventory :: 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 , active , backpack , hero } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { $ (pub $ field : crate :: prisma :: inventory :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } 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 :: inventory :: $ 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 :: inventory :: $ 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 :: inventory :: $ 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 :: inventory :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: inventory :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "active" , "backpack" , "hero"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: inventory :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { String } ; (@ field_type ; active : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < active :: Data > } ; (@ field_type ; active) => { Vec < crate :: prisma :: item :: Data > } ; (@ field_type ; backpack : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < backpack :: Data > } ; (@ field_type ; backpack) => { Vec < crate :: prisma :: item :: Data > } ; (@ field_type ; hero : $ selection_mode : ident { $ ($ selections : tt) + }) => { Option < hero :: Data > } ; (@ field_type ; hero) => { Option < crate :: prisma :: hero :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Inventory" , available relations are "id, active, backpack, hero")) } ; (@ field_module ; active : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: item :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; backpack : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: item :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; hero : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: hero :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: inventory :: SelectParam > :: into (crate :: prisma :: inventory :: id :: Select) } ; (@ selection_field_to_selection_param ; active $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: inventory :: SelectParam > :: into (crate :: prisma :: inventory :: active :: Select :: $ selection_mode (crate :: prisma :: item :: ManyArgs :: new (crate :: prisma :: item :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: item :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; active $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: inventory :: SelectParam > :: into (crate :: prisma :: inventory :: active :: Select :: Fetch (crate :: prisma :: item :: ManyArgs :: new (crate :: prisma :: item :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; backpack $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: inventory :: SelectParam > :: into (crate :: prisma :: inventory :: backpack :: Select :: $ selection_mode (crate :: prisma :: item :: ManyArgs :: new (crate :: prisma :: item :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: item :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; backpack $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: inventory :: SelectParam > :: into (crate :: prisma :: inventory :: backpack :: Select :: Fetch (crate :: prisma :: item :: ManyArgs :: new (crate :: prisma :: item :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; hero $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: inventory :: SelectParam > :: into (crate :: prisma :: inventory :: hero :: Select :: $ selection_mode (crate :: prisma :: hero :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; hero $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: inventory :: SelectParam > :: into (crate :: prisma :: inventory :: hero :: 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 :: inventory :: $ 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 ; active) => { "active" } ; (@ field_serde_name ; backpack) => { "backpack" } ; (@ field_serde_name ; hero) => { "hero" } ; } | |
| pub use _select_inventory as select; | |
| pub enum SelectParam { | |
| Id(id::Select), | |
| Active(active::Select), | |
| Backpack(backpack::Select), | |
| Hero(hero::Select), | |
| } | |
| impl SelectParam { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::Id(data) => data.to_selection(), | |
| Self::Active(data) => data.to_selection(), | |
| Self::Backpack(data) => data.to_selection(), | |
| Self::Hero(data) => data.to_selection(), | |
| } | |
| } | |
| } | |
| #[macro_export] | |
| macro_rules ! _include_inventory { ($ (($ ($ 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 :: inventory :: 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 :: inventory :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: inventory :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: inventory :: 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 :: inventory :: 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 :: inventory :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: inventory :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: inventory :: 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 { active , backpack , hero } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { pub id : String , $ (pub $ field : crate :: prisma :: inventory :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } 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)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: inventory :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: inventory :: id :: NAME , & self . 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 } 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 :: inventory :: $ field :: NAME) , + , crate :: prisma :: inventory :: 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 :: inventory :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: inventory :: id :: NAME => Ok (Field :: 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 ; while let Some (key) = map . next_key () ? { match key { Field :: id => { if id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: inventory :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: inventory :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: inventory :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: inventory :: id :: NAME)) ? ; Ok (Data { id , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "active" , "backpack" , "hero"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: inventory :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; active : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < active :: Data > } ; (@ field_type ; active) => { Vec < crate :: prisma :: item :: Data > } ; (@ field_type ; backpack : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < backpack :: Data > } ; (@ field_type ; backpack) => { Vec < crate :: prisma :: item :: Data > } ; (@ field_type ; hero : $ selection_mode : ident { $ ($ selections : tt) + }) => { Option < hero :: Data > } ; (@ field_type ; hero) => { Option < crate :: prisma :: hero :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Inventory" , available relations are "active, backpack, hero")) } ; (@ field_module ; active : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: item :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; backpack : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: item :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; hero : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: hero :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; active $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: inventory :: IncludeParam > :: into (crate :: prisma :: inventory :: active :: Include :: $ selection_mode (crate :: prisma :: item :: ManyArgs :: new (crate :: prisma :: item :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: item :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; active $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: inventory :: IncludeParam > :: into (crate :: prisma :: inventory :: active :: Include :: Fetch (crate :: prisma :: item :: ManyArgs :: new (crate :: prisma :: item :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; backpack $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: inventory :: IncludeParam > :: into (crate :: prisma :: inventory :: backpack :: Include :: $ selection_mode (crate :: prisma :: item :: ManyArgs :: new (crate :: prisma :: item :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: item :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; backpack $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: inventory :: IncludeParam > :: into (crate :: prisma :: inventory :: backpack :: Include :: Fetch (crate :: prisma :: item :: ManyArgs :: new (crate :: prisma :: item :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; hero $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: inventory :: IncludeParam > :: into (crate :: prisma :: inventory :: hero :: Include :: $ selection_mode (crate :: prisma :: hero :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; hero $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: inventory :: IncludeParam > :: into (crate :: prisma :: inventory :: hero :: 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 :: inventory :: $ 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 ; active) => { "active" } ; (@ field_serde_name ; backpack) => { "backpack" } ; (@ field_serde_name ; hero) => { "hero" } ; } | |
| pub use _include_inventory as include; | |
| pub enum IncludeParam { | |
| Id(id::Include), | |
| Active(active::Include), | |
| Backpack(backpack::Include), | |
| Hero(hero::Include), | |
| } | |
| impl IncludeParam { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::Id(data) => data.to_selection(), | |
| Self::Active(data) => data.to_selection(), | |
| Self::Backpack(data) => data.to_selection(), | |
| Self::Hero(data) => data.to_selection(), | |
| } | |
| } | |
| } | |
| #[macro_export] | |
| macro_rules ! _partial_unchecked_inventory { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: inventory struct $ struct_name { # [serde (rename = "id")] pub id : String } [$ ($ scalar_field) , +] } } ; } | |
| pub use _partial_unchecked_inventory as partial_unchecked; | |
| #[derive(Debug, Clone, :: serde :: Serialize, :: serde :: Deserialize)] | |
| pub struct Data { | |
| #[serde(rename = "id")] | |
| pub id: String, | |
| #[serde(rename = "active")] | |
| pub active: Option<Vec<super::item::Data>>, | |
| #[serde(rename = "backpack")] | |
| pub backpack: Option<Vec<super::item::Data>>, | |
| #[serde( | |
| rename = "hero", | |
| default, | |
| skip_serializing_if = "Option::is_none", | |
| with = "prisma_client_rust::serde::double_option" | |
| )] | |
| pub hero: Option<Option<Box<super::hero::Data>>>, | |
| } | |
| impl Data { | |
| pub fn active( | |
| &self, | |
| ) -> Result<&Vec<super::item::Data>, ::prisma_client_rust::RelationNotFetchedError> | |
| { | |
| self.active | |
| .as_ref() | |
| .ok_or(::prisma_client_rust::RelationNotFetchedError::new( | |
| stringify!(active), | |
| )) | |
| } | |
| pub fn backpack( | |
| &self, | |
| ) -> Result<&Vec<super::item::Data>, ::prisma_client_rust::RelationNotFetchedError> | |
| { | |
| self.backpack | |
| .as_ref() | |
| .ok_or(::prisma_client_rust::RelationNotFetchedError::new( | |
| stringify!(backpack), | |
| )) | |
| } | |
| pub fn hero( | |
| &self, | |
| ) -> Result<Option<&super::hero::Data>, ::prisma_client_rust::RelationNotFetchedError> | |
| { | |
| self.hero | |
| .as_ref() | |
| .ok_or(::prisma_client_rust::RelationNotFetchedError::new( | |
| stringify!(hero), | |
| )) | |
| .map(|v| v.as_ref().map(|v| v.as_ref())) | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum WithParam { | |
| Active(super::item::ManyArgs), | |
| Backpack(super::item::ManyArgs), | |
| Hero(super::hero::UniqueArgs), | |
| } | |
| impl Into<::prisma_client_rust::Selection> for WithParam { | |
| fn into(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::Active(args) => { | |
| let (arguments, mut nested_selections) = args.to_graphql(); | |
| nested_selections.extend( | |
| <super::item::Types as ::prisma_client_rust::ModelTypes>::scalar_selections( | |
| ), | |
| ); | |
| ::prisma_client_rust::Selection::new( | |
| active::NAME, | |
| None, | |
| arguments, | |
| nested_selections, | |
| ) | |
| } | |
| Self::Backpack(args) => { | |
| let (arguments, mut nested_selections) = args.to_graphql(); | |
| nested_selections.extend( | |
| <super::item::Types as ::prisma_client_rust::ModelTypes>::scalar_selections( | |
| ), | |
| ); | |
| ::prisma_client_rust::Selection::new( | |
| backpack::NAME, | |
| None, | |
| arguments, | |
| nested_selections, | |
| ) | |
| } | |
| Self::Hero(args) => { | |
| let mut selections = | |
| <super::hero::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(hero::NAME, None, [], selections) | |
| } | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum SetParam { | |
| SetId(String), | |
| ConnectActive(Vec<super::item::UniqueWhereParam>), | |
| DisconnectActive(Vec<super::item::UniqueWhereParam>), | |
| SetActive(Vec<super::item::UniqueWhereParam>), | |
| ConnectBackpack(Vec<super::item::UniqueWhereParam>), | |
| DisconnectBackpack(Vec<super::item::UniqueWhereParam>), | |
| SetBackpack(Vec<super::item::UniqueWhereParam>), | |
| ConnectHero(super::hero::UniqueWhereParam), | |
| DisconnectHero, | |
| } | |
| impl From<SetParam> 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::ConnectActive(where_params) => ( | |
| active::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "connect".to_string(), | |
| ::prisma_client_rust::PrismaValue::List( | |
| where_params | |
| .into_iter() | |
| .map(Into::<super::item::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::DisconnectActive(where_params) => ( | |
| active::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "disconnect".to_string(), | |
| ::prisma_client_rust::PrismaValue::List( | |
| where_params | |
| .into_iter() | |
| .map(Into::<super::item::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::SetActive(where_params) => ( | |
| active::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "set".to_string(), | |
| ::prisma_client_rust::PrismaValue::List( | |
| where_params | |
| .into_iter() | |
| .map(Into::<super::item::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::ConnectBackpack(where_params) => ( | |
| backpack::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "connect".to_string(), | |
| ::prisma_client_rust::PrismaValue::List( | |
| where_params | |
| .into_iter() | |
| .map(Into::<super::item::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::DisconnectBackpack(where_params) => ( | |
| backpack::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "disconnect".to_string(), | |
| ::prisma_client_rust::PrismaValue::List( | |
| where_params | |
| .into_iter() | |
| .map(Into::<super::item::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::SetBackpack(where_params) => ( | |
| backpack::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "set".to_string(), | |
| ::prisma_client_rust::PrismaValue::List( | |
| where_params | |
| .into_iter() | |
| .map(Into::<super::item::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::ConnectHero(where_param) => ( | |
| hero::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "connect".to_string(), | |
| ::prisma_client_rust::PrismaValue::Object( | |
| [where_param] | |
| .into_iter() | |
| .map(Into::<super::hero::WhereParam>::into) | |
| .map(::prisma_client_rust::WhereInput::serialize) | |
| .map(::prisma_client_rust::SerializedWhereInput::transform_equals) | |
| .collect(), | |
| ), | |
| )]), | |
| ), | |
| SetParam::DisconnectHero => ( | |
| hero::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), | |
| } | |
| impl From<UncheckedSetParam> for SetParam { | |
| fn from(param: UncheckedSetParam) -> Self { | |
| match param { | |
| UncheckedSetParam::Id(value) => Self::SetId(value), | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum OrderByParam { | |
| Id(::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()), | |
| ), | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum WhereParam { | |
| Not(Vec<WhereParam>), | |
| Or(Vec<WhereParam>), | |
| And(Vec<WhereParam>), | |
| Id(_prisma::read_filters::StringFilter), | |
| ActiveSome(Vec<super::item::WhereParam>), | |
| ActiveEvery(Vec<super::item::WhereParam>), | |
| ActiveNone(Vec<super::item::WhereParam>), | |
| BackpackSome(Vec<super::item::WhereParam>), | |
| BackpackEvery(Vec<super::item::WhereParam>), | |
| BackpackNone(Vec<super::item::WhereParam>), | |
| HeroIsNull, | |
| HeroIs(Vec<super::hero::WhereParam>), | |
| HeroIsNot(Vec<super::hero::WhereParam>), | |
| } | |
| 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::ActiveSome(where_params) => ( | |
| active::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::ActiveEvery(where_params) => ( | |
| active::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::ActiveNone(where_params) => ( | |
| active::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::BackpackSome(where_params) => ( | |
| backpack::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::BackpackEvery(where_params) => ( | |
| backpack::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::BackpackNone(where_params) => ( | |
| backpack::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::HeroIsNull => ( | |
| hero::NAME, | |
| ::prisma_client_rust::SerializedWhereValue::Value( | |
| ::prisma_client_rust::PrismaValue::Null, | |
| ), | |
| ), | |
| Self::HeroIs(where_params) => ( | |
| hero::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::HeroIsNot(where_params) => ( | |
| hero::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<UniqueWhereParam> 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<Self>> for WhereParam { | |
| fn from(op: ::prisma_client_rust::Operator<Self>) -> 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)] | |
| } | |
| } | |
| pub type UniqueArgs = ::prisma_client_rust::UniqueArgs<Types>; | |
| pub type ManyArgs = ::prisma_client_rust::ManyArgs<Types>; | |
| 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<WhereParam>) -> FindFirst<'a> { | |
| FindFirst::new(self.client, _where) | |
| } | |
| pub fn find_many(self, _where: Vec<WhereParam>) -> FindMany<'a> { | |
| FindMany::new(self.client, _where) | |
| } | |
| pub fn create(self, mut _params: Vec<SetParam>) -> Create<'a> { | |
| _params.extend([]); | |
| Create::new(self.client, _params) | |
| } | |
| pub fn create_unchecked(self, mut _params: Vec<UncheckedSetParam>) -> Create<'a> { | |
| _params.extend([]); | |
| Create::new(self.client, _params.into_iter().map(Into::into).collect()) | |
| } | |
| pub fn create_many(self, data: Vec<(Vec<SetParam>)>) -> CreateMany<'a> { | |
| let data = data | |
| .into_iter() | |
| .map(|(mut _params)| { | |
| _params.extend([]); | |
| _params | |
| }) | |
| .collect(); | |
| CreateMany::new(self.client, data) | |
| } | |
| pub fn update(self, _where: UniqueWhereParam, _params: Vec<SetParam>) -> Update<'a> { | |
| Update::new(self.client, _where.into(), _params, vec![]) | |
| } | |
| pub fn update_unchecked( | |
| self, | |
| _where: UniqueWhereParam, | |
| _params: Vec<UncheckedSetParam>, | |
| ) -> Update<'a> { | |
| Update::new( | |
| self.client, | |
| _where.into(), | |
| _params.into_iter().map(Into::into).collect(), | |
| vec![], | |
| ) | |
| } | |
| pub fn update_many( | |
| self, | |
| _where: Vec<WhereParam>, | |
| _params: Vec<SetParam>, | |
| ) -> UpdateMany<'a> { | |
| UpdateMany::new(self.client, _where, _params) | |
| } | |
| pub fn upsert( | |
| self, | |
| _where: UniqueWhereParam, | |
| (mut _params): (Vec<SetParam>), | |
| _update: Vec<SetParam>, | |
| ) -> Upsert<'a> { | |
| _params.extend([]); | |
| 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<WhereParam>) -> DeleteMany<'a> { | |
| DeleteMany::new(self.client, _where) | |
| } | |
| pub fn count(self, _where: Vec<WhereParam>) -> Count<'a> { | |
| Count::new(self.client, _where) | |
| } | |
| } | |
| } | |
| pub mod hero { | |
| use super::_prisma::*; | |
| use super::*; | |
| pub const NAME: &str = "Hero"; | |
| 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<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetId(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::Id(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: String) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::Id(direction) | |
| } | |
| pub fn equals<T: From<UniqueWhereParam>>(value: String) -> T { | |
| UniqueWhereParam::IdEquals(value).into() | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::StringFilter, Id, { | |
| fn in_vec(_: Vec<String>) -> InVec; | |
| fn not_in_vec(_: Vec<String>) -> 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<super::IncludeParam> 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<super::SelectParam> 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 aion_capacity { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "aionCapacity"; | |
| pub struct Set(pub i32); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetAionCapacity(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::AionCapacity(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: i32) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::AionCapacity(direction) | |
| } | |
| pub fn equals(value: i32) -> WhereParam { | |
| WhereParam::AionCapacity(_prisma::read_filters::IntFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!( | |
| _prisma::read_filters::IntFilter, | |
| AionCapacity, | |
| { | |
| fn in_vec(_: Vec<i32>) -> InVec; | |
| fn not_in_vec(_: Vec<i32>) -> 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::IncrementAionCapacity(value) | |
| } | |
| pub fn decrement(value: i32) -> SetParam { | |
| SetParam::DecrementAionCapacity(value) | |
| } | |
| pub fn multiply(value: i32) -> SetParam { | |
| SetParam::MultiplyAionCapacity(value) | |
| } | |
| pub fn divide(value: i32) -> SetParam { | |
| SetParam::DivideAionCapacity(value) | |
| } | |
| pub struct Include; | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::AionCapacity(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::AionCapacity(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod aion_collected { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "aionCollected"; | |
| pub struct Set(pub i32); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetAionCollected(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::AionCollected(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: i32) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::AionCollected(direction) | |
| } | |
| pub fn equals(value: i32) -> WhereParam { | |
| WhereParam::AionCollected(_prisma::read_filters::IntFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!( | |
| _prisma::read_filters::IntFilter, | |
| AionCollected, | |
| { | |
| fn in_vec(_: Vec<i32>) -> InVec; | |
| fn not_in_vec(_: Vec<i32>) -> 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::IncrementAionCollected(value) | |
| } | |
| pub fn decrement(value: i32) -> SetParam { | |
| SetParam::DecrementAionCollected(value) | |
| } | |
| pub fn multiply(value: i32) -> SetParam { | |
| SetParam::MultiplyAionCollected(value) | |
| } | |
| pub fn divide(value: i32) -> SetParam { | |
| SetParam::DivideAionCollected(value) | |
| } | |
| pub struct Include; | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::AionCollected(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::AionCollected(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod base_stats_id { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "baseStatsId"; | |
| pub struct Set(pub String); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetBaseStatsId(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::BaseStatsId(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: String) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::BaseStatsId(direction) | |
| } | |
| pub fn equals<T: From<UniqueWhereParam>>(value: String) -> T { | |
| UniqueWhereParam::BaseStatsIdEquals(value).into() | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!( | |
| _prisma::read_filters::StringFilter, | |
| BaseStatsId, | |
| { | |
| fn in_vec(_: Vec<String>) -> InVec; | |
| fn not_in_vec(_: Vec<String>) -> 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<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::BaseStatsId(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::BaseStatsId(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod attributes_id { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "attributesId"; | |
| pub struct Set(pub String); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetAttributesId(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::AttributesId(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: String) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::AttributesId(direction) | |
| } | |
| pub fn equals<T: From<UniqueWhereParam>>(value: String) -> T { | |
| UniqueWhereParam::AttributesIdEquals(value).into() | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!( | |
| _prisma::read_filters::StringFilter, | |
| AttributesId, | |
| { | |
| fn in_vec(_: Vec<String>) -> InVec; | |
| fn not_in_vec(_: Vec<String>) -> 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<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::AttributesId(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::AttributesId(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod base_stats { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "baseStats"; | |
| pub struct Fetch(pub base_stats::UniqueArgs); | |
| impl Fetch { | |
| pub fn with(mut self, params: impl Into<base_stats::WithParam>) -> Self { | |
| self.0 = self.0.with(params.into()); | |
| self | |
| } | |
| } | |
| impl From<Fetch> for WithParam { | |
| fn from(Fetch(v): Fetch) -> Self { | |
| WithParam::BaseStats(v) | |
| } | |
| } | |
| pub fn fetch() -> Fetch { | |
| Fetch(base_stats::UniqueArgs::new()) | |
| } | |
| pub struct Connect(base_stats::UniqueWhereParam); | |
| impl From<Connect> for SetParam { | |
| fn from(Connect(v): Connect) -> Self { | |
| Self::ConnectBaseStats(v) | |
| } | |
| } | |
| pub fn connect<T: From<Connect>>(value: base_stats::UniqueWhereParam) -> T { | |
| Connect(value).into() | |
| } | |
| pub fn is(value: Vec<base_stats::WhereParam>) -> WhereParam { | |
| WhereParam::BaseStatsIs(value) | |
| } | |
| pub fn is_not(value: Vec<base_stats::WhereParam>) -> WhereParam { | |
| WhereParam::BaseStatsIsNot(value) | |
| } | |
| pub enum Include { | |
| Select(Vec<base_stats::SelectParam>), | |
| Include(Vec<base_stats::IncludeParam>), | |
| Fetch, | |
| } | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::BaseStats(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 = < base_stats :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; | |
| nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); | |
| nested_selections | |
| } | |
| Self::Fetch => { | |
| <base_stats::Types as ::prisma_client_rust::ModelTypes>::scalar_selections() | |
| } | |
| }; | |
| ::prisma_client_rust::Selection::new("baseStats", None, [], selections) | |
| } | |
| pub fn select(nested_selections: Vec<base_stats::SelectParam>) -> Self { | |
| Self::Select(nested_selections) | |
| } | |
| pub fn include(nested_selections: Vec<base_stats::IncludeParam>) -> Self { | |
| Self::Include(nested_selections) | |
| } | |
| } | |
| pub enum Select { | |
| Select(Vec<base_stats::SelectParam>), | |
| Include(Vec<base_stats::IncludeParam>), | |
| Fetch, | |
| } | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::BaseStats(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 => { | |
| <base_stats::Types as ::prisma_client_rust::ModelTypes>::scalar_selections() | |
| } | |
| }; | |
| ::prisma_client_rust::Selection::new("baseStats", None, [], selections) | |
| } | |
| pub fn select(nested_selections: Vec<base_stats::SelectParam>) -> Self { | |
| Self::Select(nested_selections) | |
| } | |
| pub fn include(nested_selections: Vec<base_stats::IncludeParam>) -> Self { | |
| Self::Include(nested_selections) | |
| } | |
| } | |
| } | |
| pub mod attributes { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "attributes"; | |
| pub struct Fetch(pub attributes::UniqueArgs); | |
| impl Fetch { | |
| pub fn with(mut self, params: impl Into<attributes::WithParam>) -> Self { | |
| self.0 = self.0.with(params.into()); | |
| self | |
| } | |
| } | |
| impl From<Fetch> for WithParam { | |
| fn from(Fetch(v): Fetch) -> Self { | |
| WithParam::Attributes(v) | |
| } | |
| } | |
| pub fn fetch() -> Fetch { | |
| Fetch(attributes::UniqueArgs::new()) | |
| } | |
| pub struct Connect(attributes::UniqueWhereParam); | |
| impl From<Connect> for SetParam { | |
| fn from(Connect(v): Connect) -> Self { | |
| Self::ConnectAttributes(v) | |
| } | |
| } | |
| pub fn connect<T: From<Connect>>(value: attributes::UniqueWhereParam) -> T { | |
| Connect(value).into() | |
| } | |
| pub fn is(value: Vec<attributes::WhereParam>) -> WhereParam { | |
| WhereParam::AttributesIs(value) | |
| } | |
| pub fn is_not(value: Vec<attributes::WhereParam>) -> WhereParam { | |
| WhereParam::AttributesIsNot(value) | |
| } | |
| pub enum Include { | |
| Select(Vec<attributes::SelectParam>), | |
| Include(Vec<attributes::IncludeParam>), | |
| Fetch, | |
| } | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Attributes(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 = < attributes :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; | |
| nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); | |
| nested_selections | |
| } | |
| Self::Fetch => { | |
| <attributes::Types as ::prisma_client_rust::ModelTypes>::scalar_selections() | |
| } | |
| }; | |
| ::prisma_client_rust::Selection::new("attributes", None, [], selections) | |
| } | |
| pub fn select(nested_selections: Vec<attributes::SelectParam>) -> Self { | |
| Self::Select(nested_selections) | |
| } | |
| pub fn include(nested_selections: Vec<attributes::IncludeParam>) -> Self { | |
| Self::Include(nested_selections) | |
| } | |
| } | |
| pub enum Select { | |
| Select(Vec<attributes::SelectParam>), | |
| Include(Vec<attributes::IncludeParam>), | |
| Fetch, | |
| } | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Attributes(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 => { | |
| <attributes::Types as ::prisma_client_rust::ModelTypes>::scalar_selections() | |
| } | |
| }; | |
| ::prisma_client_rust::Selection::new("attributes", None, [], selections) | |
| } | |
| pub fn select(nested_selections: Vec<attributes::SelectParam>) -> Self { | |
| Self::Select(nested_selections) | |
| } | |
| pub fn include(nested_selections: Vec<attributes::IncludeParam>) -> Self { | |
| Self::Include(nested_selections) | |
| } | |
| } | |
| } | |
| pub mod inventory { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "inventory"; | |
| pub struct Fetch(pub inventory::UniqueArgs); | |
| impl Fetch { | |
| pub fn with(mut self, params: impl Into<inventory::WithParam>) -> Self { | |
| self.0 = self.0.with(params.into()); | |
| self | |
| } | |
| } | |
| impl From<Fetch> for WithParam { | |
| fn from(Fetch(v): Fetch) -> Self { | |
| WithParam::Inventory(v) | |
| } | |
| } | |
| pub fn fetch() -> Fetch { | |
| Fetch(inventory::UniqueArgs::new()) | |
| } | |
| pub struct Connect(inventory::UniqueWhereParam); | |
| impl From<Connect> for SetParam { | |
| fn from(Connect(v): Connect) -> Self { | |
| Self::ConnectInventory(v) | |
| } | |
| } | |
| pub fn connect<T: From<Connect>>(value: inventory::UniqueWhereParam) -> T { | |
| Connect(value).into() | |
| } | |
| pub fn is(value: Vec<inventory::WhereParam>) -> WhereParam { | |
| WhereParam::InventoryIs(value) | |
| } | |
| pub fn is_not(value: Vec<inventory::WhereParam>) -> WhereParam { | |
| WhereParam::InventoryIsNot(value) | |
| } | |
| pub enum Include { | |
| Select(Vec<inventory::SelectParam>), | |
| Include(Vec<inventory::IncludeParam>), | |
| Fetch, | |
| } | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Inventory(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 = < inventory :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; | |
| nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); | |
| nested_selections | |
| } | |
| Self::Fetch => { | |
| <inventory::Types as ::prisma_client_rust::ModelTypes>::scalar_selections() | |
| } | |
| }; | |
| ::prisma_client_rust::Selection::new("inventory", None, [], selections) | |
| } | |
| pub fn select(nested_selections: Vec<inventory::SelectParam>) -> Self { | |
| Self::Select(nested_selections) | |
| } | |
| pub fn include(nested_selections: Vec<inventory::IncludeParam>) -> Self { | |
| Self::Include(nested_selections) | |
| } | |
| } | |
| pub enum Select { | |
| Select(Vec<inventory::SelectParam>), | |
| Include(Vec<inventory::IncludeParam>), | |
| Fetch, | |
| } | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Inventory(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 => { | |
| <inventory::Types as ::prisma_client_rust::ModelTypes>::scalar_selections() | |
| } | |
| }; | |
| ::prisma_client_rust::Selection::new("inventory", None, [], selections) | |
| } | |
| pub fn select(nested_selections: Vec<inventory::SelectParam>) -> Self { | |
| Self::Select(nested_selections) | |
| } | |
| pub fn include(nested_selections: Vec<inventory::IncludeParam>) -> Self { | |
| Self::Include(nested_selections) | |
| } | |
| } | |
| } | |
| pub mod inventory_id { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "inventoryId"; | |
| pub struct Set(pub String); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetInventoryId(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::InventoryId(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: String) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::InventoryId(direction) | |
| } | |
| pub fn equals<T: From<UniqueWhereParam>>(value: String) -> T { | |
| UniqueWhereParam::InventoryIdEquals(value).into() | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!( | |
| _prisma::read_filters::StringFilter, | |
| InventoryId, | |
| { | |
| fn in_vec(_: Vec<String>) -> InVec; | |
| fn not_in_vec(_: Vec<String>) -> 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<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::InventoryId(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::InventoryId(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod retinue_slots { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "retinueSlots"; | |
| pub struct Fetch(pub retinue_slot::ManyArgs); | |
| impl Fetch { | |
| pub fn with(mut self, params: impl Into<retinue_slot::WithParam>) -> Self { | |
| self.0 = self.0.with(params.into()); | |
| self | |
| } | |
| pub fn order_by(mut self, param: retinue_slot::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: retinue_slot::UniqueWhereParam) -> Self { | |
| self.0 = self.0.cursor(value.into()); | |
| self | |
| } | |
| } | |
| impl From<Fetch> for WithParam { | |
| fn from(Fetch(v): Fetch) -> Self { | |
| WithParam::RetinueSlots(v) | |
| } | |
| } | |
| pub fn fetch(params: Vec<retinue_slot::WhereParam>) -> Fetch { | |
| Fetch(retinue_slot::ManyArgs::new(params)) | |
| } | |
| pub struct Connect(pub Vec<retinue_slot::UniqueWhereParam>); | |
| impl From<Connect> for SetParam { | |
| fn from(Connect(v): Connect) -> Self { | |
| Self::ConnectRetinueSlots(v) | |
| } | |
| } | |
| pub fn connect<T: From<Connect>>(params: Vec<retinue_slot::UniqueWhereParam>) -> T { | |
| Connect(params).into() | |
| } | |
| pub fn disconnect(params: Vec<retinue_slot::UniqueWhereParam>) -> SetParam { | |
| SetParam::DisconnectRetinueSlots(params) | |
| } | |
| pub fn set(params: Vec<retinue_slot::UniqueWhereParam>) -> SetParam { | |
| SetParam::SetRetinueSlots(params) | |
| } | |
| pub fn some(value: Vec<retinue_slot::WhereParam>) -> WhereParam { | |
| WhereParam::RetinueSlotsSome(value) | |
| } | |
| pub fn every(value: Vec<retinue_slot::WhereParam>) -> WhereParam { | |
| WhereParam::RetinueSlotsEvery(value) | |
| } | |
| pub fn none(value: Vec<retinue_slot::WhereParam>) -> WhereParam { | |
| WhereParam::RetinueSlotsNone(value) | |
| } | |
| pub enum Include { | |
| Select(retinue_slot::ManyArgs, Vec<retinue_slot::SelectParam>), | |
| Include(retinue_slot::ManyArgs, Vec<retinue_slot::IncludeParam>), | |
| Fetch(retinue_slot::ManyArgs), | |
| } | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::RetinueSlots(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 = < retinue_slot :: 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 , < retinue_slot :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; | |
| ::prisma_client_rust::Selection::new(NAME, None, args, selections) | |
| } | |
| pub fn select( | |
| args: retinue_slot::ManyArgs, | |
| nested_selections: Vec<retinue_slot::SelectParam>, | |
| ) -> Self { | |
| Self::Select(args, nested_selections) | |
| } | |
| pub fn include( | |
| args: retinue_slot::ManyArgs, | |
| nested_selections: Vec<retinue_slot::IncludeParam>, | |
| ) -> Self { | |
| Self::Include(args, nested_selections) | |
| } | |
| } | |
| pub enum Select { | |
| Select(retinue_slot::ManyArgs, Vec<retinue_slot::SelectParam>), | |
| Include(retinue_slot::ManyArgs, Vec<retinue_slot::IncludeParam>), | |
| Fetch(retinue_slot::ManyArgs), | |
| } | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::RetinueSlots(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 , < retinue_slot :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; | |
| ::prisma_client_rust::Selection::new(NAME, None, args, selections) | |
| } | |
| pub fn select( | |
| args: retinue_slot::ManyArgs, | |
| nested_selections: Vec<retinue_slot::SelectParam>, | |
| ) -> Self { | |
| Self::Select(args, nested_selections) | |
| } | |
| pub fn include( | |
| args: retinue_slot::ManyArgs, | |
| nested_selections: Vec<retinue_slot::IncludeParam>, | |
| ) -> Self { | |
| Self::Include(args, nested_selections) | |
| } | |
| } | |
| } | |
| pub mod hero_region { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "heroRegion"; | |
| pub struct Fetch(pub hero_region::ManyArgs); | |
| impl Fetch { | |
| pub fn with(mut self, params: impl Into<hero_region::WithParam>) -> Self { | |
| self.0 = self.0.with(params.into()); | |
| self | |
| } | |
| pub fn order_by(mut self, param: hero_region::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: hero_region::UniqueWhereParam) -> Self { | |
| self.0 = self.0.cursor(value.into()); | |
| self | |
| } | |
| } | |
| impl From<Fetch> for WithParam { | |
| fn from(Fetch(v): Fetch) -> Self { | |
| WithParam::HeroRegion(v) | |
| } | |
| } | |
| pub fn fetch(params: Vec<hero_region::WhereParam>) -> Fetch { | |
| Fetch(hero_region::ManyArgs::new(params)) | |
| } | |
| pub struct Connect(pub Vec<hero_region::UniqueWhereParam>); | |
| impl From<Connect> for SetParam { | |
| fn from(Connect(v): Connect) -> Self { | |
| Self::ConnectHeroRegion(v) | |
| } | |
| } | |
| pub fn connect<T: From<Connect>>(params: Vec<hero_region::UniqueWhereParam>) -> T { | |
| Connect(params).into() | |
| } | |
| pub fn disconnect(params: Vec<hero_region::UniqueWhereParam>) -> SetParam { | |
| SetParam::DisconnectHeroRegion(params) | |
| } | |
| pub fn set(params: Vec<hero_region::UniqueWhereParam>) -> SetParam { | |
| SetParam::SetHeroRegion(params) | |
| } | |
| pub fn some(value: Vec<hero_region::WhereParam>) -> WhereParam { | |
| WhereParam::HeroRegionSome(value) | |
| } | |
| pub fn every(value: Vec<hero_region::WhereParam>) -> WhereParam { | |
| WhereParam::HeroRegionEvery(value) | |
| } | |
| pub fn none(value: Vec<hero_region::WhereParam>) -> WhereParam { | |
| WhereParam::HeroRegionNone(value) | |
| } | |
| pub enum Include { | |
| Select(hero_region::ManyArgs, Vec<hero_region::SelectParam>), | |
| Include(hero_region::ManyArgs, Vec<hero_region::IncludeParam>), | |
| Fetch(hero_region::ManyArgs), | |
| } | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::HeroRegion(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 = < hero_region :: 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, | |
| <hero_region::Types as ::prisma_client_rust::ModelTypes>::scalar_selections( | |
| ), | |
| ), | |
| }; | |
| ::prisma_client_rust::Selection::new(NAME, None, args, selections) | |
| } | |
| pub fn select( | |
| args: hero_region::ManyArgs, | |
| nested_selections: Vec<hero_region::SelectParam>, | |
| ) -> Self { | |
| Self::Select(args, nested_selections) | |
| } | |
| pub fn include( | |
| args: hero_region::ManyArgs, | |
| nested_selections: Vec<hero_region::IncludeParam>, | |
| ) -> Self { | |
| Self::Include(args, nested_selections) | |
| } | |
| } | |
| pub enum Select { | |
| Select(hero_region::ManyArgs, Vec<hero_region::SelectParam>), | |
| Include(hero_region::ManyArgs, Vec<hero_region::IncludeParam>), | |
| Fetch(hero_region::ManyArgs), | |
| } | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::HeroRegion(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, | |
| <hero_region::Types as ::prisma_client_rust::ModelTypes>::scalar_selections( | |
| ), | |
| ), | |
| }; | |
| ::prisma_client_rust::Selection::new(NAME, None, args, selections) | |
| } | |
| pub fn select( | |
| args: hero_region::ManyArgs, | |
| nested_selections: Vec<hero_region::SelectParam>, | |
| ) -> Self { | |
| Self::Select(args, nested_selections) | |
| } | |
| pub fn include( | |
| args: hero_region::ManyArgs, | |
| nested_selections: Vec<hero_region::IncludeParam>, | |
| ) -> Self { | |
| Self::Include(args, nested_selections) | |
| } | |
| } | |
| } | |
| pub fn create( | |
| aion_capacity: i32, | |
| aion_collected: i32, | |
| base_stats: super::base_stats::UniqueWhereParam, | |
| attributes: super::attributes::UniqueWhereParam, | |
| inventory: super::inventory::UniqueWhereParam, | |
| _params: Vec<SetParam>, | |
| ) -> ( | |
| i32, | |
| i32, | |
| super::base_stats::UniqueWhereParam, | |
| super::attributes::UniqueWhereParam, | |
| super::inventory::UniqueWhereParam, | |
| Vec<SetParam>, | |
| ) { | |
| ( | |
| aion_capacity, | |
| aion_collected, | |
| base_stats, | |
| attributes, | |
| inventory, | |
| _params, | |
| ) | |
| } | |
| pub fn create_unchecked( | |
| aion_capacity: i32, | |
| aion_collected: i32, | |
| base_stats_id: String, | |
| attributes_id: String, | |
| inventory_id: String, | |
| _params: Vec<SetParam>, | |
| ) -> (i32, i32, String, String, String, Vec<SetParam>) { | |
| ( | |
| aion_capacity, | |
| aion_collected, | |
| base_stats_id, | |
| attributes_id, | |
| inventory_id, | |
| _params, | |
| ) | |
| } | |
| #[macro_export] | |
| macro_rules ! _select_hero { ($ (($ ($ 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 :: hero :: 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 :: hero :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: hero :: 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 :: hero :: 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 :: hero :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: hero :: 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 , aion_capacity , aion_collected , base_stats_id , attributes_id , base_stats , attributes , inventory , inventory_id , retinue_slots , hero_region } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { $ (pub $ field : crate :: prisma :: hero :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } 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 :: hero :: $ 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 :: hero :: $ 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 :: hero :: $ 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 :: hero :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: hero :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "aionCapacity" , "aionCollected" , "baseStatsId" , "attributesId" , "baseStats" , "attributes" , "inventory" , "inventoryId" , "retinueSlots" , "heroRegion"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: hero :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { String } ; (@ field_type ; aion_capacity) => { i32 } ; (@ field_type ; aion_collected) => { i32 } ; (@ field_type ; base_stats_id) => { String } ; (@ field_type ; attributes_id) => { String } ; (@ field_type ; base_stats : $ selection_mode : ident { $ ($ selections : tt) + }) => { base_stats :: Data } ; (@ field_type ; base_stats) => { crate :: prisma :: base_stats :: Data } ; (@ field_type ; attributes : $ selection_mode : ident { $ ($ selections : tt) + }) => { attributes :: Data } ; (@ field_type ; attributes) => { crate :: prisma :: attributes :: Data } ; (@ field_type ; inventory : $ selection_mode : ident { $ ($ selections : tt) + }) => { inventory :: Data } ; (@ field_type ; inventory) => { crate :: prisma :: inventory :: Data } ; (@ field_type ; inventory_id) => { String } ; (@ field_type ; retinue_slots : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < retinue_slots :: Data > } ; (@ field_type ; retinue_slots) => { Vec < crate :: prisma :: retinue_slot :: Data > } ; (@ field_type ; hero_region : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < hero_region :: Data > } ; (@ field_type ; hero_region) => { Vec < crate :: prisma :: hero_region :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Hero" , available relations are "id, aion_capacity, aion_collected, base_stats_id, attributes_id, base_stats, attributes, inventory, inventory_id, retinue_slots, hero_region")) } ; (@ field_module ; base_stats : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: base_stats :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; attributes : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: attributes :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; inventory : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: inventory :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; retinue_slots : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: retinue_slot :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; hero_region : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: hero_region :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: hero :: SelectParam > :: into (crate :: prisma :: hero :: id :: Select) } ; (@ selection_field_to_selection_param ; aion_capacity) => { Into :: < crate :: prisma :: hero :: SelectParam > :: into (crate :: prisma :: hero :: aion_capacity :: Select) } ; (@ selection_field_to_selection_param ; aion_collected) => { Into :: < crate :: prisma :: hero :: SelectParam > :: into (crate :: prisma :: hero :: aion_collected :: Select) } ; (@ selection_field_to_selection_param ; base_stats_id) => { Into :: < crate :: prisma :: hero :: SelectParam > :: into (crate :: prisma :: hero :: base_stats_id :: Select) } ; (@ selection_field_to_selection_param ; attributes_id) => { Into :: < crate :: prisma :: hero :: SelectParam > :: into (crate :: prisma :: hero :: attributes_id :: Select) } ; (@ selection_field_to_selection_param ; base_stats $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: hero :: SelectParam > :: into (crate :: prisma :: hero :: base_stats :: Select :: $ selection_mode (crate :: prisma :: base_stats :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; base_stats $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: hero :: SelectParam > :: into (crate :: prisma :: hero :: base_stats :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; attributes $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: hero :: SelectParam > :: into (crate :: prisma :: hero :: attributes :: Select :: $ selection_mode (crate :: prisma :: attributes :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; attributes $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: hero :: SelectParam > :: into (crate :: prisma :: hero :: attributes :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; inventory $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: hero :: SelectParam > :: into (crate :: prisma :: hero :: inventory :: Select :: $ selection_mode (crate :: prisma :: inventory :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; inventory $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: hero :: SelectParam > :: into (crate :: prisma :: hero :: inventory :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; inventory_id) => { Into :: < crate :: prisma :: hero :: SelectParam > :: into (crate :: prisma :: hero :: inventory_id :: Select) } ; (@ selection_field_to_selection_param ; retinue_slots $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: hero :: SelectParam > :: into (crate :: prisma :: hero :: retinue_slots :: Select :: $ selection_mode (crate :: prisma :: retinue_slot :: ManyArgs :: new (crate :: prisma :: retinue_slot :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: retinue_slot :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; retinue_slots $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: hero :: SelectParam > :: into (crate :: prisma :: hero :: retinue_slots :: Select :: Fetch (crate :: prisma :: retinue_slot :: ManyArgs :: new (crate :: prisma :: retinue_slot :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; hero_region $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: hero :: SelectParam > :: into (crate :: prisma :: hero :: hero_region :: Select :: $ selection_mode (crate :: prisma :: hero_region :: ManyArgs :: new (crate :: prisma :: hero_region :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: hero_region :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; hero_region $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: hero :: SelectParam > :: into (crate :: prisma :: hero :: hero_region :: Select :: Fetch (crate :: prisma :: hero_region :: ManyArgs :: new (crate :: prisma :: hero_region :: 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 :: hero :: $ 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 ; aion_capacity) => { "aionCapacity" } ; (@ field_serde_name ; aion_collected) => { "aionCollected" } ; (@ field_serde_name ; base_stats_id) => { "baseStatsId" } ; (@ field_serde_name ; attributes_id) => { "attributesId" } ; (@ field_serde_name ; base_stats) => { "baseStats" } ; (@ field_serde_name ; attributes) => { "attributes" } ; (@ field_serde_name ; inventory) => { "inventory" } ; (@ field_serde_name ; inventory_id) => { "inventoryId" } ; (@ field_serde_name ; retinue_slots) => { "retinueSlots" } ; (@ field_serde_name ; hero_region) => { "heroRegion" } ; } | |
| pub use _select_hero as select; | |
| pub enum SelectParam { | |
| Id(id::Select), | |
| AionCapacity(aion_capacity::Select), | |
| AionCollected(aion_collected::Select), | |
| BaseStatsId(base_stats_id::Select), | |
| AttributesId(attributes_id::Select), | |
| BaseStats(base_stats::Select), | |
| Attributes(attributes::Select), | |
| Inventory(inventory::Select), | |
| InventoryId(inventory_id::Select), | |
| RetinueSlots(retinue_slots::Select), | |
| HeroRegion(hero_region::Select), | |
| } | |
| impl SelectParam { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::Id(data) => data.to_selection(), | |
| Self::AionCapacity(data) => data.to_selection(), | |
| Self::AionCollected(data) => data.to_selection(), | |
| Self::BaseStatsId(data) => data.to_selection(), | |
| Self::AttributesId(data) => data.to_selection(), | |
| Self::BaseStats(data) => data.to_selection(), | |
| Self::Attributes(data) => data.to_selection(), | |
| Self::Inventory(data) => data.to_selection(), | |
| Self::InventoryId(data) => data.to_selection(), | |
| Self::RetinueSlots(data) => data.to_selection(), | |
| Self::HeroRegion(data) => data.to_selection(), | |
| } | |
| } | |
| } | |
| #[macro_export] | |
| macro_rules ! _include_hero { ($ (($ ($ 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 :: hero :: 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 :: hero :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: hero :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: hero :: 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 :: hero :: 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 :: hero :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: hero :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: hero :: 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 { base_stats , attributes , inventory , retinue_slots , hero_region } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { pub id : String , pub aion_capacity : i32 , pub aion_collected : i32 , pub base_stats_id : String , pub attributes_id : String , pub inventory_id : String , $ (pub $ field : crate :: prisma :: hero :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } 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 ! (aion_capacity) , stringify ! (aion_collected) , stringify ! (base_stats_id) , stringify ! (attributes_id) , stringify ! (inventory_id)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: hero :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: hero :: id :: NAME , & self . id) ? ; state . serialize_field (crate :: prisma :: hero :: aion_capacity :: NAME , & self . aion_capacity) ? ; state . serialize_field (crate :: prisma :: hero :: aion_collected :: NAME , & self . aion_collected) ? ; state . serialize_field (crate :: prisma :: hero :: base_stats_id :: NAME , & self . base_stats_id) ? ; state . serialize_field (crate :: prisma :: hero :: attributes_id :: NAME , & self . attributes_id) ? ; state . serialize_field (crate :: prisma :: hero :: inventory_id :: NAME , & self . inventory_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 , aion_capacity , aion_collected , base_stats_id , attributes_id , inventory_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 :: hero :: $ field :: NAME) , + , crate :: prisma :: hero :: id :: NAME , crate :: prisma :: hero :: aion_capacity :: NAME , crate :: prisma :: hero :: aion_collected :: NAME , crate :: prisma :: hero :: base_stats_id :: NAME , crate :: prisma :: hero :: attributes_id :: NAME , crate :: prisma :: hero :: inventory_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 :: hero :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: hero :: id :: NAME => Ok (Field :: id) , crate :: prisma :: hero :: aion_capacity :: NAME => Ok (Field :: aion_capacity) , crate :: prisma :: hero :: aion_collected :: NAME => Ok (Field :: aion_collected) , crate :: prisma :: hero :: base_stats_id :: NAME => Ok (Field :: base_stats_id) , crate :: prisma :: hero :: attributes_id :: NAME => Ok (Field :: attributes_id) , crate :: prisma :: hero :: inventory_id :: NAME => Ok (Field :: inventory_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 aion_capacity = None ; let mut aion_collected = None ; let mut base_stats_id = None ; let mut attributes_id = None ; let mut inventory_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 :: hero :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } Field :: aion_capacity => { if aion_capacity . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: hero :: aion_capacity :: NAME)) ; } aion_capacity = Some (map . next_value () ?) ; } Field :: aion_collected => { if aion_collected . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: hero :: aion_collected :: NAME)) ; } aion_collected = Some (map . next_value () ?) ; } Field :: base_stats_id => { if base_stats_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: hero :: base_stats_id :: NAME)) ; } base_stats_id = Some (map . next_value () ?) ; } Field :: attributes_id => { if attributes_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: hero :: attributes_id :: NAME)) ; } attributes_id = Some (map . next_value () ?) ; } Field :: inventory_id => { if inventory_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: hero :: inventory_id :: NAME)) ; } inventory_id = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: hero :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: hero :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: hero :: id :: NAME)) ? ; let aion_capacity = aion_capacity . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: hero :: aion_capacity :: NAME)) ? ; let aion_collected = aion_collected . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: hero :: aion_collected :: NAME)) ? ; let base_stats_id = base_stats_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: hero :: base_stats_id :: NAME)) ? ; let attributes_id = attributes_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: hero :: attributes_id :: NAME)) ? ; let inventory_id = inventory_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: hero :: inventory_id :: NAME)) ? ; Ok (Data { id , aion_capacity , aion_collected , base_stats_id , attributes_id , inventory_id , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "aionCapacity" , "aionCollected" , "baseStatsId" , "attributesId" , "baseStats" , "attributes" , "inventory" , "inventoryId" , "retinueSlots" , "heroRegion"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: hero :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; base_stats : $ selection_mode : ident { $ ($ selections : tt) + }) => { base_stats :: Data } ; (@ field_type ; base_stats) => { crate :: prisma :: base_stats :: Data } ; (@ field_type ; attributes : $ selection_mode : ident { $ ($ selections : tt) + }) => { attributes :: Data } ; (@ field_type ; attributes) => { crate :: prisma :: attributes :: Data } ; (@ field_type ; inventory : $ selection_mode : ident { $ ($ selections : tt) + }) => { inventory :: Data } ; (@ field_type ; inventory) => { crate :: prisma :: inventory :: Data } ; (@ field_type ; retinue_slots : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < retinue_slots :: Data > } ; (@ field_type ; retinue_slots) => { Vec < crate :: prisma :: retinue_slot :: Data > } ; (@ field_type ; hero_region : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < hero_region :: Data > } ; (@ field_type ; hero_region) => { Vec < crate :: prisma :: hero_region :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Hero" , available relations are "base_stats, attributes, inventory, retinue_slots, hero_region")) } ; (@ field_module ; base_stats : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: base_stats :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; attributes : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: attributes :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; inventory : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: inventory :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; retinue_slots : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: retinue_slot :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; hero_region : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: hero_region :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; base_stats $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: hero :: IncludeParam > :: into (crate :: prisma :: hero :: base_stats :: Include :: $ selection_mode (crate :: prisma :: base_stats :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; base_stats $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: hero :: IncludeParam > :: into (crate :: prisma :: hero :: base_stats :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; attributes $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: hero :: IncludeParam > :: into (crate :: prisma :: hero :: attributes :: Include :: $ selection_mode (crate :: prisma :: attributes :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; attributes $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: hero :: IncludeParam > :: into (crate :: prisma :: hero :: attributes :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; inventory $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: hero :: IncludeParam > :: into (crate :: prisma :: hero :: inventory :: Include :: $ selection_mode (crate :: prisma :: inventory :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; inventory $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: hero :: IncludeParam > :: into (crate :: prisma :: hero :: inventory :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; retinue_slots $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: hero :: IncludeParam > :: into (crate :: prisma :: hero :: retinue_slots :: Include :: $ selection_mode (crate :: prisma :: retinue_slot :: ManyArgs :: new (crate :: prisma :: retinue_slot :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: retinue_slot :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; retinue_slots $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: hero :: IncludeParam > :: into (crate :: prisma :: hero :: retinue_slots :: Include :: Fetch (crate :: prisma :: retinue_slot :: ManyArgs :: new (crate :: prisma :: retinue_slot :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; hero_region $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: hero :: IncludeParam > :: into (crate :: prisma :: hero :: hero_region :: Include :: $ selection_mode (crate :: prisma :: hero_region :: ManyArgs :: new (crate :: prisma :: hero_region :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: hero_region :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; hero_region $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: hero :: IncludeParam > :: into (crate :: prisma :: hero :: hero_region :: Include :: Fetch (crate :: prisma :: hero_region :: ManyArgs :: new (crate :: prisma :: hero_region :: 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 :: hero :: $ 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 ; aion_capacity) => { "aionCapacity" } ; (@ field_serde_name ; aion_collected) => { "aionCollected" } ; (@ field_serde_name ; base_stats_id) => { "baseStatsId" } ; (@ field_serde_name ; attributes_id) => { "attributesId" } ; (@ field_serde_name ; base_stats) => { "baseStats" } ; (@ field_serde_name ; attributes) => { "attributes" } ; (@ field_serde_name ; inventory) => { "inventory" } ; (@ field_serde_name ; inventory_id) => { "inventoryId" } ; (@ field_serde_name ; retinue_slots) => { "retinueSlots" } ; (@ field_serde_name ; hero_region) => { "heroRegion" } ; } | |
| pub use _include_hero as include; | |
| pub enum IncludeParam { | |
| Id(id::Include), | |
| AionCapacity(aion_capacity::Include), | |
| AionCollected(aion_collected::Include), | |
| BaseStatsId(base_stats_id::Include), | |
| AttributesId(attributes_id::Include), | |
| BaseStats(base_stats::Include), | |
| Attributes(attributes::Include), | |
| Inventory(inventory::Include), | |
| InventoryId(inventory_id::Include), | |
| RetinueSlots(retinue_slots::Include), | |
| HeroRegion(hero_region::Include), | |
| } | |
| impl IncludeParam { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::Id(data) => data.to_selection(), | |
| Self::AionCapacity(data) => data.to_selection(), | |
| Self::AionCollected(data) => data.to_selection(), | |
| Self::BaseStatsId(data) => data.to_selection(), | |
| Self::AttributesId(data) => data.to_selection(), | |
| Self::BaseStats(data) => data.to_selection(), | |
| Self::Attributes(data) => data.to_selection(), | |
| Self::Inventory(data) => data.to_selection(), | |
| Self::InventoryId(data) => data.to_selection(), | |
| Self::RetinueSlots(data) => data.to_selection(), | |
| Self::HeroRegion(data) => data.to_selection(), | |
| } | |
| } | |
| } | |
| #[macro_export] | |
| macro_rules ! _partial_unchecked_hero { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: hero struct $ struct_name { # [serde (rename = "id")] pub id : String , # [serde (rename = "aionCapacity")] pub aion_capacity : i32 , # [serde (rename = "aionCollected")] pub aion_collected : i32 , # [serde (rename = "baseStatsId")] pub base_stats_id : String , # [serde (rename = "attributesId")] pub attributes_id : String , # [serde (rename = "inventoryId")] pub inventory_id : String } [$ ($ scalar_field) , +] } } ; } | |
| pub use _partial_unchecked_hero as partial_unchecked; | |
| #[derive(Debug, Clone, :: serde :: Serialize, :: serde :: Deserialize)] | |
| pub struct Data { | |
| #[serde(rename = "id")] | |
| pub id: String, | |
| #[serde(rename = "aionCapacity")] | |
| pub aion_capacity: i32, | |
| #[serde(rename = "aionCollected")] | |
| pub aion_collected: i32, | |
| #[serde(rename = "baseStatsId")] | |
| pub base_stats_id: String, | |
| #[serde(rename = "attributesId")] | |
| pub attributes_id: String, | |
| #[serde(rename = "baseStats")] | |
| pub base_stats: Option<Box<super::base_stats::Data>>, | |
| #[serde(rename = "attributes")] | |
| pub attributes: Option<Box<super::attributes::Data>>, | |
| #[serde(rename = "inventory")] | |
| pub inventory: Option<Box<super::inventory::Data>>, | |
| #[serde(rename = "inventoryId")] | |
| pub inventory_id: String, | |
| #[serde(rename = "retinueSlots")] | |
| pub retinue_slots: Option<Vec<super::retinue_slot::Data>>, | |
| #[serde(rename = "heroRegion")] | |
| pub hero_region: Option<Vec<super::hero_region::Data>>, | |
| } | |
| impl Data { | |
| pub fn base_stats( | |
| &self, | |
| ) -> Result<&super::base_stats::Data, ::prisma_client_rust::RelationNotFetchedError> | |
| { | |
| self.base_stats | |
| .as_ref() | |
| .ok_or(::prisma_client_rust::RelationNotFetchedError::new( | |
| stringify!(base_stats), | |
| )) | |
| .map(|v| v.as_ref()) | |
| } | |
| pub fn attributes( | |
| &self, | |
| ) -> Result<&super::attributes::Data, ::prisma_client_rust::RelationNotFetchedError> | |
| { | |
| self.attributes | |
| .as_ref() | |
| .ok_or(::prisma_client_rust::RelationNotFetchedError::new( | |
| stringify!(attributes), | |
| )) | |
| .map(|v| v.as_ref()) | |
| } | |
| pub fn inventory( | |
| &self, | |
| ) -> Result<&super::inventory::Data, ::prisma_client_rust::RelationNotFetchedError> | |
| { | |
| self.inventory | |
| .as_ref() | |
| .ok_or(::prisma_client_rust::RelationNotFetchedError::new( | |
| stringify!(inventory), | |
| )) | |
| .map(|v| v.as_ref()) | |
| } | |
| pub fn retinue_slots( | |
| &self, | |
| ) -> Result<&Vec<super::retinue_slot::Data>, ::prisma_client_rust::RelationNotFetchedError> | |
| { | |
| self.retinue_slots | |
| .as_ref() | |
| .ok_or(::prisma_client_rust::RelationNotFetchedError::new( | |
| stringify!(retinue_slots), | |
| )) | |
| } | |
| pub fn hero_region( | |
| &self, | |
| ) -> Result<&Vec<super::hero_region::Data>, ::prisma_client_rust::RelationNotFetchedError> | |
| { | |
| self.hero_region | |
| .as_ref() | |
| .ok_or(::prisma_client_rust::RelationNotFetchedError::new( | |
| stringify!(hero_region), | |
| )) | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum WithParam { | |
| BaseStats(super::base_stats::UniqueArgs), | |
| Attributes(super::attributes::UniqueArgs), | |
| Inventory(super::inventory::UniqueArgs), | |
| RetinueSlots(super::retinue_slot::ManyArgs), | |
| HeroRegion(super::hero_region::ManyArgs), | |
| } | |
| impl Into<::prisma_client_rust::Selection> for WithParam { | |
| fn into(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::BaseStats(args) => { | |
| let mut selections = < super :: base_stats :: 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(base_stats::NAME, None, [], selections) | |
| } | |
| Self::Attributes(args) => { | |
| let mut selections = < super :: attributes :: 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(attributes::NAME, None, [], selections) | |
| } | |
| Self::Inventory(args) => { | |
| let mut selections = < super :: inventory :: 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(inventory::NAME, None, [], selections) | |
| } | |
| Self::RetinueSlots(args) => { | |
| let (arguments, mut nested_selections) = args.to_graphql(); | |
| nested_selections . extend (< super :: retinue_slot :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) ; | |
| ::prisma_client_rust::Selection::new( | |
| retinue_slots::NAME, | |
| None, | |
| arguments, | |
| nested_selections, | |
| ) | |
| } | |
| Self::HeroRegion(args) => { | |
| let (arguments, mut nested_selections) = args.to_graphql(); | |
| nested_selections . extend (< super :: hero_region :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) ; | |
| ::prisma_client_rust::Selection::new( | |
| hero_region::NAME, | |
| None, | |
| arguments, | |
| nested_selections, | |
| ) | |
| } | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum SetParam { | |
| SetId(String), | |
| SetAionCapacity(i32), | |
| IncrementAionCapacity(i32), | |
| DecrementAionCapacity(i32), | |
| MultiplyAionCapacity(i32), | |
| DivideAionCapacity(i32), | |
| SetAionCollected(i32), | |
| IncrementAionCollected(i32), | |
| DecrementAionCollected(i32), | |
| MultiplyAionCollected(i32), | |
| DivideAionCollected(i32), | |
| SetBaseStatsId(String), | |
| SetAttributesId(String), | |
| ConnectBaseStats(super::base_stats::UniqueWhereParam), | |
| ConnectAttributes(super::attributes::UniqueWhereParam), | |
| ConnectInventory(super::inventory::UniqueWhereParam), | |
| SetInventoryId(String), | |
| ConnectRetinueSlots(Vec<super::retinue_slot::UniqueWhereParam>), | |
| DisconnectRetinueSlots(Vec<super::retinue_slot::UniqueWhereParam>), | |
| SetRetinueSlots(Vec<super::retinue_slot::UniqueWhereParam>), | |
| ConnectHeroRegion(Vec<super::hero_region::UniqueWhereParam>), | |
| DisconnectHeroRegion(Vec<super::hero_region::UniqueWhereParam>), | |
| SetHeroRegion(Vec<super::hero_region::UniqueWhereParam>), | |
| } | |
| impl From<SetParam> 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::SetAionCapacity(value) => ( | |
| aion_capacity::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| ), | |
| SetParam::IncrementAionCapacity(value) => ( | |
| aion_capacity::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "increment".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DecrementAionCapacity(value) => ( | |
| aion_capacity::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "decrement".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::MultiplyAionCapacity(value) => ( | |
| aion_capacity::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "multiply".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DivideAionCapacity(value) => ( | |
| aion_capacity::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "divide".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::SetAionCollected(value) => ( | |
| aion_collected::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| ), | |
| SetParam::IncrementAionCollected(value) => ( | |
| aion_collected::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "increment".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DecrementAionCollected(value) => ( | |
| aion_collected::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "decrement".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::MultiplyAionCollected(value) => ( | |
| aion_collected::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "multiply".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DivideAionCollected(value) => ( | |
| aion_collected::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "divide".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::SetBaseStatsId(value) => ( | |
| base_stats_id::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(value), | |
| ), | |
| SetParam::SetAttributesId(value) => ( | |
| attributes_id::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(value), | |
| ), | |
| SetParam::ConnectBaseStats(where_param) => ( | |
| base_stats::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "connect".to_string(), | |
| ::prisma_client_rust::PrismaValue::Object( | |
| [where_param] | |
| .into_iter() | |
| .map(Into::<super::base_stats::WhereParam>::into) | |
| .map(::prisma_client_rust::WhereInput::serialize) | |
| .map(::prisma_client_rust::SerializedWhereInput::transform_equals) | |
| .collect(), | |
| ), | |
| )]), | |
| ), | |
| SetParam::ConnectAttributes(where_param) => ( | |
| attributes::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "connect".to_string(), | |
| ::prisma_client_rust::PrismaValue::Object( | |
| [where_param] | |
| .into_iter() | |
| .map(Into::<super::attributes::WhereParam>::into) | |
| .map(::prisma_client_rust::WhereInput::serialize) | |
| .map(::prisma_client_rust::SerializedWhereInput::transform_equals) | |
| .collect(), | |
| ), | |
| )]), | |
| ), | |
| SetParam::ConnectInventory(where_param) => ( | |
| inventory::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "connect".to_string(), | |
| ::prisma_client_rust::PrismaValue::Object( | |
| [where_param] | |
| .into_iter() | |
| .map(Into::<super::inventory::WhereParam>::into) | |
| .map(::prisma_client_rust::WhereInput::serialize) | |
| .map(::prisma_client_rust::SerializedWhereInput::transform_equals) | |
| .collect(), | |
| ), | |
| )]), | |
| ), | |
| SetParam::SetInventoryId(value) => ( | |
| inventory_id::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(value), | |
| ), | |
| SetParam::ConnectRetinueSlots(where_params) => ( | |
| retinue_slots::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "connect".to_string(), | |
| ::prisma_client_rust::PrismaValue::List( | |
| where_params | |
| .into_iter() | |
| .map(Into::<super::retinue_slot::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::DisconnectRetinueSlots(where_params) => ( | |
| retinue_slots::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "disconnect".to_string(), | |
| ::prisma_client_rust::PrismaValue::List( | |
| where_params | |
| .into_iter() | |
| .map(Into::<super::retinue_slot::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::SetRetinueSlots(where_params) => ( | |
| retinue_slots::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "set".to_string(), | |
| ::prisma_client_rust::PrismaValue::List( | |
| where_params | |
| .into_iter() | |
| .map(Into::<super::retinue_slot::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::ConnectHeroRegion(where_params) => ( | |
| hero_region::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "connect".to_string(), | |
| ::prisma_client_rust::PrismaValue::List( | |
| where_params | |
| .into_iter() | |
| .map(Into::<super::hero_region::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::DisconnectHeroRegion(where_params) => ( | |
| hero_region::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "disconnect".to_string(), | |
| ::prisma_client_rust::PrismaValue::List( | |
| where_params | |
| .into_iter() | |
| .map(Into::<super::hero_region::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::SetHeroRegion(where_params) => ( | |
| hero_region::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "set".to_string(), | |
| ::prisma_client_rust::PrismaValue::List( | |
| where_params | |
| .into_iter() | |
| .map(Into::<super::hero_region::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(), | |
| ), | |
| )]), | |
| ), | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum UncheckedSetParam { | |
| Id(String), | |
| AionCapacity(i32), | |
| AionCollected(i32), | |
| BaseStatsId(String), | |
| AttributesId(String), | |
| InventoryId(String), | |
| } | |
| impl From<UncheckedSetParam> for SetParam { | |
| fn from(param: UncheckedSetParam) -> Self { | |
| match param { | |
| UncheckedSetParam::Id(value) => Self::SetId(value), | |
| UncheckedSetParam::AionCapacity(value) => Self::SetAionCapacity(value), | |
| UncheckedSetParam::AionCollected(value) => Self::SetAionCollected(value), | |
| UncheckedSetParam::BaseStatsId(value) => Self::SetBaseStatsId(value), | |
| UncheckedSetParam::AttributesId(value) => Self::SetAttributesId(value), | |
| UncheckedSetParam::InventoryId(value) => Self::SetInventoryId(value), | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum OrderByParam { | |
| Id(::prisma_client_rust::Direction), | |
| AionCapacity(::prisma_client_rust::Direction), | |
| AionCollected(::prisma_client_rust::Direction), | |
| BaseStatsId(::prisma_client_rust::Direction), | |
| AttributesId(::prisma_client_rust::Direction), | |
| InventoryId(::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::AionCapacity(direction) => ( | |
| aion_capacity::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| Self::AionCollected(direction) => ( | |
| aion_collected::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| Self::BaseStatsId(direction) => ( | |
| base_stats_id::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| Self::AttributesId(direction) => ( | |
| attributes_id::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| Self::InventoryId(direction) => ( | |
| inventory_id::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum WhereParam { | |
| Not(Vec<WhereParam>), | |
| Or(Vec<WhereParam>), | |
| And(Vec<WhereParam>), | |
| Id(_prisma::read_filters::StringFilter), | |
| AionCapacity(_prisma::read_filters::IntFilter), | |
| AionCollected(_prisma::read_filters::IntFilter), | |
| BaseStatsId(_prisma::read_filters::StringFilter), | |
| AttributesId(_prisma::read_filters::StringFilter), | |
| BaseStatsIs(Vec<super::base_stats::WhereParam>), | |
| BaseStatsIsNot(Vec<super::base_stats::WhereParam>), | |
| AttributesIs(Vec<super::attributes::WhereParam>), | |
| AttributesIsNot(Vec<super::attributes::WhereParam>), | |
| InventoryIs(Vec<super::inventory::WhereParam>), | |
| InventoryIsNot(Vec<super::inventory::WhereParam>), | |
| InventoryId(_prisma::read_filters::StringFilter), | |
| RetinueSlotsSome(Vec<super::retinue_slot::WhereParam>), | |
| RetinueSlotsEvery(Vec<super::retinue_slot::WhereParam>), | |
| RetinueSlotsNone(Vec<super::retinue_slot::WhereParam>), | |
| HeroRegionSome(Vec<super::hero_region::WhereParam>), | |
| HeroRegionEvery(Vec<super::hero_region::WhereParam>), | |
| HeroRegionNone(Vec<super::hero_region::WhereParam>), | |
| } | |
| 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::AionCapacity(value) => (aion_capacity::NAME, value.into()), | |
| Self::AionCollected(value) => (aion_collected::NAME, value.into()), | |
| Self::BaseStatsId(value) => (base_stats_id::NAME, value.into()), | |
| Self::AttributesId(value) => (attributes_id::NAME, value.into()), | |
| Self::BaseStatsIs(where_params) => ( | |
| base_stats::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::BaseStatsIsNot(where_params) => ( | |
| base_stats::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::AttributesIs(where_params) => ( | |
| attributes::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::AttributesIsNot(where_params) => ( | |
| attributes::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::InventoryIs(where_params) => ( | |
| inventory::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::InventoryIsNot(where_params) => ( | |
| inventory::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::InventoryId(value) => (inventory_id::NAME, value.into()), | |
| Self::RetinueSlotsSome(where_params) => ( | |
| retinue_slots::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::RetinueSlotsEvery(where_params) => ( | |
| retinue_slots::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::RetinueSlotsNone(where_params) => ( | |
| retinue_slots::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::HeroRegionSome(where_params) => ( | |
| hero_region::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::HeroRegionEvery(where_params) => ( | |
| hero_region::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::HeroRegionNone(where_params) => ( | |
| hero_region::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 { | |
| BaseStatsIdEquals(String), | |
| AttributesIdEquals(String), | |
| InventoryIdEquals(String), | |
| IdEquals(String), | |
| } | |
| impl From<UniqueWhereParam> for WhereParam { | |
| fn from(value: UniqueWhereParam) -> Self { | |
| match value { | |
| UniqueWhereParam::BaseStatsIdEquals(value) => { | |
| Self::BaseStatsId(_prisma::read_filters::StringFilter::Equals(value)) | |
| } | |
| UniqueWhereParam::AttributesIdEquals(value) => { | |
| Self::AttributesId(_prisma::read_filters::StringFilter::Equals(value)) | |
| } | |
| UniqueWhereParam::InventoryIdEquals(value) => { | |
| Self::InventoryId(_prisma::read_filters::StringFilter::Equals(value)) | |
| } | |
| UniqueWhereParam::IdEquals(value) => { | |
| Self::Id(_prisma::read_filters::StringFilter::Equals(value)) | |
| } | |
| } | |
| } | |
| } | |
| impl From<::prisma_client_rust::Operator<Self>> for WhereParam { | |
| fn from(op: ::prisma_client_rust::Operator<Self>) -> 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(aion_capacity::NAME), | |
| ::prisma_client_rust::sel(aion_collected::NAME), | |
| ::prisma_client_rust::sel(base_stats_id::NAME), | |
| ::prisma_client_rust::sel(attributes_id::NAME), | |
| ::prisma_client_rust::sel(inventory_id::NAME), | |
| ] | |
| } | |
| } | |
| pub type UniqueArgs = ::prisma_client_rust::UniqueArgs<Types>; | |
| pub type ManyArgs = ::prisma_client_rust::ManyArgs<Types>; | |
| 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<WhereParam>) -> FindFirst<'a> { | |
| FindFirst::new(self.client, _where) | |
| } | |
| pub fn find_many(self, _where: Vec<WhereParam>) -> FindMany<'a> { | |
| FindMany::new(self.client, _where) | |
| } | |
| pub fn create( | |
| self, | |
| aion_capacity: i32, | |
| aion_collected: i32, | |
| base_stats: super::base_stats::UniqueWhereParam, | |
| attributes: super::attributes::UniqueWhereParam, | |
| inventory: super::inventory::UniqueWhereParam, | |
| mut _params: Vec<SetParam>, | |
| ) -> Create<'a> { | |
| _params.extend([ | |
| aion_capacity::set(aion_capacity), | |
| aion_collected::set(aion_collected), | |
| base_stats::connect(base_stats), | |
| attributes::connect(attributes), | |
| inventory::connect(inventory), | |
| ]); | |
| Create::new(self.client, _params) | |
| } | |
| pub fn create_unchecked( | |
| self, | |
| aion_capacity: i32, | |
| aion_collected: i32, | |
| base_stats_id: String, | |
| attributes_id: String, | |
| inventory_id: String, | |
| mut _params: Vec<UncheckedSetParam>, | |
| ) -> Create<'a> { | |
| _params.extend([ | |
| aion_capacity::set(aion_capacity), | |
| aion_collected::set(aion_collected), | |
| base_stats_id::set(base_stats_id), | |
| attributes_id::set(attributes_id), | |
| inventory_id::set(inventory_id), | |
| ]); | |
| Create::new(self.client, _params.into_iter().map(Into::into).collect()) | |
| } | |
| pub fn create_many( | |
| self, | |
| data: Vec<(i32, i32, String, String, String, Vec<SetParam>)>, | |
| ) -> CreateMany<'a> { | |
| let data = data | |
| .into_iter() | |
| .map( | |
| |( | |
| aion_capacity, | |
| aion_collected, | |
| base_stats_id, | |
| attributes_id, | |
| inventory_id, | |
| mut _params, | |
| )| { | |
| _params.extend([ | |
| aion_capacity::set(aion_capacity), | |
| aion_collected::set(aion_collected), | |
| base_stats_id::set(base_stats_id), | |
| attributes_id::set(attributes_id), | |
| inventory_id::set(inventory_id), | |
| ]); | |
| _params | |
| }, | |
| ) | |
| .collect(); | |
| CreateMany::new(self.client, data) | |
| } | |
| pub fn update(self, _where: UniqueWhereParam, _params: Vec<SetParam>) -> Update<'a> { | |
| Update::new(self.client, _where.into(), _params, vec![]) | |
| } | |
| pub fn update_unchecked( | |
| self, | |
| _where: UniqueWhereParam, | |
| _params: Vec<UncheckedSetParam>, | |
| ) -> Update<'a> { | |
| Update::new( | |
| self.client, | |
| _where.into(), | |
| _params.into_iter().map(Into::into).collect(), | |
| vec![], | |
| ) | |
| } | |
| pub fn update_many( | |
| self, | |
| _where: Vec<WhereParam>, | |
| _params: Vec<SetParam>, | |
| ) -> UpdateMany<'a> { | |
| UpdateMany::new(self.client, _where, _params) | |
| } | |
| pub fn upsert( | |
| self, | |
| _where: UniqueWhereParam, | |
| (aion_capacity, aion_collected, base_stats, attributes, inventory, mut _params): ( | |
| i32, | |
| i32, | |
| super::base_stats::UniqueWhereParam, | |
| super::attributes::UniqueWhereParam, | |
| super::inventory::UniqueWhereParam, | |
| Vec<SetParam>, | |
| ), | |
| _update: Vec<SetParam>, | |
| ) -> Upsert<'a> { | |
| _params.extend([ | |
| aion_capacity::set(aion_capacity), | |
| aion_collected::set(aion_collected), | |
| base_stats::connect(base_stats), | |
| attributes::connect(attributes), | |
| inventory::connect(inventory), | |
| ]); | |
| 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<WhereParam>) -> DeleteMany<'a> { | |
| DeleteMany::new(self.client, _where) | |
| } | |
| pub fn count(self, _where: Vec<WhereParam>) -> Count<'a> { | |
| Count::new(self.client, _where) | |
| } | |
| } | |
| } | |
| pub mod hero_region { | |
| use super::_prisma::*; | |
| use super::*; | |
| pub const NAME: &str = "HeroRegion"; | |
| 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<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetId(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::Id(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: String) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::Id(direction) | |
| } | |
| pub fn equals<T: From<UniqueWhereParam>>(value: String) -> T { | |
| UniqueWhereParam::IdEquals(value).into() | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::StringFilter, Id, { | |
| fn in_vec(_: Vec<String>) -> InVec; | |
| fn not_in_vec(_: Vec<String>) -> 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<super::IncludeParam> 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<super::SelectParam> 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 hero_id { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "HeroId"; | |
| pub struct Set(pub String); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetHeroId(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::HeroId(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: String) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::HeroId(direction) | |
| } | |
| pub fn equals(value: String) -> WhereParam { | |
| WhereParam::HeroId(_prisma::read_filters::StringFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!( | |
| _prisma::read_filters::StringFilter, | |
| HeroId, | |
| { | |
| fn in_vec(_: Vec<String>) -> InVec; | |
| fn not_in_vec(_: Vec<String>) -> 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<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::HeroId(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::HeroId(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod region_name { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "region_name"; | |
| pub struct Set(pub String); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetRegionName(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::RegionName(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: String) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::RegionName(direction) | |
| } | |
| pub fn equals(value: String) -> WhereParam { | |
| WhereParam::RegionName(_prisma::read_filters::StringFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!( | |
| _prisma::read_filters::StringFilter, | |
| RegionName, | |
| { | |
| fn in_vec(_: Vec<String>) -> InVec; | |
| fn not_in_vec(_: Vec<String>) -> 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<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::RegionName(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::RegionName(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod discovery_level { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "discovery_level"; | |
| pub struct Set(pub i32); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetDiscoveryLevel(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::DiscoveryLevel(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: i32) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::DiscoveryLevel(direction) | |
| } | |
| pub fn equals(value: i32) -> WhereParam { | |
| WhereParam::DiscoveryLevel(_prisma::read_filters::IntFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!( | |
| _prisma::read_filters::IntFilter, | |
| DiscoveryLevel, | |
| { | |
| fn in_vec(_: Vec<i32>) -> InVec; | |
| fn not_in_vec(_: Vec<i32>) -> 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::IncrementDiscoveryLevel(value) | |
| } | |
| pub fn decrement(value: i32) -> SetParam { | |
| SetParam::DecrementDiscoveryLevel(value) | |
| } | |
| pub fn multiply(value: i32) -> SetParam { | |
| SetParam::MultiplyDiscoveryLevel(value) | |
| } | |
| pub fn divide(value: i32) -> SetParam { | |
| SetParam::DivideDiscoveryLevel(value) | |
| } | |
| pub struct Include; | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::DiscoveryLevel(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::DiscoveryLevel(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod hero { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "Hero"; | |
| pub struct Fetch(pub hero::UniqueArgs); | |
| impl Fetch { | |
| pub fn with(mut self, params: impl Into<hero::WithParam>) -> Self { | |
| self.0 = self.0.with(params.into()); | |
| self | |
| } | |
| } | |
| impl From<Fetch> for WithParam { | |
| fn from(Fetch(v): Fetch) -> Self { | |
| WithParam::Hero(v) | |
| } | |
| } | |
| pub fn fetch() -> Fetch { | |
| Fetch(hero::UniqueArgs::new()) | |
| } | |
| pub struct Connect(hero::UniqueWhereParam); | |
| impl From<Connect> for SetParam { | |
| fn from(Connect(v): Connect) -> Self { | |
| Self::ConnectHero(v) | |
| } | |
| } | |
| pub fn connect<T: From<Connect>>(value: hero::UniqueWhereParam) -> T { | |
| Connect(value).into() | |
| } | |
| pub fn is(value: Vec<hero::WhereParam>) -> WhereParam { | |
| WhereParam::HeroIs(value) | |
| } | |
| pub fn is_not(value: Vec<hero::WhereParam>) -> WhereParam { | |
| WhereParam::HeroIsNot(value) | |
| } | |
| pub enum Include { | |
| Select(Vec<hero::SelectParam>), | |
| Include(Vec<hero::IncludeParam>), | |
| Fetch, | |
| } | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Hero(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 = | |
| <hero::Types as ::prisma_client_rust::ModelTypes>::scalar_selections(); | |
| nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); | |
| nested_selections | |
| } | |
| Self::Fetch => { | |
| <hero::Types as ::prisma_client_rust::ModelTypes>::scalar_selections() | |
| } | |
| }; | |
| ::prisma_client_rust::Selection::new("Hero", None, [], selections) | |
| } | |
| pub fn select(nested_selections: Vec<hero::SelectParam>) -> Self { | |
| Self::Select(nested_selections) | |
| } | |
| pub fn include(nested_selections: Vec<hero::IncludeParam>) -> Self { | |
| Self::Include(nested_selections) | |
| } | |
| } | |
| pub enum Select { | |
| Select(Vec<hero::SelectParam>), | |
| Include(Vec<hero::IncludeParam>), | |
| Fetch, | |
| } | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Hero(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 => { | |
| <hero::Types as ::prisma_client_rust::ModelTypes>::scalar_selections() | |
| } | |
| }; | |
| ::prisma_client_rust::Selection::new("Hero", None, [], selections) | |
| } | |
| pub fn select(nested_selections: Vec<hero::SelectParam>) -> Self { | |
| Self::Select(nested_selections) | |
| } | |
| pub fn include(nested_selections: Vec<hero::IncludeParam>) -> Self { | |
| Self::Include(nested_selections) | |
| } | |
| } | |
| } | |
| pub mod region { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "Region"; | |
| pub struct Fetch(pub region::UniqueArgs); | |
| impl Fetch { | |
| pub fn with(mut self, params: impl Into<region::WithParam>) -> Self { | |
| self.0 = self.0.with(params.into()); | |
| self | |
| } | |
| } | |
| impl From<Fetch> for WithParam { | |
| fn from(Fetch(v): Fetch) -> Self { | |
| WithParam::Region(v) | |
| } | |
| } | |
| pub fn fetch() -> Fetch { | |
| Fetch(region::UniqueArgs::new()) | |
| } | |
| pub struct Connect(region::UniqueWhereParam); | |
| impl From<Connect> for SetParam { | |
| fn from(Connect(v): Connect) -> Self { | |
| Self::ConnectRegion(v) | |
| } | |
| } | |
| pub fn connect<T: From<Connect>>(value: region::UniqueWhereParam) -> T { | |
| Connect(value).into() | |
| } | |
| pub fn is(value: Vec<region::WhereParam>) -> WhereParam { | |
| WhereParam::RegionIs(value) | |
| } | |
| pub fn is_not(value: Vec<region::WhereParam>) -> WhereParam { | |
| WhereParam::RegionIsNot(value) | |
| } | |
| pub enum Include { | |
| Select(Vec<region::SelectParam>), | |
| Include(Vec<region::IncludeParam>), | |
| Fetch, | |
| } | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Region(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 = | |
| <region::Types as ::prisma_client_rust::ModelTypes>::scalar_selections( | |
| ); | |
| nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); | |
| nested_selections | |
| } | |
| Self::Fetch => { | |
| <region::Types as ::prisma_client_rust::ModelTypes>::scalar_selections() | |
| } | |
| }; | |
| ::prisma_client_rust::Selection::new("Region", None, [], selections) | |
| } | |
| pub fn select(nested_selections: Vec<region::SelectParam>) -> Self { | |
| Self::Select(nested_selections) | |
| } | |
| pub fn include(nested_selections: Vec<region::IncludeParam>) -> Self { | |
| Self::Include(nested_selections) | |
| } | |
| } | |
| pub enum Select { | |
| Select(Vec<region::SelectParam>), | |
| Include(Vec<region::IncludeParam>), | |
| Fetch, | |
| } | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Region(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 => { | |
| <region::Types as ::prisma_client_rust::ModelTypes>::scalar_selections() | |
| } | |
| }; | |
| ::prisma_client_rust::Selection::new("Region", None, [], selections) | |
| } | |
| pub fn select(nested_selections: Vec<region::SelectParam>) -> Self { | |
| Self::Select(nested_selections) | |
| } | |
| pub fn include(nested_selections: Vec<region::IncludeParam>) -> Self { | |
| Self::Include(nested_selections) | |
| } | |
| } | |
| } | |
| pub fn create( | |
| discovery_level: i32, | |
| hero: super::hero::UniqueWhereParam, | |
| region: super::region::UniqueWhereParam, | |
| _params: Vec<SetParam>, | |
| ) -> ( | |
| i32, | |
| super::hero::UniqueWhereParam, | |
| super::region::UniqueWhereParam, | |
| Vec<SetParam>, | |
| ) { | |
| (discovery_level, hero, region, _params) | |
| } | |
| pub fn create_unchecked( | |
| hero_id: String, | |
| region_name: String, | |
| discovery_level: i32, | |
| _params: Vec<SetParam>, | |
| ) -> (String, String, i32, Vec<SetParam>) { | |
| (hero_id, region_name, discovery_level, _params) | |
| } | |
| #[macro_export] | |
| macro_rules ! _select_hero_region { ($ (($ ($ 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 :: hero_region :: 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 :: hero_region :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: hero_region :: 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 :: hero_region :: 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 :: hero_region :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: hero_region :: 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 , hero_id , region_name , discovery_level , hero , region } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { $ (pub $ field : crate :: prisma :: hero_region :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } 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 :: hero_region :: $ 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 :: hero_region :: $ 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 :: hero_region :: $ 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 :: hero_region :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: hero_region :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "HeroId" , "region_name" , "discovery_level" , "Hero" , "Region"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: hero_region :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { String } ; (@ field_type ; hero_id) => { String } ; (@ field_type ; region_name) => { String } ; (@ field_type ; discovery_level) => { i32 } ; (@ field_type ; hero : $ selection_mode : ident { $ ($ selections : tt) + }) => { hero :: Data } ; (@ field_type ; hero) => { crate :: prisma :: hero :: Data } ; (@ field_type ; region : $ selection_mode : ident { $ ($ selections : tt) + }) => { region :: Data } ; (@ field_type ; region) => { crate :: prisma :: region :: Data } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "HeroRegion" , available relations are "id, hero_id, region_name, discovery_level, hero, region")) } ; (@ field_module ; hero : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: hero :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; region : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: region :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: hero_region :: SelectParam > :: into (crate :: prisma :: hero_region :: id :: Select) } ; (@ selection_field_to_selection_param ; hero_id) => { Into :: < crate :: prisma :: hero_region :: SelectParam > :: into (crate :: prisma :: hero_region :: hero_id :: Select) } ; (@ selection_field_to_selection_param ; region_name) => { Into :: < crate :: prisma :: hero_region :: SelectParam > :: into (crate :: prisma :: hero_region :: region_name :: Select) } ; (@ selection_field_to_selection_param ; discovery_level) => { Into :: < crate :: prisma :: hero_region :: SelectParam > :: into (crate :: prisma :: hero_region :: discovery_level :: Select) } ; (@ selection_field_to_selection_param ; hero $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: hero_region :: SelectParam > :: into (crate :: prisma :: hero_region :: hero :: Select :: $ selection_mode (crate :: prisma :: hero :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; hero $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: hero_region :: SelectParam > :: into (crate :: prisma :: hero_region :: hero :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; region $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: hero_region :: SelectParam > :: into (crate :: prisma :: hero_region :: region :: Select :: $ selection_mode (crate :: prisma :: region :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; region $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: hero_region :: SelectParam > :: into (crate :: prisma :: hero_region :: region :: 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 :: hero_region :: $ 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 ; hero_id) => { "HeroId" } ; (@ field_serde_name ; region_name) => { "region_name" } ; (@ field_serde_name ; discovery_level) => { "discovery_level" } ; (@ field_serde_name ; hero) => { "Hero" } ; (@ field_serde_name ; region) => { "Region" } ; } | |
| pub use _select_hero_region as select; | |
| pub enum SelectParam { | |
| Id(id::Select), | |
| HeroId(hero_id::Select), | |
| RegionName(region_name::Select), | |
| DiscoveryLevel(discovery_level::Select), | |
| Hero(hero::Select), | |
| Region(region::Select), | |
| } | |
| impl SelectParam { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::Id(data) => data.to_selection(), | |
| Self::HeroId(data) => data.to_selection(), | |
| Self::RegionName(data) => data.to_selection(), | |
| Self::DiscoveryLevel(data) => data.to_selection(), | |
| Self::Hero(data) => data.to_selection(), | |
| Self::Region(data) => data.to_selection(), | |
| } | |
| } | |
| } | |
| #[macro_export] | |
| macro_rules ! _include_hero_region { ($ (($ ($ 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 :: hero_region :: 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 :: hero_region :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: hero_region :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: hero_region :: 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 :: hero_region :: 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 :: hero_region :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: hero_region :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: hero_region :: 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 { hero , region } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { pub id : String , pub hero_id : String , pub region_name : String , pub discovery_level : i32 , $ (pub $ field : crate :: prisma :: hero_region :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } 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 ! (hero_id) , stringify ! (region_name) , stringify ! (discovery_level)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: hero_region :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: hero_region :: id :: NAME , & self . id) ? ; state . serialize_field (crate :: prisma :: hero_region :: hero_id :: NAME , & self . hero_id) ? ; state . serialize_field (crate :: prisma :: hero_region :: region_name :: NAME , & self . region_name) ? ; state . serialize_field (crate :: prisma :: hero_region :: discovery_level :: NAME , & self . discovery_level) ? ; 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 , hero_id , region_name , discovery_level } 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 :: hero_region :: $ field :: NAME) , + , crate :: prisma :: hero_region :: id :: NAME , crate :: prisma :: hero_region :: hero_id :: NAME , crate :: prisma :: hero_region :: region_name :: NAME , crate :: prisma :: hero_region :: discovery_level :: 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 :: hero_region :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: hero_region :: id :: NAME => Ok (Field :: id) , crate :: prisma :: hero_region :: hero_id :: NAME => Ok (Field :: hero_id) , crate :: prisma :: hero_region :: region_name :: NAME => Ok (Field :: region_name) , crate :: prisma :: hero_region :: discovery_level :: NAME => Ok (Field :: discovery_level) , _ => 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 hero_id = None ; let mut region_name = None ; let mut discovery_level = 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 :: hero_region :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } Field :: hero_id => { if hero_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: hero_region :: hero_id :: NAME)) ; } hero_id = Some (map . next_value () ?) ; } Field :: region_name => { if region_name . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: hero_region :: region_name :: NAME)) ; } region_name = Some (map . next_value () ?) ; } Field :: discovery_level => { if discovery_level . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: hero_region :: discovery_level :: NAME)) ; } discovery_level = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: hero_region :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: hero_region :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: hero_region :: id :: NAME)) ? ; let hero_id = hero_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: hero_region :: hero_id :: NAME)) ? ; let region_name = region_name . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: hero_region :: region_name :: NAME)) ? ; let discovery_level = discovery_level . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: hero_region :: discovery_level :: NAME)) ? ; Ok (Data { id , hero_id , region_name , discovery_level , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "HeroId" , "region_name" , "discovery_level" , "Hero" , "Region"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: hero_region :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; hero : $ selection_mode : ident { $ ($ selections : tt) + }) => { hero :: Data } ; (@ field_type ; hero) => { crate :: prisma :: hero :: Data } ; (@ field_type ; region : $ selection_mode : ident { $ ($ selections : tt) + }) => { region :: Data } ; (@ field_type ; region) => { crate :: prisma :: region :: Data } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "HeroRegion" , available relations are "hero, region")) } ; (@ field_module ; hero : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: hero :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; region : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: region :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; hero $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: hero_region :: IncludeParam > :: into (crate :: prisma :: hero_region :: hero :: Include :: $ selection_mode (crate :: prisma :: hero :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; hero $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: hero_region :: IncludeParam > :: into (crate :: prisma :: hero_region :: hero :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; region $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: hero_region :: IncludeParam > :: into (crate :: prisma :: hero_region :: region :: Include :: $ selection_mode (crate :: prisma :: region :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; region $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: hero_region :: IncludeParam > :: into (crate :: prisma :: hero_region :: region :: 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 :: hero_region :: $ 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 ; hero_id) => { "HeroId" } ; (@ field_serde_name ; region_name) => { "region_name" } ; (@ field_serde_name ; discovery_level) => { "discovery_level" } ; (@ field_serde_name ; hero) => { "Hero" } ; (@ field_serde_name ; region) => { "Region" } ; } | |
| pub use _include_hero_region as include; | |
| pub enum IncludeParam { | |
| Id(id::Include), | |
| HeroId(hero_id::Include), | |
| RegionName(region_name::Include), | |
| DiscoveryLevel(discovery_level::Include), | |
| Hero(hero::Include), | |
| Region(region::Include), | |
| } | |
| impl IncludeParam { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::Id(data) => data.to_selection(), | |
| Self::HeroId(data) => data.to_selection(), | |
| Self::RegionName(data) => data.to_selection(), | |
| Self::DiscoveryLevel(data) => data.to_selection(), | |
| Self::Hero(data) => data.to_selection(), | |
| Self::Region(data) => data.to_selection(), | |
| } | |
| } | |
| } | |
| #[macro_export] | |
| macro_rules ! _partial_unchecked_hero_region { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: hero_region struct $ struct_name { # [serde (rename = "id")] pub id : String , # [serde (rename = "HeroId")] pub hero_id : String , # [serde (rename = "region_name")] pub region_name : String , # [serde (rename = "discovery_level")] pub discovery_level : i32 } [$ ($ scalar_field) , +] } } ; } | |
| pub use _partial_unchecked_hero_region as partial_unchecked; | |
| #[derive(Debug, Clone, :: serde :: Serialize, :: serde :: Deserialize)] | |
| pub struct Data { | |
| #[serde(rename = "id")] | |
| pub id: String, | |
| #[serde(rename = "HeroId")] | |
| pub hero_id: String, | |
| #[serde(rename = "region_name")] | |
| pub region_name: String, | |
| #[serde(rename = "discovery_level")] | |
| pub discovery_level: i32, | |
| #[serde(rename = "Hero")] | |
| pub hero: Option<Box<super::hero::Data>>, | |
| #[serde(rename = "Region")] | |
| pub region: Option<Box<super::region::Data>>, | |
| } | |
| impl Data { | |
| pub fn hero( | |
| &self, | |
| ) -> Result<&super::hero::Data, ::prisma_client_rust::RelationNotFetchedError> { | |
| self.hero | |
| .as_ref() | |
| .ok_or(::prisma_client_rust::RelationNotFetchedError::new( | |
| stringify!(hero), | |
| )) | |
| .map(|v| v.as_ref()) | |
| } | |
| pub fn region( | |
| &self, | |
| ) -> Result<&super::region::Data, ::prisma_client_rust::RelationNotFetchedError> { | |
| self.region | |
| .as_ref() | |
| .ok_or(::prisma_client_rust::RelationNotFetchedError::new( | |
| stringify!(region), | |
| )) | |
| .map(|v| v.as_ref()) | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum WithParam { | |
| Hero(super::hero::UniqueArgs), | |
| Region(super::region::UniqueArgs), | |
| } | |
| impl Into<::prisma_client_rust::Selection> for WithParam { | |
| fn into(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::Hero(args) => { | |
| let mut selections = | |
| <super::hero::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(hero::NAME, None, [], selections) | |
| } | |
| Self::Region(args) => { | |
| let mut selections = < super :: region :: 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(region::NAME, None, [], selections) | |
| } | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum SetParam { | |
| SetId(String), | |
| SetHeroId(String), | |
| SetRegionName(String), | |
| SetDiscoveryLevel(i32), | |
| IncrementDiscoveryLevel(i32), | |
| DecrementDiscoveryLevel(i32), | |
| MultiplyDiscoveryLevel(i32), | |
| DivideDiscoveryLevel(i32), | |
| ConnectHero(super::hero::UniqueWhereParam), | |
| ConnectRegion(super::region::UniqueWhereParam), | |
| } | |
| impl From<SetParam> 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::SetHeroId(value) => ( | |
| hero_id::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(value), | |
| ), | |
| SetParam::SetRegionName(value) => ( | |
| region_name::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(value), | |
| ), | |
| SetParam::SetDiscoveryLevel(value) => ( | |
| discovery_level::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| ), | |
| SetParam::IncrementDiscoveryLevel(value) => ( | |
| discovery_level::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "increment".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DecrementDiscoveryLevel(value) => ( | |
| discovery_level::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "decrement".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::MultiplyDiscoveryLevel(value) => ( | |
| discovery_level::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "multiply".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DivideDiscoveryLevel(value) => ( | |
| discovery_level::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "divide".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::ConnectHero(where_param) => ( | |
| hero::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "connect".to_string(), | |
| ::prisma_client_rust::PrismaValue::Object( | |
| [where_param] | |
| .into_iter() | |
| .map(Into::<super::hero::WhereParam>::into) | |
| .map(::prisma_client_rust::WhereInput::serialize) | |
| .map(::prisma_client_rust::SerializedWhereInput::transform_equals) | |
| .collect(), | |
| ), | |
| )]), | |
| ), | |
| SetParam::ConnectRegion(where_param) => ( | |
| region::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "connect".to_string(), | |
| ::prisma_client_rust::PrismaValue::Object( | |
| [where_param] | |
| .into_iter() | |
| .map(Into::<super::region::WhereParam>::into) | |
| .map(::prisma_client_rust::WhereInput::serialize) | |
| .map(::prisma_client_rust::SerializedWhereInput::transform_equals) | |
| .collect(), | |
| ), | |
| )]), | |
| ), | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum UncheckedSetParam { | |
| Id(String), | |
| HeroId(String), | |
| RegionName(String), | |
| DiscoveryLevel(i32), | |
| } | |
| impl From<UncheckedSetParam> for SetParam { | |
| fn from(param: UncheckedSetParam) -> Self { | |
| match param { | |
| UncheckedSetParam::Id(value) => Self::SetId(value), | |
| UncheckedSetParam::HeroId(value) => Self::SetHeroId(value), | |
| UncheckedSetParam::RegionName(value) => Self::SetRegionName(value), | |
| UncheckedSetParam::DiscoveryLevel(value) => Self::SetDiscoveryLevel(value), | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum OrderByParam { | |
| Id(::prisma_client_rust::Direction), | |
| HeroId(::prisma_client_rust::Direction), | |
| RegionName(::prisma_client_rust::Direction), | |
| DiscoveryLevel(::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::HeroId(direction) => ( | |
| hero_id::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| Self::RegionName(direction) => ( | |
| region_name::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| Self::DiscoveryLevel(direction) => ( | |
| discovery_level::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum WhereParam { | |
| Not(Vec<WhereParam>), | |
| Or(Vec<WhereParam>), | |
| And(Vec<WhereParam>), | |
| Id(_prisma::read_filters::StringFilter), | |
| HeroId(_prisma::read_filters::StringFilter), | |
| RegionName(_prisma::read_filters::StringFilter), | |
| DiscoveryLevel(_prisma::read_filters::IntFilter), | |
| HeroIs(Vec<super::hero::WhereParam>), | |
| HeroIsNot(Vec<super::hero::WhereParam>), | |
| RegionIs(Vec<super::region::WhereParam>), | |
| RegionIsNot(Vec<super::region::WhereParam>), | |
| } | |
| 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::HeroId(value) => (hero_id::NAME, value.into()), | |
| Self::RegionName(value) => (region_name::NAME, value.into()), | |
| Self::DiscoveryLevel(value) => (discovery_level::NAME, value.into()), | |
| Self::HeroIs(where_params) => ( | |
| hero::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::HeroIsNot(where_params) => ( | |
| hero::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::RegionIs(where_params) => ( | |
| region::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::RegionIsNot(where_params) => ( | |
| region::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<UniqueWhereParam> 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<Self>> for WhereParam { | |
| fn from(op: ::prisma_client_rust::Operator<Self>) -> 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(hero_id::NAME), | |
| ::prisma_client_rust::sel(region_name::NAME), | |
| ::prisma_client_rust::sel(discovery_level::NAME), | |
| ] | |
| } | |
| } | |
| pub type UniqueArgs = ::prisma_client_rust::UniqueArgs<Types>; | |
| pub type ManyArgs = ::prisma_client_rust::ManyArgs<Types>; | |
| 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<WhereParam>) -> FindFirst<'a> { | |
| FindFirst::new(self.client, _where) | |
| } | |
| pub fn find_many(self, _where: Vec<WhereParam>) -> FindMany<'a> { | |
| FindMany::new(self.client, _where) | |
| } | |
| pub fn create( | |
| self, | |
| discovery_level: i32, | |
| hero: super::hero::UniqueWhereParam, | |
| region: super::region::UniqueWhereParam, | |
| mut _params: Vec<SetParam>, | |
| ) -> Create<'a> { | |
| _params.extend([ | |
| discovery_level::set(discovery_level), | |
| hero::connect(hero), | |
| region::connect(region), | |
| ]); | |
| Create::new(self.client, _params) | |
| } | |
| pub fn create_unchecked( | |
| self, | |
| hero_id: String, | |
| region_name: String, | |
| discovery_level: i32, | |
| mut _params: Vec<UncheckedSetParam>, | |
| ) -> Create<'a> { | |
| _params.extend([ | |
| hero_id::set(hero_id), | |
| region_name::set(region_name), | |
| discovery_level::set(discovery_level), | |
| ]); | |
| Create::new(self.client, _params.into_iter().map(Into::into).collect()) | |
| } | |
| pub fn create_many( | |
| self, | |
| data: Vec<(String, String, i32, Vec<SetParam>)>, | |
| ) -> CreateMany<'a> { | |
| let data = data | |
| .into_iter() | |
| .map(|(hero_id, region_name, discovery_level, mut _params)| { | |
| _params.extend([ | |
| hero_id::set(hero_id), | |
| region_name::set(region_name), | |
| discovery_level::set(discovery_level), | |
| ]); | |
| _params | |
| }) | |
| .collect(); | |
| CreateMany::new(self.client, data) | |
| } | |
| pub fn update(self, _where: UniqueWhereParam, _params: Vec<SetParam>) -> Update<'a> { | |
| Update::new(self.client, _where.into(), _params, vec![]) | |
| } | |
| pub fn update_unchecked( | |
| self, | |
| _where: UniqueWhereParam, | |
| _params: Vec<UncheckedSetParam>, | |
| ) -> Update<'a> { | |
| Update::new( | |
| self.client, | |
| _where.into(), | |
| _params.into_iter().map(Into::into).collect(), | |
| vec![], | |
| ) | |
| } | |
| pub fn update_many( | |
| self, | |
| _where: Vec<WhereParam>, | |
| _params: Vec<SetParam>, | |
| ) -> UpdateMany<'a> { | |
| UpdateMany::new(self.client, _where, _params) | |
| } | |
| pub fn upsert( | |
| self, | |
| _where: UniqueWhereParam, | |
| (discovery_level, hero, region, mut _params): ( | |
| i32, | |
| super::hero::UniqueWhereParam, | |
| super::region::UniqueWhereParam, | |
| Vec<SetParam>, | |
| ), | |
| _update: Vec<SetParam>, | |
| ) -> Upsert<'a> { | |
| _params.extend([ | |
| discovery_level::set(discovery_level), | |
| hero::connect(hero), | |
| region::connect(region), | |
| ]); | |
| 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<WhereParam>) -> DeleteMany<'a> { | |
| DeleteMany::new(self.client, _where) | |
| } | |
| pub fn count(self, _where: Vec<WhereParam>) -> Count<'a> { | |
| Count::new(self.client, _where) | |
| } | |
| } | |
| } | |
| pub mod base_stats { | |
| use super::_prisma::*; | |
| use super::*; | |
| pub const NAME: &str = "BaseStats"; | |
| 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<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetId(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::Id(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: String) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::Id(direction) | |
| } | |
| pub fn equals<T: From<UniqueWhereParam>>(value: String) -> T { | |
| UniqueWhereParam::IdEquals(value).into() | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::StringFilter, Id, { | |
| fn in_vec(_: Vec<String>) -> InVec; | |
| fn not_in_vec(_: Vec<String>) -> 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<super::IncludeParam> 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<super::SelectParam> 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 level { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "level"; | |
| pub struct Set(pub i32); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetLevel(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::Level(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: i32) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::Level(direction) | |
| } | |
| pub fn equals(value: i32) -> WhereParam { | |
| WhereParam::Level(_prisma::read_filters::IntFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::IntFilter, Level, { | |
| fn in_vec(_: Vec<i32>) -> InVec; | |
| fn not_in_vec(_: Vec<i32>) -> 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::IncrementLevel(value) | |
| } | |
| pub fn decrement(value: i32) -> SetParam { | |
| SetParam::DecrementLevel(value) | |
| } | |
| pub fn multiply(value: i32) -> SetParam { | |
| SetParam::MultiplyLevel(value) | |
| } | |
| pub fn divide(value: i32) -> SetParam { | |
| SetParam::DivideLevel(value) | |
| } | |
| pub struct Include; | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Level(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Level(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod xp { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "xp"; | |
| pub struct Set(pub i32); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetXp(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::Xp(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: i32) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::Xp(direction) | |
| } | |
| pub fn equals(value: i32) -> WhereParam { | |
| WhereParam::Xp(_prisma::read_filters::IntFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::IntFilter, Xp, { | |
| fn in_vec(_: Vec<i32>) -> InVec; | |
| fn not_in_vec(_: Vec<i32>) -> 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::IncrementXp(value) | |
| } | |
| pub fn decrement(value: i32) -> SetParam { | |
| SetParam::DecrementXp(value) | |
| } | |
| pub fn multiply(value: i32) -> SetParam { | |
| SetParam::MultiplyXp(value) | |
| } | |
| pub fn divide(value: i32) -> SetParam { | |
| SetParam::DivideXp(value) | |
| } | |
| pub struct Include; | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Xp(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Xp(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod damage_min { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "damageMin"; | |
| pub struct Set(pub i32); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetDamageMin(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::DamageMin(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: i32) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::DamageMin(direction) | |
| } | |
| pub fn equals(value: i32) -> WhereParam { | |
| WhereParam::DamageMin(_prisma::read_filters::IntFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!( | |
| _prisma::read_filters::IntFilter, | |
| DamageMin, | |
| { | |
| fn in_vec(_: Vec<i32>) -> InVec; | |
| fn not_in_vec(_: Vec<i32>) -> 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::IncrementDamageMin(value) | |
| } | |
| pub fn decrement(value: i32) -> SetParam { | |
| SetParam::DecrementDamageMin(value) | |
| } | |
| pub fn multiply(value: i32) -> SetParam { | |
| SetParam::MultiplyDamageMin(value) | |
| } | |
| pub fn divide(value: i32) -> SetParam { | |
| SetParam::DivideDamageMin(value) | |
| } | |
| pub struct Include; | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::DamageMin(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::DamageMin(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod damage_max { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "damageMax"; | |
| pub struct Set(pub i32); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetDamageMax(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::DamageMax(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: i32) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::DamageMax(direction) | |
| } | |
| pub fn equals(value: i32) -> WhereParam { | |
| WhereParam::DamageMax(_prisma::read_filters::IntFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!( | |
| _prisma::read_filters::IntFilter, | |
| DamageMax, | |
| { | |
| fn in_vec(_: Vec<i32>) -> InVec; | |
| fn not_in_vec(_: Vec<i32>) -> 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::IncrementDamageMax(value) | |
| } | |
| pub fn decrement(value: i32) -> SetParam { | |
| SetParam::DecrementDamageMax(value) | |
| } | |
| pub fn multiply(value: i32) -> SetParam { | |
| SetParam::MultiplyDamageMax(value) | |
| } | |
| pub fn divide(value: i32) -> SetParam { | |
| SetParam::DivideDamageMax(value) | |
| } | |
| pub struct Include; | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::DamageMax(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::DamageMax(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod hit_points { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "hitPoints"; | |
| pub struct Set(pub i32); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetHitPoints(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::HitPoints(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: i32) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::HitPoints(direction) | |
| } | |
| pub fn equals(value: i32) -> WhereParam { | |
| WhereParam::HitPoints(_prisma::read_filters::IntFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!( | |
| _prisma::read_filters::IntFilter, | |
| HitPoints, | |
| { | |
| fn in_vec(_: Vec<i32>) -> InVec; | |
| fn not_in_vec(_: Vec<i32>) -> 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::IncrementHitPoints(value) | |
| } | |
| pub fn decrement(value: i32) -> SetParam { | |
| SetParam::DecrementHitPoints(value) | |
| } | |
| pub fn multiply(value: i32) -> SetParam { | |
| SetParam::MultiplyHitPoints(value) | |
| } | |
| pub fn divide(value: i32) -> SetParam { | |
| SetParam::DivideHitPoints(value) | |
| } | |
| pub struct Include; | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::HitPoints(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::HitPoints(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod mana { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "mana"; | |
| pub struct Set(pub i32); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetMana(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::Mana(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: i32) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::Mana(direction) | |
| } | |
| pub fn equals(value: i32) -> WhereParam { | |
| WhereParam::Mana(_prisma::read_filters::IntFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::IntFilter, Mana, { | |
| fn in_vec(_: Vec<i32>) -> InVec; | |
| fn not_in_vec(_: Vec<i32>) -> 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::IncrementMana(value) | |
| } | |
| pub fn decrement(value: i32) -> SetParam { | |
| SetParam::DecrementMana(value) | |
| } | |
| pub fn multiply(value: i32) -> SetParam { | |
| SetParam::MultiplyMana(value) | |
| } | |
| pub fn divide(value: i32) -> SetParam { | |
| SetParam::DivideMana(value) | |
| } | |
| pub struct Include; | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Mana(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Mana(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod armor { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "armor"; | |
| pub struct Set(pub i32); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetArmor(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::Armor(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: i32) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::Armor(direction) | |
| } | |
| pub fn equals(value: i32) -> WhereParam { | |
| WhereParam::Armor(_prisma::read_filters::IntFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::IntFilter, Armor, { | |
| fn in_vec(_: Vec<i32>) -> InVec; | |
| fn not_in_vec(_: Vec<i32>) -> 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::IncrementArmor(value) | |
| } | |
| pub fn decrement(value: i32) -> SetParam { | |
| SetParam::DecrementArmor(value) | |
| } | |
| pub fn multiply(value: i32) -> SetParam { | |
| SetParam::MultiplyArmor(value) | |
| } | |
| pub fn divide(value: i32) -> SetParam { | |
| SetParam::DivideArmor(value) | |
| } | |
| pub struct Include; | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Armor(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Armor(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod hero { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "hero"; | |
| pub struct Fetch(pub hero::UniqueArgs); | |
| impl Fetch { | |
| pub fn with(mut self, params: impl Into<hero::WithParam>) -> Self { | |
| self.0 = self.0.with(params.into()); | |
| self | |
| } | |
| } | |
| impl From<Fetch> for WithParam { | |
| fn from(Fetch(v): Fetch) -> Self { | |
| WithParam::Hero(v) | |
| } | |
| } | |
| pub fn fetch() -> Fetch { | |
| Fetch(hero::UniqueArgs::new()) | |
| } | |
| pub struct Connect(hero::UniqueWhereParam); | |
| impl From<Connect> for SetParam { | |
| fn from(Connect(v): Connect) -> Self { | |
| Self::ConnectHero(v) | |
| } | |
| } | |
| pub fn connect<T: From<Connect>>(value: hero::UniqueWhereParam) -> T { | |
| Connect(value).into() | |
| } | |
| pub fn disconnect() -> SetParam { | |
| SetParam::DisconnectHero | |
| } | |
| pub fn is_null() -> WhereParam { | |
| WhereParam::HeroIsNull | |
| } | |
| pub fn is(value: Vec<hero::WhereParam>) -> WhereParam { | |
| WhereParam::HeroIs(value) | |
| } | |
| pub fn is_not(value: Vec<hero::WhereParam>) -> WhereParam { | |
| WhereParam::HeroIsNot(value) | |
| } | |
| pub enum Include { | |
| Select(Vec<hero::SelectParam>), | |
| Include(Vec<hero::IncludeParam>), | |
| Fetch, | |
| } | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Hero(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 = | |
| <hero::Types as ::prisma_client_rust::ModelTypes>::scalar_selections(); | |
| nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); | |
| nested_selections | |
| } | |
| Self::Fetch => { | |
| <hero::Types as ::prisma_client_rust::ModelTypes>::scalar_selections() | |
| } | |
| }; | |
| ::prisma_client_rust::Selection::new("hero", None, [], selections) | |
| } | |
| pub fn select(nested_selections: Vec<hero::SelectParam>) -> Self { | |
| Self::Select(nested_selections) | |
| } | |
| pub fn include(nested_selections: Vec<hero::IncludeParam>) -> Self { | |
| Self::Include(nested_selections) | |
| } | |
| } | |
| pub enum Select { | |
| Select(Vec<hero::SelectParam>), | |
| Include(Vec<hero::IncludeParam>), | |
| Fetch, | |
| } | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Hero(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 => { | |
| <hero::Types as ::prisma_client_rust::ModelTypes>::scalar_selections() | |
| } | |
| }; | |
| ::prisma_client_rust::Selection::new("hero", None, [], selections) | |
| } | |
| pub fn select(nested_selections: Vec<hero::SelectParam>) -> Self { | |
| Self::Select(nested_selections) | |
| } | |
| pub fn include(nested_selections: Vec<hero::IncludeParam>) -> Self { | |
| Self::Include(nested_selections) | |
| } | |
| } | |
| } | |
| pub fn create( | |
| level: i32, | |
| xp: i32, | |
| damage_min: i32, | |
| damage_max: i32, | |
| hit_points: i32, | |
| mana: i32, | |
| armor: i32, | |
| _params: Vec<SetParam>, | |
| ) -> (i32, i32, i32, i32, i32, i32, i32, Vec<SetParam>) { | |
| ( | |
| level, xp, damage_min, damage_max, hit_points, mana, armor, _params, | |
| ) | |
| } | |
| pub fn create_unchecked( | |
| level: i32, | |
| xp: i32, | |
| damage_min: i32, | |
| damage_max: i32, | |
| hit_points: i32, | |
| mana: i32, | |
| armor: i32, | |
| _params: Vec<SetParam>, | |
| ) -> (i32, i32, i32, i32, i32, i32, i32, Vec<SetParam>) { | |
| ( | |
| level, xp, damage_min, damage_max, hit_points, mana, armor, _params, | |
| ) | |
| } | |
| #[macro_export] | |
| macro_rules ! _select_base_stats { ($ (($ ($ 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 :: base_stats :: 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 :: base_stats :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: base_stats :: 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 :: base_stats :: 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 :: base_stats :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: base_stats :: 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 , level , xp , damage_min , damage_max , hit_points , mana , armor , hero } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { $ (pub $ field : crate :: prisma :: base_stats :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } 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 :: base_stats :: $ 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 :: base_stats :: $ 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 :: base_stats :: $ 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 :: base_stats :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: base_stats :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "level" , "xp" , "damageMin" , "damageMax" , "hitPoints" , "mana" , "armor" , "hero"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: base_stats :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { String } ; (@ field_type ; level) => { i32 } ; (@ field_type ; xp) => { i32 } ; (@ field_type ; damage_min) => { i32 } ; (@ field_type ; damage_max) => { i32 } ; (@ field_type ; hit_points) => { i32 } ; (@ field_type ; mana) => { i32 } ; (@ field_type ; armor) => { i32 } ; (@ field_type ; hero : $ selection_mode : ident { $ ($ selections : tt) + }) => { Option < hero :: Data > } ; (@ field_type ; hero) => { Option < crate :: prisma :: hero :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "BaseStats" , available relations are "id, level, xp, damage_min, damage_max, hit_points, mana, armor, hero")) } ; (@ field_module ; hero : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: hero :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: base_stats :: SelectParam > :: into (crate :: prisma :: base_stats :: id :: Select) } ; (@ selection_field_to_selection_param ; level) => { Into :: < crate :: prisma :: base_stats :: SelectParam > :: into (crate :: prisma :: base_stats :: level :: Select) } ; (@ selection_field_to_selection_param ; xp) => { Into :: < crate :: prisma :: base_stats :: SelectParam > :: into (crate :: prisma :: base_stats :: xp :: Select) } ; (@ selection_field_to_selection_param ; damage_min) => { Into :: < crate :: prisma :: base_stats :: SelectParam > :: into (crate :: prisma :: base_stats :: damage_min :: Select) } ; (@ selection_field_to_selection_param ; damage_max) => { Into :: < crate :: prisma :: base_stats :: SelectParam > :: into (crate :: prisma :: base_stats :: damage_max :: Select) } ; (@ selection_field_to_selection_param ; hit_points) => { Into :: < crate :: prisma :: base_stats :: SelectParam > :: into (crate :: prisma :: base_stats :: hit_points :: Select) } ; (@ selection_field_to_selection_param ; mana) => { Into :: < crate :: prisma :: base_stats :: SelectParam > :: into (crate :: prisma :: base_stats :: mana :: Select) } ; (@ selection_field_to_selection_param ; armor) => { Into :: < crate :: prisma :: base_stats :: SelectParam > :: into (crate :: prisma :: base_stats :: armor :: Select) } ; (@ selection_field_to_selection_param ; hero $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: base_stats :: SelectParam > :: into (crate :: prisma :: base_stats :: hero :: Select :: $ selection_mode (crate :: prisma :: hero :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; hero $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: base_stats :: SelectParam > :: into (crate :: prisma :: base_stats :: hero :: 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 :: base_stats :: $ 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 ; level) => { "level" } ; (@ field_serde_name ; xp) => { "xp" } ; (@ field_serde_name ; damage_min) => { "damageMin" } ; (@ field_serde_name ; damage_max) => { "damageMax" } ; (@ field_serde_name ; hit_points) => { "hitPoints" } ; (@ field_serde_name ; mana) => { "mana" } ; (@ field_serde_name ; armor) => { "armor" } ; (@ field_serde_name ; hero) => { "hero" } ; } | |
| pub use _select_base_stats as select; | |
| pub enum SelectParam { | |
| Id(id::Select), | |
| Level(level::Select), | |
| Xp(xp::Select), | |
| DamageMin(damage_min::Select), | |
| DamageMax(damage_max::Select), | |
| HitPoints(hit_points::Select), | |
| Mana(mana::Select), | |
| Armor(armor::Select), | |
| Hero(hero::Select), | |
| } | |
| impl SelectParam { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::Id(data) => data.to_selection(), | |
| Self::Level(data) => data.to_selection(), | |
| Self::Xp(data) => data.to_selection(), | |
| Self::DamageMin(data) => data.to_selection(), | |
| Self::DamageMax(data) => data.to_selection(), | |
| Self::HitPoints(data) => data.to_selection(), | |
| Self::Mana(data) => data.to_selection(), | |
| Self::Armor(data) => data.to_selection(), | |
| Self::Hero(data) => data.to_selection(), | |
| } | |
| } | |
| } | |
| #[macro_export] | |
| macro_rules ! _include_base_stats { ($ (($ ($ 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 :: base_stats :: 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 :: base_stats :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: base_stats :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: base_stats :: 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 :: base_stats :: 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 :: base_stats :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: base_stats :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: base_stats :: 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 { hero } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { pub id : String , pub level : i32 , pub xp : i32 , pub damage_min : i32 , pub damage_max : i32 , pub hit_points : i32 , pub mana : i32 , pub armor : i32 , $ (pub $ field : crate :: prisma :: base_stats :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } 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 ! (level) , stringify ! (xp) , stringify ! (damage_min) , stringify ! (damage_max) , stringify ! (hit_points) , stringify ! (mana) , stringify ! (armor)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: base_stats :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: base_stats :: id :: NAME , & self . id) ? ; state . serialize_field (crate :: prisma :: base_stats :: level :: NAME , & self . level) ? ; state . serialize_field (crate :: prisma :: base_stats :: xp :: NAME , & self . xp) ? ; state . serialize_field (crate :: prisma :: base_stats :: damage_min :: NAME , & self . damage_min) ? ; state . serialize_field (crate :: prisma :: base_stats :: damage_max :: NAME , & self . damage_max) ? ; state . serialize_field (crate :: prisma :: base_stats :: hit_points :: NAME , & self . hit_points) ? ; state . serialize_field (crate :: prisma :: base_stats :: mana :: NAME , & self . mana) ? ; state . serialize_field (crate :: prisma :: base_stats :: armor :: NAME , & self . armor) ? ; 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 , level , xp , damage_min , damage_max , hit_points , mana , armor } 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 :: base_stats :: $ field :: NAME) , + , crate :: prisma :: base_stats :: id :: NAME , crate :: prisma :: base_stats :: level :: NAME , crate :: prisma :: base_stats :: xp :: NAME , crate :: prisma :: base_stats :: damage_min :: NAME , crate :: prisma :: base_stats :: damage_max :: NAME , crate :: prisma :: base_stats :: hit_points :: NAME , crate :: prisma :: base_stats :: mana :: NAME , crate :: prisma :: base_stats :: armor :: 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 :: base_stats :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: base_stats :: id :: NAME => Ok (Field :: id) , crate :: prisma :: base_stats :: level :: NAME => Ok (Field :: level) , crate :: prisma :: base_stats :: xp :: NAME => Ok (Field :: xp) , crate :: prisma :: base_stats :: damage_min :: NAME => Ok (Field :: damage_min) , crate :: prisma :: base_stats :: damage_max :: NAME => Ok (Field :: damage_max) , crate :: prisma :: base_stats :: hit_points :: NAME => Ok (Field :: hit_points) , crate :: prisma :: base_stats :: mana :: NAME => Ok (Field :: mana) , crate :: prisma :: base_stats :: armor :: NAME => Ok (Field :: armor) , _ => 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 level = None ; let mut xp = None ; let mut damage_min = None ; let mut damage_max = None ; let mut hit_points = None ; let mut mana = None ; let mut armor = 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 :: base_stats :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } Field :: level => { if level . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: base_stats :: level :: NAME)) ; } level = Some (map . next_value () ?) ; } Field :: xp => { if xp . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: base_stats :: xp :: NAME)) ; } xp = Some (map . next_value () ?) ; } Field :: damage_min => { if damage_min . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: base_stats :: damage_min :: NAME)) ; } damage_min = Some (map . next_value () ?) ; } Field :: damage_max => { if damage_max . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: base_stats :: damage_max :: NAME)) ; } damage_max = Some (map . next_value () ?) ; } Field :: hit_points => { if hit_points . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: base_stats :: hit_points :: NAME)) ; } hit_points = Some (map . next_value () ?) ; } Field :: mana => { if mana . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: base_stats :: mana :: NAME)) ; } mana = Some (map . next_value () ?) ; } Field :: armor => { if armor . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: base_stats :: armor :: NAME)) ; } armor = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: base_stats :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: base_stats :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: base_stats :: id :: NAME)) ? ; let level = level . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: base_stats :: level :: NAME)) ? ; let xp = xp . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: base_stats :: xp :: NAME)) ? ; let damage_min = damage_min . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: base_stats :: damage_min :: NAME)) ? ; let damage_max = damage_max . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: base_stats :: damage_max :: NAME)) ? ; let hit_points = hit_points . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: base_stats :: hit_points :: NAME)) ? ; let mana = mana . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: base_stats :: mana :: NAME)) ? ; let armor = armor . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: base_stats :: armor :: NAME)) ? ; Ok (Data { id , level , xp , damage_min , damage_max , hit_points , mana , armor , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "level" , "xp" , "damageMin" , "damageMax" , "hitPoints" , "mana" , "armor" , "hero"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: base_stats :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; hero : $ selection_mode : ident { $ ($ selections : tt) + }) => { Option < hero :: Data > } ; (@ field_type ; hero) => { Option < crate :: prisma :: hero :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "BaseStats" , available relations are "hero")) } ; (@ field_module ; hero : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: hero :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; hero $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: base_stats :: IncludeParam > :: into (crate :: prisma :: base_stats :: hero :: Include :: $ selection_mode (crate :: prisma :: hero :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; hero $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: base_stats :: IncludeParam > :: into (crate :: prisma :: base_stats :: hero :: 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 :: base_stats :: $ 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 ; level) => { "level" } ; (@ field_serde_name ; xp) => { "xp" } ; (@ field_serde_name ; damage_min) => { "damageMin" } ; (@ field_serde_name ; damage_max) => { "damageMax" } ; (@ field_serde_name ; hit_points) => { "hitPoints" } ; (@ field_serde_name ; mana) => { "mana" } ; (@ field_serde_name ; armor) => { "armor" } ; (@ field_serde_name ; hero) => { "hero" } ; } | |
| pub use _include_base_stats as include; | |
| pub enum IncludeParam { | |
| Id(id::Include), | |
| Level(level::Include), | |
| Xp(xp::Include), | |
| DamageMin(damage_min::Include), | |
| DamageMax(damage_max::Include), | |
| HitPoints(hit_points::Include), | |
| Mana(mana::Include), | |
| Armor(armor::Include), | |
| Hero(hero::Include), | |
| } | |
| impl IncludeParam { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::Id(data) => data.to_selection(), | |
| Self::Level(data) => data.to_selection(), | |
| Self::Xp(data) => data.to_selection(), | |
| Self::DamageMin(data) => data.to_selection(), | |
| Self::DamageMax(data) => data.to_selection(), | |
| Self::HitPoints(data) => data.to_selection(), | |
| Self::Mana(data) => data.to_selection(), | |
| Self::Armor(data) => data.to_selection(), | |
| Self::Hero(data) => data.to_selection(), | |
| } | |
| } | |
| } | |
| #[macro_export] | |
| macro_rules ! _partial_unchecked_base_stats { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: base_stats struct $ struct_name { # [serde (rename = "id")] pub id : String , # [serde (rename = "level")] pub level : i32 , # [serde (rename = "xp")] pub xp : i32 , # [serde (rename = "damageMin")] pub damage_min : i32 , # [serde (rename = "damageMax")] pub damage_max : i32 , # [serde (rename = "hitPoints")] pub hit_points : i32 , # [serde (rename = "mana")] pub mana : i32 , # [serde (rename = "armor")] pub armor : i32 } [$ ($ scalar_field) , +] } } ; } | |
| pub use _partial_unchecked_base_stats as partial_unchecked; | |
| #[derive(Debug, Clone, :: serde :: Serialize, :: serde :: Deserialize)] | |
| pub struct Data { | |
| #[serde(rename = "id")] | |
| pub id: String, | |
| #[serde(rename = "level")] | |
| pub level: i32, | |
| #[serde(rename = "xp")] | |
| pub xp: i32, | |
| #[serde(rename = "damageMin")] | |
| pub damage_min: i32, | |
| #[serde(rename = "damageMax")] | |
| pub damage_max: i32, | |
| #[serde(rename = "hitPoints")] | |
| pub hit_points: i32, | |
| #[serde(rename = "mana")] | |
| pub mana: i32, | |
| #[serde(rename = "armor")] | |
| pub armor: i32, | |
| #[serde( | |
| rename = "hero", | |
| default, | |
| skip_serializing_if = "Option::is_none", | |
| with = "prisma_client_rust::serde::double_option" | |
| )] | |
| pub hero: Option<Option<Box<super::hero::Data>>>, | |
| } | |
| impl Data { | |
| pub fn hero( | |
| &self, | |
| ) -> Result<Option<&super::hero::Data>, ::prisma_client_rust::RelationNotFetchedError> | |
| { | |
| self.hero | |
| .as_ref() | |
| .ok_or(::prisma_client_rust::RelationNotFetchedError::new( | |
| stringify!(hero), | |
| )) | |
| .map(|v| v.as_ref().map(|v| v.as_ref())) | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum WithParam { | |
| Hero(super::hero::UniqueArgs), | |
| } | |
| impl Into<::prisma_client_rust::Selection> for WithParam { | |
| fn into(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::Hero(args) => { | |
| let mut selections = | |
| <super::hero::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(hero::NAME, None, [], selections) | |
| } | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum SetParam { | |
| SetId(String), | |
| SetLevel(i32), | |
| IncrementLevel(i32), | |
| DecrementLevel(i32), | |
| MultiplyLevel(i32), | |
| DivideLevel(i32), | |
| SetXp(i32), | |
| IncrementXp(i32), | |
| DecrementXp(i32), | |
| MultiplyXp(i32), | |
| DivideXp(i32), | |
| SetDamageMin(i32), | |
| IncrementDamageMin(i32), | |
| DecrementDamageMin(i32), | |
| MultiplyDamageMin(i32), | |
| DivideDamageMin(i32), | |
| SetDamageMax(i32), | |
| IncrementDamageMax(i32), | |
| DecrementDamageMax(i32), | |
| MultiplyDamageMax(i32), | |
| DivideDamageMax(i32), | |
| SetHitPoints(i32), | |
| IncrementHitPoints(i32), | |
| DecrementHitPoints(i32), | |
| MultiplyHitPoints(i32), | |
| DivideHitPoints(i32), | |
| SetMana(i32), | |
| IncrementMana(i32), | |
| DecrementMana(i32), | |
| MultiplyMana(i32), | |
| DivideMana(i32), | |
| SetArmor(i32), | |
| IncrementArmor(i32), | |
| DecrementArmor(i32), | |
| MultiplyArmor(i32), | |
| DivideArmor(i32), | |
| ConnectHero(super::hero::UniqueWhereParam), | |
| DisconnectHero, | |
| } | |
| impl From<SetParam> 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::SetLevel(value) => ( | |
| level::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| ), | |
| SetParam::IncrementLevel(value) => ( | |
| level::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "increment".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DecrementLevel(value) => ( | |
| level::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "decrement".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::MultiplyLevel(value) => ( | |
| level::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "multiply".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DivideLevel(value) => ( | |
| level::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "divide".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::SetXp(value) => ( | |
| xp::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| ), | |
| SetParam::IncrementXp(value) => ( | |
| xp::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "increment".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DecrementXp(value) => ( | |
| xp::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "decrement".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::MultiplyXp(value) => ( | |
| xp::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "multiply".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DivideXp(value) => ( | |
| xp::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "divide".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::SetDamageMin(value) => ( | |
| damage_min::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| ), | |
| SetParam::IncrementDamageMin(value) => ( | |
| damage_min::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "increment".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DecrementDamageMin(value) => ( | |
| damage_min::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "decrement".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::MultiplyDamageMin(value) => ( | |
| damage_min::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "multiply".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DivideDamageMin(value) => ( | |
| damage_min::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "divide".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::SetDamageMax(value) => ( | |
| damage_max::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| ), | |
| SetParam::IncrementDamageMax(value) => ( | |
| damage_max::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "increment".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DecrementDamageMax(value) => ( | |
| damage_max::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "decrement".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::MultiplyDamageMax(value) => ( | |
| damage_max::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "multiply".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DivideDamageMax(value) => ( | |
| damage_max::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "divide".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::SetHitPoints(value) => ( | |
| hit_points::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| ), | |
| SetParam::IncrementHitPoints(value) => ( | |
| hit_points::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "increment".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DecrementHitPoints(value) => ( | |
| hit_points::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "decrement".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::MultiplyHitPoints(value) => ( | |
| hit_points::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "multiply".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DivideHitPoints(value) => ( | |
| hit_points::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "divide".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::SetMana(value) => ( | |
| mana::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| ), | |
| SetParam::IncrementMana(value) => ( | |
| mana::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "increment".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DecrementMana(value) => ( | |
| mana::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "decrement".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::MultiplyMana(value) => ( | |
| mana::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "multiply".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DivideMana(value) => ( | |
| mana::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "divide".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::SetArmor(value) => ( | |
| armor::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| ), | |
| SetParam::IncrementArmor(value) => ( | |
| armor::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "increment".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DecrementArmor(value) => ( | |
| armor::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "decrement".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::MultiplyArmor(value) => ( | |
| armor::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "multiply".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DivideArmor(value) => ( | |
| armor::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "divide".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::ConnectHero(where_param) => ( | |
| hero::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "connect".to_string(), | |
| ::prisma_client_rust::PrismaValue::Object( | |
| [where_param] | |
| .into_iter() | |
| .map(Into::<super::hero::WhereParam>::into) | |
| .map(::prisma_client_rust::WhereInput::serialize) | |
| .map(::prisma_client_rust::SerializedWhereInput::transform_equals) | |
| .collect(), | |
| ), | |
| )]), | |
| ), | |
| SetParam::DisconnectHero => ( | |
| hero::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), | |
| Level(i32), | |
| Xp(i32), | |
| DamageMin(i32), | |
| DamageMax(i32), | |
| HitPoints(i32), | |
| Mana(i32), | |
| Armor(i32), | |
| } | |
| impl From<UncheckedSetParam> for SetParam { | |
| fn from(param: UncheckedSetParam) -> Self { | |
| match param { | |
| UncheckedSetParam::Id(value) => Self::SetId(value), | |
| UncheckedSetParam::Level(value) => Self::SetLevel(value), | |
| UncheckedSetParam::Xp(value) => Self::SetXp(value), | |
| UncheckedSetParam::DamageMin(value) => Self::SetDamageMin(value), | |
| UncheckedSetParam::DamageMax(value) => Self::SetDamageMax(value), | |
| UncheckedSetParam::HitPoints(value) => Self::SetHitPoints(value), | |
| UncheckedSetParam::Mana(value) => Self::SetMana(value), | |
| UncheckedSetParam::Armor(value) => Self::SetArmor(value), | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum OrderByParam { | |
| Id(::prisma_client_rust::Direction), | |
| Level(::prisma_client_rust::Direction), | |
| Xp(::prisma_client_rust::Direction), | |
| DamageMin(::prisma_client_rust::Direction), | |
| DamageMax(::prisma_client_rust::Direction), | |
| HitPoints(::prisma_client_rust::Direction), | |
| Mana(::prisma_client_rust::Direction), | |
| Armor(::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::Level(direction) => ( | |
| level::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| Self::Xp(direction) => ( | |
| xp::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| Self::DamageMin(direction) => ( | |
| damage_min::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| Self::DamageMax(direction) => ( | |
| damage_max::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| Self::HitPoints(direction) => ( | |
| hit_points::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| Self::Mana(direction) => ( | |
| mana::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| Self::Armor(direction) => ( | |
| armor::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum WhereParam { | |
| Not(Vec<WhereParam>), | |
| Or(Vec<WhereParam>), | |
| And(Vec<WhereParam>), | |
| Id(_prisma::read_filters::StringFilter), | |
| Level(_prisma::read_filters::IntFilter), | |
| Xp(_prisma::read_filters::IntFilter), | |
| DamageMin(_prisma::read_filters::IntFilter), | |
| DamageMax(_prisma::read_filters::IntFilter), | |
| HitPoints(_prisma::read_filters::IntFilter), | |
| Mana(_prisma::read_filters::IntFilter), | |
| Armor(_prisma::read_filters::IntFilter), | |
| HeroIsNull, | |
| HeroIs(Vec<super::hero::WhereParam>), | |
| HeroIsNot(Vec<super::hero::WhereParam>), | |
| } | |
| 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::Level(value) => (level::NAME, value.into()), | |
| Self::Xp(value) => (xp::NAME, value.into()), | |
| Self::DamageMin(value) => (damage_min::NAME, value.into()), | |
| Self::DamageMax(value) => (damage_max::NAME, value.into()), | |
| Self::HitPoints(value) => (hit_points::NAME, value.into()), | |
| Self::Mana(value) => (mana::NAME, value.into()), | |
| Self::Armor(value) => (armor::NAME, value.into()), | |
| Self::HeroIsNull => ( | |
| hero::NAME, | |
| ::prisma_client_rust::SerializedWhereValue::Value( | |
| ::prisma_client_rust::PrismaValue::Null, | |
| ), | |
| ), | |
| Self::HeroIs(where_params) => ( | |
| hero::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::HeroIsNot(where_params) => ( | |
| hero::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<UniqueWhereParam> 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<Self>> for WhereParam { | |
| fn from(op: ::prisma_client_rust::Operator<Self>) -> 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(level::NAME), | |
| ::prisma_client_rust::sel(xp::NAME), | |
| ::prisma_client_rust::sel(damage_min::NAME), | |
| ::prisma_client_rust::sel(damage_max::NAME), | |
| ::prisma_client_rust::sel(hit_points::NAME), | |
| ::prisma_client_rust::sel(mana::NAME), | |
| ::prisma_client_rust::sel(armor::NAME), | |
| ] | |
| } | |
| } | |
| pub type UniqueArgs = ::prisma_client_rust::UniqueArgs<Types>; | |
| pub type ManyArgs = ::prisma_client_rust::ManyArgs<Types>; | |
| 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<WhereParam>) -> FindFirst<'a> { | |
| FindFirst::new(self.client, _where) | |
| } | |
| pub fn find_many(self, _where: Vec<WhereParam>) -> FindMany<'a> { | |
| FindMany::new(self.client, _where) | |
| } | |
| pub fn create( | |
| self, | |
| level: i32, | |
| xp: i32, | |
| damage_min: i32, | |
| damage_max: i32, | |
| hit_points: i32, | |
| mana: i32, | |
| armor: i32, | |
| mut _params: Vec<SetParam>, | |
| ) -> Create<'a> { | |
| _params.extend([ | |
| level::set(level), | |
| xp::set(xp), | |
| damage_min::set(damage_min), | |
| damage_max::set(damage_max), | |
| hit_points::set(hit_points), | |
| mana::set(mana), | |
| armor::set(armor), | |
| ]); | |
| Create::new(self.client, _params) | |
| } | |
| pub fn create_unchecked( | |
| self, | |
| level: i32, | |
| xp: i32, | |
| damage_min: i32, | |
| damage_max: i32, | |
| hit_points: i32, | |
| mana: i32, | |
| armor: i32, | |
| mut _params: Vec<UncheckedSetParam>, | |
| ) -> Create<'a> { | |
| _params.extend([ | |
| level::set(level), | |
| xp::set(xp), | |
| damage_min::set(damage_min), | |
| damage_max::set(damage_max), | |
| hit_points::set(hit_points), | |
| mana::set(mana), | |
| armor::set(armor), | |
| ]); | |
| Create::new(self.client, _params.into_iter().map(Into::into).collect()) | |
| } | |
| pub fn create_many( | |
| self, | |
| data: Vec<(i32, i32, i32, i32, i32, i32, i32, Vec<SetParam>)>, | |
| ) -> CreateMany<'a> { | |
| let data = data | |
| .into_iter() | |
| .map( | |
| |(level, xp, damage_min, damage_max, hit_points, mana, armor, mut _params)| { | |
| _params.extend([ | |
| level::set(level), | |
| xp::set(xp), | |
| damage_min::set(damage_min), | |
| damage_max::set(damage_max), | |
| hit_points::set(hit_points), | |
| mana::set(mana), | |
| armor::set(armor), | |
| ]); | |
| _params | |
| }, | |
| ) | |
| .collect(); | |
| CreateMany::new(self.client, data) | |
| } | |
| pub fn update(self, _where: UniqueWhereParam, _params: Vec<SetParam>) -> Update<'a> { | |
| Update::new(self.client, _where.into(), _params, vec![]) | |
| } | |
| pub fn update_unchecked( | |
| self, | |
| _where: UniqueWhereParam, | |
| _params: Vec<UncheckedSetParam>, | |
| ) -> Update<'a> { | |
| Update::new( | |
| self.client, | |
| _where.into(), | |
| _params.into_iter().map(Into::into).collect(), | |
| vec![], | |
| ) | |
| } | |
| pub fn update_many( | |
| self, | |
| _where: Vec<WhereParam>, | |
| _params: Vec<SetParam>, | |
| ) -> UpdateMany<'a> { | |
| UpdateMany::new(self.client, _where, _params) | |
| } | |
| pub fn upsert( | |
| self, | |
| _where: UniqueWhereParam, | |
| (level, xp, damage_min, damage_max, hit_points, mana, armor, mut _params): ( | |
| i32, | |
| i32, | |
| i32, | |
| i32, | |
| i32, | |
| i32, | |
| i32, | |
| Vec<SetParam>, | |
| ), | |
| _update: Vec<SetParam>, | |
| ) -> Upsert<'a> { | |
| _params.extend([ | |
| level::set(level), | |
| xp::set(xp), | |
| damage_min::set(damage_min), | |
| damage_max::set(damage_max), | |
| hit_points::set(hit_points), | |
| mana::set(mana), | |
| armor::set(armor), | |
| ]); | |
| 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<WhereParam>) -> DeleteMany<'a> { | |
| DeleteMany::new(self.client, _where) | |
| } | |
| pub fn count(self, _where: Vec<WhereParam>) -> Count<'a> { | |
| Count::new(self.client, _where) | |
| } | |
| } | |
| } | |
| pub mod attributes { | |
| use super::_prisma::*; | |
| use super::*; | |
| pub const NAME: &str = "Attributes"; | |
| 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<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetId(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::Id(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: String) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::Id(direction) | |
| } | |
| pub fn equals<T: From<UniqueWhereParam>>(value: String) -> T { | |
| UniqueWhereParam::IdEquals(value).into() | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::StringFilter, Id, { | |
| fn in_vec(_: Vec<String>) -> InVec; | |
| fn not_in_vec(_: Vec<String>) -> 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<super::IncludeParam> 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<super::SelectParam> 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 resilience { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "resilience"; | |
| pub struct Set(pub i32); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetResilience(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::Resilience(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: i32) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::Resilience(direction) | |
| } | |
| pub fn equals(value: i32) -> WhereParam { | |
| WhereParam::Resilience(_prisma::read_filters::IntFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!( | |
| _prisma::read_filters::IntFilter, | |
| Resilience, | |
| { | |
| fn in_vec(_: Vec<i32>) -> InVec; | |
| fn not_in_vec(_: Vec<i32>) -> 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::IncrementResilience(value) | |
| } | |
| pub fn decrement(value: i32) -> SetParam { | |
| SetParam::DecrementResilience(value) | |
| } | |
| pub fn multiply(value: i32) -> SetParam { | |
| SetParam::MultiplyResilience(value) | |
| } | |
| pub fn divide(value: i32) -> SetParam { | |
| SetParam::DivideResilience(value) | |
| } | |
| pub struct Include; | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Resilience(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Resilience(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod strength { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "strength"; | |
| pub struct Set(pub i32); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetStrength(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::Strength(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: i32) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::Strength(direction) | |
| } | |
| pub fn equals(value: i32) -> WhereParam { | |
| WhereParam::Strength(_prisma::read_filters::IntFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!( | |
| _prisma::read_filters::IntFilter, | |
| Strength, | |
| { | |
| fn in_vec(_: Vec<i32>) -> InVec; | |
| fn not_in_vec(_: Vec<i32>) -> 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::IncrementStrength(value) | |
| } | |
| pub fn decrement(value: i32) -> SetParam { | |
| SetParam::DecrementStrength(value) | |
| } | |
| pub fn multiply(value: i32) -> SetParam { | |
| SetParam::MultiplyStrength(value) | |
| } | |
| pub fn divide(value: i32) -> SetParam { | |
| SetParam::DivideStrength(value) | |
| } | |
| pub struct Include; | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Strength(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Strength(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod agility { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "agility"; | |
| pub struct Set(pub i32); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetAgility(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::Agility(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: i32) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::Agility(direction) | |
| } | |
| pub fn equals(value: i32) -> WhereParam { | |
| WhereParam::Agility(_prisma::read_filters::IntFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::IntFilter, Agility, { | |
| fn in_vec(_: Vec<i32>) -> InVec; | |
| fn not_in_vec(_: Vec<i32>) -> 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::IncrementAgility(value) | |
| } | |
| pub fn decrement(value: i32) -> SetParam { | |
| SetParam::DecrementAgility(value) | |
| } | |
| pub fn multiply(value: i32) -> SetParam { | |
| SetParam::MultiplyAgility(value) | |
| } | |
| pub fn divide(value: i32) -> SetParam { | |
| SetParam::DivideAgility(value) | |
| } | |
| pub struct Include; | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Agility(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Agility(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod intelligence { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "intelligence"; | |
| pub struct Set(pub i32); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetIntelligence(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::Intelligence(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: i32) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::Intelligence(direction) | |
| } | |
| pub fn equals(value: i32) -> WhereParam { | |
| WhereParam::Intelligence(_prisma::read_filters::IntFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!( | |
| _prisma::read_filters::IntFilter, | |
| Intelligence, | |
| { | |
| fn in_vec(_: Vec<i32>) -> InVec; | |
| fn not_in_vec(_: Vec<i32>) -> 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::IncrementIntelligence(value) | |
| } | |
| pub fn decrement(value: i32) -> SetParam { | |
| SetParam::DecrementIntelligence(value) | |
| } | |
| pub fn multiply(value: i32) -> SetParam { | |
| SetParam::MultiplyIntelligence(value) | |
| } | |
| pub fn divide(value: i32) -> SetParam { | |
| SetParam::DivideIntelligence(value) | |
| } | |
| pub struct Include; | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Intelligence(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Intelligence(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod exploration { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "exploration"; | |
| pub struct Set(pub i32); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetExploration(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::Exploration(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: i32) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::Exploration(direction) | |
| } | |
| pub fn equals(value: i32) -> WhereParam { | |
| WhereParam::Exploration(_prisma::read_filters::IntFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!( | |
| _prisma::read_filters::IntFilter, | |
| Exploration, | |
| { | |
| fn in_vec(_: Vec<i32>) -> InVec; | |
| fn not_in_vec(_: Vec<i32>) -> 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::IncrementExploration(value) | |
| } | |
| pub fn decrement(value: i32) -> SetParam { | |
| SetParam::DecrementExploration(value) | |
| } | |
| pub fn multiply(value: i32) -> SetParam { | |
| SetParam::MultiplyExploration(value) | |
| } | |
| pub fn divide(value: i32) -> SetParam { | |
| SetParam::DivideExploration(value) | |
| } | |
| pub struct Include; | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Exploration(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Exploration(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod crafting { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "crafting"; | |
| pub struct Set(pub i32); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetCrafting(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::Crafting(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: i32) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::Crafting(direction) | |
| } | |
| pub fn equals(value: i32) -> WhereParam { | |
| WhereParam::Crafting(_prisma::read_filters::IntFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!( | |
| _prisma::read_filters::IntFilter, | |
| Crafting, | |
| { | |
| fn in_vec(_: Vec<i32>) -> InVec; | |
| fn not_in_vec(_: Vec<i32>) -> 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::IncrementCrafting(value) | |
| } | |
| pub fn decrement(value: i32) -> SetParam { | |
| SetParam::DecrementCrafting(value) | |
| } | |
| pub fn multiply(value: i32) -> SetParam { | |
| SetParam::MultiplyCrafting(value) | |
| } | |
| pub fn divide(value: i32) -> SetParam { | |
| SetParam::DivideCrafting(value) | |
| } | |
| pub struct Include; | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Crafting(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Crafting(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod hero { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "Hero"; | |
| pub struct Fetch(pub hero::UniqueArgs); | |
| impl Fetch { | |
| pub fn with(mut self, params: impl Into<hero::WithParam>) -> Self { | |
| self.0 = self.0.with(params.into()); | |
| self | |
| } | |
| } | |
| impl From<Fetch> for WithParam { | |
| fn from(Fetch(v): Fetch) -> Self { | |
| WithParam::Hero(v) | |
| } | |
| } | |
| pub fn fetch() -> Fetch { | |
| Fetch(hero::UniqueArgs::new()) | |
| } | |
| pub struct Connect(hero::UniqueWhereParam); | |
| impl From<Connect> for SetParam { | |
| fn from(Connect(v): Connect) -> Self { | |
| Self::ConnectHero(v) | |
| } | |
| } | |
| pub fn connect<T: From<Connect>>(value: hero::UniqueWhereParam) -> T { | |
| Connect(value).into() | |
| } | |
| pub fn disconnect() -> SetParam { | |
| SetParam::DisconnectHero | |
| } | |
| pub fn is_null() -> WhereParam { | |
| WhereParam::HeroIsNull | |
| } | |
| pub fn is(value: Vec<hero::WhereParam>) -> WhereParam { | |
| WhereParam::HeroIs(value) | |
| } | |
| pub fn is_not(value: Vec<hero::WhereParam>) -> WhereParam { | |
| WhereParam::HeroIsNot(value) | |
| } | |
| pub enum Include { | |
| Select(Vec<hero::SelectParam>), | |
| Include(Vec<hero::IncludeParam>), | |
| Fetch, | |
| } | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Hero(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 = | |
| <hero::Types as ::prisma_client_rust::ModelTypes>::scalar_selections(); | |
| nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); | |
| nested_selections | |
| } | |
| Self::Fetch => { | |
| <hero::Types as ::prisma_client_rust::ModelTypes>::scalar_selections() | |
| } | |
| }; | |
| ::prisma_client_rust::Selection::new("Hero", None, [], selections) | |
| } | |
| pub fn select(nested_selections: Vec<hero::SelectParam>) -> Self { | |
| Self::Select(nested_selections) | |
| } | |
| pub fn include(nested_selections: Vec<hero::IncludeParam>) -> Self { | |
| Self::Include(nested_selections) | |
| } | |
| } | |
| pub enum Select { | |
| Select(Vec<hero::SelectParam>), | |
| Include(Vec<hero::IncludeParam>), | |
| Fetch, | |
| } | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Hero(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 => { | |
| <hero::Types as ::prisma_client_rust::ModelTypes>::scalar_selections() | |
| } | |
| }; | |
| ::prisma_client_rust::Selection::new("Hero", None, [], selections) | |
| } | |
| pub fn select(nested_selections: Vec<hero::SelectParam>) -> Self { | |
| Self::Select(nested_selections) | |
| } | |
| pub fn include(nested_selections: Vec<hero::IncludeParam>) -> Self { | |
| Self::Include(nested_selections) | |
| } | |
| } | |
| } | |
| pub mod follower { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "Follower"; | |
| pub struct Fetch(pub follower::ManyArgs); | |
| impl Fetch { | |
| pub fn with(mut self, params: impl Into<follower::WithParam>) -> Self { | |
| self.0 = self.0.with(params.into()); | |
| self | |
| } | |
| pub fn order_by(mut self, param: follower::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: follower::UniqueWhereParam) -> Self { | |
| self.0 = self.0.cursor(value.into()); | |
| self | |
| } | |
| } | |
| impl From<Fetch> for WithParam { | |
| fn from(Fetch(v): Fetch) -> Self { | |
| WithParam::Follower(v) | |
| } | |
| } | |
| pub fn fetch(params: Vec<follower::WhereParam>) -> Fetch { | |
| Fetch(follower::ManyArgs::new(params)) | |
| } | |
| pub struct Connect(pub Vec<follower::UniqueWhereParam>); | |
| impl From<Connect> for SetParam { | |
| fn from(Connect(v): Connect) -> Self { | |
| Self::ConnectFollower(v) | |
| } | |
| } | |
| pub fn connect<T: From<Connect>>(params: Vec<follower::UniqueWhereParam>) -> T { | |
| Connect(params).into() | |
| } | |
| pub fn disconnect(params: Vec<follower::UniqueWhereParam>) -> SetParam { | |
| SetParam::DisconnectFollower(params) | |
| } | |
| pub fn set(params: Vec<follower::UniqueWhereParam>) -> SetParam { | |
| SetParam::SetFollower(params) | |
| } | |
| pub fn some(value: Vec<follower::WhereParam>) -> WhereParam { | |
| WhereParam::FollowerSome(value) | |
| } | |
| pub fn every(value: Vec<follower::WhereParam>) -> WhereParam { | |
| WhereParam::FollowerEvery(value) | |
| } | |
| pub fn none(value: Vec<follower::WhereParam>) -> WhereParam { | |
| WhereParam::FollowerNone(value) | |
| } | |
| pub enum Include { | |
| Select(follower::ManyArgs, Vec<follower::SelectParam>), | |
| Include(follower::ManyArgs, Vec<follower::IncludeParam>), | |
| Fetch(follower::ManyArgs), | |
| } | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Follower(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 = < follower :: 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, | |
| <follower::Types as ::prisma_client_rust::ModelTypes>::scalar_selections(), | |
| ), | |
| }; | |
| ::prisma_client_rust::Selection::new(NAME, None, args, selections) | |
| } | |
| pub fn select( | |
| args: follower::ManyArgs, | |
| nested_selections: Vec<follower::SelectParam>, | |
| ) -> Self { | |
| Self::Select(args, nested_selections) | |
| } | |
| pub fn include( | |
| args: follower::ManyArgs, | |
| nested_selections: Vec<follower::IncludeParam>, | |
| ) -> Self { | |
| Self::Include(args, nested_selections) | |
| } | |
| } | |
| pub enum Select { | |
| Select(follower::ManyArgs, Vec<follower::SelectParam>), | |
| Include(follower::ManyArgs, Vec<follower::IncludeParam>), | |
| Fetch(follower::ManyArgs), | |
| } | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Follower(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, | |
| <follower::Types as ::prisma_client_rust::ModelTypes>::scalar_selections(), | |
| ), | |
| }; | |
| ::prisma_client_rust::Selection::new(NAME, None, args, selections) | |
| } | |
| pub fn select( | |
| args: follower::ManyArgs, | |
| nested_selections: Vec<follower::SelectParam>, | |
| ) -> Self { | |
| Self::Select(args, nested_selections) | |
| } | |
| pub fn include( | |
| args: follower::ManyArgs, | |
| nested_selections: Vec<follower::IncludeParam>, | |
| ) -> Self { | |
| Self::Include(args, nested_selections) | |
| } | |
| } | |
| } | |
| pub fn create( | |
| resilience: i32, | |
| strength: i32, | |
| agility: i32, | |
| intelligence: i32, | |
| exploration: i32, | |
| crafting: i32, | |
| _params: Vec<SetParam>, | |
| ) -> (i32, i32, i32, i32, i32, i32, Vec<SetParam>) { | |
| ( | |
| resilience, | |
| strength, | |
| agility, | |
| intelligence, | |
| exploration, | |
| crafting, | |
| _params, | |
| ) | |
| } | |
| pub fn create_unchecked( | |
| resilience: i32, | |
| strength: i32, | |
| agility: i32, | |
| intelligence: i32, | |
| exploration: i32, | |
| crafting: i32, | |
| _params: Vec<SetParam>, | |
| ) -> (i32, i32, i32, i32, i32, i32, Vec<SetParam>) { | |
| ( | |
| resilience, | |
| strength, | |
| agility, | |
| intelligence, | |
| exploration, | |
| crafting, | |
| _params, | |
| ) | |
| } | |
| #[macro_export] | |
| macro_rules ! _select_attributes { ($ (($ ($ 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 :: attributes :: 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 :: attributes :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: attributes :: 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 :: attributes :: 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 :: attributes :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: attributes :: 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 , resilience , strength , agility , intelligence , exploration , crafting , hero , follower } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { $ (pub $ field : crate :: prisma :: attributes :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } 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 :: attributes :: $ 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 :: attributes :: $ 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 :: attributes :: $ 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 :: attributes :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: attributes :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "resilience" , "strength" , "agility" , "intelligence" , "exploration" , "crafting" , "Hero" , "Follower"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: attributes :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { String } ; (@ field_type ; resilience) => { i32 } ; (@ field_type ; strength) => { i32 } ; (@ field_type ; agility) => { i32 } ; (@ field_type ; intelligence) => { i32 } ; (@ field_type ; exploration) => { i32 } ; (@ field_type ; crafting) => { i32 } ; (@ field_type ; hero : $ selection_mode : ident { $ ($ selections : tt) + }) => { Option < hero :: Data > } ; (@ field_type ; hero) => { Option < crate :: prisma :: hero :: Data > } ; (@ field_type ; follower : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < follower :: Data > } ; (@ field_type ; follower) => { Vec < crate :: prisma :: follower :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Attributes" , available relations are "id, resilience, strength, agility, intelligence, exploration, crafting, hero, follower")) } ; (@ field_module ; hero : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: hero :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; follower : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: follower :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: attributes :: SelectParam > :: into (crate :: prisma :: attributes :: id :: Select) } ; (@ selection_field_to_selection_param ; resilience) => { Into :: < crate :: prisma :: attributes :: SelectParam > :: into (crate :: prisma :: attributes :: resilience :: Select) } ; (@ selection_field_to_selection_param ; strength) => { Into :: < crate :: prisma :: attributes :: SelectParam > :: into (crate :: prisma :: attributes :: strength :: Select) } ; (@ selection_field_to_selection_param ; agility) => { Into :: < crate :: prisma :: attributes :: SelectParam > :: into (crate :: prisma :: attributes :: agility :: Select) } ; (@ selection_field_to_selection_param ; intelligence) => { Into :: < crate :: prisma :: attributes :: SelectParam > :: into (crate :: prisma :: attributes :: intelligence :: Select) } ; (@ selection_field_to_selection_param ; exploration) => { Into :: < crate :: prisma :: attributes :: SelectParam > :: into (crate :: prisma :: attributes :: exploration :: Select) } ; (@ selection_field_to_selection_param ; crafting) => { Into :: < crate :: prisma :: attributes :: SelectParam > :: into (crate :: prisma :: attributes :: crafting :: Select) } ; (@ selection_field_to_selection_param ; hero $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: attributes :: SelectParam > :: into (crate :: prisma :: attributes :: hero :: Select :: $ selection_mode (crate :: prisma :: hero :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; hero $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: attributes :: SelectParam > :: into (crate :: prisma :: attributes :: hero :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; follower $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: attributes :: SelectParam > :: into (crate :: prisma :: attributes :: follower :: Select :: $ selection_mode (crate :: prisma :: follower :: ManyArgs :: new (crate :: prisma :: follower :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: follower :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; follower $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: attributes :: SelectParam > :: into (crate :: prisma :: attributes :: follower :: Select :: Fetch (crate :: prisma :: follower :: ManyArgs :: new (crate :: prisma :: follower :: 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 :: attributes :: $ 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 ; resilience) => { "resilience" } ; (@ field_serde_name ; strength) => { "strength" } ; (@ field_serde_name ; agility) => { "agility" } ; (@ field_serde_name ; intelligence) => { "intelligence" } ; (@ field_serde_name ; exploration) => { "exploration" } ; (@ field_serde_name ; crafting) => { "crafting" } ; (@ field_serde_name ; hero) => { "Hero" } ; (@ field_serde_name ; follower) => { "Follower" } ; } | |
| pub use _select_attributes as select; | |
| pub enum SelectParam { | |
| Id(id::Select), | |
| Resilience(resilience::Select), | |
| Strength(strength::Select), | |
| Agility(agility::Select), | |
| Intelligence(intelligence::Select), | |
| Exploration(exploration::Select), | |
| Crafting(crafting::Select), | |
| Hero(hero::Select), | |
| Follower(follower::Select), | |
| } | |
| impl SelectParam { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::Id(data) => data.to_selection(), | |
| Self::Resilience(data) => data.to_selection(), | |
| Self::Strength(data) => data.to_selection(), | |
| Self::Agility(data) => data.to_selection(), | |
| Self::Intelligence(data) => data.to_selection(), | |
| Self::Exploration(data) => data.to_selection(), | |
| Self::Crafting(data) => data.to_selection(), | |
| Self::Hero(data) => data.to_selection(), | |
| Self::Follower(data) => data.to_selection(), | |
| } | |
| } | |
| } | |
| #[macro_export] | |
| macro_rules ! _include_attributes { ($ (($ ($ 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 :: attributes :: 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 :: attributes :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: attributes :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: attributes :: 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 :: attributes :: 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 :: attributes :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: attributes :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: attributes :: 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 { hero , follower } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { pub id : String , pub resilience : i32 , pub strength : i32 , pub agility : i32 , pub intelligence : i32 , pub exploration : i32 , pub crafting : i32 , $ (pub $ field : crate :: prisma :: attributes :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } 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 ! (resilience) , stringify ! (strength) , stringify ! (agility) , stringify ! (intelligence) , stringify ! (exploration) , stringify ! (crafting)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: attributes :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: attributes :: id :: NAME , & self . id) ? ; state . serialize_field (crate :: prisma :: attributes :: resilience :: NAME , & self . resilience) ? ; state . serialize_field (crate :: prisma :: attributes :: strength :: NAME , & self . strength) ? ; state . serialize_field (crate :: prisma :: attributes :: agility :: NAME , & self . agility) ? ; state . serialize_field (crate :: prisma :: attributes :: intelligence :: NAME , & self . intelligence) ? ; state . serialize_field (crate :: prisma :: attributes :: exploration :: NAME , & self . exploration) ? ; state . serialize_field (crate :: prisma :: attributes :: crafting :: NAME , & self . crafting) ? ; 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 , resilience , strength , agility , intelligence , exploration , crafting } 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 :: attributes :: $ field :: NAME) , + , crate :: prisma :: attributes :: id :: NAME , crate :: prisma :: attributes :: resilience :: NAME , crate :: prisma :: attributes :: strength :: NAME , crate :: prisma :: attributes :: agility :: NAME , crate :: prisma :: attributes :: intelligence :: NAME , crate :: prisma :: attributes :: exploration :: NAME , crate :: prisma :: attributes :: crafting :: 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 :: attributes :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: attributes :: id :: NAME => Ok (Field :: id) , crate :: prisma :: attributes :: resilience :: NAME => Ok (Field :: resilience) , crate :: prisma :: attributes :: strength :: NAME => Ok (Field :: strength) , crate :: prisma :: attributes :: agility :: NAME => Ok (Field :: agility) , crate :: prisma :: attributes :: intelligence :: NAME => Ok (Field :: intelligence) , crate :: prisma :: attributes :: exploration :: NAME => Ok (Field :: exploration) , crate :: prisma :: attributes :: crafting :: NAME => Ok (Field :: crafting) , _ => 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 resilience = None ; let mut strength = None ; let mut agility = None ; let mut intelligence = None ; let mut exploration = None ; let mut crafting = 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 :: attributes :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } Field :: resilience => { if resilience . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: attributes :: resilience :: NAME)) ; } resilience = Some (map . next_value () ?) ; } Field :: strength => { if strength . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: attributes :: strength :: NAME)) ; } strength = Some (map . next_value () ?) ; } Field :: agility => { if agility . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: attributes :: agility :: NAME)) ; } agility = Some (map . next_value () ?) ; } Field :: intelligence => { if intelligence . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: attributes :: intelligence :: NAME)) ; } intelligence = Some (map . next_value () ?) ; } Field :: exploration => { if exploration . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: attributes :: exploration :: NAME)) ; } exploration = Some (map . next_value () ?) ; } Field :: crafting => { if crafting . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: attributes :: crafting :: NAME)) ; } crafting = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: attributes :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: attributes :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: attributes :: id :: NAME)) ? ; let resilience = resilience . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: attributes :: resilience :: NAME)) ? ; let strength = strength . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: attributes :: strength :: NAME)) ? ; let agility = agility . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: attributes :: agility :: NAME)) ? ; let intelligence = intelligence . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: attributes :: intelligence :: NAME)) ? ; let exploration = exploration . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: attributes :: exploration :: NAME)) ? ; let crafting = crafting . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: attributes :: crafting :: NAME)) ? ; Ok (Data { id , resilience , strength , agility , intelligence , exploration , crafting , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "resilience" , "strength" , "agility" , "intelligence" , "exploration" , "crafting" , "Hero" , "Follower"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: attributes :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; hero : $ selection_mode : ident { $ ($ selections : tt) + }) => { Option < hero :: Data > } ; (@ field_type ; hero) => { Option < crate :: prisma :: hero :: Data > } ; (@ field_type ; follower : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < follower :: Data > } ; (@ field_type ; follower) => { Vec < crate :: prisma :: follower :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Attributes" , available relations are "hero, follower")) } ; (@ field_module ; hero : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: hero :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; follower : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: follower :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; hero $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: attributes :: IncludeParam > :: into (crate :: prisma :: attributes :: hero :: Include :: $ selection_mode (crate :: prisma :: hero :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; hero $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: attributes :: IncludeParam > :: into (crate :: prisma :: attributes :: hero :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; follower $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: attributes :: IncludeParam > :: into (crate :: prisma :: attributes :: follower :: Include :: $ selection_mode (crate :: prisma :: follower :: ManyArgs :: new (crate :: prisma :: follower :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: follower :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; follower $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: attributes :: IncludeParam > :: into (crate :: prisma :: attributes :: follower :: Include :: Fetch (crate :: prisma :: follower :: ManyArgs :: new (crate :: prisma :: follower :: 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 :: attributes :: $ 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 ; resilience) => { "resilience" } ; (@ field_serde_name ; strength) => { "strength" } ; (@ field_serde_name ; agility) => { "agility" } ; (@ field_serde_name ; intelligence) => { "intelligence" } ; (@ field_serde_name ; exploration) => { "exploration" } ; (@ field_serde_name ; crafting) => { "crafting" } ; (@ field_serde_name ; hero) => { "Hero" } ; (@ field_serde_name ; follower) => { "Follower" } ; } | |
| pub use _include_attributes as include; | |
| pub enum IncludeParam { | |
| Id(id::Include), | |
| Resilience(resilience::Include), | |
| Strength(strength::Include), | |
| Agility(agility::Include), | |
| Intelligence(intelligence::Include), | |
| Exploration(exploration::Include), | |
| Crafting(crafting::Include), | |
| Hero(hero::Include), | |
| Follower(follower::Include), | |
| } | |
| impl IncludeParam { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::Id(data) => data.to_selection(), | |
| Self::Resilience(data) => data.to_selection(), | |
| Self::Strength(data) => data.to_selection(), | |
| Self::Agility(data) => data.to_selection(), | |
| Self::Intelligence(data) => data.to_selection(), | |
| Self::Exploration(data) => data.to_selection(), | |
| Self::Crafting(data) => data.to_selection(), | |
| Self::Hero(data) => data.to_selection(), | |
| Self::Follower(data) => data.to_selection(), | |
| } | |
| } | |
| } | |
| #[macro_export] | |
| macro_rules ! _partial_unchecked_attributes { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: attributes struct $ struct_name { # [serde (rename = "id")] pub id : String , # [serde (rename = "resilience")] pub resilience : i32 , # [serde (rename = "strength")] pub strength : i32 , # [serde (rename = "agility")] pub agility : i32 , # [serde (rename = "intelligence")] pub intelligence : i32 , # [serde (rename = "exploration")] pub exploration : i32 , # [serde (rename = "crafting")] pub crafting : i32 } [$ ($ scalar_field) , +] } } ; } | |
| pub use _partial_unchecked_attributes as partial_unchecked; | |
| #[derive(Debug, Clone, :: serde :: Serialize, :: serde :: Deserialize)] | |
| pub struct Data { | |
| #[serde(rename = "id")] | |
| pub id: String, | |
| #[serde(rename = "resilience")] | |
| pub resilience: i32, | |
| #[serde(rename = "strength")] | |
| pub strength: i32, | |
| #[serde(rename = "agility")] | |
| pub agility: i32, | |
| #[serde(rename = "intelligence")] | |
| pub intelligence: i32, | |
| #[serde(rename = "exploration")] | |
| pub exploration: i32, | |
| #[serde(rename = "crafting")] | |
| pub crafting: i32, | |
| #[serde( | |
| rename = "Hero", | |
| default, | |
| skip_serializing_if = "Option::is_none", | |
| with = "prisma_client_rust::serde::double_option" | |
| )] | |
| pub hero: Option<Option<Box<super::hero::Data>>>, | |
| #[serde(rename = "Follower")] | |
| pub follower: Option<Vec<super::follower::Data>>, | |
| } | |
| impl Data { | |
| pub fn hero( | |
| &self, | |
| ) -> Result<Option<&super::hero::Data>, ::prisma_client_rust::RelationNotFetchedError> | |
| { | |
| self.hero | |
| .as_ref() | |
| .ok_or(::prisma_client_rust::RelationNotFetchedError::new( | |
| stringify!(hero), | |
| )) | |
| .map(|v| v.as_ref().map(|v| v.as_ref())) | |
| } | |
| pub fn follower( | |
| &self, | |
| ) -> Result<&Vec<super::follower::Data>, ::prisma_client_rust::RelationNotFetchedError> | |
| { | |
| self.follower | |
| .as_ref() | |
| .ok_or(::prisma_client_rust::RelationNotFetchedError::new( | |
| stringify!(follower), | |
| )) | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum WithParam { | |
| Hero(super::hero::UniqueArgs), | |
| Follower(super::follower::ManyArgs), | |
| } | |
| impl Into<::prisma_client_rust::Selection> for WithParam { | |
| fn into(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::Hero(args) => { | |
| let mut selections = | |
| <super::hero::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(hero::NAME, None, [], selections) | |
| } | |
| Self::Follower(args) => { | |
| let (arguments, mut nested_selections) = args.to_graphql(); | |
| nested_selections . extend (< super :: follower :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) ; | |
| ::prisma_client_rust::Selection::new( | |
| follower::NAME, | |
| None, | |
| arguments, | |
| nested_selections, | |
| ) | |
| } | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum SetParam { | |
| SetId(String), | |
| SetResilience(i32), | |
| IncrementResilience(i32), | |
| DecrementResilience(i32), | |
| MultiplyResilience(i32), | |
| DivideResilience(i32), | |
| SetStrength(i32), | |
| IncrementStrength(i32), | |
| DecrementStrength(i32), | |
| MultiplyStrength(i32), | |
| DivideStrength(i32), | |
| SetAgility(i32), | |
| IncrementAgility(i32), | |
| DecrementAgility(i32), | |
| MultiplyAgility(i32), | |
| DivideAgility(i32), | |
| SetIntelligence(i32), | |
| IncrementIntelligence(i32), | |
| DecrementIntelligence(i32), | |
| MultiplyIntelligence(i32), | |
| DivideIntelligence(i32), | |
| SetExploration(i32), | |
| IncrementExploration(i32), | |
| DecrementExploration(i32), | |
| MultiplyExploration(i32), | |
| DivideExploration(i32), | |
| SetCrafting(i32), | |
| IncrementCrafting(i32), | |
| DecrementCrafting(i32), | |
| MultiplyCrafting(i32), | |
| DivideCrafting(i32), | |
| ConnectHero(super::hero::UniqueWhereParam), | |
| DisconnectHero, | |
| ConnectFollower(Vec<super::follower::UniqueWhereParam>), | |
| DisconnectFollower(Vec<super::follower::UniqueWhereParam>), | |
| SetFollower(Vec<super::follower::UniqueWhereParam>), | |
| } | |
| impl From<SetParam> 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::SetResilience(value) => ( | |
| resilience::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| ), | |
| SetParam::IncrementResilience(value) => ( | |
| resilience::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "increment".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DecrementResilience(value) => ( | |
| resilience::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "decrement".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::MultiplyResilience(value) => ( | |
| resilience::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "multiply".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DivideResilience(value) => ( | |
| resilience::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "divide".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::SetStrength(value) => ( | |
| strength::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| ), | |
| SetParam::IncrementStrength(value) => ( | |
| strength::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "increment".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DecrementStrength(value) => ( | |
| strength::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "decrement".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::MultiplyStrength(value) => ( | |
| strength::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "multiply".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DivideStrength(value) => ( | |
| strength::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "divide".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::SetAgility(value) => ( | |
| agility::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| ), | |
| SetParam::IncrementAgility(value) => ( | |
| agility::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "increment".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DecrementAgility(value) => ( | |
| agility::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "decrement".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::MultiplyAgility(value) => ( | |
| agility::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "multiply".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DivideAgility(value) => ( | |
| agility::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "divide".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::SetIntelligence(value) => ( | |
| intelligence::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| ), | |
| SetParam::IncrementIntelligence(value) => ( | |
| intelligence::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "increment".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DecrementIntelligence(value) => ( | |
| intelligence::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "decrement".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::MultiplyIntelligence(value) => ( | |
| intelligence::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "multiply".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DivideIntelligence(value) => ( | |
| intelligence::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "divide".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::SetExploration(value) => ( | |
| exploration::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| ), | |
| SetParam::IncrementExploration(value) => ( | |
| exploration::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "increment".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DecrementExploration(value) => ( | |
| exploration::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "decrement".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::MultiplyExploration(value) => ( | |
| exploration::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "multiply".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DivideExploration(value) => ( | |
| exploration::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "divide".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::SetCrafting(value) => ( | |
| crafting::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| ), | |
| SetParam::IncrementCrafting(value) => ( | |
| crafting::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "increment".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DecrementCrafting(value) => ( | |
| crafting::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "decrement".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::MultiplyCrafting(value) => ( | |
| crafting::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "multiply".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DivideCrafting(value) => ( | |
| crafting::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "divide".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::ConnectHero(where_param) => ( | |
| hero::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "connect".to_string(), | |
| ::prisma_client_rust::PrismaValue::Object( | |
| [where_param] | |
| .into_iter() | |
| .map(Into::<super::hero::WhereParam>::into) | |
| .map(::prisma_client_rust::WhereInput::serialize) | |
| .map(::prisma_client_rust::SerializedWhereInput::transform_equals) | |
| .collect(), | |
| ), | |
| )]), | |
| ), | |
| SetParam::DisconnectHero => ( | |
| hero::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "disconnect".to_string(), | |
| ::prisma_client_rust::PrismaValue::Boolean(true), | |
| )]), | |
| ), | |
| SetParam::ConnectFollower(where_params) => ( | |
| follower::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "connect".to_string(), | |
| ::prisma_client_rust::PrismaValue::List( | |
| where_params | |
| .into_iter() | |
| .map(Into::<super::follower::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::DisconnectFollower(where_params) => ( | |
| follower::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "disconnect".to_string(), | |
| ::prisma_client_rust::PrismaValue::List( | |
| where_params | |
| .into_iter() | |
| .map(Into::<super::follower::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::SetFollower(where_params) => ( | |
| follower::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "set".to_string(), | |
| ::prisma_client_rust::PrismaValue::List( | |
| where_params | |
| .into_iter() | |
| .map(Into::<super::follower::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(), | |
| ), | |
| )]), | |
| ), | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum UncheckedSetParam { | |
| Id(String), | |
| Resilience(i32), | |
| Strength(i32), | |
| Agility(i32), | |
| Intelligence(i32), | |
| Exploration(i32), | |
| Crafting(i32), | |
| } | |
| impl From<UncheckedSetParam> for SetParam { | |
| fn from(param: UncheckedSetParam) -> Self { | |
| match param { | |
| UncheckedSetParam::Id(value) => Self::SetId(value), | |
| UncheckedSetParam::Resilience(value) => Self::SetResilience(value), | |
| UncheckedSetParam::Strength(value) => Self::SetStrength(value), | |
| UncheckedSetParam::Agility(value) => Self::SetAgility(value), | |
| UncheckedSetParam::Intelligence(value) => Self::SetIntelligence(value), | |
| UncheckedSetParam::Exploration(value) => Self::SetExploration(value), | |
| UncheckedSetParam::Crafting(value) => Self::SetCrafting(value), | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum OrderByParam { | |
| Id(::prisma_client_rust::Direction), | |
| Resilience(::prisma_client_rust::Direction), | |
| Strength(::prisma_client_rust::Direction), | |
| Agility(::prisma_client_rust::Direction), | |
| Intelligence(::prisma_client_rust::Direction), | |
| Exploration(::prisma_client_rust::Direction), | |
| Crafting(::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::Resilience(direction) => ( | |
| resilience::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| Self::Strength(direction) => ( | |
| strength::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| Self::Agility(direction) => ( | |
| agility::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| Self::Intelligence(direction) => ( | |
| intelligence::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| Self::Exploration(direction) => ( | |
| exploration::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| Self::Crafting(direction) => ( | |
| crafting::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum WhereParam { | |
| Not(Vec<WhereParam>), | |
| Or(Vec<WhereParam>), | |
| And(Vec<WhereParam>), | |
| Id(_prisma::read_filters::StringFilter), | |
| Resilience(_prisma::read_filters::IntFilter), | |
| Strength(_prisma::read_filters::IntFilter), | |
| Agility(_prisma::read_filters::IntFilter), | |
| Intelligence(_prisma::read_filters::IntFilter), | |
| Exploration(_prisma::read_filters::IntFilter), | |
| Crafting(_prisma::read_filters::IntFilter), | |
| HeroIsNull, | |
| HeroIs(Vec<super::hero::WhereParam>), | |
| HeroIsNot(Vec<super::hero::WhereParam>), | |
| FollowerSome(Vec<super::follower::WhereParam>), | |
| FollowerEvery(Vec<super::follower::WhereParam>), | |
| FollowerNone(Vec<super::follower::WhereParam>), | |
| } | |
| 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::Resilience(value) => (resilience::NAME, value.into()), | |
| Self::Strength(value) => (strength::NAME, value.into()), | |
| Self::Agility(value) => (agility::NAME, value.into()), | |
| Self::Intelligence(value) => (intelligence::NAME, value.into()), | |
| Self::Exploration(value) => (exploration::NAME, value.into()), | |
| Self::Crafting(value) => (crafting::NAME, value.into()), | |
| Self::HeroIsNull => ( | |
| hero::NAME, | |
| ::prisma_client_rust::SerializedWhereValue::Value( | |
| ::prisma_client_rust::PrismaValue::Null, | |
| ), | |
| ), | |
| Self::HeroIs(where_params) => ( | |
| hero::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::HeroIsNot(where_params) => ( | |
| hero::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::FollowerSome(where_params) => ( | |
| follower::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::FollowerEvery(where_params) => ( | |
| follower::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::FollowerNone(where_params) => ( | |
| follower::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(String), | |
| } | |
| impl From<UniqueWhereParam> 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<Self>> for WhereParam { | |
| fn from(op: ::prisma_client_rust::Operator<Self>) -> 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(resilience::NAME), | |
| ::prisma_client_rust::sel(strength::NAME), | |
| ::prisma_client_rust::sel(agility::NAME), | |
| ::prisma_client_rust::sel(intelligence::NAME), | |
| ::prisma_client_rust::sel(exploration::NAME), | |
| ::prisma_client_rust::sel(crafting::NAME), | |
| ] | |
| } | |
| } | |
| pub type UniqueArgs = ::prisma_client_rust::UniqueArgs<Types>; | |
| pub type ManyArgs = ::prisma_client_rust::ManyArgs<Types>; | |
| 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<WhereParam>) -> FindFirst<'a> { | |
| FindFirst::new(self.client, _where) | |
| } | |
| pub fn find_many(self, _where: Vec<WhereParam>) -> FindMany<'a> { | |
| FindMany::new(self.client, _where) | |
| } | |
| pub fn create( | |
| self, | |
| resilience: i32, | |
| strength: i32, | |
| agility: i32, | |
| intelligence: i32, | |
| exploration: i32, | |
| crafting: i32, | |
| mut _params: Vec<SetParam>, | |
| ) -> Create<'a> { | |
| _params.extend([ | |
| resilience::set(resilience), | |
| strength::set(strength), | |
| agility::set(agility), | |
| intelligence::set(intelligence), | |
| exploration::set(exploration), | |
| crafting::set(crafting), | |
| ]); | |
| Create::new(self.client, _params) | |
| } | |
| pub fn create_unchecked( | |
| self, | |
| resilience: i32, | |
| strength: i32, | |
| agility: i32, | |
| intelligence: i32, | |
| exploration: i32, | |
| crafting: i32, | |
| mut _params: Vec<UncheckedSetParam>, | |
| ) -> Create<'a> { | |
| _params.extend([ | |
| resilience::set(resilience), | |
| strength::set(strength), | |
| agility::set(agility), | |
| intelligence::set(intelligence), | |
| exploration::set(exploration), | |
| crafting::set(crafting), | |
| ]); | |
| Create::new(self.client, _params.into_iter().map(Into::into).collect()) | |
| } | |
| pub fn create_many( | |
| self, | |
| data: Vec<(i32, i32, i32, i32, i32, i32, Vec<SetParam>)>, | |
| ) -> CreateMany<'a> { | |
| let data = data | |
| .into_iter() | |
| .map( | |
| |( | |
| resilience, | |
| strength, | |
| agility, | |
| intelligence, | |
| exploration, | |
| crafting, | |
| mut _params, | |
| )| { | |
| _params.extend([ | |
| resilience::set(resilience), | |
| strength::set(strength), | |
| agility::set(agility), | |
| intelligence::set(intelligence), | |
| exploration::set(exploration), | |
| crafting::set(crafting), | |
| ]); | |
| _params | |
| }, | |
| ) | |
| .collect(); | |
| CreateMany::new(self.client, data) | |
| } | |
| pub fn update(self, _where: UniqueWhereParam, _params: Vec<SetParam>) -> Update<'a> { | |
| Update::new(self.client, _where.into(), _params, vec![]) | |
| } | |
| pub fn update_unchecked( | |
| self, | |
| _where: UniqueWhereParam, | |
| _params: Vec<UncheckedSetParam>, | |
| ) -> Update<'a> { | |
| Update::new( | |
| self.client, | |
| _where.into(), | |
| _params.into_iter().map(Into::into).collect(), | |
| vec![], | |
| ) | |
| } | |
| pub fn update_many( | |
| self, | |
| _where: Vec<WhereParam>, | |
| _params: Vec<SetParam>, | |
| ) -> UpdateMany<'a> { | |
| UpdateMany::new(self.client, _where, _params) | |
| } | |
| pub fn upsert( | |
| self, | |
| _where: UniqueWhereParam, | |
| (resilience, strength, agility, intelligence, exploration, crafting, mut _params): ( | |
| i32, | |
| i32, | |
| i32, | |
| i32, | |
| i32, | |
| i32, | |
| Vec<SetParam>, | |
| ), | |
| _update: Vec<SetParam>, | |
| ) -> Upsert<'a> { | |
| _params.extend([ | |
| resilience::set(resilience), | |
| strength::set(strength), | |
| agility::set(agility), | |
| intelligence::set(intelligence), | |
| exploration::set(exploration), | |
| crafting::set(crafting), | |
| ]); | |
| 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<WhereParam>) -> DeleteMany<'a> { | |
| DeleteMany::new(self.client, _where) | |
| } | |
| pub fn count(self, _where: Vec<WhereParam>) -> Count<'a> { | |
| Count::new(self.client, _where) | |
| } | |
| } | |
| } | |
| pub mod retinue_slot { | |
| use super::_prisma::*; | |
| use super::*; | |
| pub const NAME: &str = "RetinueSlot"; | |
| 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<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetId(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::Id(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: String) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::Id(direction) | |
| } | |
| pub fn equals<T: From<UniqueWhereParam>>(value: String) -> T { | |
| UniqueWhereParam::IdEquals(value).into() | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::StringFilter, Id, { | |
| fn in_vec(_: Vec<String>) -> InVec; | |
| fn not_in_vec(_: Vec<String>) -> 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<super::IncludeParam> 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<super::SelectParam> 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 slot_type { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "slotType"; | |
| pub struct Set(pub String); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetSlotType(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SlotType(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: String) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::SlotType(direction) | |
| } | |
| pub fn equals(value: String) -> WhereParam { | |
| WhereParam::SlotType(_prisma::read_filters::StringFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!( | |
| _prisma::read_filters::StringFilter, | |
| SlotType, | |
| { | |
| fn in_vec(_: Vec<String>) -> InVec; | |
| fn not_in_vec(_: Vec<String>) -> 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<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::SlotType(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::SlotType(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod hero_id { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "HeroId"; | |
| pub struct Set(pub String); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetHeroId(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::HeroId(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: String) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::HeroId(direction) | |
| } | |
| pub fn equals(value: String) -> WhereParam { | |
| WhereParam::HeroId(_prisma::read_filters::StringFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!( | |
| _prisma::read_filters::StringFilter, | |
| HeroId, | |
| { | |
| fn in_vec(_: Vec<String>) -> InVec; | |
| fn not_in_vec(_: Vec<String>) -> 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<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::HeroId(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::HeroId(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod hero { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "Hero"; | |
| pub struct Fetch(pub hero::UniqueArgs); | |
| impl Fetch { | |
| pub fn with(mut self, params: impl Into<hero::WithParam>) -> Self { | |
| self.0 = self.0.with(params.into()); | |
| self | |
| } | |
| } | |
| impl From<Fetch> for WithParam { | |
| fn from(Fetch(v): Fetch) -> Self { | |
| WithParam::Hero(v) | |
| } | |
| } | |
| pub fn fetch() -> Fetch { | |
| Fetch(hero::UniqueArgs::new()) | |
| } | |
| pub struct Connect(hero::UniqueWhereParam); | |
| impl From<Connect> for SetParam { | |
| fn from(Connect(v): Connect) -> Self { | |
| Self::ConnectHero(v) | |
| } | |
| } | |
| pub fn connect<T: From<Connect>>(value: hero::UniqueWhereParam) -> T { | |
| Connect(value).into() | |
| } | |
| pub fn is(value: Vec<hero::WhereParam>) -> WhereParam { | |
| WhereParam::HeroIs(value) | |
| } | |
| pub fn is_not(value: Vec<hero::WhereParam>) -> WhereParam { | |
| WhereParam::HeroIsNot(value) | |
| } | |
| pub enum Include { | |
| Select(Vec<hero::SelectParam>), | |
| Include(Vec<hero::IncludeParam>), | |
| Fetch, | |
| } | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Hero(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 = | |
| <hero::Types as ::prisma_client_rust::ModelTypes>::scalar_selections(); | |
| nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); | |
| nested_selections | |
| } | |
| Self::Fetch => { | |
| <hero::Types as ::prisma_client_rust::ModelTypes>::scalar_selections() | |
| } | |
| }; | |
| ::prisma_client_rust::Selection::new("Hero", None, [], selections) | |
| } | |
| pub fn select(nested_selections: Vec<hero::SelectParam>) -> Self { | |
| Self::Select(nested_selections) | |
| } | |
| pub fn include(nested_selections: Vec<hero::IncludeParam>) -> Self { | |
| Self::Include(nested_selections) | |
| } | |
| } | |
| pub enum Select { | |
| Select(Vec<hero::SelectParam>), | |
| Include(Vec<hero::IncludeParam>), | |
| Fetch, | |
| } | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Hero(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 => { | |
| <hero::Types as ::prisma_client_rust::ModelTypes>::scalar_selections() | |
| } | |
| }; | |
| ::prisma_client_rust::Selection::new("Hero", None, [], selections) | |
| } | |
| pub fn select(nested_selections: Vec<hero::SelectParam>) -> Self { | |
| Self::Select(nested_selections) | |
| } | |
| pub fn include(nested_selections: Vec<hero::IncludeParam>) -> Self { | |
| Self::Include(nested_selections) | |
| } | |
| } | |
| } | |
| pub mod follower { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "Follower"; | |
| pub struct Fetch(pub follower::UniqueArgs); | |
| impl Fetch { | |
| pub fn with(mut self, params: impl Into<follower::WithParam>) -> Self { | |
| self.0 = self.0.with(params.into()); | |
| self | |
| } | |
| } | |
| impl From<Fetch> for WithParam { | |
| fn from(Fetch(v): Fetch) -> Self { | |
| WithParam::Follower(v) | |
| } | |
| } | |
| pub fn fetch() -> Fetch { | |
| Fetch(follower::UniqueArgs::new()) | |
| } | |
| pub struct Connect(follower::UniqueWhereParam); | |
| impl From<Connect> for SetParam { | |
| fn from(Connect(v): Connect) -> Self { | |
| Self::ConnectFollower(v) | |
| } | |
| } | |
| pub fn connect<T: From<Connect>>(value: follower::UniqueWhereParam) -> T { | |
| Connect(value).into() | |
| } | |
| pub fn disconnect() -> SetParam { | |
| SetParam::DisconnectFollower | |
| } | |
| pub fn is_null() -> WhereParam { | |
| WhereParam::FollowerIsNull | |
| } | |
| pub fn is(value: Vec<follower::WhereParam>) -> WhereParam { | |
| WhereParam::FollowerIs(value) | |
| } | |
| pub fn is_not(value: Vec<follower::WhereParam>) -> WhereParam { | |
| WhereParam::FollowerIsNot(value) | |
| } | |
| pub enum Include { | |
| Select(Vec<follower::SelectParam>), | |
| Include(Vec<follower::IncludeParam>), | |
| Fetch, | |
| } | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Follower(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 = < follower :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; | |
| nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); | |
| nested_selections | |
| } | |
| Self::Fetch => { | |
| <follower::Types as ::prisma_client_rust::ModelTypes>::scalar_selections() | |
| } | |
| }; | |
| ::prisma_client_rust::Selection::new("Follower", None, [], selections) | |
| } | |
| pub fn select(nested_selections: Vec<follower::SelectParam>) -> Self { | |
| Self::Select(nested_selections) | |
| } | |
| pub fn include(nested_selections: Vec<follower::IncludeParam>) -> Self { | |
| Self::Include(nested_selections) | |
| } | |
| } | |
| pub enum Select { | |
| Select(Vec<follower::SelectParam>), | |
| Include(Vec<follower::IncludeParam>), | |
| Fetch, | |
| } | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Follower(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 => { | |
| <follower::Types as ::prisma_client_rust::ModelTypes>::scalar_selections() | |
| } | |
| }; | |
| ::prisma_client_rust::Selection::new("Follower", None, [], selections) | |
| } | |
| pub fn select(nested_selections: Vec<follower::SelectParam>) -> Self { | |
| Self::Select(nested_selections) | |
| } | |
| pub fn include(nested_selections: Vec<follower::IncludeParam>) -> Self { | |
| Self::Include(nested_selections) | |
| } | |
| } | |
| } | |
| pub mod follower_id { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "followerId"; | |
| pub struct Set(pub Option<String>); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetFollowerId(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::FollowerId(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: Option<String>) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::FollowerId(direction) | |
| } | |
| pub fn equals(value: Option<String>) -> WhereParam { | |
| WhereParam::FollowerId(_prisma::read_filters::StringNullableFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!( | |
| _prisma::read_filters::StringNullableFilter, | |
| FollowerId, | |
| { | |
| fn in_vec(_: Vec<String>) -> InVec; | |
| fn not_in_vec(_: Vec<String>) -> 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<String>) -> Not; | |
| } | |
| ); | |
| pub struct Include; | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::FollowerId(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::FollowerId(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub fn create( | |
| slot_type: String, | |
| hero: super::hero::UniqueWhereParam, | |
| _params: Vec<SetParam>, | |
| ) -> (String, super::hero::UniqueWhereParam, Vec<SetParam>) { | |
| (slot_type, hero, _params) | |
| } | |
| pub fn create_unchecked( | |
| slot_type: String, | |
| hero_id: String, | |
| _params: Vec<SetParam>, | |
| ) -> (String, String, Vec<SetParam>) { | |
| (slot_type, hero_id, _params) | |
| } | |
| #[macro_export] | |
| macro_rules ! _select_retinue_slot { ($ (($ ($ 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 :: retinue_slot :: 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 :: retinue_slot :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: retinue_slot :: 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 :: retinue_slot :: 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 :: retinue_slot :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: retinue_slot :: 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 , slot_type , hero_id , hero , follower , follower_id } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { $ (pub $ field : crate :: prisma :: retinue_slot :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } 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 :: retinue_slot :: $ 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 :: retinue_slot :: $ 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 :: retinue_slot :: $ 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 :: retinue_slot :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: retinue_slot :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "slotType" , "HeroId" , "Hero" , "Follower" , "followerId"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: retinue_slot :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { String } ; (@ field_type ; slot_type) => { String } ; (@ field_type ; hero_id) => { String } ; (@ field_type ; hero : $ selection_mode : ident { $ ($ selections : tt) + }) => { hero :: Data } ; (@ field_type ; hero) => { crate :: prisma :: hero :: Data } ; (@ field_type ; follower : $ selection_mode : ident { $ ($ selections : tt) + }) => { Option < follower :: Data > } ; (@ field_type ; follower) => { Option < crate :: prisma :: follower :: Data > } ; (@ field_type ; follower_id) => { Option < String > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "RetinueSlot" , available relations are "id, slot_type, hero_id, hero, follower, follower_id")) } ; (@ field_module ; hero : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: hero :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; follower : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: follower :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: retinue_slot :: SelectParam > :: into (crate :: prisma :: retinue_slot :: id :: Select) } ; (@ selection_field_to_selection_param ; slot_type) => { Into :: < crate :: prisma :: retinue_slot :: SelectParam > :: into (crate :: prisma :: retinue_slot :: slot_type :: Select) } ; (@ selection_field_to_selection_param ; hero_id) => { Into :: < crate :: prisma :: retinue_slot :: SelectParam > :: into (crate :: prisma :: retinue_slot :: hero_id :: Select) } ; (@ selection_field_to_selection_param ; hero $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: retinue_slot :: SelectParam > :: into (crate :: prisma :: retinue_slot :: hero :: Select :: $ selection_mode (crate :: prisma :: hero :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; hero $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: retinue_slot :: SelectParam > :: into (crate :: prisma :: retinue_slot :: hero :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; follower $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: retinue_slot :: SelectParam > :: into (crate :: prisma :: retinue_slot :: follower :: Select :: $ selection_mode (crate :: prisma :: follower :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; follower $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: retinue_slot :: SelectParam > :: into (crate :: prisma :: retinue_slot :: follower :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; follower_id) => { Into :: < crate :: prisma :: retinue_slot :: SelectParam > :: into (crate :: prisma :: retinue_slot :: follower_id :: 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 :: retinue_slot :: $ 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 ; slot_type) => { "slotType" } ; (@ field_serde_name ; hero_id) => { "HeroId" } ; (@ field_serde_name ; hero) => { "Hero" } ; (@ field_serde_name ; follower) => { "Follower" } ; (@ field_serde_name ; follower_id) => { "followerId" } ; } | |
| pub use _select_retinue_slot as select; | |
| pub enum SelectParam { | |
| Id(id::Select), | |
| SlotType(slot_type::Select), | |
| HeroId(hero_id::Select), | |
| Hero(hero::Select), | |
| Follower(follower::Select), | |
| FollowerId(follower_id::Select), | |
| } | |
| impl SelectParam { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::Id(data) => data.to_selection(), | |
| Self::SlotType(data) => data.to_selection(), | |
| Self::HeroId(data) => data.to_selection(), | |
| Self::Hero(data) => data.to_selection(), | |
| Self::Follower(data) => data.to_selection(), | |
| Self::FollowerId(data) => data.to_selection(), | |
| } | |
| } | |
| } | |
| #[macro_export] | |
| macro_rules ! _include_retinue_slot { ($ (($ ($ 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 :: retinue_slot :: 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 :: retinue_slot :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: retinue_slot :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: retinue_slot :: 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 :: retinue_slot :: 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 :: retinue_slot :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: retinue_slot :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: retinue_slot :: 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 { hero , follower } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { pub id : String , pub slot_type : String , pub hero_id : String , pub follower_id : Option < String > , $ (pub $ field : crate :: prisma :: retinue_slot :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } 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 ! (slot_type) , stringify ! (hero_id) , stringify ! (follower_id)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: retinue_slot :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: retinue_slot :: id :: NAME , & self . id) ? ; state . serialize_field (crate :: prisma :: retinue_slot :: slot_type :: NAME , & self . slot_type) ? ; state . serialize_field (crate :: prisma :: retinue_slot :: hero_id :: NAME , & self . hero_id) ? ; state . serialize_field (crate :: prisma :: retinue_slot :: follower_id :: NAME , & self . follower_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 , slot_type , hero_id , follower_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 :: retinue_slot :: $ field :: NAME) , + , crate :: prisma :: retinue_slot :: id :: NAME , crate :: prisma :: retinue_slot :: slot_type :: NAME , crate :: prisma :: retinue_slot :: hero_id :: NAME , crate :: prisma :: retinue_slot :: follower_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 :: retinue_slot :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: retinue_slot :: id :: NAME => Ok (Field :: id) , crate :: prisma :: retinue_slot :: slot_type :: NAME => Ok (Field :: slot_type) , crate :: prisma :: retinue_slot :: hero_id :: NAME => Ok (Field :: hero_id) , crate :: prisma :: retinue_slot :: follower_id :: NAME => Ok (Field :: follower_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 slot_type = None ; let mut hero_id = None ; let mut follower_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 :: retinue_slot :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } Field :: slot_type => { if slot_type . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: retinue_slot :: slot_type :: NAME)) ; } slot_type = Some (map . next_value () ?) ; } Field :: hero_id => { if hero_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: retinue_slot :: hero_id :: NAME)) ; } hero_id = Some (map . next_value () ?) ; } Field :: follower_id => { if follower_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: retinue_slot :: follower_id :: NAME)) ; } follower_id = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: retinue_slot :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: retinue_slot :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: retinue_slot :: id :: NAME)) ? ; let slot_type = slot_type . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: retinue_slot :: slot_type :: NAME)) ? ; let hero_id = hero_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: retinue_slot :: hero_id :: NAME)) ? ; let follower_id = follower_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: retinue_slot :: follower_id :: NAME)) ? ; Ok (Data { id , slot_type , hero_id , follower_id , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "slotType" , "HeroId" , "Hero" , "Follower" , "followerId"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: retinue_slot :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; hero : $ selection_mode : ident { $ ($ selections : tt) + }) => { hero :: Data } ; (@ field_type ; hero) => { crate :: prisma :: hero :: Data } ; (@ field_type ; follower : $ selection_mode : ident { $ ($ selections : tt) + }) => { Option < follower :: Data > } ; (@ field_type ; follower) => { Option < crate :: prisma :: follower :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "RetinueSlot" , available relations are "hero, follower")) } ; (@ field_module ; hero : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: hero :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; follower : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: follower :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; hero $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: retinue_slot :: IncludeParam > :: into (crate :: prisma :: retinue_slot :: hero :: Include :: $ selection_mode (crate :: prisma :: hero :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; hero $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: retinue_slot :: IncludeParam > :: into (crate :: prisma :: retinue_slot :: hero :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; follower $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: retinue_slot :: IncludeParam > :: into (crate :: prisma :: retinue_slot :: follower :: Include :: $ selection_mode (crate :: prisma :: follower :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; follower $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: retinue_slot :: IncludeParam > :: into (crate :: prisma :: retinue_slot :: follower :: 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 :: retinue_slot :: $ 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 ; slot_type) => { "slotType" } ; (@ field_serde_name ; hero_id) => { "HeroId" } ; (@ field_serde_name ; hero) => { "Hero" } ; (@ field_serde_name ; follower) => { "Follower" } ; (@ field_serde_name ; follower_id) => { "followerId" } ; } | |
| pub use _include_retinue_slot as include; | |
| pub enum IncludeParam { | |
| Id(id::Include), | |
| SlotType(slot_type::Include), | |
| HeroId(hero_id::Include), | |
| Hero(hero::Include), | |
| Follower(follower::Include), | |
| FollowerId(follower_id::Include), | |
| } | |
| impl IncludeParam { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::Id(data) => data.to_selection(), | |
| Self::SlotType(data) => data.to_selection(), | |
| Self::HeroId(data) => data.to_selection(), | |
| Self::Hero(data) => data.to_selection(), | |
| Self::Follower(data) => data.to_selection(), | |
| Self::FollowerId(data) => data.to_selection(), | |
| } | |
| } | |
| } | |
| #[macro_export] | |
| macro_rules ! _partial_unchecked_retinue_slot { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: retinue_slot struct $ struct_name { # [serde (rename = "id")] pub id : String , # [serde (rename = "slotType")] pub slot_type : String , # [serde (rename = "HeroId")] pub hero_id : String , # [serde (rename = "followerId")] # [serde (default , with = "::prisma_client_rust::serde::double_option")] pub follower_id : Option < String > } [$ ($ scalar_field) , +] } } ; } | |
| pub use _partial_unchecked_retinue_slot as partial_unchecked; | |
| #[derive(Debug, Clone, :: serde :: Serialize, :: serde :: Deserialize)] | |
| pub struct Data { | |
| #[serde(rename = "id")] | |
| pub id: String, | |
| #[serde(rename = "slotType")] | |
| pub slot_type: String, | |
| #[serde(rename = "HeroId")] | |
| pub hero_id: String, | |
| #[serde(rename = "Hero")] | |
| pub hero: Option<Box<super::hero::Data>>, | |
| #[serde( | |
| rename = "Follower", | |
| default, | |
| skip_serializing_if = "Option::is_none", | |
| with = "prisma_client_rust::serde::double_option" | |
| )] | |
| pub follower: Option<Option<Box<super::follower::Data>>>, | |
| #[serde(rename = "followerId")] | |
| pub follower_id: Option<String>, | |
| } | |
| impl Data { | |
| pub fn hero( | |
| &self, | |
| ) -> Result<&super::hero::Data, ::prisma_client_rust::RelationNotFetchedError> { | |
| self.hero | |
| .as_ref() | |
| .ok_or(::prisma_client_rust::RelationNotFetchedError::new( | |
| stringify!(hero), | |
| )) | |
| .map(|v| v.as_ref()) | |
| } | |
| pub fn follower( | |
| &self, | |
| ) -> Result<Option<&super::follower::Data>, ::prisma_client_rust::RelationNotFetchedError> | |
| { | |
| self.follower | |
| .as_ref() | |
| .ok_or(::prisma_client_rust::RelationNotFetchedError::new( | |
| stringify!(follower), | |
| )) | |
| .map(|v| v.as_ref().map(|v| v.as_ref())) | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum WithParam { | |
| Hero(super::hero::UniqueArgs), | |
| Follower(super::follower::UniqueArgs), | |
| } | |
| impl Into<::prisma_client_rust::Selection> for WithParam { | |
| fn into(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::Hero(args) => { | |
| let mut selections = | |
| <super::hero::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(hero::NAME, None, [], selections) | |
| } | |
| Self::Follower(args) => { | |
| let mut selections = < super :: follower :: 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(follower::NAME, None, [], selections) | |
| } | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum SetParam { | |
| SetId(String), | |
| SetSlotType(String), | |
| SetHeroId(String), | |
| ConnectHero(super::hero::UniqueWhereParam), | |
| ConnectFollower(super::follower::UniqueWhereParam), | |
| DisconnectFollower, | |
| SetFollowerId(Option<String>), | |
| } | |
| impl From<SetParam> 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::SetSlotType(value) => ( | |
| slot_type::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(value), | |
| ), | |
| SetParam::SetHeroId(value) => ( | |
| hero_id::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(value), | |
| ), | |
| SetParam::ConnectHero(where_param) => ( | |
| hero::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "connect".to_string(), | |
| ::prisma_client_rust::PrismaValue::Object( | |
| [where_param] | |
| .into_iter() | |
| .map(Into::<super::hero::WhereParam>::into) | |
| .map(::prisma_client_rust::WhereInput::serialize) | |
| .map(::prisma_client_rust::SerializedWhereInput::transform_equals) | |
| .collect(), | |
| ), | |
| )]), | |
| ), | |
| SetParam::ConnectFollower(where_param) => ( | |
| follower::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "connect".to_string(), | |
| ::prisma_client_rust::PrismaValue::Object( | |
| [where_param] | |
| .into_iter() | |
| .map(Into::<super::follower::WhereParam>::into) | |
| .map(::prisma_client_rust::WhereInput::serialize) | |
| .map(::prisma_client_rust::SerializedWhereInput::transform_equals) | |
| .collect(), | |
| ), | |
| )]), | |
| ), | |
| SetParam::DisconnectFollower => ( | |
| follower::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "disconnect".to_string(), | |
| ::prisma_client_rust::PrismaValue::Boolean(true), | |
| )]), | |
| ), | |
| SetParam::SetFollowerId(value) => ( | |
| follower_id::NAME.to_string(), | |
| value | |
| .map(|value| ::prisma_client_rust::PrismaValue::String(value)) | |
| .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), | |
| ), | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum UncheckedSetParam { | |
| Id(String), | |
| SlotType(String), | |
| HeroId(String), | |
| FollowerId(Option<String>), | |
| } | |
| impl From<UncheckedSetParam> for SetParam { | |
| fn from(param: UncheckedSetParam) -> Self { | |
| match param { | |
| UncheckedSetParam::Id(value) => Self::SetId(value), | |
| UncheckedSetParam::SlotType(value) => Self::SetSlotType(value), | |
| UncheckedSetParam::HeroId(value) => Self::SetHeroId(value), | |
| UncheckedSetParam::FollowerId(value) => Self::SetFollowerId(value), | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum OrderByParam { | |
| Id(::prisma_client_rust::Direction), | |
| SlotType(::prisma_client_rust::Direction), | |
| HeroId(::prisma_client_rust::Direction), | |
| FollowerId(::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::SlotType(direction) => ( | |
| slot_type::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| Self::HeroId(direction) => ( | |
| hero_id::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| Self::FollowerId(direction) => ( | |
| follower_id::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum WhereParam { | |
| Not(Vec<WhereParam>), | |
| Or(Vec<WhereParam>), | |
| And(Vec<WhereParam>), | |
| Id(_prisma::read_filters::StringFilter), | |
| SlotType(_prisma::read_filters::StringFilter), | |
| HeroId(_prisma::read_filters::StringFilter), | |
| HeroIs(Vec<super::hero::WhereParam>), | |
| HeroIsNot(Vec<super::hero::WhereParam>), | |
| FollowerIsNull, | |
| FollowerIs(Vec<super::follower::WhereParam>), | |
| FollowerIsNot(Vec<super::follower::WhereParam>), | |
| FollowerId(_prisma::read_filters::StringNullableFilter), | |
| } | |
| 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::SlotType(value) => (slot_type::NAME, value.into()), | |
| Self::HeroId(value) => (hero_id::NAME, value.into()), | |
| Self::HeroIs(where_params) => ( | |
| hero::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::HeroIsNot(where_params) => ( | |
| hero::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::FollowerIsNull => ( | |
| follower::NAME, | |
| ::prisma_client_rust::SerializedWhereValue::Value( | |
| ::prisma_client_rust::PrismaValue::Null, | |
| ), | |
| ), | |
| Self::FollowerIs(where_params) => ( | |
| follower::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::FollowerIsNot(where_params) => ( | |
| follower::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::FollowerId(value) => (follower_id::NAME, value.into()), | |
| }; | |
| ::prisma_client_rust::SerializedWhereInput::new(name, value.into()) | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum UniqueWhereParam { | |
| IdEquals(String), | |
| } | |
| impl From<UniqueWhereParam> 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<Self>> for WhereParam { | |
| fn from(op: ::prisma_client_rust::Operator<Self>) -> 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(slot_type::NAME), | |
| ::prisma_client_rust::sel(hero_id::NAME), | |
| ::prisma_client_rust::sel(follower_id::NAME), | |
| ] | |
| } | |
| } | |
| pub type UniqueArgs = ::prisma_client_rust::UniqueArgs<Types>; | |
| pub type ManyArgs = ::prisma_client_rust::ManyArgs<Types>; | |
| 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<WhereParam>) -> FindFirst<'a> { | |
| FindFirst::new(self.client, _where) | |
| } | |
| pub fn find_many(self, _where: Vec<WhereParam>) -> FindMany<'a> { | |
| FindMany::new(self.client, _where) | |
| } | |
| pub fn create( | |
| self, | |
| slot_type: String, | |
| hero: super::hero::UniqueWhereParam, | |
| mut _params: Vec<SetParam>, | |
| ) -> Create<'a> { | |
| _params.extend([slot_type::set(slot_type), hero::connect(hero)]); | |
| Create::new(self.client, _params) | |
| } | |
| pub fn create_unchecked( | |
| self, | |
| slot_type: String, | |
| hero_id: String, | |
| mut _params: Vec<UncheckedSetParam>, | |
| ) -> Create<'a> { | |
| _params.extend([slot_type::set(slot_type), hero_id::set(hero_id)]); | |
| Create::new(self.client, _params.into_iter().map(Into::into).collect()) | |
| } | |
| pub fn create_many(self, data: Vec<(String, String, Vec<SetParam>)>) -> CreateMany<'a> { | |
| let data = data | |
| .into_iter() | |
| .map(|(slot_type, hero_id, mut _params)| { | |
| _params.extend([slot_type::set(slot_type), hero_id::set(hero_id)]); | |
| _params | |
| }) | |
| .collect(); | |
| CreateMany::new(self.client, data) | |
| } | |
| pub fn update(self, _where: UniqueWhereParam, _params: Vec<SetParam>) -> Update<'a> { | |
| Update::new(self.client, _where.into(), _params, vec![]) | |
| } | |
| pub fn update_unchecked( | |
| self, | |
| _where: UniqueWhereParam, | |
| _params: Vec<UncheckedSetParam>, | |
| ) -> Update<'a> { | |
| Update::new( | |
| self.client, | |
| _where.into(), | |
| _params.into_iter().map(Into::into).collect(), | |
| vec![], | |
| ) | |
| } | |
| pub fn update_many( | |
| self, | |
| _where: Vec<WhereParam>, | |
| _params: Vec<SetParam>, | |
| ) -> UpdateMany<'a> { | |
| UpdateMany::new(self.client, _where, _params) | |
| } | |
| pub fn upsert( | |
| self, | |
| _where: UniqueWhereParam, | |
| (slot_type, hero, mut _params): (String, super::hero::UniqueWhereParam, Vec<SetParam>), | |
| _update: Vec<SetParam>, | |
| ) -> Upsert<'a> { | |
| _params.extend([slot_type::set(slot_type), hero::connect(hero)]); | |
| 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<WhereParam>) -> DeleteMany<'a> { | |
| DeleteMany::new(self.client, _where) | |
| } | |
| pub fn count(self, _where: Vec<WhereParam>) -> Count<'a> { | |
| Count::new(self.client, _where) | |
| } | |
| } | |
| } | |
| pub mod follower { | |
| use super::_prisma::*; | |
| use super::*; | |
| pub const NAME: &str = "Follower"; | |
| 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<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetId(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::Id(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: String) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::Id(direction) | |
| } | |
| pub fn equals<T: From<UniqueWhereParam>>(value: String) -> T { | |
| UniqueWhereParam::IdEquals(value).into() | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::StringFilter, Id, { | |
| fn in_vec(_: Vec<String>) -> InVec; | |
| fn not_in_vec(_: Vec<String>) -> 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<super::IncludeParam> 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<super::SelectParam> 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 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<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetName(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::Name(v) | |
| } | |
| } | |
| pub fn set<T: From<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<String>) -> InVec; | |
| fn not_in_vec(_: Vec<String>) -> 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<super::IncludeParam> 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<super::SelectParam> 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 level { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "level"; | |
| pub struct Set(pub i32); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetLevel(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::Level(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: i32) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::Level(direction) | |
| } | |
| pub fn equals(value: i32) -> WhereParam { | |
| WhereParam::Level(_prisma::read_filters::IntFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::IntFilter, Level, { | |
| fn in_vec(_: Vec<i32>) -> InVec; | |
| fn not_in_vec(_: Vec<i32>) -> 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::IncrementLevel(value) | |
| } | |
| pub fn decrement(value: i32) -> SetParam { | |
| SetParam::DecrementLevel(value) | |
| } | |
| pub fn multiply(value: i32) -> SetParam { | |
| SetParam::MultiplyLevel(value) | |
| } | |
| pub fn divide(value: i32) -> SetParam { | |
| SetParam::DivideLevel(value) | |
| } | |
| pub struct Include; | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Level(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Level(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod attributes_id { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "attributesId"; | |
| pub struct Set(pub String); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetAttributesId(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::AttributesId(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: String) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::AttributesId(direction) | |
| } | |
| pub fn equals(value: String) -> WhereParam { | |
| WhereParam::AttributesId(_prisma::read_filters::StringFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!( | |
| _prisma::read_filters::StringFilter, | |
| AttributesId, | |
| { | |
| fn in_vec(_: Vec<String>) -> InVec; | |
| fn not_in_vec(_: Vec<String>) -> 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<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::AttributesId(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::AttributesId(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod attributes { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "attributes"; | |
| pub struct Fetch(pub attributes::UniqueArgs); | |
| impl Fetch { | |
| pub fn with(mut self, params: impl Into<attributes::WithParam>) -> Self { | |
| self.0 = self.0.with(params.into()); | |
| self | |
| } | |
| } | |
| impl From<Fetch> for WithParam { | |
| fn from(Fetch(v): Fetch) -> Self { | |
| WithParam::Attributes(v) | |
| } | |
| } | |
| pub fn fetch() -> Fetch { | |
| Fetch(attributes::UniqueArgs::new()) | |
| } | |
| pub struct Connect(attributes::UniqueWhereParam); | |
| impl From<Connect> for SetParam { | |
| fn from(Connect(v): Connect) -> Self { | |
| Self::ConnectAttributes(v) | |
| } | |
| } | |
| pub fn connect<T: From<Connect>>(value: attributes::UniqueWhereParam) -> T { | |
| Connect(value).into() | |
| } | |
| pub fn is(value: Vec<attributes::WhereParam>) -> WhereParam { | |
| WhereParam::AttributesIs(value) | |
| } | |
| pub fn is_not(value: Vec<attributes::WhereParam>) -> WhereParam { | |
| WhereParam::AttributesIsNot(value) | |
| } | |
| pub enum Include { | |
| Select(Vec<attributes::SelectParam>), | |
| Include(Vec<attributes::IncludeParam>), | |
| Fetch, | |
| } | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Attributes(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 = < attributes :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; | |
| nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); | |
| nested_selections | |
| } | |
| Self::Fetch => { | |
| <attributes::Types as ::prisma_client_rust::ModelTypes>::scalar_selections() | |
| } | |
| }; | |
| ::prisma_client_rust::Selection::new("attributes", None, [], selections) | |
| } | |
| pub fn select(nested_selections: Vec<attributes::SelectParam>) -> Self { | |
| Self::Select(nested_selections) | |
| } | |
| pub fn include(nested_selections: Vec<attributes::IncludeParam>) -> Self { | |
| Self::Include(nested_selections) | |
| } | |
| } | |
| pub enum Select { | |
| Select(Vec<attributes::SelectParam>), | |
| Include(Vec<attributes::IncludeParam>), | |
| Fetch, | |
| } | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Attributes(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 => { | |
| <attributes::Types as ::prisma_client_rust::ModelTypes>::scalar_selections() | |
| } | |
| }; | |
| ::prisma_client_rust::Selection::new("attributes", None, [], selections) | |
| } | |
| pub fn select(nested_selections: Vec<attributes::SelectParam>) -> Self { | |
| Self::Select(nested_selections) | |
| } | |
| pub fn include(nested_selections: Vec<attributes::IncludeParam>) -> Self { | |
| Self::Include(nested_selections) | |
| } | |
| } | |
| } | |
| pub mod retinue_slot { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "RetinueSlot"; | |
| pub struct Fetch(pub retinue_slot::ManyArgs); | |
| impl Fetch { | |
| pub fn with(mut self, params: impl Into<retinue_slot::WithParam>) -> Self { | |
| self.0 = self.0.with(params.into()); | |
| self | |
| } | |
| pub fn order_by(mut self, param: retinue_slot::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: retinue_slot::UniqueWhereParam) -> Self { | |
| self.0 = self.0.cursor(value.into()); | |
| self | |
| } | |
| } | |
| impl From<Fetch> for WithParam { | |
| fn from(Fetch(v): Fetch) -> Self { | |
| WithParam::RetinueSlot(v) | |
| } | |
| } | |
| pub fn fetch(params: Vec<retinue_slot::WhereParam>) -> Fetch { | |
| Fetch(retinue_slot::ManyArgs::new(params)) | |
| } | |
| pub struct Connect(pub Vec<retinue_slot::UniqueWhereParam>); | |
| impl From<Connect> for SetParam { | |
| fn from(Connect(v): Connect) -> Self { | |
| Self::ConnectRetinueSlot(v) | |
| } | |
| } | |
| pub fn connect<T: From<Connect>>(params: Vec<retinue_slot::UniqueWhereParam>) -> T { | |
| Connect(params).into() | |
| } | |
| pub fn disconnect(params: Vec<retinue_slot::UniqueWhereParam>) -> SetParam { | |
| SetParam::DisconnectRetinueSlot(params) | |
| } | |
| pub fn set(params: Vec<retinue_slot::UniqueWhereParam>) -> SetParam { | |
| SetParam::SetRetinueSlot(params) | |
| } | |
| pub fn some(value: Vec<retinue_slot::WhereParam>) -> WhereParam { | |
| WhereParam::RetinueSlotSome(value) | |
| } | |
| pub fn every(value: Vec<retinue_slot::WhereParam>) -> WhereParam { | |
| WhereParam::RetinueSlotEvery(value) | |
| } | |
| pub fn none(value: Vec<retinue_slot::WhereParam>) -> WhereParam { | |
| WhereParam::RetinueSlotNone(value) | |
| } | |
| pub enum Include { | |
| Select(retinue_slot::ManyArgs, Vec<retinue_slot::SelectParam>), | |
| Include(retinue_slot::ManyArgs, Vec<retinue_slot::IncludeParam>), | |
| Fetch(retinue_slot::ManyArgs), | |
| } | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::RetinueSlot(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 = < retinue_slot :: 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 , < retinue_slot :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; | |
| ::prisma_client_rust::Selection::new(NAME, None, args, selections) | |
| } | |
| pub fn select( | |
| args: retinue_slot::ManyArgs, | |
| nested_selections: Vec<retinue_slot::SelectParam>, | |
| ) -> Self { | |
| Self::Select(args, nested_selections) | |
| } | |
| pub fn include( | |
| args: retinue_slot::ManyArgs, | |
| nested_selections: Vec<retinue_slot::IncludeParam>, | |
| ) -> Self { | |
| Self::Include(args, nested_selections) | |
| } | |
| } | |
| pub enum Select { | |
| Select(retinue_slot::ManyArgs, Vec<retinue_slot::SelectParam>), | |
| Include(retinue_slot::ManyArgs, Vec<retinue_slot::IncludeParam>), | |
| Fetch(retinue_slot::ManyArgs), | |
| } | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::RetinueSlot(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 , < retinue_slot :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; | |
| ::prisma_client_rust::Selection::new(NAME, None, args, selections) | |
| } | |
| pub fn select( | |
| args: retinue_slot::ManyArgs, | |
| nested_selections: Vec<retinue_slot::SelectParam>, | |
| ) -> Self { | |
| Self::Select(args, nested_selections) | |
| } | |
| pub fn include( | |
| args: retinue_slot::ManyArgs, | |
| nested_selections: Vec<retinue_slot::IncludeParam>, | |
| ) -> Self { | |
| Self::Include(args, nested_selections) | |
| } | |
| } | |
| } | |
| pub fn create( | |
| name: String, | |
| level: i32, | |
| attributes: super::attributes::UniqueWhereParam, | |
| _params: Vec<SetParam>, | |
| ) -> ( | |
| String, | |
| i32, | |
| super::attributes::UniqueWhereParam, | |
| Vec<SetParam>, | |
| ) { | |
| (name, level, attributes, _params) | |
| } | |
| pub fn create_unchecked( | |
| name: String, | |
| level: i32, | |
| attributes_id: String, | |
| _params: Vec<SetParam>, | |
| ) -> (String, i32, String, Vec<SetParam>) { | |
| (name, level, attributes_id, _params) | |
| } | |
| #[macro_export] | |
| macro_rules ! _select_follower { ($ (($ ($ 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 :: follower :: 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 :: follower :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: follower :: 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 :: follower :: 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 :: follower :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: follower :: 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 , name , level , attributes_id , attributes , retinue_slot } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { $ (pub $ field : crate :: prisma :: follower :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } 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 :: follower :: $ 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 :: follower :: $ 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 :: follower :: $ 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 :: follower :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: follower :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "name" , "level" , "attributesId" , "attributes" , "RetinueSlot"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: follower :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { String } ; (@ field_type ; name) => { String } ; (@ field_type ; level) => { i32 } ; (@ field_type ; attributes_id) => { String } ; (@ field_type ; attributes : $ selection_mode : ident { $ ($ selections : tt) + }) => { attributes :: Data } ; (@ field_type ; attributes) => { crate :: prisma :: attributes :: Data } ; (@ field_type ; retinue_slot : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < retinue_slot :: Data > } ; (@ field_type ; retinue_slot) => { Vec < crate :: prisma :: retinue_slot :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Follower" , available relations are "id, name, level, attributes_id, attributes, retinue_slot")) } ; (@ field_module ; attributes : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: attributes :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; retinue_slot : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: retinue_slot :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: follower :: SelectParam > :: into (crate :: prisma :: follower :: id :: Select) } ; (@ selection_field_to_selection_param ; name) => { Into :: < crate :: prisma :: follower :: SelectParam > :: into (crate :: prisma :: follower :: name :: Select) } ; (@ selection_field_to_selection_param ; level) => { Into :: < crate :: prisma :: follower :: SelectParam > :: into (crate :: prisma :: follower :: level :: Select) } ; (@ selection_field_to_selection_param ; attributes_id) => { Into :: < crate :: prisma :: follower :: SelectParam > :: into (crate :: prisma :: follower :: attributes_id :: Select) } ; (@ selection_field_to_selection_param ; attributes $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: follower :: SelectParam > :: into (crate :: prisma :: follower :: attributes :: Select :: $ selection_mode (crate :: prisma :: attributes :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; attributes $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: follower :: SelectParam > :: into (crate :: prisma :: follower :: attributes :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; retinue_slot $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: follower :: SelectParam > :: into (crate :: prisma :: follower :: retinue_slot :: Select :: $ selection_mode (crate :: prisma :: retinue_slot :: ManyArgs :: new (crate :: prisma :: retinue_slot :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: retinue_slot :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; retinue_slot $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: follower :: SelectParam > :: into (crate :: prisma :: follower :: retinue_slot :: Select :: Fetch (crate :: prisma :: retinue_slot :: ManyArgs :: new (crate :: prisma :: retinue_slot :: 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 :: follower :: $ 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 ; name) => { "name" } ; (@ field_serde_name ; level) => { "level" } ; (@ field_serde_name ; attributes_id) => { "attributesId" } ; (@ field_serde_name ; attributes) => { "attributes" } ; (@ field_serde_name ; retinue_slot) => { "RetinueSlot" } ; } | |
| pub use _select_follower as select; | |
| pub enum SelectParam { | |
| Id(id::Select), | |
| Name(name::Select), | |
| Level(level::Select), | |
| AttributesId(attributes_id::Select), | |
| Attributes(attributes::Select), | |
| RetinueSlot(retinue_slot::Select), | |
| } | |
| impl SelectParam { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::Id(data) => data.to_selection(), | |
| Self::Name(data) => data.to_selection(), | |
| Self::Level(data) => data.to_selection(), | |
| Self::AttributesId(data) => data.to_selection(), | |
| Self::Attributes(data) => data.to_selection(), | |
| Self::RetinueSlot(data) => data.to_selection(), | |
| } | |
| } | |
| } | |
| #[macro_export] | |
| macro_rules ! _include_follower { ($ (($ ($ 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 :: follower :: 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 :: follower :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: follower :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: follower :: 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 :: follower :: 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 :: follower :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: follower :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: follower :: 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 { attributes , retinue_slot } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { pub id : String , pub name : String , pub level : i32 , pub attributes_id : String , $ (pub $ field : crate :: prisma :: follower :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } 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 ! (name) , stringify ! (level) , stringify ! (attributes_id)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: follower :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: follower :: id :: NAME , & self . id) ? ; state . serialize_field (crate :: prisma :: follower :: name :: NAME , & self . name) ? ; state . serialize_field (crate :: prisma :: follower :: level :: NAME , & self . level) ? ; state . serialize_field (crate :: prisma :: follower :: attributes_id :: NAME , & self . attributes_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 , name , level , attributes_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 :: follower :: $ field :: NAME) , + , crate :: prisma :: follower :: id :: NAME , crate :: prisma :: follower :: name :: NAME , crate :: prisma :: follower :: level :: NAME , crate :: prisma :: follower :: attributes_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 :: follower :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: follower :: id :: NAME => Ok (Field :: id) , crate :: prisma :: follower :: name :: NAME => Ok (Field :: name) , crate :: prisma :: follower :: level :: NAME => Ok (Field :: level) , crate :: prisma :: follower :: attributes_id :: NAME => Ok (Field :: attributes_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 name = None ; let mut level = None ; let mut attributes_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 :: follower :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } Field :: name => { if name . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: follower :: name :: NAME)) ; } name = Some (map . next_value () ?) ; } Field :: level => { if level . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: follower :: level :: NAME)) ; } level = Some (map . next_value () ?) ; } Field :: attributes_id => { if attributes_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: follower :: attributes_id :: NAME)) ; } attributes_id = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: follower :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: follower :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: follower :: id :: NAME)) ? ; let name = name . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: follower :: name :: NAME)) ? ; let level = level . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: follower :: level :: NAME)) ? ; let attributes_id = attributes_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: follower :: attributes_id :: NAME)) ? ; Ok (Data { id , name , level , attributes_id , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "name" , "level" , "attributesId" , "attributes" , "RetinueSlot"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: follower :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; attributes : $ selection_mode : ident { $ ($ selections : tt) + }) => { attributes :: Data } ; (@ field_type ; attributes) => { crate :: prisma :: attributes :: Data } ; (@ field_type ; retinue_slot : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < retinue_slot :: Data > } ; (@ field_type ; retinue_slot) => { Vec < crate :: prisma :: retinue_slot :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Follower" , available relations are "attributes, retinue_slot")) } ; (@ field_module ; attributes : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: attributes :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; retinue_slot : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: retinue_slot :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; attributes $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: follower :: IncludeParam > :: into (crate :: prisma :: follower :: attributes :: Include :: $ selection_mode (crate :: prisma :: attributes :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; attributes $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: follower :: IncludeParam > :: into (crate :: prisma :: follower :: attributes :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; retinue_slot $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: follower :: IncludeParam > :: into (crate :: prisma :: follower :: retinue_slot :: Include :: $ selection_mode (crate :: prisma :: retinue_slot :: ManyArgs :: new (crate :: prisma :: retinue_slot :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: retinue_slot :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; retinue_slot $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: follower :: IncludeParam > :: into (crate :: prisma :: follower :: retinue_slot :: Include :: Fetch (crate :: prisma :: retinue_slot :: ManyArgs :: new (crate :: prisma :: retinue_slot :: 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 :: follower :: $ 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 ; name) => { "name" } ; (@ field_serde_name ; level) => { "level" } ; (@ field_serde_name ; attributes_id) => { "attributesId" } ; (@ field_serde_name ; attributes) => { "attributes" } ; (@ field_serde_name ; retinue_slot) => { "RetinueSlot" } ; } | |
| pub use _include_follower as include; | |
| pub enum IncludeParam { | |
| Id(id::Include), | |
| Name(name::Include), | |
| Level(level::Include), | |
| AttributesId(attributes_id::Include), | |
| Attributes(attributes::Include), | |
| RetinueSlot(retinue_slot::Include), | |
| } | |
| impl IncludeParam { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::Id(data) => data.to_selection(), | |
| Self::Name(data) => data.to_selection(), | |
| Self::Level(data) => data.to_selection(), | |
| Self::AttributesId(data) => data.to_selection(), | |
| Self::Attributes(data) => data.to_selection(), | |
| Self::RetinueSlot(data) => data.to_selection(), | |
| } | |
| } | |
| } | |
| #[macro_export] | |
| macro_rules ! _partial_unchecked_follower { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: follower struct $ struct_name { # [serde (rename = "id")] pub id : String , # [serde (rename = "name")] pub name : String , # [serde (rename = "level")] pub level : i32 , # [serde (rename = "attributesId")] pub attributes_id : String } [$ ($ scalar_field) , +] } } ; } | |
| pub use _partial_unchecked_follower as partial_unchecked; | |
| #[derive(Debug, Clone, :: serde :: Serialize, :: serde :: Deserialize)] | |
| pub struct Data { | |
| #[serde(rename = "id")] | |
| pub id: String, | |
| #[serde(rename = "name")] | |
| pub name: String, | |
| #[serde(rename = "level")] | |
| pub level: i32, | |
| #[serde(rename = "attributesId")] | |
| pub attributes_id: String, | |
| #[serde(rename = "attributes")] | |
| pub attributes: Option<Box<super::attributes::Data>>, | |
| #[serde(rename = "RetinueSlot")] | |
| pub retinue_slot: Option<Vec<super::retinue_slot::Data>>, | |
| } | |
| impl Data { | |
| pub fn attributes( | |
| &self, | |
| ) -> Result<&super::attributes::Data, ::prisma_client_rust::RelationNotFetchedError> | |
| { | |
| self.attributes | |
| .as_ref() | |
| .ok_or(::prisma_client_rust::RelationNotFetchedError::new( | |
| stringify!(attributes), | |
| )) | |
| .map(|v| v.as_ref()) | |
| } | |
| pub fn retinue_slot( | |
| &self, | |
| ) -> Result<&Vec<super::retinue_slot::Data>, ::prisma_client_rust::RelationNotFetchedError> | |
| { | |
| self.retinue_slot | |
| .as_ref() | |
| .ok_or(::prisma_client_rust::RelationNotFetchedError::new( | |
| stringify!(retinue_slot), | |
| )) | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum WithParam { | |
| Attributes(super::attributes::UniqueArgs), | |
| RetinueSlot(super::retinue_slot::ManyArgs), | |
| } | |
| impl Into<::prisma_client_rust::Selection> for WithParam { | |
| fn into(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::Attributes(args) => { | |
| let mut selections = < super :: attributes :: 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(attributes::NAME, None, [], selections) | |
| } | |
| Self::RetinueSlot(args) => { | |
| let (arguments, mut nested_selections) = args.to_graphql(); | |
| nested_selections . extend (< super :: retinue_slot :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) ; | |
| ::prisma_client_rust::Selection::new( | |
| retinue_slot::NAME, | |
| None, | |
| arguments, | |
| nested_selections, | |
| ) | |
| } | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum SetParam { | |
| SetId(String), | |
| SetName(String), | |
| SetLevel(i32), | |
| IncrementLevel(i32), | |
| DecrementLevel(i32), | |
| MultiplyLevel(i32), | |
| DivideLevel(i32), | |
| SetAttributesId(String), | |
| ConnectAttributes(super::attributes::UniqueWhereParam), | |
| ConnectRetinueSlot(Vec<super::retinue_slot::UniqueWhereParam>), | |
| DisconnectRetinueSlot(Vec<super::retinue_slot::UniqueWhereParam>), | |
| SetRetinueSlot(Vec<super::retinue_slot::UniqueWhereParam>), | |
| } | |
| impl From<SetParam> 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::SetName(value) => ( | |
| name::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(value), | |
| ), | |
| SetParam::SetLevel(value) => ( | |
| level::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| ), | |
| SetParam::IncrementLevel(value) => ( | |
| level::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "increment".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DecrementLevel(value) => ( | |
| level::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "decrement".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::MultiplyLevel(value) => ( | |
| level::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "multiply".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DivideLevel(value) => ( | |
| level::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "divide".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::SetAttributesId(value) => ( | |
| attributes_id::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(value), | |
| ), | |
| SetParam::ConnectAttributes(where_param) => ( | |
| attributes::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "connect".to_string(), | |
| ::prisma_client_rust::PrismaValue::Object( | |
| [where_param] | |
| .into_iter() | |
| .map(Into::<super::attributes::WhereParam>::into) | |
| .map(::prisma_client_rust::WhereInput::serialize) | |
| .map(::prisma_client_rust::SerializedWhereInput::transform_equals) | |
| .collect(), | |
| ), | |
| )]), | |
| ), | |
| SetParam::ConnectRetinueSlot(where_params) => ( | |
| retinue_slot::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "connect".to_string(), | |
| ::prisma_client_rust::PrismaValue::List( | |
| where_params | |
| .into_iter() | |
| .map(Into::<super::retinue_slot::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::DisconnectRetinueSlot(where_params) => ( | |
| retinue_slot::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "disconnect".to_string(), | |
| ::prisma_client_rust::PrismaValue::List( | |
| where_params | |
| .into_iter() | |
| .map(Into::<super::retinue_slot::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::SetRetinueSlot(where_params) => ( | |
| retinue_slot::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "set".to_string(), | |
| ::prisma_client_rust::PrismaValue::List( | |
| where_params | |
| .into_iter() | |
| .map(Into::<super::retinue_slot::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(), | |
| ), | |
| )]), | |
| ), | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum UncheckedSetParam { | |
| Id(String), | |
| Name(String), | |
| Level(i32), | |
| AttributesId(String), | |
| } | |
| impl From<UncheckedSetParam> for SetParam { | |
| fn from(param: UncheckedSetParam) -> Self { | |
| match param { | |
| UncheckedSetParam::Id(value) => Self::SetId(value), | |
| UncheckedSetParam::Name(value) => Self::SetName(value), | |
| UncheckedSetParam::Level(value) => Self::SetLevel(value), | |
| UncheckedSetParam::AttributesId(value) => Self::SetAttributesId(value), | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum OrderByParam { | |
| Id(::prisma_client_rust::Direction), | |
| Name(::prisma_client_rust::Direction), | |
| Level(::prisma_client_rust::Direction), | |
| AttributesId(::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::Name(direction) => ( | |
| name::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| Self::Level(direction) => ( | |
| level::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| Self::AttributesId(direction) => ( | |
| attributes_id::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum WhereParam { | |
| Not(Vec<WhereParam>), | |
| Or(Vec<WhereParam>), | |
| And(Vec<WhereParam>), | |
| Id(_prisma::read_filters::StringFilter), | |
| Name(_prisma::read_filters::StringFilter), | |
| Level(_prisma::read_filters::IntFilter), | |
| AttributesId(_prisma::read_filters::StringFilter), | |
| AttributesIs(Vec<super::attributes::WhereParam>), | |
| AttributesIsNot(Vec<super::attributes::WhereParam>), | |
| RetinueSlotSome(Vec<super::retinue_slot::WhereParam>), | |
| RetinueSlotEvery(Vec<super::retinue_slot::WhereParam>), | |
| RetinueSlotNone(Vec<super::retinue_slot::WhereParam>), | |
| } | |
| 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::Name(value) => (name::NAME, value.into()), | |
| Self::Level(value) => (level::NAME, value.into()), | |
| Self::AttributesId(value) => (attributes_id::NAME, value.into()), | |
| Self::AttributesIs(where_params) => ( | |
| attributes::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::AttributesIsNot(where_params) => ( | |
| attributes::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::RetinueSlotSome(where_params) => ( | |
| retinue_slot::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::RetinueSlotEvery(where_params) => ( | |
| retinue_slot::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::RetinueSlotNone(where_params) => ( | |
| retinue_slot::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(String), | |
| } | |
| impl From<UniqueWhereParam> 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<Self>> for WhereParam { | |
| fn from(op: ::prisma_client_rust::Operator<Self>) -> 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(name::NAME), | |
| ::prisma_client_rust::sel(level::NAME), | |
| ::prisma_client_rust::sel(attributes_id::NAME), | |
| ] | |
| } | |
| } | |
| pub type UniqueArgs = ::prisma_client_rust::UniqueArgs<Types>; | |
| pub type ManyArgs = ::prisma_client_rust::ManyArgs<Types>; | |
| 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<WhereParam>) -> FindFirst<'a> { | |
| FindFirst::new(self.client, _where) | |
| } | |
| pub fn find_many(self, _where: Vec<WhereParam>) -> FindMany<'a> { | |
| FindMany::new(self.client, _where) | |
| } | |
| pub fn create( | |
| self, | |
| name: String, | |
| level: i32, | |
| attributes: super::attributes::UniqueWhereParam, | |
| mut _params: Vec<SetParam>, | |
| ) -> Create<'a> { | |
| _params.extend([ | |
| name::set(name), | |
| level::set(level), | |
| attributes::connect(attributes), | |
| ]); | |
| Create::new(self.client, _params) | |
| } | |
| pub fn create_unchecked( | |
| self, | |
| name: String, | |
| level: i32, | |
| attributes_id: String, | |
| mut _params: Vec<UncheckedSetParam>, | |
| ) -> Create<'a> { | |
| _params.extend([ | |
| name::set(name), | |
| level::set(level), | |
| attributes_id::set(attributes_id), | |
| ]); | |
| Create::new(self.client, _params.into_iter().map(Into::into).collect()) | |
| } | |
| pub fn create_many( | |
| self, | |
| data: Vec<(String, i32, String, Vec<SetParam>)>, | |
| ) -> CreateMany<'a> { | |
| let data = data | |
| .into_iter() | |
| .map(|(name, level, attributes_id, mut _params)| { | |
| _params.extend([ | |
| name::set(name), | |
| level::set(level), | |
| attributes_id::set(attributes_id), | |
| ]); | |
| _params | |
| }) | |
| .collect(); | |
| CreateMany::new(self.client, data) | |
| } | |
| pub fn update(self, _where: UniqueWhereParam, _params: Vec<SetParam>) -> Update<'a> { | |
| Update::new(self.client, _where.into(), _params, vec![]) | |
| } | |
| pub fn update_unchecked( | |
| self, | |
| _where: UniqueWhereParam, | |
| _params: Vec<UncheckedSetParam>, | |
| ) -> Update<'a> { | |
| Update::new( | |
| self.client, | |
| _where.into(), | |
| _params.into_iter().map(Into::into).collect(), | |
| vec![], | |
| ) | |
| } | |
| pub fn update_many( | |
| self, | |
| _where: Vec<WhereParam>, | |
| _params: Vec<SetParam>, | |
| ) -> UpdateMany<'a> { | |
| UpdateMany::new(self.client, _where, _params) | |
| } | |
| pub fn upsert( | |
| self, | |
| _where: UniqueWhereParam, | |
| (name, level, attributes, mut _params): ( | |
| String, | |
| i32, | |
| super::attributes::UniqueWhereParam, | |
| Vec<SetParam>, | |
| ), | |
| _update: Vec<SetParam>, | |
| ) -> Upsert<'a> { | |
| _params.extend([ | |
| name::set(name), | |
| level::set(level), | |
| attributes::connect(attributes), | |
| ]); | |
| 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<WhereParam>) -> DeleteMany<'a> { | |
| DeleteMany::new(self.client, _where) | |
| } | |
| pub fn count(self, _where: Vec<WhereParam>) -> Count<'a> { | |
| Count::new(self.client, _where) | |
| } | |
| } | |
| } | |
| pub mod resource_cost { | |
| use super::_prisma::*; | |
| use super::*; | |
| pub const NAME: &str = "ResourceCost"; | |
| 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<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetId(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::Id(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: String) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::Id(direction) | |
| } | |
| pub fn equals<T: From<UniqueWhereParam>>(value: String) -> T { | |
| UniqueWhereParam::IdEquals(value).into() | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::StringFilter, Id, { | |
| fn in_vec(_: Vec<String>) -> InVec; | |
| fn not_in_vec(_: Vec<String>) -> 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<super::IncludeParam> 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<super::SelectParam> 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 resource { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "resource"; | |
| pub struct Set(pub self::ResourceType); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetResource(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::Resource(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: self::ResourceType) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::Resource(direction) | |
| } | |
| pub fn equals(value: self::ResourceType) -> WhereParam { | |
| WhereParam::Resource(_prisma::read_filters::ResourceTypeFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!( | |
| _prisma::read_filters::ResourceTypeFilter, | |
| Resource, | |
| { | |
| fn in_vec(_: Vec<super::super::ResourceType>) -> InVec; | |
| fn not_in_vec(_: Vec<super::super::ResourceType>) -> NotInVec; | |
| fn not(_: super::super::ResourceType) -> Not; | |
| } | |
| ); | |
| pub struct Include; | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Resource(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Resource(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod amount { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "amount"; | |
| pub struct Set(pub i32); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetAmount(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::Amount(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: i32) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::Amount(direction) | |
| } | |
| pub fn equals(value: i32) -> WhereParam { | |
| WhereParam::Amount(_prisma::read_filters::IntFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::IntFilter, Amount, { | |
| fn in_vec(_: Vec<i32>) -> InVec; | |
| fn not_in_vec(_: Vec<i32>) -> 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::IncrementAmount(value) | |
| } | |
| pub fn decrement(value: i32) -> SetParam { | |
| SetParam::DecrementAmount(value) | |
| } | |
| pub fn multiply(value: i32) -> SetParam { | |
| SetParam::MultiplyAmount(value) | |
| } | |
| pub fn divide(value: i32) -> SetParam { | |
| SetParam::DivideAmount(value) | |
| } | |
| pub struct Include; | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Amount(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Amount(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod material { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "material"; | |
| pub struct Set(pub self::MaterialType); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetMaterial(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::Material(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: self::MaterialType) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::Material(direction) | |
| } | |
| pub fn equals(value: self::MaterialType) -> WhereParam { | |
| WhereParam::Material(_prisma::read_filters::MaterialTypeFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!( | |
| _prisma::read_filters::MaterialTypeFilter, | |
| Material, | |
| { | |
| fn in_vec(_: Vec<super::super::MaterialType>) -> InVec; | |
| fn not_in_vec(_: Vec<super::super::MaterialType>) -> NotInVec; | |
| fn not(_: super::super::MaterialType) -> Not; | |
| } | |
| ); | |
| pub struct Include; | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Material(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Material(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub fn create( | |
| resource: super::ResourceType, | |
| amount: i32, | |
| material: super::MaterialType, | |
| _params: Vec<SetParam>, | |
| ) -> (super::ResourceType, i32, super::MaterialType, Vec<SetParam>) { | |
| (resource, amount, material, _params) | |
| } | |
| pub fn create_unchecked( | |
| resource: super::ResourceType, | |
| amount: i32, | |
| material: super::MaterialType, | |
| _params: Vec<SetParam>, | |
| ) -> (super::ResourceType, i32, super::MaterialType, Vec<SetParam>) { | |
| (resource, amount, material, _params) | |
| } | |
| #[macro_export] | |
| macro_rules ! _select_resource_cost { ($ (($ ($ 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 :: resource_cost :: 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 :: resource_cost :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: resource_cost :: 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 :: resource_cost :: 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 :: resource_cost :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: resource_cost :: 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 , resource , amount , material } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { $ (pub $ field : crate :: prisma :: resource_cost :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } 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 :: resource_cost :: $ 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 :: resource_cost :: $ 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 :: resource_cost :: $ 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 :: resource_cost :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: resource_cost :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "resource" , "amount" , "material"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: resource_cost :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { String } ; (@ field_type ; resource) => { crate :: prisma :: ResourceType } ; (@ field_type ; amount) => { i32 } ; (@ field_type ; material) => { crate :: prisma :: MaterialType } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "ResourceCost" , available relations are "id, resource, amount, material")) } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: resource_cost :: SelectParam > :: into (crate :: prisma :: resource_cost :: id :: Select) } ; (@ selection_field_to_selection_param ; resource) => { Into :: < crate :: prisma :: resource_cost :: SelectParam > :: into (crate :: prisma :: resource_cost :: resource :: Select) } ; (@ selection_field_to_selection_param ; amount) => { Into :: < crate :: prisma :: resource_cost :: SelectParam > :: into (crate :: prisma :: resource_cost :: amount :: Select) } ; (@ selection_field_to_selection_param ; material) => { Into :: < crate :: prisma :: resource_cost :: SelectParam > :: into (crate :: prisma :: resource_cost :: material :: 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 :: resource_cost :: $ 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 ; resource) => { "resource" } ; (@ field_serde_name ; amount) => { "amount" } ; (@ field_serde_name ; material) => { "material" } ; } | |
| pub use _select_resource_cost as select; | |
| pub enum SelectParam { | |
| Id(id::Select), | |
| Resource(resource::Select), | |
| Amount(amount::Select), | |
| Material(material::Select), | |
| } | |
| impl SelectParam { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::Id(data) => data.to_selection(), | |
| Self::Resource(data) => data.to_selection(), | |
| Self::Amount(data) => data.to_selection(), | |
| Self::Material(data) => data.to_selection(), | |
| } | |
| } | |
| } | |
| #[macro_export] | |
| macro_rules ! _include_resource_cost { ($ (($ ($ 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 :: resource_cost :: 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 :: resource_cost :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: resource_cost :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: resource_cost :: 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 :: resource_cost :: 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 :: resource_cost :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: resource_cost :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: resource_cost :: 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 ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { pub id : String , pub resource : crate :: prisma :: ResourceType , pub amount : i32 , pub material : crate :: prisma :: MaterialType , $ (pub $ field : crate :: prisma :: resource_cost :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } 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 ! (resource) , stringify ! (amount) , stringify ! (material)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: resource_cost :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: resource_cost :: id :: NAME , & self . id) ? ; state . serialize_field (crate :: prisma :: resource_cost :: resource :: NAME , & self . resource) ? ; state . serialize_field (crate :: prisma :: resource_cost :: amount :: NAME , & self . amount) ? ; state . serialize_field (crate :: prisma :: resource_cost :: material :: NAME , & self . material) ? ; 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 , resource , amount , material } 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 :: resource_cost :: $ field :: NAME) , + , crate :: prisma :: resource_cost :: id :: NAME , crate :: prisma :: resource_cost :: resource :: NAME , crate :: prisma :: resource_cost :: amount :: NAME , crate :: prisma :: resource_cost :: material :: 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 :: resource_cost :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: resource_cost :: id :: NAME => Ok (Field :: id) , crate :: prisma :: resource_cost :: resource :: NAME => Ok (Field :: resource) , crate :: prisma :: resource_cost :: amount :: NAME => Ok (Field :: amount) , crate :: prisma :: resource_cost :: material :: NAME => Ok (Field :: material) , _ => 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 resource = None ; let mut amount = None ; let mut material = 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 :: resource_cost :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } Field :: resource => { if resource . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: resource_cost :: resource :: NAME)) ; } resource = Some (map . next_value () ?) ; } Field :: amount => { if amount . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: resource_cost :: amount :: NAME)) ; } amount = Some (map . next_value () ?) ; } Field :: material => { if material . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: resource_cost :: material :: NAME)) ; } material = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: resource_cost :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: resource_cost :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: resource_cost :: id :: NAME)) ? ; let resource = resource . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: resource_cost :: resource :: NAME)) ? ; let amount = amount . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: resource_cost :: amount :: NAME)) ? ; let material = material . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: resource_cost :: material :: NAME)) ? ; Ok (Data { id , resource , amount , material , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "resource" , "amount" , "material"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: resource_cost :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "ResourceCost" , 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 :: resource_cost :: $ 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 ; resource) => { "resource" } ; (@ field_serde_name ; amount) => { "amount" } ; (@ field_serde_name ; material) => { "material" } ; } | |
| pub use _include_resource_cost as include; | |
| pub enum IncludeParam { | |
| Id(id::Include), | |
| Resource(resource::Include), | |
| Amount(amount::Include), | |
| Material(material::Include), | |
| } | |
| impl IncludeParam { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::Id(data) => data.to_selection(), | |
| Self::Resource(data) => data.to_selection(), | |
| Self::Amount(data) => data.to_selection(), | |
| Self::Material(data) => data.to_selection(), | |
| } | |
| } | |
| } | |
| #[macro_export] | |
| macro_rules ! _partial_unchecked_resource_cost { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: resource_cost struct $ struct_name { # [serde (rename = "id")] pub id : String , # [serde (rename = "resource")] pub resource : crate :: prisma :: ResourceType , # [serde (rename = "amount")] pub amount : i32 , # [serde (rename = "material")] pub material : crate :: prisma :: MaterialType } [$ ($ scalar_field) , +] } } ; } | |
| pub use _partial_unchecked_resource_cost as partial_unchecked; | |
| #[derive(Debug, Clone, :: serde :: Serialize, :: serde :: Deserialize)] | |
| pub struct Data { | |
| #[serde(rename = "id")] | |
| pub id: String, | |
| #[serde(rename = "resource")] | |
| pub resource: super::ResourceType, | |
| #[serde(rename = "amount")] | |
| pub amount: i32, | |
| #[serde(rename = "material")] | |
| pub material: super::MaterialType, | |
| } | |
| 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 { | |
| SetId(String), | |
| SetResource(super::ResourceType), | |
| SetAmount(i32), | |
| IncrementAmount(i32), | |
| DecrementAmount(i32), | |
| MultiplyAmount(i32), | |
| DivideAmount(i32), | |
| SetMaterial(super::MaterialType), | |
| } | |
| impl From<SetParam> 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::SetResource(value) => ( | |
| resource::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Enum(value.to_string()), | |
| ), | |
| SetParam::SetAmount(value) => ( | |
| amount::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| ), | |
| SetParam::IncrementAmount(value) => ( | |
| amount::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "increment".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DecrementAmount(value) => ( | |
| amount::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "decrement".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::MultiplyAmount(value) => ( | |
| amount::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "multiply".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DivideAmount(value) => ( | |
| amount::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "divide".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::SetMaterial(value) => ( | |
| material::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Enum(value.to_string()), | |
| ), | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum UncheckedSetParam { | |
| Id(String), | |
| Resource(super::ResourceType), | |
| Amount(i32), | |
| Material(super::MaterialType), | |
| } | |
| impl From<UncheckedSetParam> for SetParam { | |
| fn from(param: UncheckedSetParam) -> Self { | |
| match param { | |
| UncheckedSetParam::Id(value) => Self::SetId(value), | |
| UncheckedSetParam::Resource(value) => Self::SetResource(value), | |
| UncheckedSetParam::Amount(value) => Self::SetAmount(value), | |
| UncheckedSetParam::Material(value) => Self::SetMaterial(value), | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum OrderByParam { | |
| Id(::prisma_client_rust::Direction), | |
| Resource(::prisma_client_rust::Direction), | |
| Amount(::prisma_client_rust::Direction), | |
| Material(::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::Resource(direction) => ( | |
| resource::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| Self::Amount(direction) => ( | |
| amount::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| Self::Material(direction) => ( | |
| material::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum WhereParam { | |
| Not(Vec<WhereParam>), | |
| Or(Vec<WhereParam>), | |
| And(Vec<WhereParam>), | |
| Id(_prisma::read_filters::StringFilter), | |
| Resource(_prisma::read_filters::ResourceTypeFilter), | |
| Amount(_prisma::read_filters::IntFilter), | |
| Material(_prisma::read_filters::MaterialTypeFilter), | |
| } | |
| 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::Resource(value) => (resource::NAME, value.into()), | |
| Self::Amount(value) => (amount::NAME, value.into()), | |
| Self::Material(value) => (material::NAME, value.into()), | |
| }; | |
| ::prisma_client_rust::SerializedWhereInput::new(name, value.into()) | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum UniqueWhereParam { | |
| IdEquals(String), | |
| } | |
| impl From<UniqueWhereParam> 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<Self>> for WhereParam { | |
| fn from(op: ::prisma_client_rust::Operator<Self>) -> 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(resource::NAME), | |
| ::prisma_client_rust::sel(amount::NAME), | |
| ::prisma_client_rust::sel(material::NAME), | |
| ] | |
| } | |
| } | |
| pub type UniqueArgs = ::prisma_client_rust::UniqueArgs<Types>; | |
| pub type ManyArgs = ::prisma_client_rust::ManyArgs<Types>; | |
| 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<WhereParam>) -> FindFirst<'a> { | |
| FindFirst::new(self.client, _where) | |
| } | |
| pub fn find_many(self, _where: Vec<WhereParam>) -> FindMany<'a> { | |
| FindMany::new(self.client, _where) | |
| } | |
| pub fn create( | |
| self, | |
| resource: super::ResourceType, | |
| amount: i32, | |
| material: super::MaterialType, | |
| mut _params: Vec<SetParam>, | |
| ) -> Create<'a> { | |
| _params.extend([ | |
| resource::set(resource), | |
| amount::set(amount), | |
| material::set(material), | |
| ]); | |
| Create::new(self.client, _params) | |
| } | |
| pub fn create_unchecked( | |
| self, | |
| resource: super::ResourceType, | |
| amount: i32, | |
| material: super::MaterialType, | |
| mut _params: Vec<UncheckedSetParam>, | |
| ) -> Create<'a> { | |
| _params.extend([ | |
| resource::set(resource), | |
| amount::set(amount), | |
| material::set(material), | |
| ]); | |
| Create::new(self.client, _params.into_iter().map(Into::into).collect()) | |
| } | |
| pub fn create_many( | |
| self, | |
| data: Vec<(super::ResourceType, i32, super::MaterialType, Vec<SetParam>)>, | |
| ) -> CreateMany<'a> { | |
| let data = data | |
| .into_iter() | |
| .map(|(resource, amount, material, mut _params)| { | |
| _params.extend([ | |
| resource::set(resource), | |
| amount::set(amount), | |
| material::set(material), | |
| ]); | |
| _params | |
| }) | |
| .collect(); | |
| CreateMany::new(self.client, data) | |
| } | |
| pub fn update(self, _where: UniqueWhereParam, _params: Vec<SetParam>) -> Update<'a> { | |
| Update::new(self.client, _where.into(), _params, vec![]) | |
| } | |
| pub fn update_unchecked( | |
| self, | |
| _where: UniqueWhereParam, | |
| _params: Vec<UncheckedSetParam>, | |
| ) -> Update<'a> { | |
| Update::new( | |
| self.client, | |
| _where.into(), | |
| _params.into_iter().map(Into::into).collect(), | |
| vec![], | |
| ) | |
| } | |
| pub fn update_many( | |
| self, | |
| _where: Vec<WhereParam>, | |
| _params: Vec<SetParam>, | |
| ) -> UpdateMany<'a> { | |
| UpdateMany::new(self.client, _where, _params) | |
| } | |
| pub fn upsert( | |
| self, | |
| _where: UniqueWhereParam, | |
| (resource, amount, material, mut _params): ( | |
| super::ResourceType, | |
| i32, | |
| super::MaterialType, | |
| Vec<SetParam>, | |
| ), | |
| _update: Vec<SetParam>, | |
| ) -> Upsert<'a> { | |
| _params.extend([ | |
| resource::set(resource), | |
| amount::set(amount), | |
| material::set(material), | |
| ]); | |
| 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<WhereParam>) -> DeleteMany<'a> { | |
| DeleteMany::new(self.client, _where) | |
| } | |
| pub fn count(self, _where: Vec<WhereParam>) -> Count<'a> { | |
| Count::new(self.client, _where) | |
| } | |
| } | |
| } | |
| pub mod region { | |
| use super::_prisma::*; | |
| use super::*; | |
| pub const NAME: &str = "Region"; | |
| 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<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetName(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::Name(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: String) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::Name(direction) | |
| } | |
| pub fn equals<T: From<UniqueWhereParam>>(value: String) -> T { | |
| UniqueWhereParam::NameEquals(value).into() | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::StringFilter, Name, { | |
| fn in_vec(_: Vec<String>) -> InVec; | |
| fn not_in_vec(_: Vec<String>) -> 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<super::IncludeParam> 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<super::SelectParam> 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 adjacent_regions { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "adjacent_regions"; | |
| pub struct Set(pub String); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetAdjacentRegions(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::AdjacentRegions(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: String) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::AdjacentRegions(direction) | |
| } | |
| pub fn equals(value: String) -> WhereParam { | |
| WhereParam::AdjacentRegions(_prisma::read_filters::StringFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!( | |
| _prisma::read_filters::StringFilter, | |
| AdjacentRegions, | |
| { | |
| fn in_vec(_: Vec<String>) -> InVec; | |
| fn not_in_vec(_: Vec<String>) -> 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<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::AdjacentRegions(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::AdjacentRegions(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod hero_region { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "HeroRegion"; | |
| pub struct Fetch(pub hero_region::ManyArgs); | |
| impl Fetch { | |
| pub fn with(mut self, params: impl Into<hero_region::WithParam>) -> Self { | |
| self.0 = self.0.with(params.into()); | |
| self | |
| } | |
| pub fn order_by(mut self, param: hero_region::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: hero_region::UniqueWhereParam) -> Self { | |
| self.0 = self.0.cursor(value.into()); | |
| self | |
| } | |
| } | |
| impl From<Fetch> for WithParam { | |
| fn from(Fetch(v): Fetch) -> Self { | |
| WithParam::HeroRegion(v) | |
| } | |
| } | |
| pub fn fetch(params: Vec<hero_region::WhereParam>) -> Fetch { | |
| Fetch(hero_region::ManyArgs::new(params)) | |
| } | |
| pub struct Connect(pub Vec<hero_region::UniqueWhereParam>); | |
| impl From<Connect> for SetParam { | |
| fn from(Connect(v): Connect) -> Self { | |
| Self::ConnectHeroRegion(v) | |
| } | |
| } | |
| pub fn connect<T: From<Connect>>(params: Vec<hero_region::UniqueWhereParam>) -> T { | |
| Connect(params).into() | |
| } | |
| pub fn disconnect(params: Vec<hero_region::UniqueWhereParam>) -> SetParam { | |
| SetParam::DisconnectHeroRegion(params) | |
| } | |
| pub fn set(params: Vec<hero_region::UniqueWhereParam>) -> SetParam { | |
| SetParam::SetHeroRegion(params) | |
| } | |
| pub fn some(value: Vec<hero_region::WhereParam>) -> WhereParam { | |
| WhereParam::HeroRegionSome(value) | |
| } | |
| pub fn every(value: Vec<hero_region::WhereParam>) -> WhereParam { | |
| WhereParam::HeroRegionEvery(value) | |
| } | |
| pub fn none(value: Vec<hero_region::WhereParam>) -> WhereParam { | |
| WhereParam::HeroRegionNone(value) | |
| } | |
| pub enum Include { | |
| Select(hero_region::ManyArgs, Vec<hero_region::SelectParam>), | |
| Include(hero_region::ManyArgs, Vec<hero_region::IncludeParam>), | |
| Fetch(hero_region::ManyArgs), | |
| } | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::HeroRegion(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 = < hero_region :: 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, | |
| <hero_region::Types as ::prisma_client_rust::ModelTypes>::scalar_selections( | |
| ), | |
| ), | |
| }; | |
| ::prisma_client_rust::Selection::new(NAME, None, args, selections) | |
| } | |
| pub fn select( | |
| args: hero_region::ManyArgs, | |
| nested_selections: Vec<hero_region::SelectParam>, | |
| ) -> Self { | |
| Self::Select(args, nested_selections) | |
| } | |
| pub fn include( | |
| args: hero_region::ManyArgs, | |
| nested_selections: Vec<hero_region::IncludeParam>, | |
| ) -> Self { | |
| Self::Include(args, nested_selections) | |
| } | |
| } | |
| pub enum Select { | |
| Select(hero_region::ManyArgs, Vec<hero_region::SelectParam>), | |
| Include(hero_region::ManyArgs, Vec<hero_region::IncludeParam>), | |
| Fetch(hero_region::ManyArgs), | |
| } | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::HeroRegion(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, | |
| <hero_region::Types as ::prisma_client_rust::ModelTypes>::scalar_selections( | |
| ), | |
| ), | |
| }; | |
| ::prisma_client_rust::Selection::new(NAME, None, args, selections) | |
| } | |
| pub fn select( | |
| args: hero_region::ManyArgs, | |
| nested_selections: Vec<hero_region::SelectParam>, | |
| ) -> Self { | |
| Self::Select(args, nested_selections) | |
| } | |
| pub fn include( | |
| args: hero_region::ManyArgs, | |
| nested_selections: Vec<hero_region::IncludeParam>, | |
| ) -> Self { | |
| Self::Include(args, nested_selections) | |
| } | |
| } | |
| } | |
| pub mod leyline { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "Leyline"; | |
| pub struct Fetch(pub leyline::ManyArgs); | |
| impl Fetch { | |
| pub fn with(mut self, params: impl Into<leyline::WithParam>) -> Self { | |
| self.0 = self.0.with(params.into()); | |
| self | |
| } | |
| pub fn order_by(mut self, param: leyline::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: leyline::UniqueWhereParam) -> Self { | |
| self.0 = self.0.cursor(value.into()); | |
| self | |
| } | |
| } | |
| impl From<Fetch> for WithParam { | |
| fn from(Fetch(v): Fetch) -> Self { | |
| WithParam::Leyline(v) | |
| } | |
| } | |
| pub fn fetch(params: Vec<leyline::WhereParam>) -> Fetch { | |
| Fetch(leyline::ManyArgs::new(params)) | |
| } | |
| pub struct Connect(pub Vec<leyline::UniqueWhereParam>); | |
| impl From<Connect> for SetParam { | |
| fn from(Connect(v): Connect) -> Self { | |
| Self::ConnectLeyline(v) | |
| } | |
| } | |
| pub fn connect<T: From<Connect>>(params: Vec<leyline::UniqueWhereParam>) -> T { | |
| Connect(params).into() | |
| } | |
| pub fn disconnect(params: Vec<leyline::UniqueWhereParam>) -> SetParam { | |
| SetParam::DisconnectLeyline(params) | |
| } | |
| pub fn set(params: Vec<leyline::UniqueWhereParam>) -> SetParam { | |
| SetParam::SetLeyline(params) | |
| } | |
| pub fn some(value: Vec<leyline::WhereParam>) -> WhereParam { | |
| WhereParam::LeylineSome(value) | |
| } | |
| pub fn every(value: Vec<leyline::WhereParam>) -> WhereParam { | |
| WhereParam::LeylineEvery(value) | |
| } | |
| pub fn none(value: Vec<leyline::WhereParam>) -> WhereParam { | |
| WhereParam::LeylineNone(value) | |
| } | |
| pub enum Include { | |
| Select(leyline::ManyArgs, Vec<leyline::SelectParam>), | |
| Include(leyline::ManyArgs, Vec<leyline::IncludeParam>), | |
| Fetch(leyline::ManyArgs), | |
| } | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Leyline(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 = | |
| <leyline::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, | |
| <leyline::Types as ::prisma_client_rust::ModelTypes>::scalar_selections(), | |
| ), | |
| }; | |
| ::prisma_client_rust::Selection::new(NAME, None, args, selections) | |
| } | |
| pub fn select( | |
| args: leyline::ManyArgs, | |
| nested_selections: Vec<leyline::SelectParam>, | |
| ) -> Self { | |
| Self::Select(args, nested_selections) | |
| } | |
| pub fn include( | |
| args: leyline::ManyArgs, | |
| nested_selections: Vec<leyline::IncludeParam>, | |
| ) -> Self { | |
| Self::Include(args, nested_selections) | |
| } | |
| } | |
| pub enum Select { | |
| Select(leyline::ManyArgs, Vec<leyline::SelectParam>), | |
| Include(leyline::ManyArgs, Vec<leyline::IncludeParam>), | |
| Fetch(leyline::ManyArgs), | |
| } | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Leyline(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, | |
| <leyline::Types as ::prisma_client_rust::ModelTypes>::scalar_selections(), | |
| ), | |
| }; | |
| ::prisma_client_rust::Selection::new(NAME, None, args, selections) | |
| } | |
| pub fn select( | |
| args: leyline::ManyArgs, | |
| nested_selections: Vec<leyline::SelectParam>, | |
| ) -> Self { | |
| Self::Select(args, nested_selections) | |
| } | |
| pub fn include( | |
| args: leyline::ManyArgs, | |
| nested_selections: Vec<leyline::IncludeParam>, | |
| ) -> Self { | |
| Self::Include(args, nested_selections) | |
| } | |
| } | |
| } | |
| pub fn create( | |
| name: String, | |
| adjacent_regions: String, | |
| _params: Vec<SetParam>, | |
| ) -> (String, String, Vec<SetParam>) { | |
| (name, adjacent_regions, _params) | |
| } | |
| pub fn create_unchecked( | |
| name: String, | |
| adjacent_regions: String, | |
| _params: Vec<SetParam>, | |
| ) -> (String, String, Vec<SetParam>) { | |
| (name, adjacent_regions, _params) | |
| } | |
| #[macro_export] | |
| macro_rules ! _select_region { ($ (($ ($ 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 :: region :: 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 :: region :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: region :: 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 :: region :: 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 :: region :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: region :: 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 , adjacent_regions , hero_region , leyline } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { $ (pub $ field : crate :: prisma :: region :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } 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 :: region :: $ 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 :: region :: $ 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 :: region :: $ 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 :: region :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: region :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["name" , "adjacent_regions" , "HeroRegion" , "Leyline"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: region :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; name) => { String } ; (@ field_type ; adjacent_regions) => { String } ; (@ field_type ; hero_region : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < hero_region :: Data > } ; (@ field_type ; hero_region) => { Vec < crate :: prisma :: hero_region :: Data > } ; (@ field_type ; leyline : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < leyline :: Data > } ; (@ field_type ; leyline) => { Vec < crate :: prisma :: leyline :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Region" , available relations are "name, adjacent_regions, hero_region, leyline")) } ; (@ field_module ; hero_region : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: hero_region :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; leyline : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: leyline :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; name) => { Into :: < crate :: prisma :: region :: SelectParam > :: into (crate :: prisma :: region :: name :: Select) } ; (@ selection_field_to_selection_param ; adjacent_regions) => { Into :: < crate :: prisma :: region :: SelectParam > :: into (crate :: prisma :: region :: adjacent_regions :: Select) } ; (@ selection_field_to_selection_param ; hero_region $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: region :: SelectParam > :: into (crate :: prisma :: region :: hero_region :: Select :: $ selection_mode (crate :: prisma :: hero_region :: ManyArgs :: new (crate :: prisma :: hero_region :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: hero_region :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; hero_region $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: region :: SelectParam > :: into (crate :: prisma :: region :: hero_region :: Select :: Fetch (crate :: prisma :: hero_region :: ManyArgs :: new (crate :: prisma :: hero_region :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; leyline $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: region :: SelectParam > :: into (crate :: prisma :: region :: leyline :: Select :: $ selection_mode (crate :: prisma :: leyline :: ManyArgs :: new (crate :: prisma :: leyline :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: leyline :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; leyline $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: region :: SelectParam > :: into (crate :: prisma :: region :: leyline :: Select :: Fetch (crate :: prisma :: leyline :: ManyArgs :: new (crate :: prisma :: leyline :: 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 :: region :: $ 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 ; adjacent_regions) => { "adjacent_regions" } ; (@ field_serde_name ; hero_region) => { "HeroRegion" } ; (@ field_serde_name ; leyline) => { "Leyline" } ; } | |
| pub use _select_region as select; | |
| pub enum SelectParam { | |
| Name(name::Select), | |
| AdjacentRegions(adjacent_regions::Select), | |
| HeroRegion(hero_region::Select), | |
| Leyline(leyline::Select), | |
| } | |
| impl SelectParam { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::Name(data) => data.to_selection(), | |
| Self::AdjacentRegions(data) => data.to_selection(), | |
| Self::HeroRegion(data) => data.to_selection(), | |
| Self::Leyline(data) => data.to_selection(), | |
| } | |
| } | |
| } | |
| #[macro_export] | |
| macro_rules ! _include_region { ($ (($ ($ 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 :: region :: 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 :: region :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: region :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: region :: 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 :: region :: 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 :: region :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: region :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: region :: 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 { hero_region , leyline } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { pub name : String , pub adjacent_regions : String , $ (pub $ field : crate :: prisma :: region :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } 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 ! (adjacent_regions)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: region :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: region :: name :: NAME , & self . name) ? ; state . serialize_field (crate :: prisma :: region :: adjacent_regions :: NAME , & self . adjacent_regions) ? ; 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 , adjacent_regions } 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 :: region :: $ field :: NAME) , + , crate :: prisma :: region :: name :: NAME , crate :: prisma :: region :: adjacent_regions :: 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 :: region :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: region :: name :: NAME => Ok (Field :: name) , crate :: prisma :: region :: adjacent_regions :: NAME => Ok (Field :: adjacent_regions) , _ => 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 adjacent_regions = 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 :: region :: name :: NAME)) ; } name = Some (map . next_value () ?) ; } Field :: adjacent_regions => { if adjacent_regions . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: region :: adjacent_regions :: NAME)) ; } adjacent_regions = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: region :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: region :: $ field :: NAME)) ? ;) * let name = name . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: region :: name :: NAME)) ? ; let adjacent_regions = adjacent_regions . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: region :: adjacent_regions :: NAME)) ? ; Ok (Data { name , adjacent_regions , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["name" , "adjacent_regions" , "HeroRegion" , "Leyline"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: region :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; hero_region : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < hero_region :: Data > } ; (@ field_type ; hero_region) => { Vec < crate :: prisma :: hero_region :: Data > } ; (@ field_type ; leyline : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < leyline :: Data > } ; (@ field_type ; leyline) => { Vec < crate :: prisma :: leyline :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Region" , available relations are "hero_region, leyline")) } ; (@ field_module ; hero_region : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: hero_region :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; leyline : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: leyline :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; hero_region $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: region :: IncludeParam > :: into (crate :: prisma :: region :: hero_region :: Include :: $ selection_mode (crate :: prisma :: hero_region :: ManyArgs :: new (crate :: prisma :: hero_region :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: hero_region :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; hero_region $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: region :: IncludeParam > :: into (crate :: prisma :: region :: hero_region :: Include :: Fetch (crate :: prisma :: hero_region :: ManyArgs :: new (crate :: prisma :: hero_region :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; leyline $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: region :: IncludeParam > :: into (crate :: prisma :: region :: leyline :: Include :: $ selection_mode (crate :: prisma :: leyline :: ManyArgs :: new (crate :: prisma :: leyline :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: leyline :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; leyline $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: region :: IncludeParam > :: into (crate :: prisma :: region :: leyline :: Include :: Fetch (crate :: prisma :: leyline :: ManyArgs :: new (crate :: prisma :: leyline :: 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 :: region :: $ 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 ; adjacent_regions) => { "adjacent_regions" } ; (@ field_serde_name ; hero_region) => { "HeroRegion" } ; (@ field_serde_name ; leyline) => { "Leyline" } ; } | |
| pub use _include_region as include; | |
| pub enum IncludeParam { | |
| Name(name::Include), | |
| AdjacentRegions(adjacent_regions::Include), | |
| HeroRegion(hero_region::Include), | |
| Leyline(leyline::Include), | |
| } | |
| impl IncludeParam { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::Name(data) => data.to_selection(), | |
| Self::AdjacentRegions(data) => data.to_selection(), | |
| Self::HeroRegion(data) => data.to_selection(), | |
| Self::Leyline(data) => data.to_selection(), | |
| } | |
| } | |
| } | |
| #[macro_export] | |
| macro_rules ! _partial_unchecked_region { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: region struct $ struct_name { # [serde (rename = "name")] pub name : String , # [serde (rename = "adjacent_regions")] pub adjacent_regions : String } [$ ($ scalar_field) , +] } } ; } | |
| pub use _partial_unchecked_region as partial_unchecked; | |
| #[derive(Debug, Clone, :: serde :: Serialize, :: serde :: Deserialize)] | |
| pub struct Data { | |
| #[serde(rename = "name")] | |
| pub name: String, | |
| #[serde(rename = "adjacent_regions")] | |
| pub adjacent_regions: String, | |
| #[serde(rename = "HeroRegion")] | |
| pub hero_region: Option<Vec<super::hero_region::Data>>, | |
| #[serde(rename = "Leyline")] | |
| pub leyline: Option<Vec<super::leyline::Data>>, | |
| } | |
| impl Data { | |
| pub fn hero_region( | |
| &self, | |
| ) -> Result<&Vec<super::hero_region::Data>, ::prisma_client_rust::RelationNotFetchedError> | |
| { | |
| self.hero_region | |
| .as_ref() | |
| .ok_or(::prisma_client_rust::RelationNotFetchedError::new( | |
| stringify!(hero_region), | |
| )) | |
| } | |
| pub fn leyline( | |
| &self, | |
| ) -> Result<&Vec<super::leyline::Data>, ::prisma_client_rust::RelationNotFetchedError> | |
| { | |
| self.leyline | |
| .as_ref() | |
| .ok_or(::prisma_client_rust::RelationNotFetchedError::new( | |
| stringify!(leyline), | |
| )) | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum WithParam { | |
| HeroRegion(super::hero_region::ManyArgs), | |
| Leyline(super::leyline::ManyArgs), | |
| } | |
| impl Into<::prisma_client_rust::Selection> for WithParam { | |
| fn into(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::HeroRegion(args) => { | |
| let (arguments, mut nested_selections) = args.to_graphql(); | |
| nested_selections . extend (< super :: hero_region :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) ; | |
| ::prisma_client_rust::Selection::new( | |
| hero_region::NAME, | |
| None, | |
| arguments, | |
| nested_selections, | |
| ) | |
| } | |
| Self::Leyline(args) => { | |
| let (arguments, mut nested_selections) = args.to_graphql(); | |
| nested_selections . extend (< super :: leyline :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) ; | |
| ::prisma_client_rust::Selection::new( | |
| leyline::NAME, | |
| None, | |
| arguments, | |
| nested_selections, | |
| ) | |
| } | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum SetParam { | |
| SetName(String), | |
| SetAdjacentRegions(String), | |
| ConnectHeroRegion(Vec<super::hero_region::UniqueWhereParam>), | |
| DisconnectHeroRegion(Vec<super::hero_region::UniqueWhereParam>), | |
| SetHeroRegion(Vec<super::hero_region::UniqueWhereParam>), | |
| ConnectLeyline(Vec<super::leyline::UniqueWhereParam>), | |
| DisconnectLeyline(Vec<super::leyline::UniqueWhereParam>), | |
| SetLeyline(Vec<super::leyline::UniqueWhereParam>), | |
| } | |
| impl From<SetParam> 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::SetAdjacentRegions(value) => ( | |
| adjacent_regions::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(value), | |
| ), | |
| SetParam::ConnectHeroRegion(where_params) => ( | |
| hero_region::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "connect".to_string(), | |
| ::prisma_client_rust::PrismaValue::List( | |
| where_params | |
| .into_iter() | |
| .map(Into::<super::hero_region::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::DisconnectHeroRegion(where_params) => ( | |
| hero_region::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "disconnect".to_string(), | |
| ::prisma_client_rust::PrismaValue::List( | |
| where_params | |
| .into_iter() | |
| .map(Into::<super::hero_region::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::SetHeroRegion(where_params) => ( | |
| hero_region::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "set".to_string(), | |
| ::prisma_client_rust::PrismaValue::List( | |
| where_params | |
| .into_iter() | |
| .map(Into::<super::hero_region::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::ConnectLeyline(where_params) => ( | |
| leyline::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "connect".to_string(), | |
| ::prisma_client_rust::PrismaValue::List( | |
| where_params | |
| .into_iter() | |
| .map(Into::<super::leyline::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::DisconnectLeyline(where_params) => ( | |
| leyline::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "disconnect".to_string(), | |
| ::prisma_client_rust::PrismaValue::List( | |
| where_params | |
| .into_iter() | |
| .map(Into::<super::leyline::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::SetLeyline(where_params) => ( | |
| leyline::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "set".to_string(), | |
| ::prisma_client_rust::PrismaValue::List( | |
| where_params | |
| .into_iter() | |
| .map(Into::<super::leyline::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(), | |
| ), | |
| )]), | |
| ), | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum UncheckedSetParam { | |
| Name(String), | |
| AdjacentRegions(String), | |
| } | |
| impl From<UncheckedSetParam> for SetParam { | |
| fn from(param: UncheckedSetParam) -> Self { | |
| match param { | |
| UncheckedSetParam::Name(value) => Self::SetName(value), | |
| UncheckedSetParam::AdjacentRegions(value) => Self::SetAdjacentRegions(value), | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum OrderByParam { | |
| Name(::prisma_client_rust::Direction), | |
| AdjacentRegions(::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::AdjacentRegions(direction) => ( | |
| adjacent_regions::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum WhereParam { | |
| Not(Vec<WhereParam>), | |
| Or(Vec<WhereParam>), | |
| And(Vec<WhereParam>), | |
| Name(_prisma::read_filters::StringFilter), | |
| AdjacentRegions(_prisma::read_filters::StringFilter), | |
| HeroRegionSome(Vec<super::hero_region::WhereParam>), | |
| HeroRegionEvery(Vec<super::hero_region::WhereParam>), | |
| HeroRegionNone(Vec<super::hero_region::WhereParam>), | |
| LeylineSome(Vec<super::leyline::WhereParam>), | |
| LeylineEvery(Vec<super::leyline::WhereParam>), | |
| LeylineNone(Vec<super::leyline::WhereParam>), | |
| } | |
| 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::AdjacentRegions(value) => (adjacent_regions::NAME, value.into()), | |
| Self::HeroRegionSome(where_params) => ( | |
| hero_region::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::HeroRegionEvery(where_params) => ( | |
| hero_region::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::HeroRegionNone(where_params) => ( | |
| hero_region::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::LeylineSome(where_params) => ( | |
| leyline::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::LeylineEvery(where_params) => ( | |
| leyline::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::LeylineNone(where_params) => ( | |
| leyline::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 { | |
| NameEquals(String), | |
| } | |
| impl From<UniqueWhereParam> 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<Self>> for WhereParam { | |
| fn from(op: ::prisma_client_rust::Operator<Self>) -> 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(adjacent_regions::NAME), | |
| ] | |
| } | |
| } | |
| pub type UniqueArgs = ::prisma_client_rust::UniqueArgs<Types>; | |
| pub type ManyArgs = ::prisma_client_rust::ManyArgs<Types>; | |
| 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<WhereParam>) -> FindFirst<'a> { | |
| FindFirst::new(self.client, _where) | |
| } | |
| pub fn find_many(self, _where: Vec<WhereParam>) -> FindMany<'a> { | |
| FindMany::new(self.client, _where) | |
| } | |
| pub fn create( | |
| self, | |
| name: String, | |
| adjacent_regions: String, | |
| mut _params: Vec<SetParam>, | |
| ) -> Create<'a> { | |
| _params.extend([name::set(name), adjacent_regions::set(adjacent_regions)]); | |
| Create::new(self.client, _params) | |
| } | |
| pub fn create_unchecked( | |
| self, | |
| name: String, | |
| adjacent_regions: String, | |
| mut _params: Vec<UncheckedSetParam>, | |
| ) -> Create<'a> { | |
| _params.extend([name::set(name), adjacent_regions::set(adjacent_regions)]); | |
| Create::new(self.client, _params.into_iter().map(Into::into).collect()) | |
| } | |
| pub fn create_many(self, data: Vec<(String, String, Vec<SetParam>)>) -> CreateMany<'a> { | |
| let data = data | |
| .into_iter() | |
| .map(|(name, adjacent_regions, mut _params)| { | |
| _params.extend([name::set(name), adjacent_regions::set(adjacent_regions)]); | |
| _params | |
| }) | |
| .collect(); | |
| CreateMany::new(self.client, data) | |
| } | |
| pub fn update(self, _where: UniqueWhereParam, _params: Vec<SetParam>) -> Update<'a> { | |
| Update::new(self.client, _where.into(), _params, vec![]) | |
| } | |
| pub fn update_unchecked( | |
| self, | |
| _where: UniqueWhereParam, | |
| _params: Vec<UncheckedSetParam>, | |
| ) -> Update<'a> { | |
| Update::new( | |
| self.client, | |
| _where.into(), | |
| _params.into_iter().map(Into::into).collect(), | |
| vec![], | |
| ) | |
| } | |
| pub fn update_many( | |
| self, | |
| _where: Vec<WhereParam>, | |
| _params: Vec<SetParam>, | |
| ) -> UpdateMany<'a> { | |
| UpdateMany::new(self.client, _where, _params) | |
| } | |
| pub fn upsert( | |
| self, | |
| _where: UniqueWhereParam, | |
| (name, adjacent_regions, mut _params): (String, String, Vec<SetParam>), | |
| _update: Vec<SetParam>, | |
| ) -> Upsert<'a> { | |
| _params.extend([name::set(name), adjacent_regions::set(adjacent_regions)]); | |
| 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<WhereParam>) -> DeleteMany<'a> { | |
| DeleteMany::new(self.client, _where) | |
| } | |
| pub fn count(self, _where: Vec<WhereParam>) -> Count<'a> { | |
| Count::new(self.client, _where) | |
| } | |
| } | |
| } | |
| pub mod leyline { | |
| use super::_prisma::*; | |
| use super::*; | |
| pub const NAME: &str = "Leyline"; | |
| 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<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetId(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::Id(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: String) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::Id(direction) | |
| } | |
| pub fn equals<T: From<UniqueWhereParam>>(value: String) -> T { | |
| UniqueWhereParam::IdEquals(value).into() | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::StringFilter, Id, { | |
| fn in_vec(_: Vec<String>) -> InVec; | |
| fn not_in_vec(_: Vec<String>) -> 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<super::IncludeParam> 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<super::SelectParam> 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 location { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "location"; | |
| pub struct Set(pub String); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetLocation(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::Location(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: String) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::Location(direction) | |
| } | |
| pub fn equals(value: String) -> WhereParam { | |
| WhereParam::Location(_prisma::read_filters::StringFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!( | |
| _prisma::read_filters::StringFilter, | |
| Location, | |
| { | |
| fn in_vec(_: Vec<String>) -> InVec; | |
| fn not_in_vec(_: Vec<String>) -> 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<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Location(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Location(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod xp_reward { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "xp_reward"; | |
| pub struct Set(pub i32); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetXpReward(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::XpReward(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: i32) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::XpReward(direction) | |
| } | |
| pub fn equals(value: i32) -> WhereParam { | |
| WhereParam::XpReward(_prisma::read_filters::IntFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!( | |
| _prisma::read_filters::IntFilter, | |
| XpReward, | |
| { | |
| fn in_vec(_: Vec<i32>) -> InVec; | |
| fn not_in_vec(_: Vec<i32>) -> 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::IncrementXpReward(value) | |
| } | |
| pub fn decrement(value: i32) -> SetParam { | |
| SetParam::DecrementXpReward(value) | |
| } | |
| pub fn multiply(value: i32) -> SetParam { | |
| SetParam::MultiplyXpReward(value) | |
| } | |
| pub fn divide(value: i32) -> SetParam { | |
| SetParam::DivideXpReward(value) | |
| } | |
| pub struct Include; | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::XpReward(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::XpReward(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod region_name { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "RegionName"; | |
| pub struct Set(pub String); | |
| impl From<Set> for SetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::SetRegionName(v) | |
| } | |
| } | |
| impl From<Set> for UncheckedSetParam { | |
| fn from(Set(v): Set) -> Self { | |
| Self::RegionName(v) | |
| } | |
| } | |
| pub fn set<T: From<Set>>(value: String) -> T { | |
| Set(value).into() | |
| } | |
| pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { | |
| OrderByParam::RegionName(direction) | |
| } | |
| pub fn equals(value: String) -> WhereParam { | |
| WhereParam::RegionName(_prisma::read_filters::StringFilter::Equals(value)) | |
| } | |
| ::prisma_client_rust::scalar_where_param_fns!( | |
| _prisma::read_filters::StringFilter, | |
| RegionName, | |
| { | |
| fn in_vec(_: Vec<String>) -> InVec; | |
| fn not_in_vec(_: Vec<String>) -> 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<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::RegionName(self) | |
| } | |
| } | |
| impl Include { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| pub struct Select; | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::RegionName(self) | |
| } | |
| } | |
| impl Select { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| ::prisma_client_rust::sel(NAME) | |
| } | |
| } | |
| } | |
| pub mod region { | |
| use super::super::*; | |
| use super::_prisma::*; | |
| use super::{ | |
| OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam, WithParam, | |
| }; | |
| pub const NAME: &str = "Region"; | |
| pub struct Fetch(pub region::UniqueArgs); | |
| impl Fetch { | |
| pub fn with(mut self, params: impl Into<region::WithParam>) -> Self { | |
| self.0 = self.0.with(params.into()); | |
| self | |
| } | |
| } | |
| impl From<Fetch> for WithParam { | |
| fn from(Fetch(v): Fetch) -> Self { | |
| WithParam::Region(v) | |
| } | |
| } | |
| pub fn fetch() -> Fetch { | |
| Fetch(region::UniqueArgs::new()) | |
| } | |
| pub struct Connect(region::UniqueWhereParam); | |
| impl From<Connect> for SetParam { | |
| fn from(Connect(v): Connect) -> Self { | |
| Self::ConnectRegion(v) | |
| } | |
| } | |
| pub fn connect<T: From<Connect>>(value: region::UniqueWhereParam) -> T { | |
| Connect(value).into() | |
| } | |
| pub fn is(value: Vec<region::WhereParam>) -> WhereParam { | |
| WhereParam::RegionIs(value) | |
| } | |
| pub fn is_not(value: Vec<region::WhereParam>) -> WhereParam { | |
| WhereParam::RegionIsNot(value) | |
| } | |
| pub enum Include { | |
| Select(Vec<region::SelectParam>), | |
| Include(Vec<region::IncludeParam>), | |
| Fetch, | |
| } | |
| impl Into<super::IncludeParam> for Include { | |
| fn into(self) -> super::IncludeParam { | |
| super::IncludeParam::Region(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 = | |
| <region::Types as ::prisma_client_rust::ModelTypes>::scalar_selections( | |
| ); | |
| nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); | |
| nested_selections | |
| } | |
| Self::Fetch => { | |
| <region::Types as ::prisma_client_rust::ModelTypes>::scalar_selections() | |
| } | |
| }; | |
| ::prisma_client_rust::Selection::new("Region", None, [], selections) | |
| } | |
| pub fn select(nested_selections: Vec<region::SelectParam>) -> Self { | |
| Self::Select(nested_selections) | |
| } | |
| pub fn include(nested_selections: Vec<region::IncludeParam>) -> Self { | |
| Self::Include(nested_selections) | |
| } | |
| } | |
| pub enum Select { | |
| Select(Vec<region::SelectParam>), | |
| Include(Vec<region::IncludeParam>), | |
| Fetch, | |
| } | |
| impl Into<super::SelectParam> for Select { | |
| fn into(self) -> super::SelectParam { | |
| super::SelectParam::Region(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 => { | |
| <region::Types as ::prisma_client_rust::ModelTypes>::scalar_selections() | |
| } | |
| }; | |
| ::prisma_client_rust::Selection::new("Region", None, [], selections) | |
| } | |
| pub fn select(nested_selections: Vec<region::SelectParam>) -> Self { | |
| Self::Select(nested_selections) | |
| } | |
| pub fn include(nested_selections: Vec<region::IncludeParam>) -> Self { | |
| Self::Include(nested_selections) | |
| } | |
| } | |
| } | |
| pub fn create( | |
| location: String, | |
| xp_reward: i32, | |
| region: super::region::UniqueWhereParam, | |
| _params: Vec<SetParam>, | |
| ) -> (String, i32, super::region::UniqueWhereParam, Vec<SetParam>) { | |
| (location, xp_reward, region, _params) | |
| } | |
| pub fn create_unchecked( | |
| location: String, | |
| xp_reward: i32, | |
| region_name: String, | |
| _params: Vec<SetParam>, | |
| ) -> (String, i32, String, Vec<SetParam>) { | |
| (location, xp_reward, region_name, _params) | |
| } | |
| #[macro_export] | |
| macro_rules ! _select_leyline { ($ (($ ($ 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 :: leyline :: 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 :: leyline :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: leyline :: 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 :: leyline :: 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 :: leyline :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: leyline :: 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 , location , xp_reward , region_name , region } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { $ (pub $ field : crate :: prisma :: leyline :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } 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 :: leyline :: $ 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 :: leyline :: $ 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 :: leyline :: $ 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 :: leyline :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: leyline :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "location" , "xp_reward" , "RegionName" , "Region"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: leyline :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { String } ; (@ field_type ; location) => { String } ; (@ field_type ; xp_reward) => { i32 } ; (@ field_type ; region_name) => { String } ; (@ field_type ; region : $ selection_mode : ident { $ ($ selections : tt) + }) => { region :: Data } ; (@ field_type ; region) => { crate :: prisma :: region :: Data } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Leyline" , available relations are "id, location, xp_reward, region_name, region")) } ; (@ field_module ; region : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: region :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: leyline :: SelectParam > :: into (crate :: prisma :: leyline :: id :: Select) } ; (@ selection_field_to_selection_param ; location) => { Into :: < crate :: prisma :: leyline :: SelectParam > :: into (crate :: prisma :: leyline :: location :: Select) } ; (@ selection_field_to_selection_param ; xp_reward) => { Into :: < crate :: prisma :: leyline :: SelectParam > :: into (crate :: prisma :: leyline :: xp_reward :: Select) } ; (@ selection_field_to_selection_param ; region_name) => { Into :: < crate :: prisma :: leyline :: SelectParam > :: into (crate :: prisma :: leyline :: region_name :: Select) } ; (@ selection_field_to_selection_param ; region $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: leyline :: SelectParam > :: into (crate :: prisma :: leyline :: region :: Select :: $ selection_mode (crate :: prisma :: region :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; region $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: leyline :: SelectParam > :: into (crate :: prisma :: leyline :: region :: 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 :: leyline :: $ 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 ; location) => { "location" } ; (@ field_serde_name ; xp_reward) => { "xp_reward" } ; (@ field_serde_name ; region_name) => { "RegionName" } ; (@ field_serde_name ; region) => { "Region" } ; } | |
| pub use _select_leyline as select; | |
| pub enum SelectParam { | |
| Id(id::Select), | |
| Location(location::Select), | |
| XpReward(xp_reward::Select), | |
| RegionName(region_name::Select), | |
| Region(region::Select), | |
| } | |
| impl SelectParam { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::Id(data) => data.to_selection(), | |
| Self::Location(data) => data.to_selection(), | |
| Self::XpReward(data) => data.to_selection(), | |
| Self::RegionName(data) => data.to_selection(), | |
| Self::Region(data) => data.to_selection(), | |
| } | |
| } | |
| } | |
| #[macro_export] | |
| macro_rules ! _include_leyline { ($ (($ ($ 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 :: leyline :: 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 :: leyline :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: leyline :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: leyline :: 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 :: leyline :: 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 :: leyline :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: leyline :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: leyline :: 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 { region } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { pub id : String , pub location : String , pub xp_reward : i32 , pub region_name : String , $ (pub $ field : crate :: prisma :: leyline :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } 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 ! (location) , stringify ! (xp_reward) , stringify ! (region_name)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: leyline :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: leyline :: id :: NAME , & self . id) ? ; state . serialize_field (crate :: prisma :: leyline :: location :: NAME , & self . location) ? ; state . serialize_field (crate :: prisma :: leyline :: xp_reward :: NAME , & self . xp_reward) ? ; state . serialize_field (crate :: prisma :: leyline :: region_name :: NAME , & self . region_name) ? ; 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 , location , xp_reward , region_name } 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 :: leyline :: $ field :: NAME) , + , crate :: prisma :: leyline :: id :: NAME , crate :: prisma :: leyline :: location :: NAME , crate :: prisma :: leyline :: xp_reward :: NAME , crate :: prisma :: leyline :: region_name :: 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 :: leyline :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: leyline :: id :: NAME => Ok (Field :: id) , crate :: prisma :: leyline :: location :: NAME => Ok (Field :: location) , crate :: prisma :: leyline :: xp_reward :: NAME => Ok (Field :: xp_reward) , crate :: prisma :: leyline :: region_name :: NAME => Ok (Field :: region_name) , _ => 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 location = None ; let mut xp_reward = None ; let mut region_name = 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 :: leyline :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } Field :: location => { if location . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: leyline :: location :: NAME)) ; } location = Some (map . next_value () ?) ; } Field :: xp_reward => { if xp_reward . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: leyline :: xp_reward :: NAME)) ; } xp_reward = Some (map . next_value () ?) ; } Field :: region_name => { if region_name . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: leyline :: region_name :: NAME)) ; } region_name = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: leyline :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: leyline :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: leyline :: id :: NAME)) ? ; let location = location . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: leyline :: location :: NAME)) ? ; let xp_reward = xp_reward . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: leyline :: xp_reward :: NAME)) ? ; let region_name = region_name . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: leyline :: region_name :: NAME)) ? ; Ok (Data { id , location , xp_reward , region_name , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "location" , "xp_reward" , "RegionName" , "Region"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: leyline :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; region : $ selection_mode : ident { $ ($ selections : tt) + }) => { region :: Data } ; (@ field_type ; region) => { crate :: prisma :: region :: Data } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Leyline" , available relations are "region")) } ; (@ field_module ; region : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: region :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; region $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: leyline :: IncludeParam > :: into (crate :: prisma :: leyline :: region :: Include :: $ selection_mode (crate :: prisma :: region :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; region $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: leyline :: IncludeParam > :: into (crate :: prisma :: leyline :: region :: 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 :: leyline :: $ 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 ; location) => { "location" } ; (@ field_serde_name ; xp_reward) => { "xp_reward" } ; (@ field_serde_name ; region_name) => { "RegionName" } ; (@ field_serde_name ; region) => { "Region" } ; } | |
| pub use _include_leyline as include; | |
| pub enum IncludeParam { | |
| Id(id::Include), | |
| Location(location::Include), | |
| XpReward(xp_reward::Include), | |
| RegionName(region_name::Include), | |
| Region(region::Include), | |
| } | |
| impl IncludeParam { | |
| pub fn to_selection(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::Id(data) => data.to_selection(), | |
| Self::Location(data) => data.to_selection(), | |
| Self::XpReward(data) => data.to_selection(), | |
| Self::RegionName(data) => data.to_selection(), | |
| Self::Region(data) => data.to_selection(), | |
| } | |
| } | |
| } | |
| #[macro_export] | |
| macro_rules ! _partial_unchecked_leyline { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: leyline struct $ struct_name { # [serde (rename = "id")] pub id : String , # [serde (rename = "location")] pub location : String , # [serde (rename = "xp_reward")] pub xp_reward : i32 , # [serde (rename = "RegionName")] pub region_name : String } [$ ($ scalar_field) , +] } } ; } | |
| pub use _partial_unchecked_leyline as partial_unchecked; | |
| #[derive(Debug, Clone, :: serde :: Serialize, :: serde :: Deserialize)] | |
| pub struct Data { | |
| #[serde(rename = "id")] | |
| pub id: String, | |
| #[serde(rename = "location")] | |
| pub location: String, | |
| #[serde(rename = "xp_reward")] | |
| pub xp_reward: i32, | |
| #[serde(rename = "RegionName")] | |
| pub region_name: String, | |
| #[serde(rename = "Region")] | |
| pub region: Option<Box<super::region::Data>>, | |
| } | |
| impl Data { | |
| pub fn region( | |
| &self, | |
| ) -> Result<&super::region::Data, ::prisma_client_rust::RelationNotFetchedError> { | |
| self.region | |
| .as_ref() | |
| .ok_or(::prisma_client_rust::RelationNotFetchedError::new( | |
| stringify!(region), | |
| )) | |
| .map(|v| v.as_ref()) | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum WithParam { | |
| Region(super::region::UniqueArgs), | |
| } | |
| impl Into<::prisma_client_rust::Selection> for WithParam { | |
| fn into(self) -> ::prisma_client_rust::Selection { | |
| match self { | |
| Self::Region(args) => { | |
| let mut selections = < super :: region :: 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(region::NAME, None, [], selections) | |
| } | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum SetParam { | |
| SetId(String), | |
| SetLocation(String), | |
| SetXpReward(i32), | |
| IncrementXpReward(i32), | |
| DecrementXpReward(i32), | |
| MultiplyXpReward(i32), | |
| DivideXpReward(i32), | |
| SetRegionName(String), | |
| ConnectRegion(super::region::UniqueWhereParam), | |
| } | |
| impl From<SetParam> 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::SetLocation(value) => ( | |
| location::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(value), | |
| ), | |
| SetParam::SetXpReward(value) => ( | |
| xp_reward::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| ), | |
| SetParam::IncrementXpReward(value) => ( | |
| xp_reward::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "increment".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DecrementXpReward(value) => ( | |
| xp_reward::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "decrement".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::MultiplyXpReward(value) => ( | |
| xp_reward::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "multiply".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::DivideXpReward(value) => ( | |
| xp_reward::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "divide".to_string(), | |
| ::prisma_client_rust::PrismaValue::Int(value as i64), | |
| )]), | |
| ), | |
| SetParam::SetRegionName(value) => ( | |
| region_name::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(value), | |
| ), | |
| SetParam::ConnectRegion(where_param) => ( | |
| region::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::Object(vec![( | |
| "connect".to_string(), | |
| ::prisma_client_rust::PrismaValue::Object( | |
| [where_param] | |
| .into_iter() | |
| .map(Into::<super::region::WhereParam>::into) | |
| .map(::prisma_client_rust::WhereInput::serialize) | |
| .map(::prisma_client_rust::SerializedWhereInput::transform_equals) | |
| .collect(), | |
| ), | |
| )]), | |
| ), | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum UncheckedSetParam { | |
| Id(String), | |
| Location(String), | |
| XpReward(i32), | |
| RegionName(String), | |
| } | |
| impl From<UncheckedSetParam> for SetParam { | |
| fn from(param: UncheckedSetParam) -> Self { | |
| match param { | |
| UncheckedSetParam::Id(value) => Self::SetId(value), | |
| UncheckedSetParam::Location(value) => Self::SetLocation(value), | |
| UncheckedSetParam::XpReward(value) => Self::SetXpReward(value), | |
| UncheckedSetParam::RegionName(value) => Self::SetRegionName(value), | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum OrderByParam { | |
| Id(::prisma_client_rust::Direction), | |
| Location(::prisma_client_rust::Direction), | |
| XpReward(::prisma_client_rust::Direction), | |
| RegionName(::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::Location(direction) => ( | |
| location::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| Self::XpReward(direction) => ( | |
| xp_reward::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| Self::RegionName(direction) => ( | |
| region_name::NAME.to_string(), | |
| ::prisma_client_rust::PrismaValue::String(direction.to_string()), | |
| ), | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum WhereParam { | |
| Not(Vec<WhereParam>), | |
| Or(Vec<WhereParam>), | |
| And(Vec<WhereParam>), | |
| Id(_prisma::read_filters::StringFilter), | |
| Location(_prisma::read_filters::StringFilter), | |
| XpReward(_prisma::read_filters::IntFilter), | |
| RegionName(_prisma::read_filters::StringFilter), | |
| RegionIs(Vec<super::region::WhereParam>), | |
| RegionIsNot(Vec<super::region::WhereParam>), | |
| } | |
| 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::Location(value) => (location::NAME, value.into()), | |
| Self::XpReward(value) => (xp_reward::NAME, value.into()), | |
| Self::RegionName(value) => (region_name::NAME, value.into()), | |
| Self::RegionIs(where_params) => ( | |
| region::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::RegionIsNot(where_params) => ( | |
| region::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<UniqueWhereParam> 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<Self>> for WhereParam { | |
| fn from(op: ::prisma_client_rust::Operator<Self>) -> 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(location::NAME), | |
| ::prisma_client_rust::sel(xp_reward::NAME), | |
| ::prisma_client_rust::sel(region_name::NAME), | |
| ] | |
| } | |
| } | |
| pub type UniqueArgs = ::prisma_client_rust::UniqueArgs<Types>; | |
| pub type ManyArgs = ::prisma_client_rust::ManyArgs<Types>; | |
| 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<WhereParam>) -> FindFirst<'a> { | |
| FindFirst::new(self.client, _where) | |
| } | |
| pub fn find_many(self, _where: Vec<WhereParam>) -> FindMany<'a> { | |
| FindMany::new(self.client, _where) | |
| } | |
| pub fn create( | |
| self, | |
| location: String, | |
| xp_reward: i32, | |
| region: super::region::UniqueWhereParam, | |
| mut _params: Vec<SetParam>, | |
| ) -> Create<'a> { | |
| _params.extend([ | |
| location::set(location), | |
| xp_reward::set(xp_reward), | |
| region::connect(region), | |
| ]); | |
| Create::new(self.client, _params) | |
| } | |
| pub fn create_unchecked( | |
| self, | |
| location: String, | |
| xp_reward: i32, | |
| region_name: String, | |
| mut _params: Vec<UncheckedSetParam>, | |
| ) -> Create<'a> { | |
| _params.extend([ | |
| location::set(location), | |
| xp_reward::set(xp_reward), | |
| region_name::set(region_name), | |
| ]); | |
| Create::new(self.client, _params.into_iter().map(Into::into).collect()) | |
| } | |
| pub fn create_many( | |
| self, | |
| data: Vec<(String, i32, String, Vec<SetParam>)>, | |
| ) -> CreateMany<'a> { | |
| let data = data | |
| .into_iter() | |
| .map(|(location, xp_reward, region_name, mut _params)| { | |
| _params.extend([ | |
| location::set(location), | |
| xp_reward::set(xp_reward), | |
| region_name::set(region_name), | |
| ]); | |
| _params | |
| }) | |
| .collect(); | |
| CreateMany::new(self.client, data) | |
| } | |
| pub fn update(self, _where: UniqueWhereParam, _params: Vec<SetParam>) -> Update<'a> { | |
| Update::new(self.client, _where.into(), _params, vec![]) | |
| } | |
| pub fn update_unchecked( | |
| self, | |
| _where: UniqueWhereParam, | |
| _params: Vec<UncheckedSetParam>, | |
| ) -> Update<'a> { | |
| Update::new( | |
| self.client, | |
| _where.into(), | |
| _params.into_iter().map(Into::into).collect(), | |
| vec![], | |
| ) | |
| } | |
| pub fn update_many( | |
| self, | |
| _where: Vec<WhereParam>, | |
| _params: Vec<SetParam>, | |
| ) -> UpdateMany<'a> { | |
| UpdateMany::new(self.client, _where, _params) | |
| } | |
| pub fn upsert( | |
| self, | |
| _where: UniqueWhereParam, | |
| (location, xp_reward, region, mut _params): ( | |
| String, | |
| i32, | |
| super::region::UniqueWhereParam, | |
| Vec<SetParam>, | |
| ), | |
| _update: Vec<SetParam>, | |
| ) -> Upsert<'a> { | |
| _params.extend([ | |
| location::set(location), | |
| xp_reward::set(xp_reward), | |
| region::connect(region), | |
| ]); | |
| 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<WhereParam>) -> DeleteMany<'a> { | |
| DeleteMany::new(self.client, _where) | |
| } | |
| pub fn count(self, _where: Vec<WhereParam>) -> Count<'a> { | |
| Count::new(self.client, _where) | |
| } | |
| } | |
| } | |
| pub mod _prisma { | |
| pub struct PrismaClientBuilder { | |
| url: Option<String>, | |
| 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<PrismaClient, ::prisma_client_rust::NewClientError> { | |
| 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<T: ::prisma_client_rust::Data>( | |
| &self, | |
| query: ::prisma_client_rust::Raw, | |
| ) -> ::prisma_client_rust::QueryRaw<T> { | |
| ::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< | |
| <T as ::prisma_client_rust::BatchContainer<'batch, Marker>>::ReturnType, | |
| > { | |
| ::prisma_client_rust::batch(queries, &self.0).await | |
| } | |
| pub fn _transaction(&self) -> ::prisma_client_rust::TransactionBuilder<Self> { | |
| ::prisma_client_rust::TransactionBuilder::_new(self, &self.0) | |
| } | |
| pub fn item(&self) -> super::item::Actions { | |
| super::item::Actions { client: &self.0 } | |
| } | |
| pub fn inventory(&self) -> super::inventory::Actions { | |
| super::inventory::Actions { client: &self.0 } | |
| } | |
| pub fn hero(&self) -> super::hero::Actions { | |
| super::hero::Actions { client: &self.0 } | |
| } | |
| pub fn hero_region(&self) -> super::hero_region::Actions { | |
| super::hero_region::Actions { client: &self.0 } | |
| } | |
| pub fn base_stats(&self) -> super::base_stats::Actions { | |
| super::base_stats::Actions { client: &self.0 } | |
| } | |
| pub fn attributes(&self) -> super::attributes::Actions { | |
| super::attributes::Actions { client: &self.0 } | |
| } | |
| pub fn retinue_slot(&self) -> super::retinue_slot::Actions { | |
| super::retinue_slot::Actions { client: &self.0 } | |
| } | |
| pub fn follower(&self) -> super::follower::Actions { | |
| super::follower::Actions { client: &self.0 } | |
| } | |
| pub fn resource_cost(&self) -> super::resource_cost::Actions { | |
| super::resource_cost::Actions { client: &self.0 } | |
| } | |
| pub fn region(&self) -> super::region::Actions { | |
| super::region::Actions { client: &self.0 } | |
| } | |
| pub fn leyline(&self) -> super::leyline::Actions { | |
| super::leyline::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 AttributesScalarFieldEnum { | |
| #[serde(rename = "id")] | |
| Id, | |
| #[serde(rename = "resilience")] | |
| Resilience, | |
| #[serde(rename = "strength")] | |
| Strength, | |
| #[serde(rename = "agility")] | |
| Agility, | |
| #[serde(rename = "intelligence")] | |
| Intelligence, | |
| #[serde(rename = "exploration")] | |
| Exploration, | |
| #[serde(rename = "crafting")] | |
| Crafting, | |
| } | |
| impl ToString for AttributesScalarFieldEnum { | |
| fn to_string(&self) -> String { | |
| match self { | |
| Self::Id => "id".to_string(), | |
| Self::Resilience => "resilience".to_string(), | |
| Self::Strength => "strength".to_string(), | |
| Self::Agility => "agility".to_string(), | |
| Self::Intelligence => "intelligence".to_string(), | |
| Self::Exploration => "exploration".to_string(), | |
| Self::Crafting => "crafting".to_string(), | |
| } | |
| } | |
| } | |
| #[derive(Debug, Clone, Copy, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Eq)] | |
| pub enum BaseStatsScalarFieldEnum { | |
| #[serde(rename = "id")] | |
| Id, | |
| #[serde(rename = "level")] | |
| Level, | |
| #[serde(rename = "xp")] | |
| Xp, | |
| #[serde(rename = "damageMin")] | |
| DamageMin, | |
| #[serde(rename = "damageMax")] | |
| DamageMax, | |
| #[serde(rename = "hitPoints")] | |
| HitPoints, | |
| #[serde(rename = "mana")] | |
| Mana, | |
| #[serde(rename = "armor")] | |
| Armor, | |
| } | |
| impl ToString for BaseStatsScalarFieldEnum { | |
| fn to_string(&self) -> String { | |
| match self { | |
| Self::Id => "id".to_string(), | |
| Self::Level => "level".to_string(), | |
| Self::Xp => "xp".to_string(), | |
| Self::DamageMin => "damageMin".to_string(), | |
| Self::DamageMax => "damageMax".to_string(), | |
| Self::HitPoints => "hitPoints".to_string(), | |
| Self::Mana => "mana".to_string(), | |
| Self::Armor => "armor".to_string(), | |
| } | |
| } | |
| } | |
| #[derive(Debug, Clone, Copy, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Eq)] | |
| pub enum FollowerScalarFieldEnum { | |
| #[serde(rename = "id")] | |
| Id, | |
| #[serde(rename = "name")] | |
| Name, | |
| #[serde(rename = "level")] | |
| Level, | |
| #[serde(rename = "attributesId")] | |
| AttributesId, | |
| } | |
| impl ToString for FollowerScalarFieldEnum { | |
| fn to_string(&self) -> String { | |
| match self { | |
| Self::Id => "id".to_string(), | |
| Self::Name => "name".to_string(), | |
| Self::Level => "level".to_string(), | |
| Self::AttributesId => "attributesId".to_string(), | |
| } | |
| } | |
| } | |
| #[derive(Debug, Clone, Copy, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Eq)] | |
| pub enum HeroRegionScalarFieldEnum { | |
| #[serde(rename = "id")] | |
| Id, | |
| #[serde(rename = "HeroId")] | |
| HeroId, | |
| #[serde(rename = "region_name")] | |
| RegionName, | |
| #[serde(rename = "discovery_level")] | |
| DiscoveryLevel, | |
| } | |
| impl ToString for HeroRegionScalarFieldEnum { | |
| fn to_string(&self) -> String { | |
| match self { | |
| Self::Id => "id".to_string(), | |
| Self::HeroId => "HeroId".to_string(), | |
| Self::RegionName => "region_name".to_string(), | |
| Self::DiscoveryLevel => "discovery_level".to_string(), | |
| } | |
| } | |
| } | |
| #[derive(Debug, Clone, Copy, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Eq)] | |
| pub enum HeroScalarFieldEnum { | |
| #[serde(rename = "id")] | |
| Id, | |
| #[serde(rename = "aionCapacity")] | |
| AionCapacity, | |
| #[serde(rename = "aionCollected")] | |
| AionCollected, | |
| #[serde(rename = "baseStatsId")] | |
| BaseStatsId, | |
| #[serde(rename = "attributesId")] | |
| AttributesId, | |
| #[serde(rename = "inventoryId")] | |
| InventoryId, | |
| } | |
| impl ToString for HeroScalarFieldEnum { | |
| fn to_string(&self) -> String { | |
| match self { | |
| Self::Id => "id".to_string(), | |
| Self::AionCapacity => "aionCapacity".to_string(), | |
| Self::AionCollected => "aionCollected".to_string(), | |
| Self::BaseStatsId => "baseStatsId".to_string(), | |
| Self::AttributesId => "attributesId".to_string(), | |
| Self::InventoryId => "inventoryId".to_string(), | |
| } | |
| } | |
| } | |
| #[derive(Debug, Clone, Copy, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Eq)] | |
| pub enum InventoryScalarFieldEnum { | |
| #[serde(rename = "id")] | |
| Id, | |
| } | |
| impl ToString for InventoryScalarFieldEnum { | |
| fn to_string(&self) -> String { | |
| match self { | |
| Self::Id => "id".to_string(), | |
| } | |
| } | |
| } | |
| #[derive(Debug, Clone, Copy, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Eq)] | |
| pub enum ItemScalarFieldEnum { | |
| #[serde(rename = "id")] | |
| Id, | |
| #[serde(rename = "name")] | |
| Name, | |
| #[serde(rename = "weight")] | |
| Weight, | |
| #[serde(rename = "value")] | |
| Value, | |
| #[serde(rename = "activeInventoryId")] | |
| ActiveInventoryId, | |
| #[serde(rename = "backpackInventoryId")] | |
| BackpackInventoryId, | |
| } | |
| impl ToString for ItemScalarFieldEnum { | |
| fn to_string(&self) -> String { | |
| match self { | |
| Self::Id => "id".to_string(), | |
| Self::Name => "name".to_string(), | |
| Self::Weight => "weight".to_string(), | |
| Self::Value => "value".to_string(), | |
| Self::ActiveInventoryId => "activeInventoryId".to_string(), | |
| Self::BackpackInventoryId => "backpackInventoryId".to_string(), | |
| } | |
| } | |
| } | |
| #[derive(Debug, Clone, Copy, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Eq)] | |
| pub enum LeylineScalarFieldEnum { | |
| #[serde(rename = "id")] | |
| Id, | |
| #[serde(rename = "location")] | |
| Location, | |
| #[serde(rename = "xp_reward")] | |
| XpReward, | |
| #[serde(rename = "RegionName")] | |
| RegionName, | |
| } | |
| impl ToString for LeylineScalarFieldEnum { | |
| fn to_string(&self) -> String { | |
| match self { | |
| Self::Id => "id".to_string(), | |
| Self::Location => "location".to_string(), | |
| Self::XpReward => "xp_reward".to_string(), | |
| Self::RegionName => "RegionName".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 RegionScalarFieldEnum { | |
| #[serde(rename = "name")] | |
| Name, | |
| #[serde(rename = "adjacent_regions")] | |
| AdjacentRegions, | |
| } | |
| impl ToString for RegionScalarFieldEnum { | |
| fn to_string(&self) -> String { | |
| match self { | |
| Self::Name => "name".to_string(), | |
| Self::AdjacentRegions => "adjacent_regions".to_string(), | |
| } | |
| } | |
| } | |
| #[derive(Debug, Clone, Copy, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Eq)] | |
| pub enum ResourceCostScalarFieldEnum { | |
| #[serde(rename = "id")] | |
| Id, | |
| #[serde(rename = "resource")] | |
| Resource, | |
| #[serde(rename = "amount")] | |
| Amount, | |
| #[serde(rename = "material")] | |
| Material, | |
| } | |
| impl ToString for ResourceCostScalarFieldEnum { | |
| fn to_string(&self) -> String { | |
| match self { | |
| Self::Id => "id".to_string(), | |
| Self::Resource => "resource".to_string(), | |
| Self::Amount => "amount".to_string(), | |
| Self::Material => "material".to_string(), | |
| } | |
| } | |
| } | |
| #[derive(Debug, Clone, Copy, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Eq)] | |
| pub enum RetinueSlotScalarFieldEnum { | |
| #[serde(rename = "id")] | |
| Id, | |
| #[serde(rename = "slotType")] | |
| SlotType, | |
| #[serde(rename = "HeroId")] | |
| HeroId, | |
| #[serde(rename = "followerId")] | |
| FollowerId, | |
| } | |
| impl ToString for RetinueSlotScalarFieldEnum { | |
| fn to_string(&self) -> String { | |
| match self { | |
| Self::Id => "id".to_string(), | |
| Self::SlotType => "slotType".to_string(), | |
| Self::HeroId => "HeroId".to_string(), | |
| Self::FollowerId => "followerId".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 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 {} | |
| pub mod read_filters { | |
| #[derive(Clone)] | |
| pub enum StringFilter { | |
| Equals(String), | |
| InVec(Vec<String>), | |
| NotInVec(Vec<String>), | |
| 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<String>), | |
| InVec(Vec<String>), | |
| NotInVec(Vec<String>), | |
| Lt(String), | |
| Lte(String), | |
| Gt(String), | |
| Gte(String), | |
| Contains(String), | |
| StartsWith(String), | |
| EndsWith(String), | |
| Mode(super::super::QueryMode), | |
| Not(Option<String>), | |
| } | |
| 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 IntFilter { | |
| Equals(i32), | |
| InVec(Vec<i32>), | |
| NotInVec(Vec<i32>), | |
| 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 ResourceTypeFilter { | |
| Equals(super::super::ResourceType), | |
| InVec(Vec<super::super::ResourceType>), | |
| NotInVec(Vec<super::super::ResourceType>), | |
| Not(super::super::ResourceType), | |
| } | |
| impl Into<::prisma_client_rust::SerializedWhereValue> for ResourceTypeFilter { | |
| 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::Enum(value.to_string()), | |
| )]) | |
| } | |
| 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::Enum(value.to_string()) | |
| }) | |
| .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::Enum(value.to_string()) | |
| }) | |
| .collect(), | |
| ), | |
| )]) | |
| } | |
| Self::Not(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![( | |
| "not".to_string(), | |
| ::prisma_client_rust::PrismaValue::Enum(value.to_string()), | |
| )]), | |
| } | |
| } | |
| } | |
| #[derive(Clone)] | |
| pub enum MaterialTypeFilter { | |
| Equals(super::super::MaterialType), | |
| InVec(Vec<super::super::MaterialType>), | |
| NotInVec(Vec<super::super::MaterialType>), | |
| Not(super::super::MaterialType), | |
| } | |
| impl Into<::prisma_client_rust::SerializedWhereValue> for MaterialTypeFilter { | |
| 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::Enum(value.to_string()), | |
| )]) | |
| } | |
| 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::Enum(value.to_string()) | |
| }) | |
| .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::Enum(value.to_string()) | |
| }) | |
| .collect(), | |
| ), | |
| )]) | |
| } | |
| Self::Not(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![( | |
| "not".to_string(), | |
| ::prisma_client_rust::PrismaValue::Enum(value.to_string()), | |
| )]), | |
| } | |
| } | |
| } | |
| } | |
| } | |
| pub use _prisma::*; | |
| #[derive(Debug, Clone, Copy, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Eq)] | |
| pub enum ResourceType { | |
| #[serde(rename = "Aion")] | |
| Aion, | |
| #[serde(rename = "Valor")] | |
| Valor, | |
| #[serde(rename = "NexusShard")] | |
| NexusShard, | |
| } | |
| impl ToString for ResourceType { | |
| fn to_string(&self) -> String { | |
| match self { | |
| Self::Aion => "Aion".to_string(), | |
| Self::Valor => "Valor".to_string(), | |
| Self::NexusShard => "NexusShard".to_string(), | |
| } | |
| } | |
| } | |
| #[derive(Debug, Clone, Copy, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Eq)] | |
| pub enum MaterialType { | |
| #[serde(rename = "Oak")] | |
| Oak, | |
| #[serde(rename = "IronOre")] | |
| IronOre, | |
| #[serde(rename = "Copper")] | |
| Copper, | |
| #[serde(rename = "Silk")] | |
| Silk, | |
| } | |
| impl ToString for MaterialType { | |
| fn to_string(&self) -> String { | |
| match self { | |
| Self::Oak => "Oak".to_string(), | |
| Self::IronOre => "IronOre".to_string(), | |
| Self::Copper => "Copper".to_string(), | |
| Self::Silk => "Silk".to_string(), | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment