/**
 * Generated by orval v8.9.1 🍺
 * Do not edit manually.
 * Api
 * API specification
 * OpenAPI spec version: 0.1.0
 */
import {
  useMutation,
  useQuery
} from '@tanstack/react-query';
import type {
  MutationFunction,
  QueryFunction,
  QueryKey,
  UseMutationOptions,
  UseMutationResult,
  UseQueryOptions,
  UseQueryResult
} from '@tanstack/react-query';

import type {
  Conversation,
  ConversationDetail,
  CreateConversationBody,
  CreateProjectBody,
  HealthStatus,
  Message,
  Project,
  ProjectStats,
  SendMessageBody,
  UpdateProjectBody
} from './api.schemas';

import { customFetch } from '../custom-fetch';
import type { ErrorType , BodyType } from '../custom-fetch';

type AwaitedInput<T> = PromiseLike<T> | T;

      type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;


type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];



export const getHealthCheckUrl = () => {




  return `/api/healthz`
}

/**
 * Returns server health status
 * @summary Health check
 */
export const healthCheck = async ( options?: RequestInit): Promise<HealthStatus> => {

  return customFetch<HealthStatus>(getHealthCheckUrl(),
  {
    ...options,
    method: 'GET'


  }
);}





export const getHealthCheckQueryKey = () => {
    return [
    `/api/healthz`
    ] as const;
    }


export const getHealthCheckQueryOptions = <TData = Awaited<ReturnType<typeof healthCheck>>, TError = ErrorType<unknown>>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof healthCheck>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
) => {

const {query: queryOptions, request: requestOptions} = options ?? {};

  const queryKey =  queryOptions?.queryKey ?? getHealthCheckQueryKey();



    const queryFn: QueryFunction<Awaited<ReturnType<typeof healthCheck>>> = ({ signal }) => healthCheck({ signal, ...requestOptions });





   return  { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof healthCheck>>, TError, TData> & { queryKey: QueryKey }
}

export type HealthCheckQueryResult = NonNullable<Awaited<ReturnType<typeof healthCheck>>>
export type HealthCheckQueryError = ErrorType<unknown>


/**
 * @summary Health check
 */

export function useHealthCheck<TData = Awaited<ReturnType<typeof healthCheck>>, TError = ErrorType<unknown>>(
  options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof healthCheck>>, TError, TData>, request?: SecondParameter<typeof customFetch>}

 ):  UseQueryResult<TData, TError> & { queryKey: QueryKey } {

  const queryOptions = getHealthCheckQueryOptions(options)

  const query = useQuery(queryOptions) as  UseQueryResult<TData, TError> & { queryKey: QueryKey };

  return { ...query, queryKey: queryOptions.queryKey };
}







export const getListConversationsUrl = () => {




  return `/api/conversations`
}

/**
 * @summary List all conversations
 */
export const listConversations = async ( options?: RequestInit): Promise<Conversation[]> => {

  return customFetch<Conversation[]>(getListConversationsUrl(),
  {
    ...options,
    method: 'GET'


  }
);}





export const getListConversationsQueryKey = () => {
    return [
    `/api/conversations`
    ] as const;
    }


export const getListConversationsQueryOptions = <TData = Awaited<ReturnType<typeof listConversations>>, TError = ErrorType<unknown>>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof listConversations>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
) => {

const {query: queryOptions, request: requestOptions} = options ?? {};

  const queryKey =  queryOptions?.queryKey ?? getListConversationsQueryKey();



    const queryFn: QueryFunction<Awaited<ReturnType<typeof listConversations>>> = ({ signal }) => listConversations({ signal, ...requestOptions });





   return  { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listConversations>>, TError, TData> & { queryKey: QueryKey }
}

export type ListConversationsQueryResult = NonNullable<Awaited<ReturnType<typeof listConversations>>>
export type ListConversationsQueryError = ErrorType<unknown>


/**
 * @summary List all conversations
 */

export function useListConversations<TData = Awaited<ReturnType<typeof listConversations>>, TError = ErrorType<unknown>>(
  options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof listConversations>>, TError, TData>, request?: SecondParameter<typeof customFetch>}

 ):  UseQueryResult<TData, TError> & { queryKey: QueryKey } {

  const queryOptions = getListConversationsQueryOptions(options)

  const query = useQuery(queryOptions) as  UseQueryResult<TData, TError> & { queryKey: QueryKey };

  return { ...query, queryKey: queryOptions.queryKey };
}







