
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
/* eslint-disable */
// biome-ignore-all lint: generated file
// @ts-nocheck 
/*
 * This file exports the `ComplexUser` 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 ComplexUser
 * 
 */
export type ComplexUserModel = runtime.Types.Result.DefaultSelection<Prisma.$ComplexUserPayload>

export type AggregateComplexUser = {
  _count: ComplexUserCountAggregateOutputType | null
  _min: ComplexUserMinAggregateOutputType | null
  _max: ComplexUserMaxAggregateOutputType | null
}

export type ComplexUserMinAggregateOutputType = {
  complexId: string | null
  userId: string | null
  role: $Enums.ComplexUserRole | null
  createdAt: Date | null
}

export type ComplexUserMaxAggregateOutputType = {
  complexId: string | null
  userId: string | null
  role: $Enums.ComplexUserRole | null
  createdAt: Date | null
}

export type ComplexUserCountAggregateOutputType = {
  complexId: number
  userId: number
  role: number
  createdAt: number
  _all: number
}


export type ComplexUserMinAggregateInputType = {
  complexId?: true
  userId?: true
  role?: true
  createdAt?: true
}

export type ComplexUserMaxAggregateInputType = {
  complexId?: true
  userId?: true
  role?: true
  createdAt?: true
}

export type ComplexUserCountAggregateInputType = {
  complexId?: true
  userId?: true
  role?: true
  createdAt?: true
  _all?: true
}

