/**
 * 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 {
  LookingFor,
  Obj3Body,
  Response
} 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];



/**
 * Get
 */
export type getContactResponse200 = {
  data: Response
  status: 200
}
    
export type getContactResponseSuccess = (getContactResponse200) & {
  headers: Headers;
};
;

export type getContactResponse = (getContactResponseSuccess)

export const getGetContactUrl = () => {


  

  return `/contact`
}

export const getContact = async ( options?: RequestInit): Promise<getContactResponse> => {
  
  return useCustomClient<getContactResponse>(getGetContactUrl(),
  {      
    ...options,
    method: 'GET'
    
    
  }
);}





export const getGetContactInfiniteQueryKey = () => {
    return [
    'infinite', `/contact`
    ] as const;
    }

export const getGetContactQueryKey = () => {
    return [
    `/contact`
    ] as const;
    }

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

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

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

  

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

      

      

   return  { queryKey, queryFn,   retry: 3, retryDelay: 1000,  ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getContact>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}

export type GetContactInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getContact>>>
export type GetContactInfiniteQueryError = ErrorType<unknown>


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

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

  const queryOptions = getGetContactInfiniteQueryOptions(options)

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

  query.queryKey = queryOptions.queryKey ;

  return query;
}

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

  ): Promise<QueryClient> => {

  const queryOptions = getGetContactInfiniteQueryOptions(options)

  await queryClient.prefetchInfiniteQuery(queryOptions);

  return queryClient;
}



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

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

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

  

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

      

      

   return  { queryKey, queryFn,   retry: 3, retryDelay: 1000,  ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getContact>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}

export type GetContactQueryResult = NonNullable<Awaited<ReturnType<typeof getContact>>>
export type GetContactQueryError = ErrorType<unknown>


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

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

  const queryOptions = getGetContactQueryOptions(options)

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

  query.queryKey = queryOptions.queryKey ;

  return query;
}

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

  ): Promise<QueryClient> => {

  const queryOptions = getGetContactQueryOptions(options)

  await queryClient.prefetchQuery(queryOptions);

  return queryClient;
}



/**
 * Update contact
 */
export type putContactResponse200 = {
  data: Response
  status: 200
}
    
export type putContactResponseSuccess = (putContactResponse200) & {
  headers: Headers;
};
;

export type putContactResponse = (putContactResponseSuccess)

export const getPutContactUrl = () => {


  

  return `/contact`
}

export const putContact = async (obj3Body: Obj3Body, options?: RequestInit): Promise<putContactResponse> => {
  
  return useCustomClient<putContactResponse>(getPutContactUrl(),
  {      
    ...options,
    method: 'PUT',
    headers: { 'Content-Type': 'application/json', ...options?.headers },
    body: JSON.stringify(
      obj3Body,)
  }
);}




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

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

          return  putContact(data,requestOptions)
        }

        


  return  { mutationFn, ...mutationOptions }}

    export type PutContactMutationResult = NonNullable<Awaited<ReturnType<typeof putContact>>>
    export type PutContactMutationBody = BodyType<Obj3Body>
    export type PutContactMutationError = ErrorType<unknown>

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

      const mutationOptions = getPutContactMutationOptions(options);

      return useMutation(mutationOptions, queryClient);
    }
    /**
 * Post
 */
export type postContactSendEmailResponse200 = {
  data: Response
  status: 200
}
    
export type postContactSendEmailResponseSuccess = (postContactSendEmailResponse200) & {
  headers: Headers;
};
;

export type postContactSendEmailResponse = (postContactSendEmailResponseSuccess)

export const getPostContactSendEmailUrl = () => {


  

  return `/contact/sendEmail`
}

export const postContactSendEmail = async (lookingFor: LookingFor, options?: RequestInit): Promise<postContactSendEmailResponse> => {
  
  return useCustomClient<postContactSendEmailResponse>(getPostContactSendEmailUrl(),
  {      
    ...options,
    method: 'POST',
    headers: { 'Content-Type': 'application/json', ...options?.headers },
    body: JSON.stringify(
      lookingFor,)
  }
);}




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

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

          return  postContactSendEmail(data,requestOptions)
        }

        


  return  { mutationFn, ...mutationOptions }}

    export type PostContactSendEmailMutationResult = NonNullable<Awaited<ReturnType<typeof postContactSendEmail>>>
    export type PostContactSendEmailMutationBody = BodyType<LookingFor>
    export type PostContactSendEmailMutationError = ErrorType<unknown>

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

      const mutationOptions = getPostContactSendEmailMutationOptions(options);

      return useMutation(mutationOptions, queryClient);
    }
    