/**
 * Generated by orval v8.0.0-rc.0 🍺
 * Do not edit manually.
 * VCCI
 * Coded by Meu TEAM
 * OpenAPI spec version: 1.0.0
 */
import {
  useInfiniteQuery,
  useMutation,
  useQuery
} from '@tanstack/react-query';
import type {
  DataTag,
  DefinedInitialDataOptions,
  DefinedUseInfiniteQueryResult,
  DefinedUseQueryResult,
  InfiniteData,
  MutationFunction,
  QueryClient,
  QueryFunction,
  QueryKey,
  UndefinedInitialDataOptions,
  UseInfiniteQueryOptions,
  UseInfiniteQueryResult,
  UseMutationOptions,
  UseMutationResult,
  UseQueryOptions,
  UseQueryResult
} from '@tanstack/react-query';

import type {
  PostValidatorOrgCodeBody,
  Response,
  UserRegisterBody
} from '../models';

import { useCustomClient } from '../mutator/custom-client';
import type { ErrorType , BodyType } from '../mutator/custom-client';



type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];



/**
 * Verify User
 */
export type postValidatorAddUserInfoResponse200 = {
  data: Response
  status: 200
}
    
export type postValidatorAddUserInfoResponseSuccess = (postValidatorAddUserInfoResponse200) & {
  headers: Headers;
};
;

export type postValidatorAddUserInfoResponse = (postValidatorAddUserInfoResponseSuccess)

export const getPostValidatorAddUserInfoUrl = () => {


  

  return `/validator/addUserInfo`
}

export const postValidatorAddUserInfo = async (userRegisterBody: UserRegisterBody, options?: RequestInit): Promise<postValidatorAddUserInfoResponse> => {
  
  return useCustomClient<postValidatorAddUserInfoResponse>(getPostValidatorAddUserInfoUrl(),
  {      
    ...options,
    method: 'POST',
    headers: { 'Content-Type': 'application/json', ...options?.headers },
    body: JSON.stringify(
      userRegisterBody,)
  }
);}