export type ComplexUserAggregateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Filter which ComplexUser to aggregate.
   */
  where?: Prisma.ComplexUserWhereInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
   * 
   * Determine the order of ComplexUsers to fetch.
   */
  orderBy?: Prisma.ComplexUserOrderByWithRelationInput | Prisma.ComplexUserOrderByWithRelationInput[]
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
   * 
   * Sets the start position
   */
  cursor?: Prisma.ComplexUserWhereUniqueInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Take `±n` ComplexUsers 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` ComplexUsers.
   */
  skip?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
   * 
   * Count returned ComplexUsers
  **/
  _count?: true | ComplexUserCountAggregateInputType
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
   * 
   * Select which fields to find the minimum value
  **/
  _min?: ComplexUserMinAggregateInputType
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
   * 
   * Select which fields to find the maximum value
  **/
  _max?: ComplexUserMaxAggregateInputType
}

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




export type ComplexUserGroupByArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  where?: Prisma.ComplexUserWhereInput
  orderBy?: Prisma.ComplexUserOrderByWithAggregationInput | Prisma.ComplexUserOrderByWithAggregationInput[]
  by: Prisma.ComplexUserScalarFieldEnum[] | Prisma.ComplexUserScalarFieldEnum
  having?: Prisma.ComplexUserScalarWhereWithAggregatesInput
  take?: number
  skip?: number
  _count?: ComplexUserCountAggregateInputType | true
  _min?: ComplexUserMinAggregateInputType
  _max?: ComplexUserMaxAggregateInputType
}

export type ComplexUserGroupByOutputType = {
  complexId: string
  userId: string
  role: $Enums.ComplexUserRole
  createdAt: Date
  _count: ComplexUserCountAggregateOutputType | null
  _min: ComplexUserMinAggregateOutputType | null
  _max: ComplexUserMaxAggregateOutputType | null
}

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



export type ComplexUserWhereInput = {
  AND?: Prisma.ComplexUserWhereInput | Prisma.ComplexUserWhereInput[]
  OR?: Prisma.ComplexUserWhereInput[]
  NOT?: Prisma.ComplexUserWhereInput | Prisma.ComplexUserWhereInput[]
  complexId?: Prisma.UuidFilter<"ComplexUser"> | string
  userId?: Prisma.StringFilter<"ComplexUser"> | string
  role?: Prisma.EnumComplexUserRoleFilter<"ComplexUser"> | $Enums.ComplexUserRole
  createdAt?: Prisma.DateTimeFilter<"ComplexUser"> | Date | string
  complex?: Prisma.XOR<Prisma.ComplexScalarRelationFilter, Prisma.ComplexWhereInput>
  user?: Prisma.XOR<Prisma.UserScalarRelationFilter, Prisma.UserWhereInput>
}

export type ComplexUserOrderByWithRelationInput = {
  complexId?: Prisma.SortOrder
  userId?: Prisma.SortOrder
  role?: Prisma.SortOrder
  createdAt?: Prisma.SortOrder
  complex?: Prisma.ComplexOrderByWithRelationInput
  user?: Prisma.UserOrderByWithRelationInput
}

export type ComplexUserWhereUniqueInput = Prisma.AtLeast<{
  complexId_userId?: Prisma.ComplexUserComplexIdUserIdCompoundUniqueInput
  AND?: Prisma.ComplexUserWhereInput | Prisma.ComplexUserWhereInput[]
  OR?: Prisma.ComplexUserWhereInput[]
  NOT?: Prisma.ComplexUserWhereInput | Prisma.ComplexUserWhereInput[]
  complexId?: Prisma.UuidFilter<"ComplexUser"> | string
  userId?: Prisma.StringFilter<"ComplexUser"> | string
  role?: Prisma.EnumComplexUserRoleFilter<"ComplexUser"> | $Enums.ComplexUserRole
  createdAt?: Prisma.DateTimeFilter<"ComplexUser"> | Date | string
  complex?: Prisma.XOR<Prisma.ComplexScalarRelationFilter, Prisma.ComplexWhereInput>
  user?: Prisma.XOR<Prisma.UserScalarRelationFilter, Prisma.UserWhereInput>
}, "complexId_userId">

export type ComplexUserOrderByWithAggregationInput = {
  complexId?: Prisma.SortOrder
  userId?: Prisma.SortOrder
  role?: Prisma.SortOrder
  createdAt?: Prisma.SortOrder
  _count?: Prisma.ComplexUserCountOrderByAggregateInput
  _max?: Prisma.ComplexUserMaxOrderByAggregateInput
  _min?: Prisma.ComplexUserMinOrderByAggregateInput
}

export type ComplexUserScalarWhereWithAggregatesInput = {
  AND?: Prisma.ComplexUserScalarWhereWithAggregatesInput | Prisma.ComplexUserScalarWhereWithAggregatesInput[]
  OR?: Prisma.ComplexUserScalarWhereWithAggregatesInput[]
  NOT?: Prisma.ComplexUserScalarWhereWithAggregatesInput | Prisma.ComplexUserScalarWhereWithAggregatesInput[]
  complexId?: Prisma.UuidWithAggregatesFilter<"ComplexUser"> | string
  userId?: Prisma.StringWithAggregatesFilter<"ComplexUser"> | string
  role?: Prisma.EnumComplexUserRoleWithAggregatesFilter<"ComplexUser"> | $Enums.ComplexUserRole
  createdAt?: Prisma.DateTimeWithAggregatesFilter<"ComplexUser"> | Date | string
}

export type ComplexUserCreateInput = {
  role?: $Enums.ComplexUserRole
  createdAt?: Date | string
  complex: Prisma.ComplexCreateNestedOneWithoutUsersInput
  user: Prisma.UserCreateNestedOneWithoutComplexesInput
}

export type ComplexUserUncheckedCreateInput = {
  complexId: string
  userId: string
  role?: $Enums.ComplexUserRole
  createdAt?: Date | string
}

export type ComplexUserUpdateInput = {
  role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  complex?: Prisma.ComplexUpdateOneRequiredWithoutUsersNestedInput
  user?: Prisma.UserUpdateOneRequiredWithoutComplexesNestedInput
}

export type ComplexUserUncheckedUpdateInput = {
  complexId?: Prisma.StringFieldUpdateOperationsInput | string
  userId?: Prisma.StringFieldUpdateOperationsInput | string
  role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type ComplexUserCreateManyInput = {
  complexId: string
  userId: string
  role?: $Enums.ComplexUserRole
  createdAt?: Date | string
}

export type ComplexUserUpdateManyMutationInput = {
  role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type ComplexUserUncheckedUpdateManyInput = {
  complexId?: Prisma.StringFieldUpdateOperationsInput | string
  userId?: Prisma.StringFieldUpdateOperationsInput | string
  role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type ComplexUserListRelationFilter = {
  every?: Prisma.ComplexUserWhereInput
  some?: Prisma.ComplexUserWhereInput
  none?: Prisma.ComplexUserWhereInput
}

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

export type ComplexUserComplexIdUserIdCompoundUniqueInput = {
  complexId: string
  userId: string
}

export type ComplexUserCountOrderByAggregateInput = {
  complexId?: Prisma.SortOrder
  userId?: Prisma.SortOrder
  role?: Prisma.SortOrder
  createdAt?: Prisma.SortOrder
}

export type ComplexUserMaxOrderByAggregateInput = {
  complexId?: Prisma.SortOrder
  userId?: Prisma.SortOrder
  role?: Prisma.SortOrder
  createdAt?: Prisma.SortOrder
}

export type ComplexUserMinOrderByAggregateInput = {
  complexId?: Prisma.SortOrder
  userId?: Prisma.SortOrder
  role?: Prisma.SortOrder
  createdAt?: Prisma.SortOrder
}

export type ComplexUserCreateNestedManyWithoutUserInput = {
  create?: Prisma.XOR<Prisma.ComplexUserCreateWithoutUserInput, Prisma.ComplexUserUncheckedCreateWithoutUserInput> | Prisma.ComplexUserCreateWithoutUserInput[] | Prisma.ComplexUserUncheckedCreateWithoutUserInput[]
  connectOrCreate?: Prisma.ComplexUserCreateOrConnectWithoutUserInput | Prisma.ComplexUserCreateOrConnectWithoutUserInput[]
  createMany?: Prisma.ComplexUserCreateManyUserInputEnvelope
  connect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
}

export type ComplexUserUncheckedCreateNestedManyWithoutUserInput = {
  create?: Prisma.XOR<Prisma.ComplexUserCreateWithoutUserInput, Prisma.ComplexUserUncheckedCreateWithoutUserInput> | Prisma.ComplexUserCreateWithoutUserInput[] | Prisma.ComplexUserUncheckedCreateWithoutUserInput[]
  connectOrCreate?: Prisma.ComplexUserCreateOrConnectWithoutUserInput | Prisma.ComplexUserCreateOrConnectWithoutUserInput[]
  createMany?: Prisma.ComplexUserCreateManyUserInputEnvelope
  connect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
}

export type ComplexUserUpdateManyWithoutUserNestedInput = {
  create?: Prisma.XOR<Prisma.ComplexUserCreateWithoutUserInput, Prisma.ComplexUserUncheckedCreateWithoutUserInput> | Prisma.ComplexUserCreateWithoutUserInput[] | Prisma.ComplexUserUncheckedCreateWithoutUserInput[]
  connectOrCreate?: Prisma.ComplexUserCreateOrConnectWithoutUserInput | Prisma.ComplexUserCreateOrConnectWithoutUserInput[]
  upsert?: Prisma.ComplexUserUpsertWithWhereUniqueWithoutUserInput | Prisma.ComplexUserUpsertWithWhereUniqueWithoutUserInput[]
  createMany?: Prisma.ComplexUserCreateManyUserInputEnvelope
  set?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
  disconnect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
  delete?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
  connect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
  update?: Prisma.ComplexUserUpdateWithWhereUniqueWithoutUserInput | Prisma.ComplexUserUpdateWithWhereUniqueWithoutUserInput[]
  updateMany?: Prisma.ComplexUserUpdateManyWithWhereWithoutUserInput | Prisma.ComplexUserUpdateManyWithWhereWithoutUserInput[]
  deleteMany?: Prisma.ComplexUserScalarWhereInput | Prisma.ComplexUserScalarWhereInput[]
}

export type ComplexUserUncheckedUpdateManyWithoutUserNestedInput = {
  create?: Prisma.XOR<Prisma.ComplexUserCreateWithoutUserInput, Prisma.ComplexUserUncheckedCreateWithoutUserInput> | Prisma.ComplexUserCreateWithoutUserInput[] | Prisma.ComplexUserUncheckedCreateWithoutUserInput[]
  connectOrCreate?: Prisma.ComplexUserCreateOrConnectWithoutUserInput | Prisma.ComplexUserCreateOrConnectWithoutUserInput[]
  upsert?: Prisma.ComplexUserUpsertWithWhereUniqueWithoutUserInput | Prisma.ComplexUserUpsertWithWhereUniqueWithoutUserInput[]
  createMany?: Prisma.ComplexUserCreateManyUserInputEnvelope
  set?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
  disconnect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
  delete?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
  connect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
  update?: Prisma.ComplexUserUpdateWithWhereUniqueWithoutUserInput | Prisma.ComplexUserUpdateWithWhereUniqueWithoutUserInput[]
  updateMany?: Prisma.ComplexUserUpdateManyWithWhereWithoutUserInput | Prisma.ComplexUserUpdateManyWithWhereWithoutUserInput[]
  deleteMany?: Prisma.ComplexUserScalarWhereInput | Prisma.ComplexUserScalarWhereInput[]
}

export type ComplexUserCreateNestedManyWithoutComplexInput = {
  create?: Prisma.XOR<Prisma.ComplexUserCreateWithoutComplexInput, Prisma.ComplexUserUncheckedCreateWithoutComplexInput> | Prisma.ComplexUserCreateWithoutComplexInput[] | Prisma.ComplexUserUncheckedCreateWithoutComplexInput[]
  connectOrCreate?: Prisma.ComplexUserCreateOrConnectWithoutComplexInput | Prisma.ComplexUserCreateOrConnectWithoutComplexInput[]
  createMany?: Prisma.ComplexUserCreateManyComplexInputEnvelope
  connect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
}

export type ComplexUserUncheckedCreateNestedManyWithoutComplexInput = {
  create?: Prisma.XOR<Prisma.ComplexUserCreateWithoutComplexInput, Prisma.ComplexUserUncheckedCreateWithoutComplexInput> | Prisma.ComplexUserCreateWithoutComplexInput[] | Prisma.ComplexUserUncheckedCreateWithoutComplexInput[]
  connectOrCreate?: Prisma.ComplexUserCreateOrConnectWithoutComplexInput | Prisma.ComplexUserCreateOrConnectWithoutComplexInput[]
  createMany?: Prisma.ComplexUserCreateManyComplexInputEnvelope
  connect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
}

export type ComplexUserUpdateManyWithoutComplexNestedInput = {
  create?: Prisma.XOR<Prisma.ComplexUserCreateWithoutComplexInput, Prisma.ComplexUserUncheckedCreateWithoutComplexInput> | Prisma.ComplexUserCreateWithoutComplexInput[] | Prisma.ComplexUserUncheckedCreateWithoutComplexInput[]
  connectOrCreate?: Prisma.ComplexUserCreateOrConnectWithoutComplexInput | Prisma.ComplexUserCreateOrConnectWithoutComplexInput[]
  upsert?: Prisma.ComplexUserUpsertWithWhereUniqueWithoutComplexInput | Prisma.ComplexUserUpsertWithWhereUniqueWithoutComplexInput[]
  createMany?: Prisma.ComplexUserCreateManyComplexInputEnvelope
  set?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
  disconnect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
  delete?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
  connect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
  update?: Prisma.ComplexUserUpdateWithWhereUniqueWithoutComplexInput | Prisma.ComplexUserUpdateWithWhereUniqueWithoutComplexInput[]
  updateMany?: Prisma.ComplexUserUpdateManyWithWhereWithoutComplexInput | Prisma.ComplexUserUpdateManyWithWhereWithoutComplexInput[]
  deleteMany?: Prisma.ComplexUserScalarWhereInput | Prisma.ComplexUserScalarWhereInput[]
}

export type ComplexUserUncheckedUpdateManyWithoutComplexNestedInput = {
  create?: Prisma.XOR<Prisma.ComplexUserCreateWithoutComplexInput, Prisma.ComplexUserUncheckedCreateWithoutComplexInput> | Prisma.ComplexUserCreateWithoutComplexInput[] | Prisma.ComplexUserUncheckedCreateWithoutComplexInput[]
  connectOrCreate?: Prisma.ComplexUserCreateOrConnectWithoutComplexInput | Prisma.ComplexUserCreateOrConnectWithoutComplexInput[]
  upsert?: Prisma.ComplexUserUpsertWithWhereUniqueWithoutComplexInput | Prisma.ComplexUserUpsertWithWhereUniqueWithoutComplexInput[]
  createMany?: Prisma.ComplexUserCreateManyComplexInputEnvelope
  set?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
  disconnect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
  delete?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
  connect?: Prisma.ComplexUserWhereUniqueInput | Prisma.ComplexUserWhereUniqueInput[]
  update?: Prisma.ComplexUserUpdateWithWhereUniqueWithoutComplexInput | Prisma.ComplexUserUpdateWithWhereUniqueWithoutComplexInput[]
  updateMany?: Prisma.ComplexUserUpdateManyWithWhereWithoutComplexInput | Prisma.ComplexUserUpdateManyWithWhereWithoutComplexInput[]
  deleteMany?: Prisma.ComplexUserScalarWhereInput | Prisma.ComplexUserScalarWhereInput[]
}

export type EnumComplexUserRoleFieldUpdateOperationsInput = {
  set?: $Enums.ComplexUserRole
}

export type ComplexUserCreateWithoutUserInput = {
  role?: $Enums.ComplexUserRole
  createdAt?: Date | string
  complex: Prisma.ComplexCreateNestedOneWithoutUsersInput
}

export type ComplexUserUncheckedCreateWithoutUserInput = {
  complexId: string
  role?: $Enums.ComplexUserRole
  createdAt?: Date | string
}

export type ComplexUserCreateOrConnectWithoutUserInput = {
  where: Prisma.ComplexUserWhereUniqueInput
  create: Prisma.XOR<Prisma.ComplexUserCreateWithoutUserInput, Prisma.ComplexUserUncheckedCreateWithoutUserInput>
}

export type ComplexUserCreateManyUserInputEnvelope = {
  data: Prisma.ComplexUserCreateManyUserInput | Prisma.ComplexUserCreateManyUserInput[]
  skipDuplicates?: boolean
}

export type ComplexUserUpsertWithWhereUniqueWithoutUserInput = {
  where: Prisma.ComplexUserWhereUniqueInput
  update: Prisma.XOR<Prisma.ComplexUserUpdateWithoutUserInput, Prisma.ComplexUserUncheckedUpdateWithoutUserInput>
  create: Prisma.XOR<Prisma.ComplexUserCreateWithoutUserInput, Prisma.ComplexUserUncheckedCreateWithoutUserInput>
}

export type ComplexUserUpdateWithWhereUniqueWithoutUserInput = {
  where: Prisma.ComplexUserWhereUniqueInput
  data: Prisma.XOR<Prisma.ComplexUserUpdateWithoutUserInput, Prisma.ComplexUserUncheckedUpdateWithoutUserInput>
}

export type ComplexUserUpdateManyWithWhereWithoutUserInput = {
  where: Prisma.ComplexUserScalarWhereInput
  data: Prisma.XOR<Prisma.ComplexUserUpdateManyMutationInput, Prisma.ComplexUserUncheckedUpdateManyWithoutUserInput>
}

export type ComplexUserScalarWhereInput = {
  AND?: Prisma.ComplexUserScalarWhereInput | Prisma.ComplexUserScalarWhereInput[]
  OR?: Prisma.ComplexUserScalarWhereInput[]
  NOT?: Prisma.ComplexUserScalarWhereInput | Prisma.ComplexUserScalarWhereInput[]
  complexId?: Prisma.UuidFilter<"ComplexUser"> | string
  userId?: Prisma.StringFilter<"ComplexUser"> | string
  role?: Prisma.EnumComplexUserRoleFilter<"ComplexUser"> | $Enums.ComplexUserRole
  createdAt?: Prisma.DateTimeFilter<"ComplexUser"> | Date | string
}

export type ComplexUserCreateWithoutComplexInput = {
  role?: $Enums.ComplexUserRole
  createdAt?: Date | string
  user: Prisma.UserCreateNestedOneWithoutComplexesInput
}

export type ComplexUserUncheckedCreateWithoutComplexInput = {
  userId: string
  role?: $Enums.ComplexUserRole
  createdAt?: Date | string
}

export type ComplexUserCreateOrConnectWithoutComplexInput = {
  where: Prisma.ComplexUserWhereUniqueInput
  create: Prisma.XOR<Prisma.ComplexUserCreateWithoutComplexInput, Prisma.ComplexUserUncheckedCreateWithoutComplexInput>
}

export type ComplexUserCreateManyComplexInputEnvelope = {
  data: Prisma.ComplexUserCreateManyComplexInput | Prisma.ComplexUserCreateManyComplexInput[]
  skipDuplicates?: boolean
}

export type ComplexUserUpsertWithWhereUniqueWithoutComplexInput = {
  where: Prisma.ComplexUserWhereUniqueInput
  update: Prisma.XOR<Prisma.ComplexUserUpdateWithoutComplexInput, Prisma.ComplexUserUncheckedUpdateWithoutComplexInput>
  create: Prisma.XOR<Prisma.ComplexUserCreateWithoutComplexInput, Prisma.ComplexUserUncheckedCreateWithoutComplexInput>
}

export type ComplexUserUpdateWithWhereUniqueWithoutComplexInput = {
  where: Prisma.ComplexUserWhereUniqueInput
  data: Prisma.XOR<Prisma.ComplexUserUpdateWithoutComplexInput, Prisma.ComplexUserUncheckedUpdateWithoutComplexInput>
}

export type ComplexUserUpdateManyWithWhereWithoutComplexInput = {
  where: Prisma.ComplexUserScalarWhereInput
  data: Prisma.XOR<Prisma.ComplexUserUpdateManyMutationInput, Prisma.ComplexUserUncheckedUpdateManyWithoutComplexInput>
}

export type ComplexUserCreateManyUserInput = {
  complexId: string
  role?: $Enums.ComplexUserRole
  createdAt?: Date | string
}

export type ComplexUserUpdateWithoutUserInput = {
  role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  complex?: Prisma.ComplexUpdateOneRequiredWithoutUsersNestedInput
}

export type ComplexUserUncheckedUpdateWithoutUserInput = {
  complexId?: Prisma.StringFieldUpdateOperationsInput | string
  role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type ComplexUserUncheckedUpdateManyWithoutUserInput = {
  complexId?: Prisma.StringFieldUpdateOperationsInput | string
  role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type ComplexUserCreateManyComplexInput = {
  userId: string
  role?: $Enums.ComplexUserRole
  createdAt?: Date | string
}

export type ComplexUserUpdateWithoutComplexInput = {
  role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  user?: Prisma.UserUpdateOneRequiredWithoutComplexesNestedInput
}

export type ComplexUserUncheckedUpdateWithoutComplexInput = {
  userId?: Prisma.StringFieldUpdateOperationsInput | string
  role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type ComplexUserUncheckedUpdateManyWithoutComplexInput = {
  userId?: Prisma.StringFieldUpdateOperationsInput | string
  role?: Prisma.EnumComplexUserRoleFieldUpdateOperationsInput | $Enums.ComplexUserRole
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}



export type ComplexUserSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
  complexId?: boolean
  userId?: boolean
  role?: boolean
  createdAt?: boolean
  complex?: boolean | Prisma.ComplexDefaultArgs<ExtArgs>
  user?: boolean | Prisma.UserDefaultArgs<ExtArgs>
}, ExtArgs["result"]["complexUser"]>

export type ComplexUserSelectCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
  complexId?: boolean
  userId?: boolean
  role?: boolean
  createdAt?: boolean
  complex?: boolean | Prisma.ComplexDefaultArgs<ExtArgs>
  user?: boolean | Prisma.UserDefaultArgs<ExtArgs>
}, ExtArgs["result"]["complexUser"]>

export type ComplexUserSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
  complexId?: boolean
  userId?: boolean
  role?: boolean
  createdAt?: boolean
  complex?: boolean | Prisma.ComplexDefaultArgs<ExtArgs>
  user?: boolean | Prisma.UserDefaultArgs<ExtArgs>
}, ExtArgs["result"]["complexUser"]>

export type ComplexUserSelectScalar = {
  complexId?: boolean
  userId?: boolean
  role?: boolean
  createdAt?: boolean
}

export type ComplexUserOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"complexId" | "userId" | "role" | "createdAt", ExtArgs["result"]["complexUser"]>
export type ComplexUserInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  complex?: boolean | Prisma.ComplexDefaultArgs<ExtArgs>
  user?: boolean | Prisma.UserDefaultArgs<ExtArgs>
}
export type ComplexUserIncludeCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  complex?: boolean | Prisma.ComplexDefaultArgs<ExtArgs>
  user?: boolean | Prisma.UserDefaultArgs<ExtArgs>
}
export type ComplexUserIncludeUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  complex?: boolean | Prisma.ComplexDefaultArgs<ExtArgs>
  user?: boolean | Prisma.UserDefaultArgs<ExtArgs>
}

export type $ComplexUserPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  name: "ComplexUser"
  objects: {
    complex: Prisma.$ComplexPayload<ExtArgs>
    user: Prisma.$UserPayload<ExtArgs>
  }
  scalars: runtime.Types.Extensions.GetPayloadResult<{
    complexId: string
    userId: string
    role: $Enums.ComplexUserRole
    createdAt: Date
  }, ExtArgs["result"]["complexUser"]>
  composites: {}
}

export type ComplexUserGetPayload<S extends boolean | null | undefined | ComplexUserDefaultArgs> = runtime.Types.Result.GetResult<Prisma.$ComplexUserPayload, S>

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

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

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

  /**
   * Find the first ComplexUser 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 {ComplexUserFindFirstArgs} args - Arguments to find a ComplexUser
   * @example
   * // Get one ComplexUser
   * const complexUser = await prisma.complexUser.findFirst({
   *   where: {
   *     // ... provide filter here
   *   }
   * })
   */
  findFirst<T extends ComplexUserFindFirstArgs>(args?: Prisma.SelectSubset<T, ComplexUserFindFirstArgs<ExtArgs>>): Prisma.Prisma__ComplexUserClient<runtime.Types.Result.GetResult<Prisma.$ComplexUserPayload<ExtArgs>, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>

  /**
   * Find the first ComplexUser 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 {ComplexUserFindFirstOrThrowArgs} args - Arguments to find a ComplexUser
   * @example
   * // Get one ComplexUser
   * const complexUser = await prisma.complexUser.findFirstOrThrow({
   *   where: {
   *     // ... provide filter here
   *   }
   * })
   */
  findFirstOrThrow<T extends ComplexUserFindFirstOrThrowArgs>(args?: Prisma.SelectSubset<T, ComplexUserFindFirstOrThrowArgs<ExtArgs>>): Prisma.Prisma__ComplexUserClient<runtime.Types.Result.GetResult<Prisma.$ComplexUserPayload<ExtArgs>, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions>

  /**
   * Find zero or more ComplexUsers 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 {ComplexUserFindManyArgs} args - Arguments to filter and select certain fields only.
   * @example
   * // Get all ComplexUsers
   * const complexUsers = await prisma.complexUser.findMany()
   * 
   * // Get first 10 ComplexUsers
   * const complexUsers = await prisma.complexUser.findMany({ take: 10 })
   * 
   * // Only select the `complexId`
   * const complexUserWithComplexIdOnly = await prisma.complexUser.findMany({ select: { complexId: true } })
   * 
   */
  findMany<T extends ComplexUserFindManyArgs>(args?: Prisma.SelectSubset<T, ComplexUserFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$ComplexUserPayload<ExtArgs>, T, "findMany", GlobalOmitOptions>>

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

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

  /**
   * Create many ComplexUsers and returns the data saved in the database.
   * @param {ComplexUserCreateManyAndReturnArgs} args - Arguments to create many ComplexUsers.
   * @example
   * // Create many ComplexUsers
   * const complexUser = await prisma.complexUser.createManyAndReturn({
   *   data: [
   *     // ... provide data here
   *   ]
   * })
   * 
   * // Create many ComplexUsers and only return the `complexId`
   * const complexUserWithComplexIdOnly = await prisma.complexUser.createManyAndReturn({
   *   select: { complexId: 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 ComplexUserCreateManyAndReturnArgs>(args?: Prisma.SelectSubset<T, ComplexUserCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$ComplexUserPayload<ExtArgs>, T, "createManyAndReturn", GlobalOmitOptions>>

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

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

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

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

  /**
   * Update zero or more ComplexUsers and returns the data updated in the database.
   * @param {ComplexUserUpdateManyAndReturnArgs} args - Arguments to update many ComplexUsers.
   * @example
   * // Update many ComplexUsers
   * const complexUser = await prisma.complexUser.updateManyAndReturn({
   *   where: {
   *     // ... provide filter here
   *   },
   *   data: [
   *     // ... provide data here
   *   ]
   * })
   * 
   * // Update zero or more ComplexUsers and only return the `complexId`
   * const complexUserWithComplexIdOnly = await prisma.complexUser.updateManyAndReturn({
   *   select: { complexId: 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 ComplexUserUpdateManyAndReturnArgs>(args: Prisma.SelectSubset<T, ComplexUserUpdateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$ComplexUserPayload<ExtArgs>, T, "updateManyAndReturn", GlobalOmitOptions>>

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


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

  /**
   * Allows you to perform aggregations operations on a ComplexUser.
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * @param {ComplexUserAggregateArgs} 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 ComplexUserAggregateArgs>(args: Prisma.Subset<T, ComplexUserAggregateArgs>): Prisma.PrismaPromise<GetComplexUserAggregateType<T>>

  /**
   * Group by ComplexUser.
   * Note, that providing `undefined` is treated as the value not being there.
   * Read more here: https://pris.ly/d/null-undefined
   * @param {ComplexUserGroupByArgs} 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 ComplexUserGroupByArgs,
    HasSelectOrTake extends Prisma.Or<
      Prisma.Extends<'skip', Prisma.Keys<T>>,
      Prisma.Extends<'take', Prisma.Keys<T>>
    >,
    OrderByArg extends Prisma.True extends HasSelectOrTake
      ? { orderBy: ComplexUserGroupByArgs['orderBy'] }
      : { orderBy?: ComplexUserGroupByArgs['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, ComplexUserGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetComplexUserGroupByPayload<T> : Prisma.PrismaPromise<InputErrors>
/**
 * Fields of the ComplexUser model
 */
readonly fields: ComplexUserFieldRefs;
}

/**
 * The delegate class that acts as a "Promise-like" for ComplexUser.
 * 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__ComplexUserClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
  readonly [Symbol.toStringTag]: "PrismaPromise"
  complex<T extends Prisma.ComplexDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.ComplexDefaultArgs<ExtArgs>>): Prisma.Prisma__ComplexClient<runtime.Types.Result.GetResult<Prisma.$ComplexPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
  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>
  /**
   * 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 ComplexUser model
 */
export interface ComplexUserFieldRefs {
  readonly complexId: Prisma.FieldRef<"ComplexUser", 'String'>
  readonly userId: Prisma.FieldRef<"ComplexUser", 'String'>
  readonly role: Prisma.FieldRef<"ComplexUser", 'ComplexUserRole'>
  readonly createdAt: Prisma.FieldRef<"ComplexUser", 'DateTime'>
}
    

// Custom InputTypes
/**
 * ComplexUser findUnique
 */
export type ComplexUserFindUniqueArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the ComplexUser
   */
  select?: Prisma.ComplexUserSelect<ExtArgs> | null
  /**
   * Omit specific fields from the ComplexUser
   */
  omit?: Prisma.ComplexUserOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.ComplexUserInclude<ExtArgs> | null
  /**
   * Filter, which ComplexUser to fetch.
   */
  where: Prisma.ComplexUserWhereUniqueInput
}

/**
 * ComplexUser findUniqueOrThrow
 */
export type ComplexUserFindUniqueOrThrowArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the ComplexUser
   */
  select?: Prisma.ComplexUserSelect<ExtArgs> | null
  /**
   * Omit specific fields from the ComplexUser
   */
  omit?: Prisma.ComplexUserOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.ComplexUserInclude<ExtArgs> | null
  /**
   * Filter, which ComplexUser to fetch.
   */
  where: Prisma.ComplexUserWhereUniqueInput
}

/**
 * ComplexUser findFirst
 */
export type ComplexUserFindFirstArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the ComplexUser
   */
  select?: Prisma.ComplexUserSelect<ExtArgs> | null
  /**
   * Omit specific fields from the ComplexUser
   */
  omit?: Prisma.ComplexUserOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.ComplexUserInclude<ExtArgs> | null
  /**
   * Filter, which ComplexUser to fetch.
   */
  where?: Prisma.ComplexUserWhereInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
   * 
   * Determine the order of ComplexUsers to fetch.
   */
  orderBy?: Prisma.ComplexUserOrderByWithRelationInput | Prisma.ComplexUserOrderByWithRelationInput[]
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
   * 
   * Sets the position for searching for ComplexUsers.
   */
  cursor?: Prisma.ComplexUserWhereUniqueInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Take `±n` ComplexUsers 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` ComplexUsers.
   */
  skip?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
   * 
   * Filter by unique combinations of ComplexUsers.
   */
  distinct?: Prisma.ComplexUserScalarFieldEnum | Prisma.ComplexUserScalarFieldEnum[]
}

