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

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





export const createExport = (
    createExportRequest: CreateExportRequest,
 signal?: AbortSignal
) => {
      
      
      return customClient<Blob>(
      {url: `/api/exports`, method: 'POST',
      headers: {'Content-Type': 'application/json', },
      data: createExportRequest,
        responseType: 'blob', signal
    },
      );
    }
  


export const getCreateExportMutationOptions = <TError = string,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createExport>>, TError,{data: CreateExportRequest}, TContext>, }
): UseMutationOptions<Awaited<ReturnType<typeof createExport>>, TError,{data: CreateExportRequest}, TContext> => {

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

          return  createExport(data,)
        }

        


  return  { mutationFn, ...mutationOptions }}

    export type CreateExportMutationResult = NonNullable<Awaited<ReturnType<typeof createExport>>>
    export type CreateExportMutationBody = CreateExportRequest
    export type CreateExportMutationError = string

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

      const mutationOptions = getCreateExportMutationOptions(options);

      return useMutation(mutationOptions , queryClient);
    }
    