
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
/* eslint-disable */
// biome-ignore-all lint: generated file
// @ts-nocheck 
/*
 * This file exports the `userBook` model and its related types.
 *
 * 🟢 You can import this file directly.
 */
import type * as runtime from "@prisma/client/runtime/client"
import type * as $Enums from "../enums"
import type * as Prisma from "../internal/prismaNamespace"

/**
 * Model userBook
 * 
 */
export type userBookModel = runtime.Types.Result.DefaultSelection<Prisma.$userBookPayload>

export type AggregateUserBook = {
  _count: UserBookCountAggregateOutputType | null
  _min: UserBookMinAggregateOutputType | null
  _max: UserBookMaxAggregateOutputType | null
}

export type UserBookMinAggregateOutputType = {
  userId: string | null
  bookId: string | null
  status: $Enums.BookStatus | null
  addedAt: Date | null
  updatedAt: Date | null
  ownNote: string | null
}

export type UserBookMaxAggregateOutputType = {
  userId: string | null
  bookId: string | null
  status: $Enums.BookStatus | null
  addedAt: Date | null
  updatedAt: Date | null
  ownNote: string | null
}

export type UserBookCountAggregateOutputType = {
  userId: number
  bookId: number
  status: number
  addedAt: number
  updatedAt: number
  ownNote: number
  _all: number
}


export type UserBookMinAggregateInputType = {
  userId?: true
  bookId?: true
  status?: true
  addedAt?: true
  updatedAt?: true
  ownNote?: true
}

export type UserBookMaxAggregateInputType = {
  userId?: true
  bookId?: true
  status?: true
  addedAt?: true
  updatedAt?: true
  ownNote?: true
}

export type UserBookCountAggregateInputType = {
  userId?: true
  bookId?: true
  status?: true
  addedAt?: true
  updatedAt?: true
  ownNote?: true
  _all?: true
}

export type UserBookAggregateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Filter which userBook to aggregate.
   */
  where?: Prisma.userBookWhereInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
   * 
   * Determine the order of userBooks to fetch.
   */
  orderBy?: Prisma.userBookOrderByWithRelationInput | Prisma.userBookOrderByWithRelationInput[]
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
   * 
   * Sets the start position
   */
  cursor?: Prisma.userBookWhereUniqueInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Take `±n` userBooks from the position of the cursor.
   */
  take?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Skip the first `n` userBooks.
   */
  skip?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
   * 
   * Count returned userBooks
  **/
  _count?: true | UserBookCountAggregateInputType
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
   * 
   * Select which fields to find the minimum value
  **/
  _min?: UserBookMinAggregateInputType
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
   * 
   * Select which fields to find the maximum value
  **/
  _max?: UserBookMaxAggregateInputType
}

export type GetUserBookAggregateType<T extends UserBookAggregateArgs> = {
      [P in keyof T & keyof AggregateUserBook]: P extends '_count' | 'count'
    ? T[P] extends true
      ? number
      : Prisma.GetScalarType<T[P], AggregateUserBook[P]>
    : Prisma.GetScalarType<T[P], AggregateUserBook[P]>
}




export type userBookGroupByArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  where?: Prisma.userBookWhereInput
  orderBy?: Prisma.userBookOrderByWithAggregationInput | Prisma.userBookOrderByWithAggregationInput[]
  by: Prisma.UserBookScalarFieldEnum[] | Prisma.UserBookScalarFieldEnum
  having?: Prisma.userBookScalarWhereWithAggregatesInput
  take?: number
  skip?: number
  _count?: UserBookCountAggregateInputType | true
  _min?: UserBookMinAggregateInputType
  _max?: UserBookMaxAggregateInputType
}

export type UserBookGroupByOutputType = {
  userId: string
  bookId: string
  status: $Enums.BookStatus
  addedAt: Date
  updatedAt: Date
  ownNote: string | null
  _count: UserBookCountAggregateOutputType | null
  _min: UserBookMinAggregateOutputType | null
  _max: UserBookMaxAggregateOutputType | null
}

type GetUserBookGroupByPayload<T extends userBookGroupByArgs> = Prisma.PrismaPromise<
  Array<
    Prisma.PickEnumerable<UserBookGroupByOutputType, T['by']> &
      {
        [P in ((keyof T) & (keyof UserBookGroupByOutputType))]: P extends '_count'
          ? T[P] extends boolean
            ? number
            : Prisma.GetScalarType<T[P], UserBookGroupByOutputType[P]>
          : Prisma.GetScalarType<T[P], UserBookGroupByOutputType[P]>
      }
    >
  >



export type userBookWhereInput = {
  AND?: Prisma.userBookWhereInput | Prisma.userBookWhereInput[]
  OR?: Prisma.userBookWhereInput[]
  NOT?: Prisma.userBookWhereInput | Prisma.userBookWhereInput[]
  userId?: Prisma.StringFilter<"userBook"> | string
  bookId?: Prisma.StringFilter<"userBook"> | string
  status?: Prisma.EnumBookStatusFilter<"userBook"> | $Enums.BookStatus
  addedAt?: Prisma.DateTimeFilter<"userBook"> | Date | string
  updatedAt?: Prisma.DateTimeFilter<"userBook"> | Date | string
  ownNote?: Prisma.StringNullableFilter<"userBook"> | string | null
  user?: Prisma.XOR<Prisma.UserScalarRelationFilter, Prisma.userWhereInput>
  book?: Prisma.XOR<Prisma.BookScalarRelationFilter, Prisma.bookWhereInput>
}

export type userBookOrderByWithRelationInput = {
  userId?: Prisma.SortOrder
  bookId?: Prisma.SortOrder
  status?: Prisma.SortOrder
  addedAt?: Prisma.SortOrder
  updatedAt?: Prisma.SortOrder
  ownNote?: Prisma.SortOrderInput | Prisma.SortOrder
  user?: Prisma.userOrderByWithRelationInput
  book?: Prisma.bookOrderByWithRelationInput
}

export type userBookWhereUniqueInput = Prisma.AtLeast<{
  userId_bookId?: Prisma.userBookUserIdBookIdCompoundUniqueInput
  AND?: Prisma.userBookWhereInput | Prisma.userBookWhereInput[]
  OR?: Prisma.userBookWhereInput[]
  NOT?: Prisma.userBookWhereInput | Prisma.userBookWhereInput[]
  userId?: Prisma.StringFilter<"userBook"> | string
  bookId?: Prisma.StringFilter<"userBook"> | string
  status?: Prisma.EnumBookStatusFilter<"userBook"> | $Enums.BookStatus
  addedAt?: Prisma.DateTimeFilter<"userBook"> | Date | string
  updatedAt?: Prisma.DateTimeFilter<"userBook"> | Date | string
  ownNote?: Prisma.StringNullableFilter<"userBook"> | string | null
  user?: Prisma.XOR<Prisma.UserScalarRelationFilter, Prisma.userWhereInput>
  book?: Prisma.XOR<Prisma.BookScalarRelationFilter, Prisma.bookWhereInput>
}, "userId_bookId">

