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

import { customFetcher } from '../../api';


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



/**
 * @summary Health
 */
export type healthHealthResponse200 = {
  data: unknown
  status: 200
}
    
export type healthHealthResponseSuccess = (healthHealthResponse200) & {
  headers: Headers;
};
;

export type healthHealthResponse = (healthHealthResponseSuccess)

export const getHealthHealthUrl = () => {


  

  return `/health`
}

export const healthHealth = async ( options?: RequestInit): Promise<healthHealthResponse> => {
  
  return customFetcher<healthHealthResponse>(getHealthHealthUrl(),
  {      
    ...options,
    method: 'GET'
    
    
  }
);}





export const getHealthHealthQueryKey = () => {
    return [
    `/health`
    ] as const;
    }

    
export const getHealthHealthQueryOptions = <TData = Awaited<ReturnType<typeof healthHealth>>, TError = unknown>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof healthHealth>>, TError, TData>>, request?: SecondParameter<typeof customFetcher>}
) => {

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

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

  

    const queryFn: QueryFunction<Awaited<ReturnType<typeof healthHealth>>> = () => healthHealth(requestOptions);

      

      

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

export type HealthHealthQueryResult = NonNullable<Awaited<ReturnType<typeof healthHealth>>>
export type HealthHealthQueryError = unknown


export function useHealthHealth<TData = Awaited<ReturnType<typeof healthHealth>>, TError = unknown>(
  options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof healthHealth>>, TError, TData>> & Pick<
        DefinedInitialDataOptions<
          Awaited<ReturnType<typeof healthHealth>>,
          TError,
          Awaited<ReturnType<typeof healthHealth>>
        > , 'initialData'
      >, request?: SecondParameter<typeof customFetcher>}
 , queryClient?: QueryClient
  ):  DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> }
export function useHealthHealth<TData = Awaited<ReturnType<typeof healthHealth>>, TError = unknown>(
  options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof healthHealth>>, TError, TData>> & Pick<
        UndefinedInitialDataOptions<
          Awaited<ReturnType<typeof healthHealth>>,
          TError,
          Awaited<ReturnType<typeof healthHealth>>
        > , 'initialData'
      >, request?: SecondParameter<typeof customFetcher>}
 , queryClient?: QueryClient
  ):  UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> }
export function useHealthHealth<TData = Awaited<ReturnType<typeof healthHealth>>, TError = unknown>(
  options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof healthHealth>>, TError, TData>>, request?: SecondParameter<typeof customFetcher>}
 , queryClient?: QueryClient
  ):  UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> }
/**
 * @summary Health
 */

export function useHealthHealth<TData = Awaited<ReturnType<typeof healthHealth>>, TError = unknown>(
  options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof healthHealth>>, TError, TData>>, request?: SecondParameter<typeof customFetcher>}
 , queryClient?: QueryClient 
 ):  UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {

  const queryOptions = getHealthHealthQueryOptions(options)

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

  query.queryKey = queryOptions.queryKey ;

  return query;
}