export const getCreateConversationUrl = () => {




  return `/api/conversations`
}

/**
 * @summary Create a conversation
 */
export const createConversation = async (createConversationBody: CreateConversationBody, options?: RequestInit): Promise<Conversation> => {

  return customFetch<Conversation>(getCreateConversationUrl(),
  {
    ...options,
    method: 'POST',
    headers: { 'Content-Type': 'application/json', ...options?.headers },
    body: JSON.stringify(
      createConversationBody,)
  }
);}




export const getCreateConversationMutationOptions = <TError = ErrorType<unknown>,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createConversation>>, TError,{data: BodyType<CreateConversationBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
): UseMutationOptions<Awaited<ReturnType<typeof createConversation>>, TError,{data: BodyType<CreateConversationBody>}, TContext> => {

const mutationKey = ['createConversation'];
const {mutation: mutationOptions, request: requestOptions} = options ?
      options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
      options
      : {...options, mutation: {...options.mutation, mutationKey}}
      : {mutation: { mutationKey, }, request: undefined};




      const mutationFn: MutationFunction<Awaited<ReturnType<typeof createConversation>>, {data: BodyType<CreateConversationBody>}> = (props) => {
          const {data} = props ?? {};

          return  createConversation(data,requestOptions)
        }






  return  { mutationFn, ...mutationOptions }}

    export type CreateConversationMutationResult = NonNullable<Awaited<ReturnType<typeof createConversation>>>
    export type CreateConversationMutationBody = BodyType<CreateConversationBody>
    export type CreateConversationMutationError = ErrorType<unknown>

    /**
 * @summary Create a conversation
 */
export const useCreateConversation = <TError = ErrorType<unknown>,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createConversation>>, TError,{data: BodyType<CreateConversationBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
 ): UseMutationResult<
        Awaited<ReturnType<typeof createConversation>>,
        TError,
        {data: BodyType<CreateConversationBody>},
        TContext
      > => {
      return useMutation(getCreateConversationMutationOptions(options));
    }

export const getGetConversationUrl = (id: number,) => {




  return `/api/conversations/${id}`
}

/**
 * @summary Get conversation by ID
 */
export const getConversation = async (id: number, options?: RequestInit): Promise<ConversationDetail> => {

  return customFetch<ConversationDetail>(getGetConversationUrl(id),
  {
    ...options,
    method: 'GET'


  }
);}





export const getGetConversationQueryKey = (id: number,) => {
    return [
    `/api/conversations/${id}`
    ] as const;
    }


export const getGetConversationQueryOptions = <TData = Awaited<ReturnType<typeof getConversation>>, TError = ErrorType<void>>(id: number, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getConversation>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
) => {

const {query: queryOptions, request: requestOptions} = options ?? {};

  const queryKey =  queryOptions?.queryKey ?? getGetConversationQueryKey(id);



    const queryFn: QueryFunction<Awaited<ReturnType<typeof getConversation>>> = ({ signal }) => getConversation(id, { signal, ...requestOptions });





   return  { queryKey, queryFn, enabled: !!(id), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getConversation>>, TError, TData> & { queryKey: QueryKey }
}

export type GetConversationQueryResult = NonNullable<Awaited<ReturnType<typeof getConversation>>>
export type GetConversationQueryError = ErrorType<void>


/**
 * @summary Get conversation by ID
 */

export function useGetConversation<TData = Awaited<ReturnType<typeof getConversation>>, TError = ErrorType<void>>(
 id: number, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getConversation>>, TError, TData>, request?: SecondParameter<typeof customFetch>}

 ):  UseQueryResult<TData, TError> & { queryKey: QueryKey } {

  const queryOptions = getGetConversationQueryOptions(id,options)

  const query = useQuery(queryOptions) as  UseQueryResult<TData, TError> & { queryKey: QueryKey };

  return { ...query, queryKey: queryOptions.queryKey };
}







export const getDeleteConversationUrl = (id: number,) => {




  return `/api/conversations/${id}`
}