export type userBookOrderByWithAggregationInput = {
  userId?: Prisma.SortOrder
  bookId?: Prisma.SortOrder
  status?: Prisma.SortOrder
  addedAt?: Prisma.SortOrder
  updatedAt?: Prisma.SortOrder
  ownNote?: Prisma.SortOrderInput | Prisma.SortOrder
  _count?: Prisma.userBookCountOrderByAggregateInput
  _max?: Prisma.userBookMaxOrderByAggregateInput
  _min?: Prisma.userBookMinOrderByAggregateInput
}

export type userBookScalarWhereWithAggregatesInput = {
  AND?: Prisma.userBookScalarWhereWithAggregatesInput | Prisma.userBookScalarWhereWithAggregatesInput[]
  OR?: Prisma.userBookScalarWhereWithAggregatesInput[]
  NOT?: Prisma.userBookScalarWhereWithAggregatesInput | Prisma.userBookScalarWhereWithAggregatesInput[]
  userId?: Prisma.StringWithAggregatesFilter<"userBook"> | string
  bookId?: Prisma.StringWithAggregatesFilter<"userBook"> | string
  status?: Prisma.EnumBookStatusWithAggregatesFilter<"userBook"> | $Enums.BookStatus
  addedAt?: Prisma.DateTimeWithAggregatesFilter<"userBook"> | Date | string
  updatedAt?: Prisma.DateTimeWithAggregatesFilter<"userBook"> | Date | string
  ownNote?: Prisma.StringNullableWithAggregatesFilter<"userBook"> | string | null
}

export type userBookCreateInput = {
  status?: $Enums.BookStatus
  addedAt?: Date | string
  updatedAt?: Date | string
  ownNote?: string | null
  user: Prisma.userCreateNestedOneWithoutUserBooksInput
  book: Prisma.bookCreateNestedOneWithoutUserBooksInput
}

export type userBookUncheckedCreateInput = {
  userId: string
  bookId: string
  status?: $Enums.BookStatus
  addedAt?: Date | string
  updatedAt?: Date | string
  ownNote?: string | null
}

export type userBookUpdateInput = {
  status?: Prisma.EnumBookStatusFieldUpdateOperationsInput | $Enums.BookStatus
  addedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  ownNote?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  user?: Prisma.userUpdateOneRequiredWithoutUserBooksNestedInput
  book?: Prisma.bookUpdateOneRequiredWithoutUserBooksNestedInput
}

export type userBookUncheckedUpdateInput = {
  userId?: Prisma.StringFieldUpdateOperationsInput | string
  bookId?: Prisma.StringFieldUpdateOperationsInput | string
  status?: Prisma.EnumBookStatusFieldUpdateOperationsInput | $Enums.BookStatus
  addedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  ownNote?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
}

export type userBookCreateManyInput = {
  userId: string
  bookId: string
  status?: $Enums.BookStatus
  addedAt?: Date | string
  updatedAt?: Date | string
  ownNote?: string | null
}

export type userBookUpdateManyMutationInput = {
  status?: Prisma.EnumBookStatusFieldUpdateOperationsInput | $Enums.BookStatus
  addedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  ownNote?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
}

export type userBookUncheckedUpdateManyInput = {
  userId?: Prisma.StringFieldUpdateOperationsInput | string
  bookId?: Prisma.StringFieldUpdateOperationsInput | string
  status?: Prisma.EnumBookStatusFieldUpdateOperationsInput | $Enums.BookStatus
  addedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  ownNote?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
}

export type UserBookListRelationFilter = {
  every?: Prisma.userBookWhereInput
  some?: Prisma.userBookWhereInput
  none?: Prisma.userBookWhereInput
}

export type userBookOrderByRelationAggregateInput = {
  _count?: Prisma.SortOrder
}

export type userBookUserIdBookIdCompoundUniqueInput = {
  userId: string
  bookId: string
}

export type userBookCountOrderByAggregateInput = {
  userId?: Prisma.SortOrder
  bookId?: Prisma.SortOrder
  status?: Prisma.SortOrder
  addedAt?: Prisma.SortOrder
  updatedAt?: Prisma.SortOrder
  ownNote?: Prisma.SortOrder
}

export type userBookMaxOrderByAggregateInput = {
  userId?: Prisma.SortOrder
  bookId?: Prisma.SortOrder
  status?: Prisma.SortOrder
  addedAt?: Prisma.SortOrder
  updatedAt?: Prisma.SortOrder
  ownNote?: Prisma.SortOrder
}

export type userBookMinOrderByAggregateInput = {
  userId?: Prisma.SortOrder
  bookId?: Prisma.SortOrder
  status?: Prisma.SortOrder
  addedAt?: Prisma.SortOrder
  updatedAt?: Prisma.SortOrder
  ownNote?: Prisma.SortOrder
}

export type userBookCreateNestedManyWithoutUserInput = {
  create?: Prisma.XOR<Prisma.userBookCreateWithoutUserInput, Prisma.userBookUncheckedCreateWithoutUserInput> | Prisma.userBookCreateWithoutUserInput[] | Prisma.userBookUncheckedCreateWithoutUserInput[]
  connectOrCreate?: Prisma.userBookCreateOrConnectWithoutUserInput | Prisma.userBookCreateOrConnectWithoutUserInput[]
  createMany?: Prisma.userBookCreateManyUserInputEnvelope
  connect?: Prisma.userBookWhereUniqueInput | Prisma.userBookWhereUniqueInput[]
}

export type userBookUncheckedCreateNestedManyWithoutUserInput = {
  create?: Prisma.XOR<Prisma.userBookCreateWithoutUserInput, Prisma.userBookUncheckedCreateWithoutUserInput> | Prisma.userBookCreateWithoutUserInput[] | Prisma.userBookUncheckedCreateWithoutUserInput[]
  connectOrCreate?: Prisma.userBookCreateOrConnectWithoutUserInput | Prisma.userBookCreateOrConnectWithoutUserInput[]
  createMany?: Prisma.userBookCreateManyUserInputEnvelope
  connect?: Prisma.userBookWhereUniqueInput | Prisma.userBookWhereUniqueInput[]
}