/**
 * ComplexUser findFirstOrThrow
 */
export type ComplexUserFindFirstOrThrowArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the ComplexUser
   */
  select?: Prisma.ComplexUserSelect<ExtArgs> | null
  /**
   * Omit specific fields from the ComplexUser
   */
  omit?: Prisma.ComplexUserOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.ComplexUserInclude<ExtArgs> | null
  /**
   * Filter, which ComplexUser to fetch.
   */
  where?: Prisma.ComplexUserWhereInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
   * 
   * Determine the order of ComplexUsers to fetch.
   */
  orderBy?: Prisma.ComplexUserOrderByWithRelationInput | Prisma.ComplexUserOrderByWithRelationInput[]
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
   * 
   * Sets the position for searching for ComplexUsers.
   */
  cursor?: Prisma.ComplexUserWhereUniqueInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Take `±n` ComplexUsers 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` ComplexUsers.
   */
  skip?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
   * 
   * Filter by unique combinations of ComplexUsers.
   */
  distinct?: Prisma.ComplexUserScalarFieldEnum | Prisma.ComplexUserScalarFieldEnum[]
}

/**
 * ComplexUser findMany
 */
export type ComplexUserFindManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the ComplexUser
   */
  select?: Prisma.ComplexUserSelect<ExtArgs> | null
  /**
   * Omit specific fields from the ComplexUser
   */
  omit?: Prisma.ComplexUserOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.ComplexUserInclude<ExtArgs> | null
  /**
   * Filter, which ComplexUsers to fetch.
   */
  where?: Prisma.ComplexUserWhereInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs}
   * 
   * Determine the order of ComplexUsers to fetch.
   */
  orderBy?: Prisma.ComplexUserOrderByWithRelationInput | Prisma.ComplexUserOrderByWithRelationInput[]
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs}
   * 
   * Sets the position for listing ComplexUsers.
   */
  cursor?: Prisma.ComplexUserWhereUniqueInput
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs}
   * 
   * Take `±n` ComplexUsers 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` ComplexUsers.
   */
  skip?: number
  /**
   * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs}
   * 
   * Filter by unique combinations of ComplexUsers.
   */
  distinct?: Prisma.ComplexUserScalarFieldEnum | Prisma.ComplexUserScalarFieldEnum[]
}

