
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
/* eslint-disable */
// biome-ignore-all lint: generated file
// @ts-nocheck 
/*
 * This file exports the `PhoneNumber` 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.js"
import type * as Prisma from "../internal/prismaNamespace.js"

/**
 * Model PhoneNumber
 * 
 */
export type PhoneNumberModel = runtime.Types.Result.DefaultSelection<Prisma.$PhoneNumberPayload>

export type AggregatePhoneNumber = {
  _count: PhoneNumberCountAggregateOutputType | null
  _min: PhoneNumberMinAggregateOutputType | null
  _max: PhoneNumberMaxAggregateOutputType | null
}

export type PhoneNumberMinAggregateOutputType = {
  phId: string | null
  number: string | null
  organizationId: string | null
  userId: string | null
  agentId: string | null
  sid: string | null
  friendlyName: string | null
  provider: $Enums.TelephonyProvider | null
  createdAt: Date | null
  updatedAt: Date | null
}

export type PhoneNumberMaxAggregateOutputType = {
  phId: string | null
  number: string | null
  organizationId: string | null
  userId: string | null
  agentId: string | null
  sid: string | null
  friendlyName: string | null
  provider: $Enums.TelephonyProvider | null
  createdAt: Date | null
  updatedAt: Date | null
}

export type PhoneNumberCountAggregateOutputType = {
  phId: number
  number: number
  organizationId: number
  userId: number
  agentId: number
  sid: number
  friendlyName: number
  provider: number
  createdAt: number
  updatedAt: number
  _all: number
}


export type PhoneNumberMinAggregateInputType = {
  phId?: true
  number?: true
  organizationId?: true
  userId?: true
  agentId?: true
  sid?: true
  friendlyName?: true
  provider?: true
  createdAt?: true
  updatedAt?: true
}

export type PhoneNumberMaxAggregateInputType = {
  phId?: true
  number?: true
  organizationId?: true
  userId?: true
  agentId?: true
  sid?: true
  friendlyName?: true
  provider?: true
  createdAt?: true
  updatedAt?: true
}

export type PhoneNumberCountAggregateInputType = {
  phId?: true
  number?: true
  organizationId?: true
  userId?: true
  agentId?: true
  sid?: true
  friendlyName?: true
  provider?: true
  createdAt?: true
  updatedAt?: true
  _all?: true
}

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

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




export type PhoneNumberGroupByArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  where?: Prisma.PhoneNumberWhereInput
  orderBy?: Prisma.PhoneNumberOrderByWithAggregationInput | Prisma.PhoneNumberOrderByWithAggregationInput[]
  by: Prisma.PhoneNumberScalarFieldEnum[] | Prisma.PhoneNumberScalarFieldEnum
  having?: Prisma.PhoneNumberScalarWhereWithAggregatesInput
  take?: number
  skip?: number
  _count?: PhoneNumberCountAggregateInputType | true
  _min?: PhoneNumberMinAggregateInputType
  _max?: PhoneNumberMaxAggregateInputType
}

export type PhoneNumberGroupByOutputType = {
  phId: string
  number: string
  organizationId: string
  userId: string | null
  agentId: string | null
  sid: string
  friendlyName: string
  provider: $Enums.TelephonyProvider
  createdAt: Date
  updatedAt: Date
  _count: PhoneNumberCountAggregateOutputType | null
  _min: PhoneNumberMinAggregateOutputType | null
  _max: PhoneNumberMaxAggregateOutputType | null
}

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



export type PhoneNumberWhereInput = {
  AND?: Prisma.PhoneNumberWhereInput | Prisma.PhoneNumberWhereInput[]
  OR?: Prisma.PhoneNumberWhereInput[]
  NOT?: Prisma.PhoneNumberWhereInput | Prisma.PhoneNumberWhereInput[]
  phId?: Prisma.StringFilter<"PhoneNumber"> | string
  number?: Prisma.StringFilter<"PhoneNumber"> | string
  organizationId?: Prisma.StringFilter<"PhoneNumber"> | string
  userId?: Prisma.StringNullableFilter<"PhoneNumber"> | string | null
  agentId?: Prisma.StringNullableFilter<"PhoneNumber"> | string | null
  sid?: Prisma.StringFilter<"PhoneNumber"> | string
  friendlyName?: Prisma.StringFilter<"PhoneNumber"> | string
  provider?: Prisma.EnumTelephonyProviderFilter<"PhoneNumber"> | $Enums.TelephonyProvider
  createdAt?: Prisma.DateTimeFilter<"PhoneNumber"> | Date | string
  updatedAt?: Prisma.DateTimeFilter<"PhoneNumber"> | Date | string
  organization?: Prisma.XOR<Prisma.OrganizationScalarRelationFilter, Prisma.OrganizationWhereInput>
  user?: Prisma.XOR<Prisma.UserNullableScalarRelationFilter, Prisma.UserWhereInput> | null
  agent?: Prisma.XOR<Prisma.AgentNullableScalarRelationFilter, Prisma.AgentWhereInput> | null
}

export type PhoneNumberOrderByWithRelationInput = {
  phId?: Prisma.SortOrder
  number?: Prisma.SortOrder
  organizationId?: Prisma.SortOrder
  userId?: Prisma.SortOrderInput | Prisma.SortOrder
  agentId?: Prisma.SortOrderInput | Prisma.SortOrder
  sid?: Prisma.SortOrder
  friendlyName?: Prisma.SortOrder
  provider?: Prisma.SortOrder
  createdAt?: Prisma.SortOrder
  updatedAt?: Prisma.SortOrder
  organization?: Prisma.OrganizationOrderByWithRelationInput
  user?: Prisma.UserOrderByWithRelationInput
  agent?: Prisma.AgentOrderByWithRelationInput
}

export type PhoneNumberWhereUniqueInput = Prisma.AtLeast<{
  phId?: string
  number?: string
  AND?: Prisma.PhoneNumberWhereInput | Prisma.PhoneNumberWhereInput[]
  OR?: Prisma.PhoneNumberWhereInput[]
  NOT?: Prisma.PhoneNumberWhereInput | Prisma.PhoneNumberWhereInput[]
  organizationId?: Prisma.StringFilter<"PhoneNumber"> | string
  userId?: Prisma.StringNullableFilter<"PhoneNumber"> | string | null
  agentId?: Prisma.StringNullableFilter<"PhoneNumber"> | string | null
  sid?: Prisma.StringFilter<"PhoneNumber"> | string
  friendlyName?: Prisma.StringFilter<"PhoneNumber"> | string
  provider?: Prisma.EnumTelephonyProviderFilter<"PhoneNumber"> | $Enums.TelephonyProvider
  createdAt?: Prisma.DateTimeFilter<"PhoneNumber"> | Date | string
  updatedAt?: Prisma.DateTimeFilter<"PhoneNumber"> | Date | string
  organization?: Prisma.XOR<Prisma.OrganizationScalarRelationFilter, Prisma.OrganizationWhereInput>
  user?: Prisma.XOR<Prisma.UserNullableScalarRelationFilter, Prisma.UserWhereInput> | null
  agent?: Prisma.XOR<Prisma.AgentNullableScalarRelationFilter, Prisma.AgentWhereInput> | null
}, "phId" | "number">

