/**
 * 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 {
  RoleModel
} from './client.schemas';

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





export const getRoleList = (
    
 signal?: AbortSignal
) => {
      
      
      return customClient<RoleModel[]>(
      {url: `/api/roles`, method: 'GET', signal
    },
      );
    }
  

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

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

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

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

  

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

      

      

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

export type GetRoleListQueryResult = NonNullable<Awaited<ReturnType<typeof getRoleList>>>
export type GetRoleListQueryError = unknown


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

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

  const queryOptions = getGetRoleListQueryOptions(options)

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

  query.queryKey = queryOptions.queryKey ;

  return query;
}