/**
 * @summary Delete a conversation
 */
export const deleteConversation = async (id: number, options?: RequestInit): Promise<void> => {

  return customFetch<void>(getDeleteConversationUrl(id),
  {
    ...options,
    method: 'DELETE'


  }
);}




export const getDeleteConversationMutationOptions = <TError = ErrorType<void>,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteConversation>>, TError,{id: number}, TContext>, request?: SecondParameter<typeof customFetch>}
): UseMutationOptions<Awaited<ReturnType<typeof deleteConversation>>, TError,{id: number}, TContext> => {

const mutationKey = ['deleteConversation'];
const {mutation: mutationOptions, request: requestOptions} = options ?
      options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
      options
      : {...options, mutation: {...options.mutation, mutationKey}}
      : {mutation: { mutationKey, }, request: undefined};




      const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteConversation>>, {id: number}> = (props) => {
          const {id} = props ?? {};

          return  deleteConversation(id,requestOptions)
        }






  return  { mutationFn, ...mutationOptions }}

    export type DeleteConversationMutationResult = NonNullable<Awaited<ReturnType<typeof deleteConversation>>>

    export type DeleteConversationMutationError = ErrorType<void>

    /**
 * @summary Delete a conversation
 */
export const useDeleteConversation = <TError = ErrorType<void>,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteConversation>>, TError,{id: number}, TContext>, request?: SecondParameter<typeof customFetch>}
 ): UseMutationResult<
        Awaited<ReturnType<typeof deleteConversation>>,
        TError,
        {id: number},
        TContext
      > => {
      return useMutation(getDeleteConversationMutationOptions(options));
    }

export const getListMessagesUrl = (id: number,) => {




  return `/api/conversations/${id}/messages`
}

/**
 * @summary List messages in a conversation
 */
export const listMessages = async (id: number, options?: RequestInit): Promise<Message[]> => {

  return customFetch<Message[]>(getListMessagesUrl(id),
  {
    ...options,
    method: 'GET'


  }
);}





export const getListMessagesQueryKey = (id: number,) => {
    return [
    `/api/conversations/${id}/messages`
    ] as const;
    }


export const getListMessagesQueryOptions = <TData = Awaited<ReturnType<typeof listMessages>>, TError = ErrorType<unknown>>(id: number, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof listMessages>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
) => {

const {query: queryOptions, request: requestOptions} = options ?? {};

  const queryKey =  queryOptions?.queryKey ?? getListMessagesQueryKey(id);



    const queryFn: QueryFunction<Awaited<ReturnType<typeof listMessages>>> = ({ signal }) => listMessages(id, { signal, ...requestOptions });





   return  { queryKey, queryFn, enabled: !!(id), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listMessages>>, TError, TData> & { queryKey: QueryKey }
}

export type ListMessagesQueryResult = NonNullable<Awaited<ReturnType<typeof listMessages>>>
export type ListMessagesQueryError = ErrorType<unknown>


/**
 * @summary List messages in a conversation
 */

export function useListMessages<TData = Awaited<ReturnType<typeof listMessages>>, TError = ErrorType<unknown>>(
 id: number, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof listMessages>>, TError, TData>, request?: SecondParameter<typeof customFetch>}

 ):  UseQueryResult<TData, TError> & { queryKey: QueryKey } {

  const queryOptions = getListMessagesQueryOptions(id,options)

  const query = useQuery(queryOptions) as  UseQueryResult<TData, TError> & { queryKey: QueryKey };

  return { ...query, queryKey: queryOptions.queryKey };
}







export const getSendMessageUrl = (id: number,) => {




  return `/api/conversations/${id}/messages`
}

/**
 * @summary Send a message (streams SSE)
 */
export const sendMessage = async (id: number,
    sendMessageBody: SendMessageBody, options?: RequestInit): Promise<string> => {

  return customFetch<string>(getSendMessageUrl(id),
  {
    ...options,
    method: 'POST',
    headers: { 'Content-Type': 'application/json', ...options?.headers },
    body: JSON.stringify(
      sendMessageBody,)
  }
);}