export type PhoneNumberOrderByWithAggregationInput = {
  phId?: Prisma.SortOrder
  number?: Prisma.SortOrder
  organizationId?: Prisma.SortOrder
  userId?: Prisma.SortOrderInput | Prisma.SortOrder
  agentId?: Prisma.SortOrderInput | Prisma.SortOrder
  sid?: Prisma.SortOrder
  friendlyName?: Prisma.SortOrder
  provider?: Prisma.SortOrder
  createdAt?: Prisma.SortOrder
  updatedAt?: Prisma.SortOrder
  _count?: Prisma.PhoneNumberCountOrderByAggregateInput
  _max?: Prisma.PhoneNumberMaxOrderByAggregateInput
  _min?: Prisma.PhoneNumberMinOrderByAggregateInput
}

export type PhoneNumberScalarWhereWithAggregatesInput = {
  AND?: Prisma.PhoneNumberScalarWhereWithAggregatesInput | Prisma.PhoneNumberScalarWhereWithAggregatesInput[]
  OR?: Prisma.PhoneNumberScalarWhereWithAggregatesInput[]
  NOT?: Prisma.PhoneNumberScalarWhereWithAggregatesInput | Prisma.PhoneNumberScalarWhereWithAggregatesInput[]
  phId?: Prisma.StringWithAggregatesFilter<"PhoneNumber"> | string
  number?: Prisma.StringWithAggregatesFilter<"PhoneNumber"> | string
  organizationId?: Prisma.StringWithAggregatesFilter<"PhoneNumber"> | string
  userId?: Prisma.StringNullableWithAggregatesFilter<"PhoneNumber"> | string | null
  agentId?: Prisma.StringNullableWithAggregatesFilter<"PhoneNumber"> | string | null
  sid?: Prisma.StringWithAggregatesFilter<"PhoneNumber"> | string
  friendlyName?: Prisma.StringWithAggregatesFilter<"PhoneNumber"> | string
  provider?: Prisma.EnumTelephonyProviderWithAggregatesFilter<"PhoneNumber"> | $Enums.TelephonyProvider
  createdAt?: Prisma.DateTimeWithAggregatesFilter<"PhoneNumber"> | Date | string
  updatedAt?: Prisma.DateTimeWithAggregatesFilter<"PhoneNumber"> | Date | string
}

export type PhoneNumberCreateInput = {
  phId?: string
  number: string
  sid: string
  friendlyName: string
  provider?: $Enums.TelephonyProvider
  createdAt?: Date | string
  updatedAt?: Date | string
  organization: Prisma.OrganizationCreateNestedOneWithoutPhoneNumbersInput
  user?: Prisma.UserCreateNestedOneWithoutPhoneNumbersInput
  agent?: Prisma.AgentCreateNestedOneWithoutPhoneNumbersInput
}

export type PhoneNumberUncheckedCreateInput = {
  phId?: string
  number: string
  organizationId: string
  userId?: string | null
  agentId?: string | null
  sid: string
  friendlyName: string
  provider?: $Enums.TelephonyProvider
  createdAt?: Date | string
  updatedAt?: Date | string
}

export type PhoneNumberUpdateInput = {
  phId?: Prisma.StringFieldUpdateOperationsInput | string
  number?: Prisma.StringFieldUpdateOperationsInput | string
  sid?: Prisma.StringFieldUpdateOperationsInput | string
  friendlyName?: Prisma.StringFieldUpdateOperationsInput | string
  provider?: Prisma.EnumTelephonyProviderFieldUpdateOperationsInput | $Enums.TelephonyProvider
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  organization?: Prisma.OrganizationUpdateOneRequiredWithoutPhoneNumbersNestedInput
  user?: Prisma.UserUpdateOneWithoutPhoneNumbersNestedInput
  agent?: Prisma.AgentUpdateOneWithoutPhoneNumbersNestedInput
}