export type userBookUpdateManyWithoutUserNestedInput = {
  create?: Prisma.XOR<Prisma.userBookCreateWithoutUserInput, Prisma.userBookUncheckedCreateWithoutUserInput> | Prisma.userBookCreateWithoutUserInput[] | Prisma.userBookUncheckedCreateWithoutUserInput[]
  connectOrCreate?: Prisma.userBookCreateOrConnectWithoutUserInput | Prisma.userBookCreateOrConnectWithoutUserInput[]
  upsert?: Prisma.userBookUpsertWithWhereUniqueWithoutUserInput | Prisma.userBookUpsertWithWhereUniqueWithoutUserInput[]
  createMany?: Prisma.userBookCreateManyUserInputEnvelope
  set?: Prisma.userBookWhereUniqueInput | Prisma.userBookWhereUniqueInput[]
  disconnect?: Prisma.userBookWhereUniqueInput | Prisma.userBookWhereUniqueInput[]
  delete?: Prisma.userBookWhereUniqueInput | Prisma.userBookWhereUniqueInput[]
  connect?: Prisma.userBookWhereUniqueInput | Prisma.userBookWhereUniqueInput[]
  update?: Prisma.userBookUpdateWithWhereUniqueWithoutUserInput | Prisma.userBookUpdateWithWhereUniqueWithoutUserInput[]
  updateMany?: Prisma.userBookUpdateManyWithWhereWithoutUserInput | Prisma.userBookUpdateManyWithWhereWithoutUserInput[]
  deleteMany?: Prisma.userBookScalarWhereInput | Prisma.userBookScalarWhereInput[]
}

export type userBookUncheckedUpdateManyWithoutUserNestedInput = {
  create?: Prisma.XOR<Prisma.userBookCreateWithoutUserInput, Prisma.userBookUncheckedCreateWithoutUserInput> | Prisma.userBookCreateWithoutUserInput[] | Prisma.userBookUncheckedCreateWithoutUserInput[]
  connectOrCreate?: Prisma.userBookCreateOrConnectWithoutUserInput | Prisma.userBookCreateOrConnectWithoutUserInput[]
  upsert?: Prisma.userBookUpsertWithWhereUniqueWithoutUserInput | Prisma.userBookUpsertWithWhereUniqueWithoutUserInput[]
  createMany?: Prisma.userBookCreateManyUserInputEnvelope
  set?: Prisma.userBookWhereUniqueInput | Prisma.userBookWhereUniqueInput[]
  disconnect?: Prisma.userBookWhereUniqueInput | Prisma.userBookWhereUniqueInput[]
  delete?: Prisma.userBookWhereUniqueInput | Prisma.userBookWhereUniqueInput[]
  connect?: Prisma.userBookWhereUniqueInput | Prisma.userBookWhereUniqueInput[]
  update?: Prisma.userBookUpdateWithWhereUniqueWithoutUserInput | Prisma.userBookUpdateWithWhereUniqueWithoutUserInput[]
  updateMany?: Prisma.userBookUpdateManyWithWhereWithoutUserInput | Prisma.userBookUpdateManyWithWhereWithoutUserInput[]
  deleteMany?: Prisma.userBookScalarWhereInput | Prisma.userBookScalarWhereInput[]
}

export type EnumBookStatusFieldUpdateOperationsInput = {
  set?: $Enums.BookStatus
}

export type userBookCreateNestedManyWithoutBookInput = {
  create?: Prisma.XOR<Prisma.userBookCreateWithoutBookInput, Prisma.userBookUncheckedCreateWithoutBookInput> | Prisma.userBookCreateWithoutBookInput[] | Prisma.userBookUncheckedCreateWithoutBookInput[]
  connectOrCreate?: Prisma.userBookCreateOrConnectWithoutBookInput | Prisma.userBookCreateOrConnectWithoutBookInput[]
  createMany?: Prisma.userBookCreateManyBookInputEnvelope
  connect?: Prisma.userBookWhereUniqueInput | Prisma.userBookWhereUniqueInput[]
}

export type userBookUncheckedCreateNestedManyWithoutBookInput = {
  create?: Prisma.XOR<Prisma.userBookCreateWithoutBookInput, Prisma.userBookUncheckedCreateWithoutBookInput> | Prisma.userBookCreateWithoutBookInput[] | Prisma.userBookUncheckedCreateWithoutBookInput[]
  connectOrCreate?: Prisma.userBookCreateOrConnectWithoutBookInput | Prisma.userBookCreateOrConnectWithoutBookInput[]
  createMany?: Prisma.userBookCreateManyBookInputEnvelope
  connect?: Prisma.userBookWhereUniqueInput | Prisma.userBookWhereUniqueInput[]
}

export type userBookUpdateManyWithoutBookNestedInput = {
  create?: Prisma.XOR<Prisma.userBookCreateWithoutBookInput, Prisma.userBookUncheckedCreateWithoutBookInput> | Prisma.userBookCreateWithoutBookInput[] | Prisma.userBookUncheckedCreateWithoutBookInput[]
  connectOrCreate?: Prisma.userBookCreateOrConnectWithoutBookInput | Prisma.userBookCreateOrConnectWithoutBookInput[]
  upsert?: Prisma.userBookUpsertWithWhereUniqueWithoutBookInput | Prisma.userBookUpsertWithWhereUniqueWithoutBookInput[]
  createMany?: Prisma.userBookCreateManyBookInputEnvelope
  set?: Prisma.userBookWhereUniqueInput | Prisma.userBookWhereUniqueInput[]
  disconnect?: Prisma.userBookWhereUniqueInput | Prisma.userBookWhereUniqueInput[]
  delete?: Prisma.userBookWhereUniqueInput | Prisma.userBookWhereUniqueInput[]
  connect?: Prisma.userBookWhereUniqueInput | Prisma.userBookWhereUniqueInput[]
  update?: Prisma.userBookUpdateWithWhereUniqueWithoutBookInput | Prisma.userBookUpdateWithWhereUniqueWithoutBookInput[]
  updateMany?: Prisma.userBookUpdateManyWithWhereWithoutBookInput | Prisma.userBookUpdateManyWithWhereWithoutBookInput[]
  deleteMany?: Prisma.userBookScalarWhereInput | Prisma.userBookScalarWhereInput[]
}

export type userBookUncheckedUpdateManyWithoutBookNestedInput = {
  create?: Prisma.XOR<Prisma.userBookCreateWithoutBookInput, Prisma.userBookUncheckedCreateWithoutBookInput> | Prisma.userBookCreateWithoutBookInput[] | Prisma.userBookUncheckedCreateWithoutBookInput[]
  connectOrCreate?: Prisma.userBookCreateOrConnectWithoutBookInput | Prisma.userBookCreateOrConnectWithoutBookInput[]
  upsert?: Prisma.userBookUpsertWithWhereUniqueWithoutBookInput | Prisma.userBookUpsertWithWhereUniqueWithoutBookInput[]
  createMany?: Prisma.userBookCreateManyBookInputEnvelope
  set?: Prisma.userBookWhereUniqueInput | Prisma.userBookWhereUniqueInput[]
  disconnect?: Prisma.userBookWhereUniqueInput | Prisma.userBookWhereUniqueInput[]
  delete?: Prisma.userBookWhereUniqueInput | Prisma.userBookWhereUniqueInput[]
  connect?: Prisma.userBookWhereUniqueInput | Prisma.userBookWhereUniqueInput[]
  update?: Prisma.userBookUpdateWithWhereUniqueWithoutBookInput | Prisma.userBookUpdateWithWhereUniqueWithoutBookInput[]
  updateMany?: Prisma.userBookUpdateManyWithWhereWithoutBookInput | Prisma.userBookUpdateManyWithWhereWithoutBookInput[]
  deleteMany?: Prisma.userBookScalarWhereInput | Prisma.userBookScalarWhereInput[]
}

