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

import type {
  AlarmScopeStatusChangingModel,
  NextAlarmScopeStatusRequest
} from './client.schemas';

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





export const nextAlarmScopeStatus = (
    alarmScopeId: string,
    nextAlarmScopeStatusRequest: NextAlarmScopeStatusRequest,
 ) => {
      
      
      return customClient<AlarmScopeStatusChangingModel>(
      {url: `/api/alarm-scopes/${alarmScopeId}/statuses`, method: 'PUT',
      headers: {'Content-Type': 'application/json', },
      data: nextAlarmScopeStatusRequest
    },
      );
    }
  


export const getNextAlarmScopeStatusMutationOptions = <TError = string,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof nextAlarmScopeStatus>>, TError,{alarmScopeId: string;data: NextAlarmScopeStatusRequest}, TContext>, }
): UseMutationOptions<Awaited<ReturnType<typeof nextAlarmScopeStatus>>, TError,{alarmScopeId: string;data: NextAlarmScopeStatusRequest}, TContext> => {

const mutationKey = ['nextAlarmScopeStatus'];
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 nextAlarmScopeStatus>>, {alarmScopeId: string;data: NextAlarmScopeStatusRequest}> = (props) => {
          const {alarmScopeId,data} = props ?? {};

          return  nextAlarmScopeStatus(alarmScopeId,data,)
        }

        


  return  { mutationFn, ...mutationOptions }}

    export type NextAlarmScopeStatusMutationResult = NonNullable<Awaited<ReturnType<typeof nextAlarmScopeStatus>>>
    export type NextAlarmScopeStatusMutationBody = NextAlarmScopeStatusRequest
    export type NextAlarmScopeStatusMutationError = string

    export const useNextAlarmScopeStatus = <TError = string,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof nextAlarmScopeStatus>>, TError,{alarmScopeId: string;data: NextAlarmScopeStatusRequest}, TContext>, }
 , queryClient?: QueryClient): UseMutationResult<
        Awaited<ReturnType<typeof nextAlarmScopeStatus>>,
        TError,
        {alarmScopeId: string;data: NextAlarmScopeStatusRequest},
        TContext
      > => {

      const mutationOptions = getNextAlarmScopeStatusMutationOptions(options);

      return useMutation(mutationOptions , queryClient);
    }
    