export type PhoneNumberUncheckedUpdateInput = {
  phId?: Prisma.StringFieldUpdateOperationsInput | string
  number?: Prisma.StringFieldUpdateOperationsInput | string
  organizationId?: Prisma.StringFieldUpdateOperationsInput | string
  userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  agentId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  sid?: Prisma.StringFieldUpdateOperationsInput | string
  friendlyName?: Prisma.StringFieldUpdateOperationsInput | string
  provider?: Prisma.EnumTelephonyProviderFieldUpdateOperationsInput | $Enums.TelephonyProvider
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type PhoneNumberCreateManyInput = {
  phId?: string
  number: string
  organizationId: string
  userId?: string | null
  agentId?: string | null
  sid: string
  friendlyName: string
  provider?: $Enums.TelephonyProvider
  createdAt?: Date | string
  updatedAt?: Date | string
}

export type PhoneNumberUpdateManyMutationInput = {
  phId?: Prisma.StringFieldUpdateOperationsInput | string
  number?: Prisma.StringFieldUpdateOperationsInput | string
  sid?: Prisma.StringFieldUpdateOperationsInput | string
  friendlyName?: Prisma.StringFieldUpdateOperationsInput | string
  provider?: Prisma.EnumTelephonyProviderFieldUpdateOperationsInput | $Enums.TelephonyProvider
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type PhoneNumberUncheckedUpdateManyInput = {
  phId?: Prisma.StringFieldUpdateOperationsInput | string
  number?: Prisma.StringFieldUpdateOperationsInput | string
  organizationId?: Prisma.StringFieldUpdateOperationsInput | string
  userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  agentId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  sid?: Prisma.StringFieldUpdateOperationsInput | string
  friendlyName?: Prisma.StringFieldUpdateOperationsInput | string
  provider?: Prisma.EnumTelephonyProviderFieldUpdateOperationsInput | $Enums.TelephonyProvider
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type PhoneNumberListRelationFilter = {
  every?: Prisma.PhoneNumberWhereInput
  some?: Prisma.PhoneNumberWhereInput
  none?: Prisma.PhoneNumberWhereInput
}

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

export type PhoneNumberCountOrderByAggregateInput = {
  phId?: Prisma.SortOrder
  number?: Prisma.SortOrder
  organizationId?: Prisma.SortOrder
  userId?: Prisma.SortOrder
  agentId?: Prisma.SortOrder
  sid?: Prisma.SortOrder
  friendlyName?: Prisma.SortOrder
  provider?: Prisma.SortOrder
  createdAt?: Prisma.SortOrder
  updatedAt?: Prisma.SortOrder
}

export type PhoneNumberMaxOrderByAggregateInput = {
  phId?: Prisma.SortOrder
  number?: Prisma.SortOrder
  organizationId?: Prisma.SortOrder
  userId?: Prisma.SortOrder
  agentId?: Prisma.SortOrder
  sid?: Prisma.SortOrder
  friendlyName?: Prisma.SortOrder
  provider?: Prisma.SortOrder
  createdAt?: Prisma.SortOrder
  updatedAt?: Prisma.SortOrder
}

export type PhoneNumberMinOrderByAggregateInput = {
  phId?: Prisma.SortOrder
  number?: Prisma.SortOrder
  organizationId?: Prisma.SortOrder
  userId?: Prisma.SortOrder
  agentId?: Prisma.SortOrder
  sid?: Prisma.SortOrder
  friendlyName?: Prisma.SortOrder
  provider?: Prisma.SortOrder
  createdAt?: Prisma.SortOrder
  updatedAt?: Prisma.SortOrder
}

export type PhoneNumberCreateNestedManyWithoutUserInput = {
  create?: Prisma.XOR<Prisma.PhoneNumberCreateWithoutUserInput, Prisma.PhoneNumberUncheckedCreateWithoutUserInput> | Prisma.PhoneNumberCreateWithoutUserInput[] | Prisma.PhoneNumberUncheckedCreateWithoutUserInput[]
  connectOrCreate?: Prisma.PhoneNumberCreateOrConnectWithoutUserInput | Prisma.PhoneNumberCreateOrConnectWithoutUserInput[]
  createMany?: Prisma.PhoneNumberCreateManyUserInputEnvelope
  connect?: Prisma.PhoneNumberWhereUniqueInput | Prisma.PhoneNumberWhereUniqueInput[]
}

export type PhoneNumberUncheckedCreateNestedManyWithoutUserInput = {
  create?: Prisma.XOR<Prisma.PhoneNumberCreateWithoutUserInput, Prisma.PhoneNumberUncheckedCreateWithoutUserInput> | Prisma.PhoneNumberCreateWithoutUserInput[] | Prisma.PhoneNumberUncheckedCreateWithoutUserInput[]
  connectOrCreate?: Prisma.PhoneNumberCreateOrConnectWithoutUserInput | Prisma.PhoneNumberCreateOrConnectWithoutUserInput[]
  createMany?: Prisma.PhoneNumberCreateManyUserInputEnvelope
  connect?: Prisma.PhoneNumberWhereUniqueInput | Prisma.PhoneNumberWhereUniqueInput[]
}

export type PhoneNumberUpdateManyWithoutUserNestedInput = {
  create?: Prisma.XOR<Prisma.PhoneNumberCreateWithoutUserInput, Prisma.PhoneNumberUncheckedCreateWithoutUserInput> | Prisma.PhoneNumberCreateWithoutUserInput[] | Prisma.PhoneNumberUncheckedCreateWithoutUserInput[]
  connectOrCreate?: Prisma.PhoneNumberCreateOrConnectWithoutUserInput | Prisma.PhoneNumberCreateOrConnectWithoutUserInput[]
  upsert?: Prisma.PhoneNumberUpsertWithWhereUniqueWithoutUserInput | Prisma.PhoneNumberUpsertWithWhereUniqueWithoutUserInput[]
  createMany?: Prisma.PhoneNumberCreateManyUserInputEnvelope
  set?: Prisma.PhoneNumberWhereUniqueInput | Prisma.PhoneNumberWhereUniqueInput[]
  disconnect?: Prisma.PhoneNumberWhereUniqueInput | Prisma.PhoneNumberWhereUniqueInput[]
  delete?: Prisma.PhoneNumberWhereUniqueInput | Prisma.PhoneNumberWhereUniqueInput[]
  connect?: Prisma.PhoneNumberWhereUniqueInput | Prisma.PhoneNumberWhereUniqueInput[]
  update?: Prisma.PhoneNumberUpdateWithWhereUniqueWithoutUserInput | Prisma.PhoneNumberUpdateWithWhereUniqueWithoutUserInput[]
  updateMany?: Prisma.PhoneNumberUpdateManyWithWhereWithoutUserInput | Prisma.PhoneNumberUpdateManyWithWhereWithoutUserInput[]
  deleteMany?: Prisma.PhoneNumberScalarWhereInput | Prisma.PhoneNumberScalarWhereInput[]
}

export type PhoneNumberUncheckedUpdateManyWithoutUserNestedInput = {
  create?: Prisma.XOR<Prisma.PhoneNumberCreateWithoutUserInput, Prisma.PhoneNumberUncheckedCreateWithoutUserInput> | Prisma.PhoneNumberCreateWithoutUserInput[] | Prisma.PhoneNumberUncheckedCreateWithoutUserInput[]
  connectOrCreate?: Prisma.PhoneNumberCreateOrConnectWithoutUserInput | Prisma.PhoneNumberCreateOrConnectWithoutUserInput[]
  upsert?: Prisma.PhoneNumberUpsertWithWhereUniqueWithoutUserInput | Prisma.PhoneNumberUpsertWithWhereUniqueWithoutUserInput[]
  createMany?: Prisma.PhoneNumberCreateManyUserInputEnvelope
  set?: Prisma.PhoneNumberWhereUniqueInput | Prisma.PhoneNumberWhereUniqueInput[]
  disconnect?: Prisma.PhoneNumberWhereUniqueInput | Prisma.PhoneNumberWhereUniqueInput[]
  delete?: Prisma.PhoneNumberWhereUniqueInput | Prisma.PhoneNumberWhereUniqueInput[]
  connect?: Prisma.PhoneNumberWhereUniqueInput | Prisma.PhoneNumberWhereUniqueInput[]
  update?: Prisma.PhoneNumberUpdateWithWhereUniqueWithoutUserInput | Prisma.PhoneNumberUpdateWithWhereUniqueWithoutUserInput[]
  updateMany?: Prisma.PhoneNumberUpdateManyWithWhereWithoutUserInput | Prisma.PhoneNumberUpdateManyWithWhereWithoutUserInput[]
  deleteMany?: Prisma.PhoneNumberScalarWhereInput | Prisma.PhoneNumberScalarWhereInput[]
}

export type PhoneNumberCreateNestedManyWithoutOrganizationInput = {
  create?: Prisma.XOR<Prisma.PhoneNumberCreateWithoutOrganizationInput, Prisma.PhoneNumberUncheckedCreateWithoutOrganizationInput> | Prisma.PhoneNumberCreateWithoutOrganizationInput[] | Prisma.PhoneNumberUncheckedCreateWithoutOrganizationInput[]
  connectOrCreate?: Prisma.PhoneNumberCreateOrConnectWithoutOrganizationInput | Prisma.PhoneNumberCreateOrConnectWithoutOrganizationInput[]
  createMany?: Prisma.PhoneNumberCreateManyOrganizationInputEnvelope
  connect?: Prisma.PhoneNumberWhereUniqueInput | Prisma.PhoneNumberWhereUniqueInput[]
}

export type PhoneNumberUncheckedCreateNestedManyWithoutOrganizationInput = {
  create?: Prisma.XOR<Prisma.PhoneNumberCreateWithoutOrganizationInput, Prisma.PhoneNumberUncheckedCreateWithoutOrganizationInput> | Prisma.PhoneNumberCreateWithoutOrganizationInput[] | Prisma.PhoneNumberUncheckedCreateWithoutOrganizationInput[]
  connectOrCreate?: Prisma.PhoneNumberCreateOrConnectWithoutOrganizationInput | Prisma.PhoneNumberCreateOrConnectWithoutOrganizationInput[]
  createMany?: Prisma.PhoneNumberCreateManyOrganizationInputEnvelope
  connect?: Prisma.PhoneNumberWhereUniqueInput | Prisma.PhoneNumberWhereUniqueInput[]
}

export type PhoneNumberUpdateManyWithoutOrganizationNestedInput = {
  create?: Prisma.XOR<Prisma.PhoneNumberCreateWithoutOrganizationInput, Prisma.PhoneNumberUncheckedCreateWithoutOrganizationInput> | Prisma.PhoneNumberCreateWithoutOrganizationInput[] | Prisma.PhoneNumberUncheckedCreateWithoutOrganizationInput[]
  connectOrCreate?: Prisma.PhoneNumberCreateOrConnectWithoutOrganizationInput | Prisma.PhoneNumberCreateOrConnectWithoutOrganizationInput[]
  upsert?: Prisma.PhoneNumberUpsertWithWhereUniqueWithoutOrganizationInput | Prisma.PhoneNumberUpsertWithWhereUniqueWithoutOrganizationInput[]
  createMany?: Prisma.PhoneNumberCreateManyOrganizationInputEnvelope
  set?: Prisma.PhoneNumberWhereUniqueInput | Prisma.PhoneNumberWhereUniqueInput[]
  disconnect?: Prisma.PhoneNumberWhereUniqueInput | Prisma.PhoneNumberWhereUniqueInput[]
  delete?: Prisma.PhoneNumberWhereUniqueInput | Prisma.PhoneNumberWhereUniqueInput[]
  connect?: Prisma.PhoneNumberWhereUniqueInput | Prisma.PhoneNumberWhereUniqueInput[]
  update?: Prisma.PhoneNumberUpdateWithWhereUniqueWithoutOrganizationInput | Prisma.PhoneNumberUpdateWithWhereUniqueWithoutOrganizationInput[]
  updateMany?: Prisma.PhoneNumberUpdateManyWithWhereWithoutOrganizationInput | Prisma.PhoneNumberUpdateManyWithWhereWithoutOrganizationInput[]
  deleteMany?: Prisma.PhoneNumberScalarWhereInput | Prisma.PhoneNumberScalarWhereInput[]
}

export type PhoneNumberUncheckedUpdateManyWithoutOrganizationNestedInput = {
  create?: Prisma.XOR<Prisma.PhoneNumberCreateWithoutOrganizationInput, Prisma.PhoneNumberUncheckedCreateWithoutOrganizationInput> | Prisma.PhoneNumberCreateWithoutOrganizationInput[] | Prisma.PhoneNumberUncheckedCreateWithoutOrganizationInput[]
  connectOrCreate?: Prisma.PhoneNumberCreateOrConnectWithoutOrganizationInput | Prisma.PhoneNumberCreateOrConnectWithoutOrganizationInput[]
  upsert?: Prisma.PhoneNumberUpsertWithWhereUniqueWithoutOrganizationInput | Prisma.PhoneNumberUpsertWithWhereUniqueWithoutOrganizationInput[]
  createMany?: Prisma.PhoneNumberCreateManyOrganizationInputEnvelope
  set?: Prisma.PhoneNumberWhereUniqueInput | Prisma.PhoneNumberWhereUniqueInput[]
  disconnect?: Prisma.PhoneNumberWhereUniqueInput | Prisma.PhoneNumberWhereUniqueInput[]
  delete?: Prisma.PhoneNumberWhereUniqueInput | Prisma.PhoneNumberWhereUniqueInput[]
  connect?: Prisma.PhoneNumberWhereUniqueInput | Prisma.PhoneNumberWhereUniqueInput[]
  update?: Prisma.PhoneNumberUpdateWithWhereUniqueWithoutOrganizationInput | Prisma.PhoneNumberUpdateWithWhereUniqueWithoutOrganizationInput[]
  updateMany?: Prisma.PhoneNumberUpdateManyWithWhereWithoutOrganizationInput | Prisma.PhoneNumberUpdateManyWithWhereWithoutOrganizationInput[]
  deleteMany?: Prisma.PhoneNumberScalarWhereInput | Prisma.PhoneNumberScalarWhereInput[]
}

export type EnumTelephonyProviderFieldUpdateOperationsInput = {
  set?: $Enums.TelephonyProvider
}

export type PhoneNumberCreateNestedManyWithoutAgentInput = {
  create?: Prisma.XOR<Prisma.PhoneNumberCreateWithoutAgentInput, Prisma.PhoneNumberUncheckedCreateWithoutAgentInput> | Prisma.PhoneNumberCreateWithoutAgentInput[] | Prisma.PhoneNumberUncheckedCreateWithoutAgentInput[]
  connectOrCreate?: Prisma.PhoneNumberCreateOrConnectWithoutAgentInput | Prisma.PhoneNumberCreateOrConnectWithoutAgentInput[]
  createMany?: Prisma.PhoneNumberCreateManyAgentInputEnvelope
  connect?: Prisma.PhoneNumberWhereUniqueInput | Prisma.PhoneNumberWhereUniqueInput[]
}

export type PhoneNumberUncheckedCreateNestedManyWithoutAgentInput = {
  create?: Prisma.XOR<Prisma.PhoneNumberCreateWithoutAgentInput, Prisma.PhoneNumberUncheckedCreateWithoutAgentInput> | Prisma.PhoneNumberCreateWithoutAgentInput[] | Prisma.PhoneNumberUncheckedCreateWithoutAgentInput[]
  connectOrCreate?: Prisma.PhoneNumberCreateOrConnectWithoutAgentInput | Prisma.PhoneNumberCreateOrConnectWithoutAgentInput[]
  createMany?: Prisma.PhoneNumberCreateManyAgentInputEnvelope
  connect?: Prisma.PhoneNumberWhereUniqueInput | Prisma.PhoneNumberWhereUniqueInput[]
}

export type PhoneNumberUpdateManyWithoutAgentNestedInput = {
  create?: Prisma.XOR<Prisma.PhoneNumberCreateWithoutAgentInput, Prisma.PhoneNumberUncheckedCreateWithoutAgentInput> | Prisma.PhoneNumberCreateWithoutAgentInput[] | Prisma.PhoneNumberUncheckedCreateWithoutAgentInput[]
  connectOrCreate?: Prisma.PhoneNumberCreateOrConnectWithoutAgentInput | Prisma.PhoneNumberCreateOrConnectWithoutAgentInput[]
  upsert?: Prisma.PhoneNumberUpsertWithWhereUniqueWithoutAgentInput | Prisma.PhoneNumberUpsertWithWhereUniqueWithoutAgentInput[]
  createMany?: Prisma.PhoneNumberCreateManyAgentInputEnvelope
  set?: Prisma.PhoneNumberWhereUniqueInput | Prisma.PhoneNumberWhereUniqueInput[]
  disconnect?: Prisma.PhoneNumberWhereUniqueInput | Prisma.PhoneNumberWhereUniqueInput[]
  delete?: Prisma.PhoneNumberWhereUniqueInput | Prisma.PhoneNumberWhereUniqueInput[]
  connect?: Prisma.PhoneNumberWhereUniqueInput | Prisma.PhoneNumberWhereUniqueInput[]
  update?: Prisma.PhoneNumberUpdateWithWhereUniqueWithoutAgentInput | Prisma.PhoneNumberUpdateWithWhereUniqueWithoutAgentInput[]
  updateMany?: Prisma.PhoneNumberUpdateManyWithWhereWithoutAgentInput | Prisma.PhoneNumberUpdateManyWithWhereWithoutAgentInput[]
  deleteMany?: Prisma.PhoneNumberScalarWhereInput | Prisma.PhoneNumberScalarWhereInput[]
}

export type PhoneNumberUncheckedUpdateManyWithoutAgentNestedInput = {
  create?: Prisma.XOR<Prisma.PhoneNumberCreateWithoutAgentInput, Prisma.PhoneNumberUncheckedCreateWithoutAgentInput> | Prisma.PhoneNumberCreateWithoutAgentInput[] | Prisma.PhoneNumberUncheckedCreateWithoutAgentInput[]
  connectOrCreate?: Prisma.PhoneNumberCreateOrConnectWithoutAgentInput | Prisma.PhoneNumberCreateOrConnectWithoutAgentInput[]
  upsert?: Prisma.PhoneNumberUpsertWithWhereUniqueWithoutAgentInput | Prisma.PhoneNumberUpsertWithWhereUniqueWithoutAgentInput[]
  createMany?: Prisma.PhoneNumberCreateManyAgentInputEnvelope
  set?: Prisma.PhoneNumberWhereUniqueInput | Prisma.PhoneNumberWhereUniqueInput[]
  disconnect?: Prisma.PhoneNumberWhereUniqueInput | Prisma.PhoneNumberWhereUniqueInput[]
  delete?: Prisma.PhoneNumberWhereUniqueInput | Prisma.PhoneNumberWhereUniqueInput[]
  connect?: Prisma.PhoneNumberWhereUniqueInput | Prisma.PhoneNumberWhereUniqueInput[]
  update?: Prisma.PhoneNumberUpdateWithWhereUniqueWithoutAgentInput | Prisma.PhoneNumberUpdateWithWhereUniqueWithoutAgentInput[]
  updateMany?: Prisma.PhoneNumberUpdateManyWithWhereWithoutAgentInput | Prisma.PhoneNumberUpdateManyWithWhereWithoutAgentInput[]
  deleteMany?: Prisma.PhoneNumberScalarWhereInput | Prisma.PhoneNumberScalarWhereInput[]
}

export type PhoneNumberCreateWithoutUserInput = {
  phId?: string
  number: string
  sid: string
  friendlyName: string
  provider?: $Enums.TelephonyProvider
  createdAt?: Date | string
  updatedAt?: Date | string
  organization: Prisma.OrganizationCreateNestedOneWithoutPhoneNumbersInput
  agent?: Prisma.AgentCreateNestedOneWithoutPhoneNumbersInput
}

export type PhoneNumberUncheckedCreateWithoutUserInput = {
  phId?: string
  number: string
  organizationId: string
  agentId?: string | null
  sid: string
  friendlyName: string
  provider?: $Enums.TelephonyProvider
  createdAt?: Date | string
  updatedAt?: Date | string
}

export type PhoneNumberCreateOrConnectWithoutUserInput = {
  where: Prisma.PhoneNumberWhereUniqueInput
  create: Prisma.XOR<Prisma.PhoneNumberCreateWithoutUserInput, Prisma.PhoneNumberUncheckedCreateWithoutUserInput>
}

export type PhoneNumberCreateManyUserInputEnvelope = {
  data: Prisma.PhoneNumberCreateManyUserInput | Prisma.PhoneNumberCreateManyUserInput[]
  skipDuplicates?: boolean
}

export type PhoneNumberUpsertWithWhereUniqueWithoutUserInput = {
  where: Prisma.PhoneNumberWhereUniqueInput
  update: Prisma.XOR<Prisma.PhoneNumberUpdateWithoutUserInput, Prisma.PhoneNumberUncheckedUpdateWithoutUserInput>
  create: Prisma.XOR<Prisma.PhoneNumberCreateWithoutUserInput, Prisma.PhoneNumberUncheckedCreateWithoutUserInput>
}

export type PhoneNumberUpdateWithWhereUniqueWithoutUserInput = {
  where: Prisma.PhoneNumberWhereUniqueInput
  data: Prisma.XOR<Prisma.PhoneNumberUpdateWithoutUserInput, Prisma.PhoneNumberUncheckedUpdateWithoutUserInput>
}

export type PhoneNumberUpdateManyWithWhereWithoutUserInput = {
  where: Prisma.PhoneNumberScalarWhereInput
  data: Prisma.XOR<Prisma.PhoneNumberUpdateManyMutationInput, Prisma.PhoneNumberUncheckedUpdateManyWithoutUserInput>
}

export type PhoneNumberScalarWhereInput = {
  AND?: Prisma.PhoneNumberScalarWhereInput | Prisma.PhoneNumberScalarWhereInput[]
  OR?: Prisma.PhoneNumberScalarWhereInput[]
  NOT?: Prisma.PhoneNumberScalarWhereInput | Prisma.PhoneNumberScalarWhereInput[]
  phId?: Prisma.StringFilter<"PhoneNumber"> | string
  number?: Prisma.StringFilter<"PhoneNumber"> | string
  organizationId?: Prisma.StringFilter<"PhoneNumber"> | string
  userId?: Prisma.StringNullableFilter<"PhoneNumber"> | string | null
  agentId?: Prisma.StringNullableFilter<"PhoneNumber"> | string | null
  sid?: Prisma.StringFilter<"PhoneNumber"> | string
  friendlyName?: Prisma.StringFilter<"PhoneNumber"> | string
  provider?: Prisma.EnumTelephonyProviderFilter<"PhoneNumber"> | $Enums.TelephonyProvider
  createdAt?: Prisma.DateTimeFilter<"PhoneNumber"> | Date | string
  updatedAt?: Prisma.DateTimeFilter<"PhoneNumber"> | Date | string
}

export type PhoneNumberCreateWithoutOrganizationInput = {
  phId?: string
  number: string
  sid: string
  friendlyName: string
  provider?: $Enums.TelephonyProvider
  createdAt?: Date | string
  updatedAt?: Date | string
  user?: Prisma.UserCreateNestedOneWithoutPhoneNumbersInput
  agent?: Prisma.AgentCreateNestedOneWithoutPhoneNumbersInput
}

export type PhoneNumberUncheckedCreateWithoutOrganizationInput = {
  phId?: string
  number: string
  userId?: string | null
  agentId?: string | null
  sid: string
  friendlyName: string
  provider?: $Enums.TelephonyProvider
  createdAt?: Date | string
  updatedAt?: Date | string
}

export type PhoneNumberCreateOrConnectWithoutOrganizationInput = {
  where: Prisma.PhoneNumberWhereUniqueInput
  create: Prisma.XOR<Prisma.PhoneNumberCreateWithoutOrganizationInput, Prisma.PhoneNumberUncheckedCreateWithoutOrganizationInput>
}

export type PhoneNumberCreateManyOrganizationInputEnvelope = {
  data: Prisma.PhoneNumberCreateManyOrganizationInput | Prisma.PhoneNumberCreateManyOrganizationInput[]
  skipDuplicates?: boolean
}

export type PhoneNumberUpsertWithWhereUniqueWithoutOrganizationInput = {
  where: Prisma.PhoneNumberWhereUniqueInput
  update: Prisma.XOR<Prisma.PhoneNumberUpdateWithoutOrganizationInput, Prisma.PhoneNumberUncheckedUpdateWithoutOrganizationInput>
  create: Prisma.XOR<Prisma.PhoneNumberCreateWithoutOrganizationInput, Prisma.PhoneNumberUncheckedCreateWithoutOrganizationInput>
}

export type PhoneNumberUpdateWithWhereUniqueWithoutOrganizationInput = {
  where: Prisma.PhoneNumberWhereUniqueInput
  data: Prisma.XOR<Prisma.PhoneNumberUpdateWithoutOrganizationInput, Prisma.PhoneNumberUncheckedUpdateWithoutOrganizationInput>
}

export type PhoneNumberUpdateManyWithWhereWithoutOrganizationInput = {
  where: Prisma.PhoneNumberScalarWhereInput
  data: Prisma.XOR<Prisma.PhoneNumberUpdateManyMutationInput, Prisma.PhoneNumberUncheckedUpdateManyWithoutOrganizationInput>
}

export type PhoneNumberCreateWithoutAgentInput = {
  phId?: string
  number: string
  sid: string
  friendlyName: string
  provider?: $Enums.TelephonyProvider
  createdAt?: Date | string
  updatedAt?: Date | string
  organization: Prisma.OrganizationCreateNestedOneWithoutPhoneNumbersInput
  user?: Prisma.UserCreateNestedOneWithoutPhoneNumbersInput
}

export type PhoneNumberUncheckedCreateWithoutAgentInput = {
  phId?: string
  number: string
  organizationId: string
  userId?: string | null
  sid: string
  friendlyName: string
  provider?: $Enums.TelephonyProvider
  createdAt?: Date | string
  updatedAt?: Date | string
}

export type PhoneNumberCreateOrConnectWithoutAgentInput = {
  where: Prisma.PhoneNumberWhereUniqueInput
  create: Prisma.XOR<Prisma.PhoneNumberCreateWithoutAgentInput, Prisma.PhoneNumberUncheckedCreateWithoutAgentInput>
}

export type PhoneNumberCreateManyAgentInputEnvelope = {
  data: Prisma.PhoneNumberCreateManyAgentInput | Prisma.PhoneNumberCreateManyAgentInput[]
  skipDuplicates?: boolean
}

export type PhoneNumberUpsertWithWhereUniqueWithoutAgentInput = {
  where: Prisma.PhoneNumberWhereUniqueInput
  update: Prisma.XOR<Prisma.PhoneNumberUpdateWithoutAgentInput, Prisma.PhoneNumberUncheckedUpdateWithoutAgentInput>
  create: Prisma.XOR<Prisma.PhoneNumberCreateWithoutAgentInput, Prisma.PhoneNumberUncheckedCreateWithoutAgentInput>
}

export type PhoneNumberUpdateWithWhereUniqueWithoutAgentInput = {
  where: Prisma.PhoneNumberWhereUniqueInput
  data: Prisma.XOR<Prisma.PhoneNumberUpdateWithoutAgentInput, Prisma.PhoneNumberUncheckedUpdateWithoutAgentInput>
}

export type PhoneNumberUpdateManyWithWhereWithoutAgentInput = {
  where: Prisma.PhoneNumberScalarWhereInput
  data: Prisma.XOR<Prisma.PhoneNumberUpdateManyMutationInput, Prisma.PhoneNumberUncheckedUpdateManyWithoutAgentInput>
}

export type PhoneNumberCreateManyUserInput = {
  phId?: string
  number: string
  organizationId: string
  agentId?: string | null
  sid: string
  friendlyName: string
  provider?: $Enums.TelephonyProvider
  createdAt?: Date | string
  updatedAt?: Date | string
}

export type PhoneNumberUpdateWithoutUserInput = {
  phId?: Prisma.StringFieldUpdateOperationsInput | string
  number?: Prisma.StringFieldUpdateOperationsInput | string
  sid?: Prisma.StringFieldUpdateOperationsInput | string
  friendlyName?: Prisma.StringFieldUpdateOperationsInput | string
  provider?: Prisma.EnumTelephonyProviderFieldUpdateOperationsInput | $Enums.TelephonyProvider
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  organization?: Prisma.OrganizationUpdateOneRequiredWithoutPhoneNumbersNestedInput
  agent?: Prisma.AgentUpdateOneWithoutPhoneNumbersNestedInput
}

export type PhoneNumberUncheckedUpdateWithoutUserInput = {
  phId?: Prisma.StringFieldUpdateOperationsInput | string
  number?: Prisma.StringFieldUpdateOperationsInput | string
  organizationId?: Prisma.StringFieldUpdateOperationsInput | string
  agentId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  sid?: Prisma.StringFieldUpdateOperationsInput | string
  friendlyName?: Prisma.StringFieldUpdateOperationsInput | string
  provider?: Prisma.EnumTelephonyProviderFieldUpdateOperationsInput | $Enums.TelephonyProvider
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type PhoneNumberUncheckedUpdateManyWithoutUserInput = {
  phId?: Prisma.StringFieldUpdateOperationsInput | string
  number?: Prisma.StringFieldUpdateOperationsInput | string
  organizationId?: Prisma.StringFieldUpdateOperationsInput | string
  agentId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  sid?: Prisma.StringFieldUpdateOperationsInput | string
  friendlyName?: Prisma.StringFieldUpdateOperationsInput | string
  provider?: Prisma.EnumTelephonyProviderFieldUpdateOperationsInput | $Enums.TelephonyProvider
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type PhoneNumberCreateManyOrganizationInput = {
  phId?: string
  number: string
  userId?: string | null
  agentId?: string | null
  sid: string
  friendlyName: string
  provider?: $Enums.TelephonyProvider
  createdAt?: Date | string
  updatedAt?: Date | string
}

export type PhoneNumberUpdateWithoutOrganizationInput = {
  phId?: Prisma.StringFieldUpdateOperationsInput | string
  number?: Prisma.StringFieldUpdateOperationsInput | string
  sid?: Prisma.StringFieldUpdateOperationsInput | string
  friendlyName?: Prisma.StringFieldUpdateOperationsInput | string
  provider?: Prisma.EnumTelephonyProviderFieldUpdateOperationsInput | $Enums.TelephonyProvider
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  user?: Prisma.UserUpdateOneWithoutPhoneNumbersNestedInput
  agent?: Prisma.AgentUpdateOneWithoutPhoneNumbersNestedInput
}

export type PhoneNumberUncheckedUpdateWithoutOrganizationInput = {
  phId?: Prisma.StringFieldUpdateOperationsInput | string
  number?: Prisma.StringFieldUpdateOperationsInput | string
  userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  agentId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  sid?: Prisma.StringFieldUpdateOperationsInput | string
  friendlyName?: Prisma.StringFieldUpdateOperationsInput | string
  provider?: Prisma.EnumTelephonyProviderFieldUpdateOperationsInput | $Enums.TelephonyProvider
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type PhoneNumberUncheckedUpdateManyWithoutOrganizationInput = {
  phId?: Prisma.StringFieldUpdateOperationsInput | string
  number?: Prisma.StringFieldUpdateOperationsInput | string
  userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  agentId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  sid?: Prisma.StringFieldUpdateOperationsInput | string
  friendlyName?: Prisma.StringFieldUpdateOperationsInput | string
  provider?: Prisma.EnumTelephonyProviderFieldUpdateOperationsInput | $Enums.TelephonyProvider
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type PhoneNumberCreateManyAgentInput = {
  phId?: string
  number: string
  organizationId: string
  userId?: string | null
  sid: string
  friendlyName: string
  provider?: $Enums.TelephonyProvider
  createdAt?: Date | string
  updatedAt?: Date | string
}

export type PhoneNumberUpdateWithoutAgentInput = {
  phId?: Prisma.StringFieldUpdateOperationsInput | string
  number?: Prisma.StringFieldUpdateOperationsInput | string
  sid?: Prisma.StringFieldUpdateOperationsInput | string
  friendlyName?: Prisma.StringFieldUpdateOperationsInput | string
  provider?: Prisma.EnumTelephonyProviderFieldUpdateOperationsInput | $Enums.TelephonyProvider
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  organization?: Prisma.OrganizationUpdateOneRequiredWithoutPhoneNumbersNestedInput
  user?: Prisma.UserUpdateOneWithoutPhoneNumbersNestedInput
}

export type PhoneNumberUncheckedUpdateWithoutAgentInput = {
  phId?: Prisma.StringFieldUpdateOperationsInput | string
  number?: Prisma.StringFieldUpdateOperationsInput | string
  organizationId?: Prisma.StringFieldUpdateOperationsInput | string
  userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  sid?: Prisma.StringFieldUpdateOperationsInput | string
  friendlyName?: Prisma.StringFieldUpdateOperationsInput | string
  provider?: Prisma.EnumTelephonyProviderFieldUpdateOperationsInput | $Enums.TelephonyProvider
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}

export type PhoneNumberUncheckedUpdateManyWithoutAgentInput = {
  phId?: Prisma.StringFieldUpdateOperationsInput | string
  number?: Prisma.StringFieldUpdateOperationsInput | string
  organizationId?: Prisma.StringFieldUpdateOperationsInput | string
  userId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
  sid?: Prisma.StringFieldUpdateOperationsInput | string
  friendlyName?: Prisma.StringFieldUpdateOperationsInput | string
  provider?: Prisma.EnumTelephonyProviderFieldUpdateOperationsInput | $Enums.TelephonyProvider
  createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
  updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}



export type PhoneNumberSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
  phId?: boolean
  number?: boolean
  organizationId?: boolean
  userId?: boolean
  agentId?: boolean
  sid?: boolean
  friendlyName?: boolean
  provider?: boolean
  createdAt?: boolean
  updatedAt?: boolean
  organization?: boolean | Prisma.OrganizationDefaultArgs<ExtArgs>
  user?: boolean | Prisma.PhoneNumber$userArgs<ExtArgs>
  agent?: boolean | Prisma.PhoneNumber$agentArgs<ExtArgs>
}, ExtArgs["result"]["phoneNumber"]>

export type PhoneNumberSelectCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
  phId?: boolean
  number?: boolean
  organizationId?: boolean
  userId?: boolean
  agentId?: boolean
  sid?: boolean
  friendlyName?: boolean
  provider?: boolean
  createdAt?: boolean
  updatedAt?: boolean
  organization?: boolean | Prisma.OrganizationDefaultArgs<ExtArgs>
  user?: boolean | Prisma.PhoneNumber$userArgs<ExtArgs>
  agent?: boolean | Prisma.PhoneNumber$agentArgs<ExtArgs>
}, ExtArgs["result"]["phoneNumber"]>

export type PhoneNumberSelectUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
  phId?: boolean
  number?: boolean
  organizationId?: boolean
  userId?: boolean
  agentId?: boolean
  sid?: boolean
  friendlyName?: boolean
  provider?: boolean
  createdAt?: boolean
  updatedAt?: boolean
  organization?: boolean | Prisma.OrganizationDefaultArgs<ExtArgs>
  user?: boolean | Prisma.PhoneNumber$userArgs<ExtArgs>
  agent?: boolean | Prisma.PhoneNumber$agentArgs<ExtArgs>
}, ExtArgs["result"]["phoneNumber"]>

export type PhoneNumberSelectScalar = {
  phId?: boolean
  number?: boolean
  organizationId?: boolean
  userId?: boolean
  agentId?: boolean
  sid?: boolean
  friendlyName?: boolean
  provider?: boolean
  createdAt?: boolean
  updatedAt?: boolean
}

export type PhoneNumberOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"phId" | "number" | "organizationId" | "userId" | "agentId" | "sid" | "friendlyName" | "provider" | "createdAt" | "updatedAt", ExtArgs["result"]["phoneNumber"]>
export type PhoneNumberInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  organization?: boolean | Prisma.OrganizationDefaultArgs<ExtArgs>
  user?: boolean | Prisma.PhoneNumber$userArgs<ExtArgs>
  agent?: boolean | Prisma.PhoneNumber$agentArgs<ExtArgs>
}
export type PhoneNumberIncludeCreateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  organization?: boolean | Prisma.OrganizationDefaultArgs<ExtArgs>
  user?: boolean | Prisma.PhoneNumber$userArgs<ExtArgs>
  agent?: boolean | Prisma.PhoneNumber$agentArgs<ExtArgs>
}
export type PhoneNumberIncludeUpdateManyAndReturn<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  organization?: boolean | Prisma.OrganizationDefaultArgs<ExtArgs>
  user?: boolean | Prisma.PhoneNumber$userArgs<ExtArgs>
  agent?: boolean | Prisma.PhoneNumber$agentArgs<ExtArgs>
}

export type $PhoneNumberPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  name: "PhoneNumber"
  objects: {
    organization: Prisma.$OrganizationPayload<ExtArgs>
    user: Prisma.$UserPayload<ExtArgs> | null
    agent: Prisma.$AgentPayload<ExtArgs> | null
  }
  scalars: runtime.Types.Extensions.GetPayloadResult<{
    phId: string
    number: string
    organizationId: string
    userId: string | null
    agentId: string | null
    sid: string
    friendlyName: string
    provider: $Enums.TelephonyProvider
    createdAt: Date
    updatedAt: Date
  }, ExtArgs["result"]["phoneNumber"]>
  composites: {}
}