export const getPostValidatorAddUserInfoMutationOptions = <TError = ErrorType<unknown>,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postValidatorAddUserInfo>>, TError,{data: BodyType<UserRegisterBody>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof postValidatorAddUserInfo>>, TError,{data: BodyType<UserRegisterBody>}, TContext> => {

const mutationKey = ['postValidatorAddUserInfo'];
const {mutation: mutationOptions, request: requestOptions} = options ?
      options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
      options
      : {...options, mutation: {...options.mutation, mutationKey}}
      : {mutation: { mutationKey, }, request: undefined};

      


      const mutationFn: MutationFunction<Awaited<ReturnType<typeof postValidatorAddUserInfo>>, {data: BodyType<UserRegisterBody>}> = (props) => {
          const {data} = props ?? {};

          return  postValidatorAddUserInfo(data,requestOptions)
        }

        


  return  { mutationFn, ...mutationOptions }}

    export type PostValidatorAddUserInfoMutationResult = NonNullable<Awaited<ReturnType<typeof postValidatorAddUserInfo>>>
    export type PostValidatorAddUserInfoMutationBody = BodyType<UserRegisterBody>
    export type PostValidatorAddUserInfoMutationError = ErrorType<unknown>

    export const usePostValidatorAddUserInfo = <TError = ErrorType<unknown>,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postValidatorAddUserInfo>>, TError,{data: BodyType<UserRegisterBody>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
 , queryClient?: QueryClient): UseMutationResult<
        Awaited<ReturnType<typeof postValidatorAddUserInfo>>,
        TError,
        {data: BodyType<UserRegisterBody>},
        TContext
      > => {

      const mutationOptions = getPostValidatorAddUserInfoMutationOptions(options);

      return useMutation(mutationOptions, queryClient);
    }
    /**
 * Verify event slots
 */
export type postValidatorCheckEventSlotsEventIdResponse200 = {
  data: Response
  status: 200
}
    
export type postValidatorCheckEventSlotsEventIdResponseSuccess = (postValidatorCheckEventSlotsEventIdResponse200) & {
  headers: Headers;
};
;

export type postValidatorCheckEventSlotsEventIdResponse = (postValidatorCheckEventSlotsEventIdResponseSuccess)

export const getPostValidatorCheckEventSlotsEventIdUrl = (eventId: string,) => {


  

  return `/validator/checkEventSlots/${eventId}`
}

export const postValidatorCheckEventSlotsEventId = async (eventId: string, options?: RequestInit): Promise<postValidatorCheckEventSlotsEventIdResponse> => {
  
  return useCustomClient<postValidatorCheckEventSlotsEventIdResponse>(getPostValidatorCheckEventSlotsEventIdUrl(eventId),
  {      
    ...options,
    method: 'POST'
    
    
  }
);}




export const getPostValidatorCheckEventSlotsEventIdMutationOptions = <TError = ErrorType<unknown>,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postValidatorCheckEventSlotsEventId>>, TError,{eventId: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof postValidatorCheckEventSlotsEventId>>, TError,{eventId: string}, TContext> => {

const mutationKey = ['postValidatorCheckEventSlotsEventId'];
const {mutation: mutationOptions, request: requestOptions} = options ?
      options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
      options
      : {...options, mutation: {...options.mutation, mutationKey}}
      : {mutation: { mutationKey, }, request: undefined};

      


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

          return  postValidatorCheckEventSlotsEventId(eventId,requestOptions)
        }

        


  return  { mutationFn, ...mutationOptions }}

    export type PostValidatorCheckEventSlotsEventIdMutationResult = NonNullable<Awaited<ReturnType<typeof postValidatorCheckEventSlotsEventId>>>
    
    export type PostValidatorCheckEventSlotsEventIdMutationError = ErrorType<unknown>

    export const usePostValidatorCheckEventSlotsEventId = <TError = ErrorType<unknown>,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postValidatorCheckEventSlotsEventId>>, TError,{eventId: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
 , queryClient?: QueryClient): UseMutationResult<
        Awaited<ReturnType<typeof postValidatorCheckEventSlotsEventId>>,
        TError,
        {eventId: string},
        TContext
      > => {

      const mutationOptions = getPostValidatorCheckEventSlotsEventIdMutationOptions(options);

      return useMutation(mutationOptions, queryClient);
    }
    /**
 * check email exists
 */
export type getValidatorEmailExistsEmailResponse200 = {
  data: Response
  status: 200
}
    
export type getValidatorEmailExistsEmailResponseSuccess = (getValidatorEmailExistsEmailResponse200) & {
  headers: Headers;
};
;

export type getValidatorEmailExistsEmailResponse = (getValidatorEmailExistsEmailResponseSuccess)

export const getGetValidatorEmailExistsEmailUrl = (email: string,) => {


  

  return `/validator/emailExists/${email}`
}

export const getValidatorEmailExistsEmail = async (email: string, options?: RequestInit): Promise<getValidatorEmailExistsEmailResponse> => {
  
  return useCustomClient<getValidatorEmailExistsEmailResponse>(getGetValidatorEmailExistsEmailUrl(email),
  {      
    ...options,
    method: 'GET'
    
    
  }
);}





export const getGetValidatorEmailExistsEmailInfiniteQueryKey = (email?: string,) => {
    return [
    'infinite', `/validator/emailExists/${email}`
    ] as const;
    }

export const getGetValidatorEmailExistsEmailQueryKey = (email?: string,) => {
    return [
    `/validator/emailExists/${email}`
    ] as const;
    }

    
export const getGetValidatorEmailExistsEmailInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>>, TError = ErrorType<unknown>>(email: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {

const {query: queryOptions, request: requestOptions} = options ?? {};

  const queryKey =  queryOptions?.queryKey ?? getGetValidatorEmailExistsEmailInfiniteQueryKey(email);

  

    const queryFn: QueryFunction<Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>> = ({ signal }) => getValidatorEmailExistsEmail(email, { signal, ...requestOptions });

      

      

   return  { queryKey, queryFn, enabled: !!(email),  retry: 3, retryDelay: 1000,  ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}

export type GetValidatorEmailExistsEmailInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>>
export type GetValidatorEmailExistsEmailInfiniteQueryError = ErrorType<unknown>


export function useGetValidatorEmailExistsEmailInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>>, TError = ErrorType<unknown>>(
 email: string, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>, TError, TData>> & Pick<
        DefinedInitialDataOptions<
          Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>,
          TError,
          Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>
        > , 'initialData'
      >, request?: SecondParameter<typeof useCustomClient>}
 , queryClient?: QueryClient
  ):  DefinedUseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetValidatorEmailExistsEmailInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>>, TError = ErrorType<unknown>>(
 email: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>, TError, TData>> & Pick<
        UndefinedInitialDataOptions<
          Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>,
          TError,
          Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>
        > , 'initialData'
      >, request?: SecondParameter<typeof useCustomClient>}
 , queryClient?: QueryClient
  ):  UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetValidatorEmailExistsEmailInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>>, TError = ErrorType<unknown>>(
 email: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
 , queryClient?: QueryClient
  ):  UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }

export function useGetValidatorEmailExistsEmailInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>>, TError = ErrorType<unknown>>(
 email: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
 , queryClient?: QueryClient 
 ):  UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {

  const queryOptions = getGetValidatorEmailExistsEmailInfiniteQueryOptions(email,options)

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

  query.queryKey = queryOptions.queryKey ;

  return query;
}

export const prefetchGetValidatorEmailExistsEmailInfiniteQuery = async <TData = Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>, TError = ErrorType<unknown>>(
 queryClient: QueryClient, email: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}

  ): Promise<QueryClient> => {

  const queryOptions = getGetValidatorEmailExistsEmailInfiniteQueryOptions(email,options)

  await queryClient.prefetchInfiniteQuery(queryOptions);

  return queryClient;
}