export type userBookCreateWithoutUserInput = {
  status?: $Enums.BookStatus
  addedAt?: Date | string
  updatedAt?: Date | string
  ownNote?: string | null
  book: Prisma.bookCreateNestedOneWithoutUserBooksInput
}

export type userBookUncheckedCreateWithoutUserInput = {
  bookId: string
  status?: $Enums.BookStatus
  addedAt?: Date | string
  updatedAt?: Date | string
  ownNote?: string | null
}

export type userBookCreateOrConnectWithoutUserInput = {
  where: Prisma.userBookWhereUniqueInput
  create: Prisma.XOR<Prisma.userBookCreateWithoutUserInput, Prisma.userBookUncheckedCreateWithoutUserInput>
}

export type userBookCreateManyUserInputEnvelope = {
  data: Prisma.userBookCreateManyUserInput | Prisma.userBookCreateManyUserInput[]
  skipDuplicates?: boolean
}

export type userBookUpsertWithWhereUniqueWithoutUserInput = {
  where: Prisma.userBookWhereUniqueInput
  update: Prisma.XOR<Prisma.userBookUpdateWithoutUserInput, Prisma.userBookUncheckedUpdateWithoutUserInput>
  create: Prisma.XOR<Prisma.userBookCreateWithoutUserInput, Prisma.userBookUncheckedCreateWithoutUserInput>
}

export type userBookUpdateWithWhereUniqueWithoutUserInput = {
  where: Prisma.userBookWhereUniqueInput
  data: Prisma.XOR<Prisma.userBookUpdateWithoutUserInput, Prisma.userBookUncheckedUpdateWithoutUserInput>
}

export type userBookUpdateManyWithWhereWithoutUserInput = {
  where: Prisma.userBookScalarWhereInput
  data: Prisma.XOR<Prisma.userBookUpdateManyMutationInput, Prisma.userBookUncheckedUpdateManyWithoutUserInput>
}

export type userBookScalarWhereInput = {
  AND?: Prisma.userBookScalarWhereInput | Prisma.userBookScalarWhereInput[]
  OR?: Prisma.userBookScalarWhereInput[]
  NOT?: Prisma.userBookScalarWhereInput | Prisma.userBookScalarWhereInput[]
  userId?: Prisma.StringFilter<"userBook"> | string
  bookId?: Prisma.StringFilter<"userBook"> | string
  status?: Prisma.EnumBookStatusFilter<"userBook"> | $Enums.BookStatus
  addedAt?: Prisma.DateTimeFilter<"userBook"> | Date | string
  updatedAt?: Prisma.DateTimeFilter<"userBook"> | Date | string
  ownNote?: Prisma.StringNullableFilter<"userBook"> | string | null
}

export type userBookCreateWithoutBookInput = {
  status?: $Enums.BookStatus
  addedAt?: Date | string
  updatedAt?: Date | string
  ownNote?: string | null
  user: Prisma.userCreateNestedOneWithoutUserBooksInput
}

export type userBookUncheckedCreateWithoutBookInput = {
  userId: string
  status?: $Enums.BookStatus
  addedAt?: Date | string
  updatedAt?: Date | string
  ownNote?: string | null
}

export type userBookCreateOrConnectWithoutBookInput = {
  where: Prisma.userBookWhereUniqueInput
  create: Prisma.XOR<Prisma.userBookCreateWithoutBookInput, Prisma.userBookUncheckedCreateWithoutBookInput>
}

export type userBookCreateManyBookInputEnvelope = {
  data: Prisma.userBookCreateManyBookInput | Prisma.userBookCreateManyBookInput[]
  skipDuplicates?: boolean
}

export type userBookUpsertWithWhereUniqueWithoutBookInput = {
  where: Prisma.userBookWhereUniqueInput
  update: Prisma.XOR<Prisma.userBookUpdateWithoutBookInput, Prisma.userBookUncheckedUpdateWithoutBookInput>
  create: Prisma.XOR<Prisma.userBookCreateWithoutBookInput, Prisma.userBookUncheckedCreateWithoutBookInput>
}

export type userBookUpdateWithWhereUniqueWithoutBookInput = {
  where: Prisma.userBookWhereUniqueInput
  data: Prisma.XOR<Prisma.userBookUpdateWithoutBookInput, Prisma.userBookUncheckedUpdateWithoutBookInput>
}

export type userBookUpdateManyWithWhereWithoutBookInput = {
  where: Prisma.userBookScalarWhereInput
  data: Prisma.XOR<Prisma.userBookUpdateManyMutationInput, Prisma.userBookUncheckedUpdateManyWithoutBookInput>
}

export type userBookCreateManyUserInput = {
  bookId: string
  status?: $Enums.BookStatus
  addedAt?: Date | string
  updatedAt?: Date | string
  ownNote?: string | null
}

export type userBookUpdateWithoutUserInput = {
  status?: Prisma.EnumBookStatusFieldUpdateOperationsInput | $Enums.BookStatus
  addedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  ownNote?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  book?: Prisma.bookUpdateOneRequiredWithoutUserBooksNestedInput
}

export type userBookUncheckedUpdateWithoutUserInput = {
  bookId?: Prisma.StringFieldUpdateOperationsInput | string
  status?: Prisma.EnumBookStatusFieldUpdateOperationsInput | $Enums.BookStatus
  addedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  ownNote?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
}

export type userBookUncheckedUpdateManyWithoutUserInput = {
  bookId?: Prisma.StringFieldUpdateOperationsInput | string
  status?: Prisma.EnumBookStatusFieldUpdateOperationsInput | $Enums.BookStatus
  addedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  ownNote?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
}

export type userBookCreateManyBookInput = {
  userId: string
  status?: $Enums.BookStatus
  addedAt?: Date | string
  updatedAt?: Date | string
  ownNote?: string | null
}

export type userBookUpdateWithoutBookInput = {
  status?: Prisma.EnumBookStatusFieldUpdateOperationsInput | $Enums.BookStatus
  addedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  ownNote?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  user?: Prisma.userUpdateOneRequiredWithoutUserBooksNestedInput
}

export type userBookUncheckedUpdateWithoutBookInput = {
  userId?: Prisma.StringFieldUpdateOperationsInput | string
  status?: Prisma.EnumBookStatusFieldUpdateOperationsInput | $Enums.BookStatus
  addedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  ownNote?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
}