export type PhoneNumberGetPayload<S extends boolean | null | undefined | PhoneNumberDefaultArgs> = runtime.Types.Result.GetResult<Prisma.$PhoneNumberPayload, S>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

/**
 * The delegate class that acts as a "Promise-like" for PhoneNumber.
 * 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__PhoneNumberClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
  readonly [Symbol.toStringTag]: "PrismaPromise"
  organization<T extends Prisma.OrganizationDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.OrganizationDefaultArgs<ExtArgs>>): Prisma.Prisma__OrganizationClient<runtime.Types.Result.GetResult<Prisma.$OrganizationPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
  user<T extends Prisma.PhoneNumber$userArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.PhoneNumber$userArgs<ExtArgs>>): Prisma.Prisma__UserClient<runtime.Types.Result.GetResult<Prisma.$UserPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
  agent<T extends Prisma.PhoneNumber$agentArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.PhoneNumber$agentArgs<ExtArgs>>): Prisma.Prisma__AgentClient<runtime.Types.Result.GetResult<Prisma.$AgentPayload<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 PhoneNumber model
 */
export interface PhoneNumberFieldRefs {
  readonly phId: Prisma.FieldRef<"PhoneNumber", 'String'>
  readonly number: Prisma.FieldRef<"PhoneNumber", 'String'>
  readonly organizationId: Prisma.FieldRef<"PhoneNumber", 'String'>
  readonly userId: Prisma.FieldRef<"PhoneNumber", 'String'>
  readonly agentId: Prisma.FieldRef<"PhoneNumber", 'String'>
  readonly sid: Prisma.FieldRef<"PhoneNumber", 'String'>
  readonly friendlyName: Prisma.FieldRef<"PhoneNumber", 'String'>
  readonly provider: Prisma.FieldRef<"PhoneNumber", 'TelephonyProvider'>
  readonly createdAt: Prisma.FieldRef<"PhoneNumber", 'DateTime'>
  readonly updatedAt: Prisma.FieldRef<"PhoneNumber", 'DateTime'>
}
    