export const getSendMessageMutationOptions = <TError = ErrorType<unknown>,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof sendMessage>>, TError,{id: number;data: BodyType<SendMessageBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
): UseMutationOptions<Awaited<ReturnType<typeof sendMessage>>, TError,{id: number;data: BodyType<SendMessageBody>}, TContext> => {

const mutationKey = ['sendMessage'];
const {mutation: mutationOptions, request: requestOptions} = options ?
      options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
      options
      : {...options, mutation: {...options.mutation, mutationKey}}
      : {mutation: { mutationKey, }, request: undefined};




      const mutationFn: MutationFunction<Awaited<ReturnType<typeof sendMessage>>, {id: number;data: BodyType<SendMessageBody>}> = (props) => {
          const {id,data} = props ?? {};

          return  sendMessage(id,data,requestOptions)
        }






  return  { mutationFn, ...mutationOptions }}

    export type SendMessageMutationResult = NonNullable<Awaited<ReturnType<typeof sendMessage>>>
    export type SendMessageMutationBody = BodyType<SendMessageBody>
    export type SendMessageMutationError = ErrorType<unknown>

    /**
 * @summary Send a message (streams SSE)
 */
export const useSendMessage = <TError = ErrorType<unknown>,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof sendMessage>>, TError,{id: number;data: BodyType<SendMessageBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
 ): UseMutationResult<
        Awaited<ReturnType<typeof sendMessage>>,
        TError,
        {id: number;data: BodyType<SendMessageBody>},
        TContext
      > => {
      return useMutation(getSendMessageMutationOptions(options));
    }

export const getGetProjectStatsUrl = () => {




  return `/api/projects/stats`
}

/**
 * @summary Get aggregate project statistics
 */
export const getProjectStats = async ( options?: RequestInit): Promise<ProjectStats> => {

  return customFetch<ProjectStats>(getGetProjectStatsUrl(),
  {
    ...options,
    method: 'GET'


  }
);}





export const getGetProjectStatsQueryKey = () => {
    return [
    `/api/projects/stats`
    ] as const;
    }


export const getGetProjectStatsQueryOptions = <TData = Awaited<ReturnType<typeof getProjectStats>>, TError = ErrorType<unknown>>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProjectStats>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
) => {

const {query: queryOptions, request: requestOptions} = options ?? {};

  const queryKey =  queryOptions?.queryKey ?? getGetProjectStatsQueryKey();



    const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjectStats>>> = ({ signal }) => getProjectStats({ signal, ...requestOptions });





   return  { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getProjectStats>>, TError, TData> & { queryKey: QueryKey }
}

export type GetProjectStatsQueryResult = NonNullable<Awaited<ReturnType<typeof getProjectStats>>>
export type GetProjectStatsQueryError = ErrorType<unknown>


/**
 * @summary Get aggregate project statistics
 */

export function useGetProjectStats<TData = Awaited<ReturnType<typeof getProjectStats>>, TError = ErrorType<unknown>>(
  options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProjectStats>>, TError, TData>, request?: SecondParameter<typeof customFetch>}

 ):  UseQueryResult<TData, TError> & { queryKey: QueryKey } {

  const queryOptions = getGetProjectStatsQueryOptions(options)

  const query = useQuery(queryOptions) as  UseQueryResult<TData, TError> & { queryKey: QueryKey };

  return { ...query, queryKey: queryOptions.queryKey };
}







export const getListProjectsUrl = () => {




  return `/api/projects`
}

/**
 * @summary List all projects
 */
export const listProjects = async ( options?: RequestInit): Promise<Project[]> => {

  return customFetch<Project[]>(getListProjectsUrl(),
  {
    ...options,
    method: 'GET'


  }
);}





export const getListProjectsQueryKey = () => {
    return [
    `/api/projects`
    ] as const;
    }