/**
 * ComplexUser create
 */
export type ComplexUserCreateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the ComplexUser
   */
  select?: Prisma.ComplexUserSelect<ExtArgs> | null
  /**
   * Omit specific fields from the ComplexUser
   */
  omit?: Prisma.ComplexUserOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.ComplexUserInclude<ExtArgs> | null
  /**
   * The data needed to create a ComplexUser.
   */
  data: Prisma.XOR<Prisma.ComplexUserCreateInput, Prisma.ComplexUserUncheckedCreateInput>
}

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

/**
 * ComplexUser createManyAndReturn
 */
export type ComplexUserCreateManyAndReturnArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the ComplexUser
   */
  select?: Prisma.ComplexUserSelectCreateManyAndReturn<ExtArgs> | null
  /**
   * Omit specific fields from the ComplexUser
   */
  omit?: Prisma.ComplexUserOmit<ExtArgs> | null
  /**
   * The data used to create many ComplexUsers.
   */
  data: Prisma.ComplexUserCreateManyInput | Prisma.ComplexUserCreateManyInput[]
  skipDuplicates?: boolean
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.ComplexUserIncludeCreateManyAndReturn<ExtArgs> | null
}

/**
 * ComplexUser update
 */
export type ComplexUserUpdateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the ComplexUser
   */
  select?: Prisma.ComplexUserSelect<ExtArgs> | null
  /**
   * Omit specific fields from the ComplexUser
   */
  omit?: Prisma.ComplexUserOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.ComplexUserInclude<ExtArgs> | null
  /**
   * The data needed to update a ComplexUser.
   */
  data: Prisma.XOR<Prisma.ComplexUserUpdateInput, Prisma.ComplexUserUncheckedUpdateInput>
  /**
   * Choose, which ComplexUser to update.
   */
  where: Prisma.ComplexUserWhereUniqueInput
}