// Custom InputTypes
/**
 * PhoneNumber findUnique
 */
export type PhoneNumberFindUniqueArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the PhoneNumber
   */
  select?: Prisma.PhoneNumberSelect<ExtArgs> | null
  /**
   * Omit specific fields from the PhoneNumber
   */
  omit?: Prisma.PhoneNumberOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.PhoneNumberInclude<ExtArgs> | null
  /**
   * Filter, which PhoneNumber to fetch.
   */
  where: Prisma.PhoneNumberWhereUniqueInput
}

/**
 * PhoneNumber findUniqueOrThrow
 */
export type PhoneNumberFindUniqueOrThrowArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the PhoneNumber
   */
  select?: Prisma.PhoneNumberSelect<ExtArgs> | null
  /**
   * Omit specific fields from the PhoneNumber
   */
  omit?: Prisma.PhoneNumberOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.PhoneNumberInclude<ExtArgs> | null
  /**
   * Filter, which PhoneNumber to fetch.
   */
  where: Prisma.PhoneNumberWhereUniqueInput
}

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

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

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

/**
 * PhoneNumber create
 */
export type PhoneNumberCreateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the PhoneNumber
   */
  select?: Prisma.PhoneNumberSelect<ExtArgs> | null
  /**
   * Omit specific fields from the PhoneNumber
   */
  omit?: Prisma.PhoneNumberOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.PhoneNumberInclude<ExtArgs> | null
  /**
   * The data needed to create a PhoneNumber.
   */
  data: Prisma.XOR<Prisma.PhoneNumberCreateInput, Prisma.PhoneNumberUncheckedCreateInput>
}

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