export const getGetValidatorEmailExistsEmailQueryOptions = <TData = Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>, TError = ErrorType<unknown>>(email: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {

const {query: queryOptions, request: requestOptions} = options ?? {};

  const queryKey =  queryOptions?.queryKey ?? getGetValidatorEmailExistsEmailQueryKey(email);

  

    const queryFn: QueryFunction<Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>> = ({ signal }) => getValidatorEmailExistsEmail(email, { signal, ...requestOptions });

      

      

   return  { queryKey, queryFn, enabled: !!(email),  retry: 3, retryDelay: 1000,  ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}

export type GetValidatorEmailExistsEmailQueryResult = NonNullable<Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>>
export type GetValidatorEmailExistsEmailQueryError = ErrorType<unknown>


export function useGetValidatorEmailExistsEmail<TData = Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>, TError = ErrorType<unknown>>(
 email: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>, TError, TData>> & Pick<
        DefinedInitialDataOptions<
          Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>,
          TError,
          Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>
        > , 'initialData'
      >, request?: SecondParameter<typeof useCustomClient>}
 , queryClient?: QueryClient
  ):  DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetValidatorEmailExistsEmail<TData = Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>, TError = ErrorType<unknown>>(
 email: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>, TError, TData>> & Pick<
        UndefinedInitialDataOptions<
          Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>,
          TError,
          Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>
        > , 'initialData'
      >, request?: SecondParameter<typeof useCustomClient>}
 , queryClient?: QueryClient
  ):  UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetValidatorEmailExistsEmail<TData = Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>, TError = ErrorType<unknown>>(
 email: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
 , queryClient?: QueryClient
  ):  UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }

export function useGetValidatorEmailExistsEmail<TData = Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>, TError = ErrorType<unknown>>(
 email: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
 , queryClient?: QueryClient 
 ):  UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {

  const queryOptions = getGetValidatorEmailExistsEmailQueryOptions(email,options)

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

  query.queryKey = queryOptions.queryKey ;

  return query;
}

export const prefetchGetValidatorEmailExistsEmailQuery = async <TData = Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>, TError = ErrorType<unknown>>(
 queryClient: QueryClient, email: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getValidatorEmailExistsEmail>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}

  ): Promise<QueryClient> => {

  const queryOptions = getGetValidatorEmailExistsEmailQueryOptions(email,options)

  await queryClient.prefetchQuery(queryOptions);

  return queryClient;
}



/**
 * Verify User
 */
export type postValidatorOrgCodeResponse200 = {
  data: Response
  status: 200
}
    
export type postValidatorOrgCodeResponseSuccess = (postValidatorOrgCodeResponse200) & {
  headers: Headers;
};
;

export type postValidatorOrgCodeResponse = (postValidatorOrgCodeResponseSuccess)

export const getPostValidatorOrgCodeUrl = () => {


  

  return `/validator/orgCode`
}

export const postValidatorOrgCode = async (postValidatorOrgCodeBody: PostValidatorOrgCodeBody, options?: RequestInit): Promise<postValidatorOrgCodeResponse> => {
  
  return useCustomClient<postValidatorOrgCodeResponse>(getPostValidatorOrgCodeUrl(),
  {      
    ...options,
    method: 'POST',
    headers: { 'Content-Type': 'application/json', ...options?.headers },
    body: JSON.stringify(
      postValidatorOrgCodeBody,)
  }
);}




export const getPostValidatorOrgCodeMutationOptions = <TError = ErrorType<unknown>,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postValidatorOrgCode>>, TError,{data: BodyType<PostValidatorOrgCodeBody>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof postValidatorOrgCode>>, TError,{data: BodyType<PostValidatorOrgCodeBody>}, TContext> => {

const mutationKey = ['postValidatorOrgCode'];
const {mutation: mutationOptions, request: requestOptions} = options ?
      options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
      options
      : {...options, mutation: {...options.mutation, mutationKey}}
      : {mutation: { mutationKey, }, request: undefined};

      


      const mutationFn: MutationFunction<Awaited<ReturnType<typeof postValidatorOrgCode>>, {data: BodyType<PostValidatorOrgCodeBody>}> = (props) => {
          const {data} = props ?? {};

          return  postValidatorOrgCode(data,requestOptions)
        }

        


  return  { mutationFn, ...mutationOptions }}

    export type PostValidatorOrgCodeMutationResult = NonNullable<Awaited<ReturnType<typeof postValidatorOrgCode>>>
    export type PostValidatorOrgCodeMutationBody = BodyType<PostValidatorOrgCodeBody>
    export type PostValidatorOrgCodeMutationError = ErrorType<unknown>

    export const usePostValidatorOrgCode = <TError = ErrorType<unknown>,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postValidatorOrgCode>>, TError,{data: BodyType<PostValidatorOrgCodeBody>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
 , queryClient?: QueryClient): UseMutationResult<
        Awaited<ReturnType<typeof postValidatorOrgCode>>,
        TError,
        {data: BodyType<PostValidatorOrgCodeBody>},
        TContext
      > => {

      const mutationOptions = getPostValidatorOrgCodeMutationOptions(options);

      return useMutation(mutationOptions, queryClient);
    }
    