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

import type {
  CreateRequest4,
  GetAlarmResetCommentListParams,
  GetCommentResponse,
  ProblemDetails,
  TableDataResponseModelOfGetCommentListResponse,
  UpdateRequest3
} from './client.schemas';

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





export const createAlarmResetComment = (
    createRequest4: CreateRequest4,
 signal?: AbortSignal
) => {
      
      
      return customClient<CreateRequest4>(
      {url: `/api/alarm-reset-comments`, method: 'POST',
      headers: {'Content-Type': 'application/json', },
      data: createRequest4, signal
    },
      );
    }
  


export const getCreateAlarmResetCommentMutationOptions = <TError = string,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createAlarmResetComment>>, TError,{data: CreateRequest4}, TContext>, }
): UseMutationOptions<Awaited<ReturnType<typeof createAlarmResetComment>>, TError,{data: CreateRequest4}, TContext> => {

const mutationKey = ['createAlarmResetComment'];
const {mutation: mutationOptions} = options ?
      options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
      options
      : {...options, mutation: {...options.mutation, mutationKey}}
      : {mutation: { mutationKey, }};

      


      const mutationFn: MutationFunction<Awaited<ReturnType<typeof createAlarmResetComment>>, {data: CreateRequest4}> = (props) => {
          const {data} = props ?? {};

          return  createAlarmResetComment(data,)
        }

        


  return  { mutationFn, ...mutationOptions }}

    export type CreateAlarmResetCommentMutationResult = NonNullable<Awaited<ReturnType<typeof createAlarmResetComment>>>
    export type CreateAlarmResetCommentMutationBody = CreateRequest4
    export type CreateAlarmResetCommentMutationError = string

    export const useCreateAlarmResetComment = <TError = string,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createAlarmResetComment>>, TError,{data: CreateRequest4}, TContext>, }
 , queryClient?: QueryClient): UseMutationResult<
        Awaited<ReturnType<typeof createAlarmResetComment>>,
        TError,
        {data: CreateRequest4},
        TContext
      > => {

      const mutationOptions = getCreateAlarmResetCommentMutationOptions(options);

      return useMutation(mutationOptions , queryClient);
    }
    export const getAlarmResetCommentList = (
    params?: GetAlarmResetCommentListParams,
 signal?: AbortSignal
) => {
      
      
      return customClient<TableDataResponseModelOfGetCommentListResponse>(
      {url: `/api/alarm-reset-comments`, method: 'GET',
        params, signal
    },
      );
    }
  

export const getGetAlarmResetCommentListQueryKey = (params?: GetAlarmResetCommentListParams,) => {
    return [`/api/alarm-reset-comments`, ...(params ? [params]: [])] as const;
    }

    
export const getGetAlarmResetCommentListQueryOptions = <TData = Awaited<ReturnType<typeof getAlarmResetCommentList>>, TError = unknown>(params?: GetAlarmResetCommentListParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getAlarmResetCommentList>>, TError, TData>>, }
) => {

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

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

  

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

      

      

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

export type GetAlarmResetCommentListQueryResult = NonNullable<Awaited<ReturnType<typeof getAlarmResetCommentList>>>
export type GetAlarmResetCommentListQueryError = unknown


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

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

  const queryOptions = getGetAlarmResetCommentListQueryOptions(params,options)

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

  query.queryKey = queryOptions.queryKey ;

  return query;
}



export const updateAlarmResetComment = (
    id: string,
    updateRequest3: UpdateRequest3,
 ) => {
      
      
      return customClient<UpdateRequest3>(
      {url: `/api/alarm-reset-comments/${id}`, method: 'PUT',
      headers: {'Content-Type': 'application/json', },
      data: updateRequest3
    },
      );
    }
  