/**
 * PhoneNumber createManyAndReturn
 */
export type PhoneNumberCreateManyAndReturnArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the PhoneNumber
   */
  select?: Prisma.PhoneNumberSelectCreateManyAndReturn<ExtArgs> | null
  /**
   * Omit specific fields from the PhoneNumber
   */
  omit?: Prisma.PhoneNumberOmit<ExtArgs> | null
  /**
   * The data used to create many PhoneNumbers.
   */
  data: Prisma.PhoneNumberCreateManyInput | Prisma.PhoneNumberCreateManyInput[]
  skipDuplicates?: boolean
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.PhoneNumberIncludeCreateManyAndReturn<ExtArgs> | null
}

/**
 * PhoneNumber update
 */
export type PhoneNumberUpdateArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the PhoneNumber
   */
  select?: Prisma.PhoneNumberSelect<ExtArgs> | null
  /**
   * Omit specific fields from the PhoneNumber
   */
  omit?: Prisma.PhoneNumberOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.PhoneNumberInclude<ExtArgs> | null
  /**
   * The data needed to update a PhoneNumber.
   */
  data: Prisma.XOR<Prisma.PhoneNumberUpdateInput, Prisma.PhoneNumberUncheckedUpdateInput>
  /**
   * Choose, which PhoneNumber to update.
   */
  where: Prisma.PhoneNumberWhereUniqueInput
}