/**
 * ComplexUser updateMany
 */
export type ComplexUserUpdateManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * The data used to update ComplexUsers.
   */
  data: Prisma.XOR<Prisma.ComplexUserUpdateManyMutationInput, Prisma.ComplexUserUncheckedUpdateManyInput>
  /**
   * Filter which ComplexUsers to update
   */
  where?: Prisma.ComplexUserWhereInput
  /**
   * Limit how many ComplexUsers to update.
   */
  limit?: number
}

/**
 * ComplexUser updateManyAndReturn
 */
export type ComplexUserUpdateManyAndReturnArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the ComplexUser
   */
  select?: Prisma.ComplexUserSelectUpdateManyAndReturn<ExtArgs> | null
  /**
   * Omit specific fields from the ComplexUser
   */
  omit?: Prisma.ComplexUserOmit<ExtArgs> | null
  /**
   * The data used to update ComplexUsers.
   */
  data: Prisma.XOR<Prisma.ComplexUserUpdateManyMutationInput, Prisma.ComplexUserUncheckedUpdateManyInput>
  /**
   * Filter which ComplexUsers to update
   */
  where?: Prisma.ComplexUserWhereInput
  /**
   * Limit how many ComplexUsers to update.
   */
  limit?: number
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.ComplexUserIncludeUpdateManyAndReturn<ExtArgs> | null
}