export type userBookUncheckedUpdateManyWithoutBookInput = {
  userId?: Prisma.StringFieldUpdateOperationsInput | string
  status?: Prisma.EnumBookStatusFieldUpdateOperationsInput | $Enums.BookStatus
  addedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  ownNote?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
}



export type userBookSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
  userId?: boolean
  bookId?: boolean
  status?: boolean
  addedAt?: boolean
  updatedAt?: boolean
  ownNote?: boolean
  user?: boolean | Prisma.userDefaultArgs<ExtArgs>
  book?: boolean | Prisma.bookDefaultArgs<ExtArgs>
}, ExtArgs["result"]["userBook"]>

export type userBookSelectCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
  userId?: boolean
  bookId?: boolean
  status?: boolean
  addedAt?: boolean
  updatedAt?: boolean
  ownNote?: boolean
  user?: boolean | Prisma.userDefaultArgs<ExtArgs>
  book?: boolean | Prisma.bookDefaultArgs<ExtArgs>
}, ExtArgs["result"]["userBook"]>

export type userBookSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
  userId?: boolean
  bookId?: boolean
  status?: boolean
  addedAt?: boolean
  updatedAt?: boolean
  ownNote?: boolean
  user?: boolean | Prisma.userDefaultArgs<ExtArgs>
  book?: boolean | Prisma.bookDefaultArgs<ExtArgs>
}, ExtArgs["result"]["userBook"]>

export type userBookSelectScalar = {
  userId?: boolean
  bookId?: boolean
  status?: boolean
  addedAt?: boolean
  updatedAt?: boolean
  ownNote?: boolean
}

export type userBookOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"userId" | "bookId" | "status" | "addedAt" | "updatedAt" | "ownNote", ExtArgs["result"]["userBook"]>
export type userBookInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  user?: boolean | Prisma.userDefaultArgs<ExtArgs>
  book?: boolean | Prisma.bookDefaultArgs<ExtArgs>
}
export type userBookIncludeCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  user?: boolean | Prisma.userDefaultArgs<ExtArgs>
  book?: boolean | Prisma.bookDefaultArgs<ExtArgs>
}
export type userBookIncludeUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  user?: boolean | Prisma.userDefaultArgs<ExtArgs>
  book?: boolean | Prisma.bookDefaultArgs<ExtArgs>
}

export type $userBookPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  name: "userBook"
  objects: {
    user: Prisma.$userPayload<ExtArgs>
    book: Prisma.$bookPayload<ExtArgs>
  }
  scalars: runtime.Types.Extensions.GetPayloadResult<{
    userId: string
    bookId: string
    status: $Enums.BookStatus
    addedAt: Date
    updatedAt: Date
    ownNote: string | null
  }, ExtArgs["result"]["userBook"]>
  composites: {}
}

export type userBookGetPayload<S extends boolean | null | undefined | userBookDefaultArgs> = runtime.Types.Result.GetResult<Prisma.$userBookPayload, S>

export type userBookCountArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> =
  Omit<userBookFindManyArgs, 'select' | 'include' | 'distinct' | 'omit'> & {
    select?: UserBookCountAggregateInputType | true
  }

export interface userBookDelegate<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> {
  [K: symbol]: { types: Prisma.TypeMap<ExtArgs>['model']['userBook'], meta: { name: 'userBook' } }
  /**
   * Find zero or one UserBook that matches the filter.
   * @param {userBookFindUniqueArgs} args - Arguments to find a UserBook
   * @example
   * // Get one UserBook
   * const userBook = await prisma.userBook.findUnique({
   *   where: {
   *     // ... provide filter here
   *   }
   * })
   */
  findUnique<T extends userBookFindUniqueArgs>(args: Prisma.SelectSubset<T, userBookFindUniqueArgs<ExtArgs>>): Prisma.Prisma__userBookClient<runtime.Types.Result.GetResult<Prisma.$userBookPayload<ExtArgs>, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>

  /**
   * Find one UserBook that matches the filter or throw an error with `error.code='P2025'`
   * if no matches were found.
   * @param {userBookFindUniqueOrThrowArgs} args - Arguments to find a UserBook
   * @example
   * // Get one UserBook
   * const userBook = await prisma.userBook.findUniqueOrThrow({
   *   where: {
   *     // ... provide filter here
   *   }
   * })
   */
  findUniqueOrThrow<T extends userBookFindUniqueOrThrowArgs>(args: Prisma.SelectSubset<T, userBookFindUniqueOrThrowArgs<ExtArgs>>): Prisma.Prisma__userBookClient<runtime.Types.Result.GetResult<Prisma.$userBookPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

  /**
   * Find the first UserBook that matches the filter.
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * @param {userBookFindFirstArgs} args - Arguments to find a UserBook
   * @example
   * // Get one UserBook
   * const userBook = await prisma.userBook.findFirst({
   *   where: {
   *     // ... provide filter here
   *   }
   * })
   */
  findFirst<T extends userBookFindFirstArgs>(args?: Prisma.SelectSubset<T, userBookFindFirstArgs<ExtArgs>>): Prisma.Prisma__userBookClient<runtime.Types.Result.GetResult<Prisma.$userBookPayload<ExtArgs>, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>

  /**
   * Find the first UserBook that matches the filter or
   * throw `PrismaKnownClientError` with `P2025` code if no matches were found.
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * @param {userBookFindFirstOrThrowArgs} args - Arguments to find a UserBook
   * @example
   * // Get one UserBook
   * const userBook = await prisma.userBook.findFirstOrThrow({
   *   where: {
   *     // ... provide filter here
   *   }
   * })
   */
  findFirstOrThrow<T extends userBookFindFirstOrThrowArgs>(args?: Prisma.SelectSubset<T, userBookFindFirstOrThrowArgs<ExtArgs>>): Prisma.Prisma__userBookClient<runtime.Types.Result.GetResult<Prisma.$userBookPayload<ExtArgs>, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