/**
 * PhoneNumber updateMany
 */
export type PhoneNumberUpdateManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * The data used to update PhoneNumbers.
   */
  data: Prisma.XOR<Prisma.PhoneNumberUpdateManyMutationInput, Prisma.PhoneNumberUncheckedUpdateManyInput>
  /**
   * Filter which PhoneNumbers to update
   */
  where?: Prisma.PhoneNumberWhereInput
  /**
   * Limit how many PhoneNumbers to update.
   */
  limit?: number
}

/**
 * PhoneNumber updateManyAndReturn
 */
export type PhoneNumberUpdateManyAndReturnArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the PhoneNumber
   */
  select?: Prisma.PhoneNumberSelectUpdateManyAndReturn<ExtArgs> | null
  /**
   * Omit specific fields from the PhoneNumber
   */
  omit?: Prisma.PhoneNumberOmit<ExtArgs> | null
  /**
   * The data used to update PhoneNumbers.
   */
  data: Prisma.XOR<Prisma.PhoneNumberUpdateManyMutationInput, Prisma.PhoneNumberUncheckedUpdateManyInput>
  /**
   * Filter which PhoneNumbers to update
   */
  where?: Prisma.PhoneNumberWhereInput
  /**
   * Limit how many PhoneNumbers to update.
   */
  limit?: number
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.PhoneNumberIncludeUpdateManyAndReturn<ExtArgs> | null
}