export const getListProjectsQueryOptions = <TData = Awaited<ReturnType<typeof listProjects>>, TError = ErrorType<unknown>>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof listProjects>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
) => {

const {query: queryOptions, request: requestOptions} = options ?? {};

  const queryKey =  queryOptions?.queryKey ?? getListProjectsQueryKey();



    const queryFn: QueryFunction<Awaited<ReturnType<typeof listProjects>>> = ({ signal }) => listProjects({ signal, ...requestOptions });





   return  { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listProjects>>, TError, TData> & { queryKey: QueryKey }
}

export type ListProjectsQueryResult = NonNullable<Awaited<ReturnType<typeof listProjects>>>
export type ListProjectsQueryError = ErrorType<unknown>


/**
 * @summary List all projects
 */

export function useListProjects<TData = Awaited<ReturnType<typeof listProjects>>, TError = ErrorType<unknown>>(
  options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof listProjects>>, TError, TData>, request?: SecondParameter<typeof customFetch>}

 ):  UseQueryResult<TData, TError> & { queryKey: QueryKey } {

  const queryOptions = getListProjectsQueryOptions(options)

  const query = useQuery(queryOptions) as  UseQueryResult<TData, TError> & { queryKey: QueryKey };

  return { ...query, queryKey: queryOptions.queryKey };
}







export const getCreateProjectUrl = () => {




  return `/api/projects`
}

/**
 * @summary Create a project
 */
export const createProject = async (createProjectBody: CreateProjectBody, options?: RequestInit): Promise<Project> => {

  return customFetch<Project>(getCreateProjectUrl(),
  {
    ...options,
    method: 'POST',
    headers: { 'Content-Type': 'application/json', ...options?.headers },
    body: JSON.stringify(
      createProjectBody,)
  }
);}




export const getCreateProjectMutationOptions = <TError = ErrorType<unknown>,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createProject>>, TError,{data: BodyType<CreateProjectBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
): UseMutationOptions<Awaited<ReturnType<typeof createProject>>, TError,{data: BodyType<CreateProjectBody>}, TContext> => {

const mutationKey = ['createProject'];
const {mutation: mutationOptions, request: requestOptions} = options ?
      options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
      options
      : {...options, mutation: {...options.mutation, mutationKey}}
      : {mutation: { mutationKey, }, request: undefined};




      const mutationFn: MutationFunction<Awaited<ReturnType<typeof createProject>>, {data: BodyType<CreateProjectBody>}> = (props) => {
          const {data} = props ?? {};

          return  createProject(data,requestOptions)
        }






  return  { mutationFn, ...mutationOptions }}

    export type CreateProjectMutationResult = NonNullable<Awaited<ReturnType<typeof createProject>>>
    export type CreateProjectMutationBody = BodyType<CreateProjectBody>
    export type CreateProjectMutationError = ErrorType<unknown>

    /**
 * @summary Create a project
 */
export const useCreateProject = <TError = ErrorType<unknown>,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createProject>>, TError,{data: BodyType<CreateProjectBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
 ): UseMutationResult<
        Awaited<ReturnType<typeof createProject>>,
        TError,
        {data: BodyType<CreateProjectBody>},
        TContext
      > => {
      return useMutation(getCreateProjectMutationOptions(options));
    }

export const getGetProjectUrl = (id: number,) => {




  return `/api/projects/${id}`
}

/**
 * @summary Get project by ID
 */
export const getProject = async (id: number, options?: RequestInit): Promise<Project> => {

  return customFetch<Project>(getGetProjectUrl(id),
  {
    ...options,
    method: 'GET'


  }
);}





export const getGetProjectQueryKey = (id: number,) => {
    return [
    `/api/projects/${id}`
    ] as const;
    }


export const getGetProjectQueryOptions = <TData = Awaited<ReturnType<typeof getProject>>, TError = ErrorType<void>>(id: number, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProject>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
) => {

const {query: queryOptions, request: requestOptions} = options ?? {};

  const queryKey =  queryOptions?.queryKey ?? getGetProjectQueryKey(id);



    const queryFn: QueryFunction<Awaited<ReturnType<typeof getProject>>> = ({ signal }) => getProject(id, { signal, ...requestOptions });





   return  { queryKey, queryFn, enabled: !!(id), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getProject>>, TError, TData> & { queryKey: QueryKey }
}

export type GetProjectQueryResult = NonNullable<Awaited<ReturnType<typeof getProject>>>
export type GetProjectQueryError = ErrorType<void>


/**
 * @summary Get project by ID
 */

export function useGetProject<TData = Awaited<ReturnType<typeof getProject>>, TError = ErrorType<void>>(
 id: number, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProject>>, TError, TData>, request?: SecondParameter<typeof customFetch>}

 ):  UseQueryResult<TData, TError> & { queryKey: QueryKey } {

  const queryOptions = getGetProjectQueryOptions(id,options)

  const query = useQuery(queryOptions) as  UseQueryResult<TData, TError> & { queryKey: QueryKey };

  return { ...query, queryKey: queryOptions.queryKey };
}