  /**
   * Find zero or more UserBooks that matches the filter.
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * @param {userBookFindManyArgs} args - Arguments to filter and select certain fields only.
   * @example
   * // Get all UserBooks
   * const userBooks = await prisma.userBook.findMany()
   * 
   * // Get first 10 UserBooks
   * const userBooks = await prisma.userBook.findMany({ take: 10 })
   * 
   * // Only select the `userId`
   * const userBookWithUserIdOnly = await prisma.userBook.findMany({ select: { userId: true } })
   * 
   */
  findMany<T extends userBookFindManyArgs>(args?: Prisma.SelectSubset<T, userBookFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$userBookPayload<ExtArgs>, T, "findMany", GlobalOmitOptions>>

  /**
   * Create a UserBook.
   * @param {userBookCreateArgs} args - Arguments to create a UserBook.
   * @example
   * // Create one UserBook
   * const UserBook = await prisma.userBook.create({
   *   data: {
   *     // ... data to create a UserBook
   *   }
   * })
   * 
   */
  create<T extends userBookCreateArgs>(args: Prisma.SelectSubset<T, userBookCreateArgs<ExtArgs>>): Prisma.Prisma__userBookClient<runtime.Types.Result.GetResult<Prisma.$userBookPayload<ExtArgs>, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

  /**
   * Create many UserBooks.
   * @param {userBookCreateManyArgs} args - Arguments to create many UserBooks.
   * @example
   * // Create many UserBooks
   * const userBook = await prisma.userBook.createMany({
   *   data: [
   *     // ... provide data here
   *   ]
   * })
   *     
   */
  createMany<T extends userBookCreateManyArgs>(args?: Prisma.SelectSubset<T, userBookCreateManyArgs<ExtArgs>>): Prisma.PrismaPromise<Prisma.BatchPayload>

  /**
   * Create many UserBooks and returns the data saved in the database.
   * @param {userBookCreateManyAndReturnArgs} args - Arguments to create many UserBooks.
   * @example
   * // Create many UserBooks
   * const userBook = await prisma.userBook.createManyAndReturn({
   *   data: [
   *     // ... provide data here
   *   ]
   * })
   * 
   * // Create many UserBooks and only return the `userId`
   * const userBookWithUserIdOnly = await prisma.userBook.createManyAndReturn({
   *   select: { userId: true },
   *   data: [
   *     // ... provide data here
   *   ]
   * })
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * 
   */
  createManyAndReturn<T extends userBookCreateManyAndReturnArgs>(args?: Prisma.SelectSubset<T, userBookCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$userBookPayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

  /**
   * Delete a UserBook.
   * @param {userBookDeleteArgs} args - Arguments to delete one UserBook.
   * @example
   * // Delete one UserBook
   * const UserBook = await prisma.userBook.delete({
   *   where: {
   *     // ... filter to delete one UserBook
   *   }
   * })
   * 
   */
  delete<T extends userBookDeleteArgs>(args: Prisma.SelectSubset<T, userBookDeleteArgs<ExtArgs>>): Prisma.Prisma__userBookClient<runtime.Types.Result.GetResult<Prisma.$userBookPayload<ExtArgs>, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

  /**
   * Update one UserBook.
   * @param {userBookUpdateArgs} args - Arguments to update one UserBook.
   * @example
   * // Update one UserBook
   * const userBook = await prisma.userBook.update({
   *   where: {
   *     // ... provide filter here
   *   },
   *   data: {
   *     // ... provide data here
   *   }
   * })
   * 
   */
  update<T extends userBookUpdateArgs>(args: Prisma.SelectSubset<T, userBookUpdateArgs<ExtArgs>>): Prisma.Prisma__userBookClient<runtime.Types.Result.GetResult<Prisma.$userBookPayload<ExtArgs>, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

  /**
   * Delete zero or more UserBooks.
   * @param {userBookDeleteManyArgs} args - Arguments to filter UserBooks to delete.
   * @example
   * // Delete a few UserBooks
   * const { count } = await prisma.userBook.deleteMany({
   *   where: {
   *     // ... provide filter here
   *   }
   * })
   * 
   */
  deleteMany<T extends userBookDeleteManyArgs>(args?: Prisma.SelectSubset<T, userBookDeleteManyArgs<ExtArgs>>): Prisma.PrismaPromise<Prisma.BatchPayload>

  /**
   * Update zero or more UserBooks.
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * @param {userBookUpdateManyArgs} args - Arguments to update one or more rows.
   * @example
   * // Update many UserBooks
   * const userBook = await prisma.userBook.updateMany({
   *   where: {
   *     // ... provide filter here
   *   },
   *   data: {
   *     // ... provide data here
   *   }
   * })
   * 
   */
  updateMany<T extends userBookUpdateManyArgs>(args: Prisma.SelectSubset<T, userBookUpdateManyArgs<ExtArgs>>): Prisma.PrismaPromise<Prisma.BatchPayload>

  /**
   * Update zero or more UserBooks and returns the data updated in the database.
   * @param {userBookUpdateManyAndReturnArgs} args - Arguments to update many UserBooks.
   * @example
   * // Update many UserBooks
   * const userBook = await prisma.userBook.updateManyAndReturn({
   *   where: {
   *     // ... provide filter here
   *   },
   *   data: [
   *     // ... provide data here
   *   ]
   * })
   * 
   * // Update zero or more UserBooks and only return the `userId`
   * const userBookWithUserIdOnly = await prisma.userBook.updateManyAndReturn({
   *   select: { userId: true },
   *   where: {
   *     // ... provide filter here
   *   },
   *   data: [
   *     // ... provide data here
   *   ]
   * })
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * 
   */
  updateManyAndReturn<T extends userBookUpdateManyAndReturnArgs>(args: Prisma.SelectSubset<T, userBookUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$userBookPayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

  /**
   * Create or update one UserBook.
   * @param {userBookUpsertArgs} args - Arguments to update or create a UserBook.
   * @example
   * // Update or create a UserBook
   * const userBook = await prisma.userBook.upsert({
   *   create: {
   *     // ... data to create a UserBook
   *   },
   *   update: {
   *     // ... in case it already exists, update
   *   },
   *   where: {
   *     // ... the filter for the UserBook we want to update
   *   }
   * })
   */
  upsert<T extends userBookUpsertArgs>(args: Prisma.SelectSubset<T, userBookUpsertArgs<ExtArgs>>): Prisma.Prisma__userBookClient<runtime.Types.Result.GetResult<Prisma.$userBookPayload<ExtArgs>, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>


  /**
   * Count the number of UserBooks.
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * @param {userBookCountArgs} args - Arguments to filter UserBooks to count.
   * @example
   * // Count the number of UserBooks
   * const count = await prisma.userBook.count({
   *   where: {
   *     // ... the filter for the UserBooks we want to count
   *   }
   * })
  **/
  count<T extends userBookCountArgs>(
    args?: Prisma.Subset<T, userBookCountArgs>,
  ): Prisma.PrismaPromise<
    T extends runtime.Types.Utils.Record<'select', any>
      ? T['select'] extends true
        ? number
        : Prisma.GetScalarType<T['select'], UserBookCountAggregateOutputType>
      : number
  >

  /**
   * Allows you to perform aggregations operations on a UserBook.
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * @param {UserBookAggregateArgs} args - Select which aggregations you would like to apply and on what fields.
   * @example
   * // Ordered by age ascending
   * // Where email contains prisma.io
   * // Limited to the 10 users
   * const aggregations = await prisma.user.aggregate({
   *   _avg: {
   *     age: true,
   *   },
   *   where: {
   *     email: {
   *       contains: "prisma.io",
   *     },
   *   },
   *   orderBy: {
   *     age: "asc",
   *   },
   *   take: 10,
   * })
  **/
  aggregate<T extends UserBookAggregateArgs>(args: Prisma.Subset<T, UserBookAggregateArgs>): Prisma.PrismaPromise<GetUserBookAggregateType<T>>

  /**
   * Group by UserBook.
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * @param {userBookGroupByArgs} args - Group by arguments.
   * @example
   * // Group by city, order by createdAt, get count
   * const result = await prisma.user.groupBy({
   *   by: ['city', 'createdAt'],
   *   orderBy: {
   *     createdAt: true
   *   },
   *   _count: {
   *     _all: true
   *   },
   * })
   * 
  **/
  groupBy<
    T extends userBookGroupByArgs,
    HasSelectOrTake extends Prisma.Or<
      Prisma.Extends<'skip', Prisma.Keys<T>>,
      Prisma.Extends<'take', Prisma.Keys<T>>
    >,
    OrderByArg extends Prisma.True extends HasSelectOrTake
      ? { orderBy: userBookGroupByArgs['orderBy'] }
      : { orderBy?: userBookGroupByArgs['orderBy'] },
    OrderFields extends Prisma.ExcludeUnderscoreKeys<Prisma.Keys<Prisma.MaybeTupleToUnion<T['orderBy']>>>,
    ByFields extends Prisma.MaybeTupleToUnion<T['by']>,
    ByValid extends Prisma.Has<ByFields, OrderFields>,
    HavingFields extends Prisma.GetHavingFields<T['having']>,
    HavingValid extends Prisma.Has<ByFields, HavingFields>,
    ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False,
    InputErrors extends ByEmpty extends Prisma.True
    ? `Error: "by" must not be empty.`
    : HavingValid extends Prisma.False
    ? {
        [P in HavingFields]: P extends ByFields
          ? never
          : P extends string
          ? `Error: Field "${P}" used in "having" needs to be provided in "by".`
          : [
              Error,
              'Field ',
              P,
              ` in "having" needs to be provided in "by"`,
            ]
      }[HavingFields]
    : 'take' extends Prisma.Keys<T>
    ? 'orderBy' extends Prisma.Keys<T>
      ? ByValid extends Prisma.True
        ? {}
        : {
            [P in OrderFields]: P extends ByFields
              ? never
              : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
          }[OrderFields]
      : 'Error: If you provide "take", you also need to provide "orderBy"'
    : 'skip' extends Prisma.Keys<T>
    ? 'orderBy' extends Prisma.Keys<T>
      ? ByValid extends Prisma.True
        ? {}
        : {
            [P in OrderFields]: P extends ByFields
              ? never
              : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
          }[OrderFields]
      : 'Error: If you provide "skip", you also need to provide "orderBy"'
    : ByValid extends Prisma.True
    ? {}
    : {
        [P in OrderFields]: P extends ByFields
          ? never
          : `Error: Field "${P}" in "orderBy" needs to be provided in "by"`
      }[OrderFields]
  >(args: Prisma.SubsetIntersection<T, userBookGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetUserBookGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
/**
 * Fields of the userBook model
 */
readonly fields: userBookFieldRefs;
}

/**
 * The delegate class that acts as a "Promise-like" for userBook.
 * Why is this prefixed with `Prisma__`?
 * Because we want to prevent naming conflicts as mentioned in
 * https://github.com/prisma/prisma-client-js/issues/707
 */
export interface Prisma__userBookClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
  readonly [Symbol.toStringTag]: "PrismaPromise"
  user<T extends Prisma.userDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.userDefaultArgs<ExtArgs>>): Prisma.Prisma__userClient<runtime.Types.Result.GetResult<Prisma.$userPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
  book<T extends Prisma.bookDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.bookDefaultArgs<ExtArgs>>): Prisma.Prisma__bookClient<runtime.Types.Result.GetResult<Prisma.$bookPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
  /**
   * Attaches callbacks for the resolution and/or rejection of the Promise.
   * @param onfulfilled The callback to execute when the Promise is resolved.
   * @param onrejected The callback to execute when the Promise is rejected.
   * @returns A Promise for the completion of which ever callback is executed.
   */
  then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): runtime.Types.Utils.JsPromise<TResult1 | TResult2>
  /**
   * Attaches a callback for only the rejection of the Promise.
   * @param onrejected The callback to execute when the Promise is rejected.
   * @returns A Promise for the completion of the callback.
   */
  catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): runtime.Types.Utils.JsPromise<T | TResult>
  /**
   * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
   * resolved value cannot be modified from the callback.
   * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
   * @returns A Promise for the completion of the callback.
   */
  finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise<T>
}




