/**
 * 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 {
  CountOfEventsResponseModel,
  GetCountOfEventsParams,
  OnlineAssetStatusResponseModel
} from './client.schemas';

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





export const getAssetOnlineStatus = (
    
 signal?: AbortSignal
) => {
      
      
      return customClient<OnlineAssetStatusResponseModel>(
      {url: `/api/analytics/asset-online-status`, method: 'GET', signal
    },
      );
    }
  

export const getGetAssetOnlineStatusQueryKey = () => {
    return [`/api/analytics/asset-online-status`] as const;
    }

    
export const getGetAssetOnlineStatusQueryOptions = <TData = Awaited<ReturnType<typeof getAssetOnlineStatus>>, TError = unknown>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getAssetOnlineStatus>>, TError, TData>>, }
) => {

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

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

  

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

      

      

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

export type GetAssetOnlineStatusQueryResult = NonNullable<Awaited<ReturnType<typeof getAssetOnlineStatus>>>
export type GetAssetOnlineStatusQueryError = unknown


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

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

  const queryOptions = getGetAssetOnlineStatusQueryOptions(options)

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

  query.queryKey = queryOptions.queryKey ;

  return query;
}



export const getCountOfEvents = (
    params?: GetCountOfEventsParams,
 signal?: AbortSignal
) => {
      
      
      return customClient<CountOfEventsResponseModel>(
      {url: `/api/analytics/count-of-events`, method: 'GET',
        params, signal
    },
      );
    }
  

export const getGetCountOfEventsQueryKey = (params?: GetCountOfEventsParams,) => {
    return [`/api/analytics/count-of-events`, ...(params ? [params]: [])] as const;
    }

    
export const getGetCountOfEventsQueryOptions = <TData = Awaited<ReturnType<typeof getCountOfEvents>>, TError = unknown>(params?: GetCountOfEventsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getCountOfEvents>>, TError, TData>>, }
) => {

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

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

  

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

      

      

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

export type GetCountOfEventsQueryResult = NonNullable<Awaited<ReturnType<typeof getCountOfEvents>>>
export type GetCountOfEventsQueryError = unknown


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

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

  const queryOptions = getGetCountOfEventsQueryOptions(params,options)

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

  query.queryKey = queryOptions.queryKey ;

  return query;
}