export const getUpdateProjectUrl = (id: number,) => {




  return `/api/projects/${id}`
}

/**
 * @summary Update a project
 */
export const updateProject = async (id: number,
    updateProjectBody: UpdateProjectBody, options?: RequestInit): Promise<Project> => {

  return customFetch<Project>(getUpdateProjectUrl(id),
  {
    ...options,
    method: 'PATCH',
    headers: { 'Content-Type': 'application/json', ...options?.headers },
    body: JSON.stringify(
      updateProjectBody,)
  }
);}




export const getUpdateProjectMutationOptions = <TError = ErrorType<void>,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof updateProject>>, TError,{id: number;data: BodyType<UpdateProjectBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
): UseMutationOptions<Awaited<ReturnType<typeof updateProject>>, TError,{id: number;data: BodyType<UpdateProjectBody>}, TContext> => {

const mutationKey = ['updateProject'];
const {mutation: mutationOptions, request: requestOptions} = options ?
      options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
      options
      : {...options, mutation: {...options.mutation, mutationKey}}
      : {mutation: { mutationKey, }, request: undefined};




      const mutationFn: MutationFunction<Awaited<ReturnType<typeof updateProject>>, {id: number;data: BodyType<UpdateProjectBody>}> = (props) => {
          const {id,data} = props ?? {};

          return  updateProject(id,data,requestOptions)
        }






  return  { mutationFn, ...mutationOptions }}

    export type UpdateProjectMutationResult = NonNullable<Awaited<ReturnType<typeof updateProject>>>
    export type UpdateProjectMutationBody = BodyType<UpdateProjectBody>
    export type UpdateProjectMutationError = ErrorType<void>

    /**
 * @summary Update a project
 */
export const useUpdateProject = <TError = ErrorType<void>,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof updateProject>>, TError,{id: number;data: BodyType<UpdateProjectBody>}, TContext>, request?: SecondParameter<typeof customFetch>}
 ): UseMutationResult<
        Awaited<ReturnType<typeof updateProject>>,
        TError,
        {id: number;data: BodyType<UpdateProjectBody>},
        TContext
      > => {
      return useMutation(getUpdateProjectMutationOptions(options));
    }

export const getDeleteProjectUrl = (id: number,) => {




  return `/api/projects/${id}`
}

/**
 * @summary Delete a project
 */
export const deleteProject = async (id: number, options?: RequestInit): Promise<void> => {

  return customFetch<void>(getDeleteProjectUrl(id),
  {
    ...options,
    method: 'DELETE'


  }
);}




export const getDeleteProjectMutationOptions = <TError = ErrorType<void>,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteProject>>, TError,{id: number}, TContext>, request?: SecondParameter<typeof customFetch>}
): UseMutationOptions<Awaited<ReturnType<typeof deleteProject>>, TError,{id: number}, TContext> => {

const mutationKey = ['deleteProject'];
const {mutation: mutationOptions, request: requestOptions} = options ?
      options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
      options
      : {...options, mutation: {...options.mutation, mutationKey}}
      : {mutation: { mutationKey, }, request: undefined};




      const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteProject>>, {id: number}> = (props) => {
          const {id} = props ?? {};

          return  deleteProject(id,requestOptions)
        }






  return  { mutationFn, ...mutationOptions }}

    export type DeleteProjectMutationResult = NonNullable<Awaited<ReturnType<typeof deleteProject>>>

    export type DeleteProjectMutationError = ErrorType<void>

    /**
 * @summary Delete a project
 */
export const useDeleteProject = <TError = ErrorType<void>,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteProject>>, TError,{id: number}, TContext>, request?: SecondParameter<typeof customFetch>}
 ): UseMutationResult<
        Awaited<ReturnType<typeof deleteProject>>,
        TError,
        {id: number},
        TContext
      > => {
      return useMutation(getDeleteProjectMutationOptions(options));
    }