/**
 * Fields of the userBook model
 */
export interface userBookFieldRefs {
  readonly userId: Prisma.FieldRef<"userBook", 'String'>
  readonly bookId: Prisma.FieldRef<"userBook", 'String'>
  readonly status: Prisma.FieldRef<"userBook", 'BookStatus'>
  readonly addedAt: Prisma.FieldRef<"userBook", 'DateTime'>
  readonly updatedAt: Prisma.FieldRef<"userBook", 'DateTime'>
  readonly ownNote: Prisma.FieldRef<"userBook", 'String'>
}
    

// Custom InputTypes
/**
 * userBook findUnique
 */
export type userBookFindUniqueArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the userBook
   */
  select?: Prisma.userBookSelect<ExtArgs> | null
  /**
   * Omit specific fields from the userBook
   */
  omit?: Prisma.userBookOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.userBookInclude<ExtArgs> | null
  /**
   * Filter, which userBook to fetch.
   */
  where: Prisma.userBookWhereUniqueInput
}

/**
 * userBook findUniqueOrThrow
 */
export type userBookFindUniqueOrThrowArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the userBook
   */
  select?: Prisma.userBookSelect<ExtArgs> | null
  /**
   * Omit specific fields from the userBook
   */
  omit?: Prisma.userBookOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.userBookInclude<ExtArgs> | null
  /**
   * Filter, which userBook to fetch.
   */
  where: Prisma.userBookWhereUniqueInput
}

/**
 * userBook findFirst
 */
export type userBookFindFirstArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the userBook
   */
  select?: Prisma.userBookSelect<ExtArgs> | null
  /**
   * Omit specific fields from the userBook
   */
  omit?: Prisma.userBookOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.userBookInclude<ExtArgs> | null
  /**
   * Filter, which userBook to fetch.
   */
  where?: Prisma.userBookWhereInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
   * 
   * Determine the order of userBooks to fetch.
   */
  orderBy?: Prisma.userBookOrderByWithRelationInput | Prisma.userBookOrderByWithRelationInput[]
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
   * 
   * Sets the position for searching for userBooks.
   */
  cursor?: Prisma.userBookWhereUniqueInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Take `±n` userBooks from the position of the cursor.
   */
  take?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Skip the first `n` userBooks.
   */
  skip?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
   * 
   * Filter by unique combinations of userBooks.
   */
  distinct?: Prisma.UserBookScalarFieldEnum | Prisma.UserBookScalarFieldEnum[]
}

