/**
 * 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 {
  AlarmModel,
  GetAlarmListByScopeParams,
  GetAlarmListParams,
  TableDataResponseModelOfAlarmModel
} from './client.schemas';

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





export const getAlarmList = (
    params?: GetAlarmListParams,
 signal?: AbortSignal
) => {
      
      
      return customClient<TableDataResponseModelOfAlarmModel>(
      {url: `/api/alarms`, method: 'GET',
        params, signal
    },
      );
    }
  

export const getGetAlarmListQueryKey = (params?: GetAlarmListParams,) => {
    return [`/api/alarms`, ...(params ? [params]: [])] as const;
    }

    
export const getGetAlarmListQueryOptions = <TData = Awaited<ReturnType<typeof getAlarmList>>, TError = unknown>(params?: GetAlarmListParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getAlarmList>>, TError, TData>>, }
) => {

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

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

  

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

      

      

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

export type GetAlarmListQueryResult = NonNullable<Awaited<ReturnType<typeof getAlarmList>>>
export type GetAlarmListQueryError = unknown


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

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

  const queryOptions = getGetAlarmListQueryOptions(params,options)

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

  query.queryKey = queryOptions.queryKey ;

  return query;
}



export const getAlarmListByScope = (
    params?: GetAlarmListByScopeParams,
 signal?: AbortSignal
) => {
      
      
      return customClient<AlarmModel[]>(
      {url: `/api/alarms/by-scope`, method: 'GET',
        params, signal
    },
      );
    }
  

export const getGetAlarmListByScopeQueryKey = (params?: GetAlarmListByScopeParams,) => {
    return [`/api/alarms/by-scope`, ...(params ? [params]: [])] as const;
    }

    
export const getGetAlarmListByScopeQueryOptions = <TData = Awaited<ReturnType<typeof getAlarmListByScope>>, TError = unknown>(params?: GetAlarmListByScopeParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getAlarmListByScope>>, TError, TData>>, }
) => {

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

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

  

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

      

      

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

export type GetAlarmListByScopeQueryResult = NonNullable<Awaited<ReturnType<typeof getAlarmListByScope>>>
export type GetAlarmListByScopeQueryError = unknown


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

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

  const queryOptions = getGetAlarmListByScopeQueryOptions(params,options)

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

  query.queryKey = queryOptions.queryKey ;

  return query;
}