/**
 * ComplexUser upsert
 */
export type ComplexUserUpsertArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the ComplexUser
   */
  select?: Prisma.ComplexUserSelect<ExtArgs> | null
  /**
   * Omit specific fields from the ComplexUser
   */
  omit?: Prisma.ComplexUserOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.ComplexUserInclude<ExtArgs> | null
  /**
   * The filter to search for the ComplexUser to update in case it exists.
   */
  where: Prisma.ComplexUserWhereUniqueInput
  /**
   * In case the ComplexUser found by the `where` argument doesn't exist, create a new ComplexUser with this data.
   */
  create: Prisma.XOR<Prisma.ComplexUserCreateInput, Prisma.ComplexUserUncheckedCreateInput>
  /**
   * In case the ComplexUser was found with the provided `where` argument, update it with this data.
   */
  update: Prisma.XOR<Prisma.ComplexUserUpdateInput, Prisma.ComplexUserUncheckedUpdateInput>
}

/**
 * ComplexUser delete
 */
export type ComplexUserDeleteArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the ComplexUser
   */
  select?: Prisma.ComplexUserSelect<ExtArgs> | null
  /**
   * Omit specific fields from the ComplexUser
   */
  omit?: Prisma.ComplexUserOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.ComplexUserInclude<ExtArgs> | null
  /**
   * Filter which ComplexUser to delete.
   */
  where: Prisma.ComplexUserWhereUniqueInput
}

/**
 * ComplexUser deleteMany
 */
export type ComplexUserDeleteManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Filter which ComplexUsers to delete
   */
  where?: Prisma.ComplexUserWhereInput
  /**
   * Limit how many ComplexUsers to delete.
   */
  limit?: number
}

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