/**
 * userBook findFirstOrThrow
 */
export type userBookFindFirstOrThrowArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the userBook
   */
  select?: Prisma.userBookSelect<ExtArgs> | null
  /**
   * Omit specific fields from the userBook
   */
  omit?: Prisma.userBookOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.userBookInclude<ExtArgs> | null
  /**
   * Filter, which userBook to fetch.
   */
  where?: Prisma.userBookWhereInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
   * 
   * Determine the order of userBooks to fetch.
   */
  orderBy?: Prisma.userBookOrderByWithRelationInput | Prisma.userBookOrderByWithRelationInput[]
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
   * 
   * Sets the position for searching for userBooks.
   */
  cursor?: Prisma.userBookWhereUniqueInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Take `±n` userBooks from the position of the cursor.
   */
  take?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Skip the first `n` userBooks.
   */
  skip?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
   * 
   * Filter by unique combinations of userBooks.
   */
  distinct?: Prisma.UserBookScalarFieldEnum | Prisma.UserBookScalarFieldEnum[]
}

/**
 * userBook findMany
 */
export type userBookFindManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the userBook
   */
  select?: Prisma.userBookSelect<ExtArgs> | null
  /**
   * Omit specific fields from the userBook
   */
  omit?: Prisma.userBookOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.userBookInclude<ExtArgs> | null
  /**
   * Filter, which userBooks to fetch.
   */
  where?: Prisma.userBookWhereInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
   * 
   * Determine the order of userBooks to fetch.
   */
  orderBy?: Prisma.userBookOrderByWithRelationInput | Prisma.userBookOrderByWithRelationInput[]
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
   * 
   * Sets the position for listing userBooks.
   */
  cursor?: Prisma.userBookWhereUniqueInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Take `±n` userBooks from the position of the cursor.
   */
  take?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Skip the first `n` userBooks.
   */
  skip?: number
  distinct?: Prisma.UserBookScalarFieldEnum | Prisma.UserBookScalarFieldEnum[]
}

/**
 * userBook create
 */
export type userBookCreateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the userBook
   */
  select?: Prisma.userBookSelect<ExtArgs> | null
  /**
   * Omit specific fields from the userBook
   */
  omit?: Prisma.userBookOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.userBookInclude<ExtArgs> | null
  /**
   * The data needed to create a userBook.
   */
  data: Prisma.XOR<Prisma.userBookCreateInput, Prisma.userBookUncheckedCreateInput>
}

/**
 * userBook createMany
 */
export type userBookCreateManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * The data used to create many userBooks.
   */
  data: Prisma.userBookCreateManyInput | Prisma.userBookCreateManyInput[]
  skipDuplicates?: boolean
}

/**
 * userBook createManyAndReturn
 */
export type userBookCreateManyAndReturnArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the userBook
   */
  select?: Prisma.userBookSelectCreateManyAndReturn<ExtArgs> | null
  /**
   * Omit specific fields from the userBook
   */
  omit?: Prisma.userBookOmit<ExtArgs> | null
  /**
   * The data used to create many userBooks.
   */
  data: Prisma.userBookCreateManyInput | Prisma.userBookCreateManyInput[]
  skipDuplicates?: boolean
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.userBookIncludeCreateManyAndReturn<ExtArgs> | null
}

/**
 * userBook update
 */
export type userBookUpdateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the userBook
   */
  select?: Prisma.userBookSelect<ExtArgs> | null
  /**
   * Omit specific fields from the userBook
   */
  omit?: Prisma.userBookOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.userBookInclude<ExtArgs> | null
  /**
   * The data needed to update a userBook.
   */
  data: Prisma.XOR<Prisma.userBookUpdateInput, Prisma.userBookUncheckedUpdateInput>
  /**
   * Choose, which userBook to update.
   */
  where: Prisma.userBookWhereUniqueInput
}

/**
 * userBook updateMany
 */
export type userBookUpdateManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * The data used to update userBooks.
   */
  data: Prisma.XOR<Prisma.userBookUpdateManyMutationInput, Prisma.userBookUncheckedUpdateManyInput>
  /**
   * Filter which userBooks to update
   */
  where?: Prisma.userBookWhereInput
  /**
   * Limit how many userBooks to update.
   */
  limit?: number
}

/**
 * userBook updateManyAndReturn
 */
export type userBookUpdateManyAndReturnArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the userBook
   */
  select?: Prisma.userBookSelectUpdateManyAndReturn<ExtArgs> | null
  /**
   * Omit specific fields from the userBook
   */
  omit?: Prisma.userBookOmit<ExtArgs> | null
  /**
   * The data used to update userBooks.
   */
  data: Prisma.XOR<Prisma.userBookUpdateManyMutationInput, Prisma.userBookUncheckedUpdateManyInput>
  /**
   * Filter which userBooks to update
   */
  where?: Prisma.userBookWhereInput
  /**
   * Limit how many userBooks to update.
   */
  limit?: number
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.userBookIncludeUpdateManyAndReturn<ExtArgs> | null
}

/**
 * userBook upsert
 */
export type userBookUpsertArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the userBook
   */
  select?: Prisma.userBookSelect<ExtArgs> | null
  /**
   * Omit specific fields from the userBook
   */
  omit?: Prisma.userBookOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.userBookInclude<ExtArgs> | null
  /**
   * The filter to search for the userBook to update in case it exists.
   */
  where: Prisma.userBookWhereUniqueInput
  /**
   * In case the userBook found by the `where` argument doesn't exist, create a new userBook with this data.
   */
  create: Prisma.XOR<Prisma.userBookCreateInput, Prisma.userBookUncheckedCreateInput>
  /**
   * In case the userBook was found with the provided `where` argument, update it with this data.
   */
  update: Prisma.XOR<Prisma.userBookUpdateInput, Prisma.userBookUncheckedUpdateInput>
}

/**
 * userBook delete
 */
export type userBookDeleteArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the userBook
   */
  select?: Prisma.userBookSelect<ExtArgs> | null
  /**
   * Omit specific fields from the userBook
   */
  omit?: Prisma.userBookOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.userBookInclude<ExtArgs> | null
  /**
   * Filter which userBook to delete.
   */
  where: Prisma.userBookWhereUniqueInput
}

/**
 * userBook deleteMany
 */
export type userBookDeleteManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Filter which userBooks to delete
   */
  where?: Prisma.userBookWhereInput
  /**
   * Limit how many userBooks to delete.
   */
  limit?: number
}

/**
 * userBook without action
 */
export type userBookDefaultArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the userBook
   */
  select?: Prisma.userBookSelect<ExtArgs> | null
  /**
   * Omit specific fields from the userBook
   */
  omit?: Prisma.userBookOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.userBookInclude<ExtArgs> | null
}