/**
 * PhoneNumber upsert
 */
export type PhoneNumberUpsertArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the PhoneNumber
   */
  select?: Prisma.PhoneNumberSelect<ExtArgs> | null
  /**
   * Omit specific fields from the PhoneNumber
   */
  omit?: Prisma.PhoneNumberOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.PhoneNumberInclude<ExtArgs> | null
  /**
   * The filter to search for the PhoneNumber to update in case it exists.
   */
  where: Prisma.PhoneNumberWhereUniqueInput
  /**
   * In case the PhoneNumber found by the `where` argument doesn't exist, create a new PhoneNumber with this data.
   */
  create: Prisma.XOR<Prisma.PhoneNumberCreateInput, Prisma.PhoneNumberUncheckedCreateInput>
  /**
   * In case the PhoneNumber was found with the provided `where` argument, update it with this data.
   */
  update: Prisma.XOR<Prisma.PhoneNumberUpdateInput, Prisma.PhoneNumberUncheckedUpdateInput>
}

/**
 * PhoneNumber delete
 */
export type PhoneNumberDeleteArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the PhoneNumber
   */
  select?: Prisma.PhoneNumberSelect<ExtArgs> | null
  /**
   * Omit specific fields from the PhoneNumber
   */
  omit?: Prisma.PhoneNumberOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.PhoneNumberInclude<ExtArgs> | null
  /**
   * Filter which PhoneNumber to delete.
   */
  where: Prisma.PhoneNumberWhereUniqueInput
}

/**
 * PhoneNumber deleteMany
 */
export type PhoneNumberDeleteManyArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Filter which PhoneNumbers to delete
   */
  where?: Prisma.PhoneNumberWhereInput
  /**
   * Limit how many PhoneNumbers to delete.
   */
  limit?: number
}

/**
 * PhoneNumber.user
 */
export type PhoneNumber$userArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the User
   */
  select?: Prisma.UserSelect<ExtArgs> | null
  /**
   * Omit specific fields from the User
   */
  omit?: Prisma.UserOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.UserInclude<ExtArgs> | null
  where?: Prisma.UserWhereInput
}

/**
 * PhoneNumber.agent
 */
export type PhoneNumber$agentArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
  /**
   * Select specific fields to fetch from the Agent
   */
  select?: Prisma.AgentSelect<ExtArgs> | null
  /**
   * Omit specific fields from the Agent
   */
  omit?: Prisma.AgentOmit<ExtArgs> | null
  /**
   * Choose, which related nodes to fetch as well
   */
  include?: Prisma.AgentInclude<ExtArgs> | null
  where?: Prisma.AgentWhereInput
}

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