/**
 * Generated by orval v7.10.0 🍺
 * Do not edit manually.
 * Monitoring | v1
 * OpenAPI spec version: 1.0.0
 */
import {
  useQuery
} from '@tanstack/react-query';
import type {
  DataTag,
  DefinedInitialDataOptions,
  DefinedUseQueryResult,
  QueryClient,
  QueryFunction,
  QueryKey,
  UndefinedInitialDataOptions,
  UseQueryOptions,
  UseQueryResult
} from '@tanstack/react-query';

import type {
  GetEventCodeListParams,
  TableDataResponseModelOfEventCodeResponse
} from './client.schemas';

import { customClient } from '../services/http.service';





export const getEventCodeList = (
    params?: GetEventCodeListParams,
 signal?: AbortSignal
) => {
      
      
      return customClient<TableDataResponseModelOfEventCodeResponse>(
      {url: `/api/event-codes`, method: 'GET',
        params, signal
    },
      );
    }
  

export const getGetEventCodeListQueryKey = (params?: GetEventCodeListParams,) => {
    return [`/api/event-codes`, ...(params ? [params]: [])] as const;
    }

    
export const getGetEventCodeListQueryOptions = <TData = Awaited<ReturnType<typeof getEventCodeList>>, TError = unknown>(params?: GetEventCodeListParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventCodeList>>, TError, TData>>, }
) => {

const {query: queryOptions} = options ?? {};

  const queryKey =  queryOptions?.queryKey ?? getGetEventCodeListQueryKey(params);

  

    const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventCodeList>>> = ({ signal }) => getEventCodeList(params, signal);

      

      

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

export type GetEventCodeListQueryResult = NonNullable<Awaited<ReturnType<typeof getEventCodeList>>>
export type GetEventCodeListQueryError = unknown


export function useGetEventCodeList<TData = Awaited<ReturnType<typeof getEventCodeList>>, TError = unknown>(
 params: undefined |  GetEventCodeListParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventCodeList>>, TError, TData>> & Pick<
        DefinedInitialDataOptions<
          Awaited<ReturnType<typeof getEventCodeList>>,
          TError,
          Awaited<ReturnType<typeof getEventCodeList>>
        > , 'initialData'
      >, }
 , queryClient?: QueryClient
  ):  DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetEventCodeList<TData = Awaited<ReturnType<typeof getEventCodeList>>, TError = unknown>(
 params?: GetEventCodeListParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventCodeList>>, TError, TData>> & Pick<
        UndefinedInitialDataOptions<
          Awaited<ReturnType<typeof getEventCodeList>>,
          TError,
          Awaited<ReturnType<typeof getEventCodeList>>
        > , 'initialData'
      >, }
 , queryClient?: QueryClient
  ):  UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetEventCodeList<TData = Awaited<ReturnType<typeof getEventCodeList>>, TError = unknown>(
 params?: GetEventCodeListParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventCodeList>>, TError, TData>>, }
 , queryClient?: QueryClient
  ):  UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }

export function useGetEventCodeList<TData = Awaited<ReturnType<typeof getEventCodeList>>, TError = unknown>(
 params?: GetEventCodeListParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventCodeList>>, TError, TData>>, }
 , queryClient?: QueryClient 
 ):  UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {

  const queryOptions = getGetEventCodeListQueryOptions(params,options)

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

  query.queryKey = queryOptions.queryKey ;

  return query;
}