export const getUpdateAlarmResetCommentMutationOptions = <TError = ProblemDetails,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof updateAlarmResetComment>>, TError,{id: string;data: UpdateRequest3}, TContext>, }
): UseMutationOptions<Awaited<ReturnType<typeof updateAlarmResetComment>>, TError,{id: string;data: UpdateRequest3}, TContext> => {

const mutationKey = ['updateAlarmResetComment'];
const {mutation: mutationOptions} = options ?
      options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
      options
      : {...options, mutation: {...options.mutation, mutationKey}}
      : {mutation: { mutationKey, }};

      


      const mutationFn: MutationFunction<Awaited<ReturnType<typeof updateAlarmResetComment>>, {id: string;data: UpdateRequest3}> = (props) => {
          const {id,data} = props ?? {};

          return  updateAlarmResetComment(id,data,)
        }

        


  return  { mutationFn, ...mutationOptions }}

    export type UpdateAlarmResetCommentMutationResult = NonNullable<Awaited<ReturnType<typeof updateAlarmResetComment>>>
    export type UpdateAlarmResetCommentMutationBody = UpdateRequest3
    export type UpdateAlarmResetCommentMutationError = ProblemDetails

    export const useUpdateAlarmResetComment = <TError = ProblemDetails,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof updateAlarmResetComment>>, TError,{id: string;data: UpdateRequest3}, TContext>, }
 , queryClient?: QueryClient): UseMutationResult<
        Awaited<ReturnType<typeof updateAlarmResetComment>>,
        TError,
        {id: string;data: UpdateRequest3},
        TContext
      > => {

      const mutationOptions = getUpdateAlarmResetCommentMutationOptions(options);

      return useMutation(mutationOptions , queryClient);
    }
    export const deleteAlarmResetComment = (
    id: string,
 ) => {
      
      
      return customClient<void>(
      {url: `/api/alarm-reset-comments/${id}`, method: 'DELETE'
    },
      );
    }
  


export const getDeleteAlarmResetCommentMutationOptions = <TError = ProblemDetails,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteAlarmResetComment>>, TError,{id: string}, TContext>, }
): UseMutationOptions<Awaited<ReturnType<typeof deleteAlarmResetComment>>, TError,{id: string}, TContext> => {

const mutationKey = ['deleteAlarmResetComment'];
const {mutation: mutationOptions} = options ?
      options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
      options
      : {...options, mutation: {...options.mutation, mutationKey}}
      : {mutation: { mutationKey, }};

      


      const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteAlarmResetComment>>, {id: string}> = (props) => {
          const {id} = props ?? {};

          return  deleteAlarmResetComment(id,)
        }

        


  return  { mutationFn, ...mutationOptions }}

    export type DeleteAlarmResetCommentMutationResult = NonNullable<Awaited<ReturnType<typeof deleteAlarmResetComment>>>
    
    export type DeleteAlarmResetCommentMutationError = ProblemDetails

    export const useDeleteAlarmResetComment = <TError = ProblemDetails,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteAlarmResetComment>>, TError,{id: string}, TContext>, }
 , queryClient?: QueryClient): UseMutationResult<
        Awaited<ReturnType<typeof deleteAlarmResetComment>>,
        TError,
        {id: string},
        TContext
      > => {

      const mutationOptions = getDeleteAlarmResetCommentMutationOptions(options);

      return useMutation(mutationOptions , queryClient);
    }
    export const getAlarmResetComment = (
    id: string,
 signal?: AbortSignal
) => {
      
      
      return customClient<GetCommentResponse>(
      {url: `/api/alarm-reset-comments/${id}`, method: 'GET', signal
    },
      );
    }
  

export const getGetAlarmResetCommentQueryKey = (id: string,) => {
    return [`/api/alarm-reset-comments/${id}`] as const;
    }

    
export const getGetAlarmResetCommentQueryOptions = <TData = Awaited<ReturnType<typeof getAlarmResetComment>>, TError = ProblemDetails>(id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getAlarmResetComment>>, TError, TData>>, }
) => {

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

  const queryKey =  queryOptions?.queryKey ?? getGetAlarmResetCommentQueryKey(id);

  

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

      

      

   return  { queryKey, queryFn, enabled: !!(id), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getAlarmResetComment>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}

export type GetAlarmResetCommentQueryResult = NonNullable<Awaited<ReturnType<typeof getAlarmResetComment>>>
export type GetAlarmResetCommentQueryError = ProblemDetails


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

export function useGetAlarmResetComment<TData = Awaited<ReturnType<typeof getAlarmResetComment>>, TError = ProblemDetails>(
 id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getAlarmResetComment>>, TError, TData>>, }
 , queryClient?: QueryClient 
 ):  UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {

  const queryOptions = getGetAlarmResetCommentQueryOptions(id,options)

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

  query.queryKey = queryOptions.queryKey ;

  return query;
}



