/**
 * Generated by orval v8.0.0-rc.0 🍺
 * Do not edit manually.
 * VietProDev CMS Backend API
 * Generated API documentation
 * 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 {
  ContactMutate,
  DeleteApiV10ContactId200,
  GetApiV10ContactId200,
  GetApiV10ContactParams,
  PostApiV10Contact200,
  PutApiV10ContactId200,
  ResponseGetAllData
} from '../models';






/**
 * Retrieve a single contact record by its ID
 * @summary Get contact by ID
 */
export type getApiV10ContactIdResponse200 = {
  data: GetApiV10ContactId200
  status: 200
}

export type getApiV10ContactIdResponse404 = {
  data: void
  status: 404
}
    
export type getApiV10ContactIdResponseSuccess = (getApiV10ContactIdResponse200) & {
  headers: Headers;
};
export type getApiV10ContactIdResponseError = (getApiV10ContactIdResponse404) & {
  headers: Headers;
};

export type getApiV10ContactIdResponse = (getApiV10ContactIdResponseSuccess | getApiV10ContactIdResponseError)

export const getGetApiV10ContactIdUrl = (id: string,) => {


  

  return `/api/v1.0/contact/${id}`
}

export const getApiV10ContactId = async (id: string, options?: RequestInit): Promise<getApiV10ContactIdResponse> => {
  
  const res = await fetch(getGetApiV10ContactIdUrl(id),
  {      
    ...options,
    method: 'GET'
    
    
  }
)

  const body = [204, 205, 304].includes(res.status) ? null : await res.text();
  
  const data: getApiV10ContactIdResponse['data'] = body ? JSON.parse(body) : {}
  return { data, status: res.status, headers: res.headers } as getApiV10ContactIdResponse
}





export const getGetApiV10ContactIdInfiniteQueryKey = (id?: string,) => {
    return [
    'infinite', `/api/v1.0/contact/${id}`
    ] as const;
    }

export const getGetApiV10ContactIdQueryKey = (id?: string,) => {
    return [
    `/api/v1.0/contact/${id}`
    ] as const;
    }

    
export const getGetApiV10ContactIdInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getApiV10ContactId>>>, TError = void>(id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10ContactId>>, TError, TData>>, fetch?: RequestInit}
) => {

const {query: queryOptions, fetch: fetchOptions} = options ?? {};

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

  

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

      

      

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

export type GetApiV10ContactIdInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10ContactId>>>
export type GetApiV10ContactIdInfiniteQueryError = void


export function useGetApiV10ContactIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10ContactId>>>, TError = void>(
 id: string, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10ContactId>>, TError, TData>> & Pick<
        DefinedInitialDataOptions<
          Awaited<ReturnType<typeof getApiV10ContactId>>,
          TError,
          Awaited<ReturnType<typeof getApiV10ContactId>>
        > , 'initialData'
      >, fetch?: RequestInit}
 , queryClient?: QueryClient
  ):  DefinedUseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetApiV10ContactIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10ContactId>>>, TError = void>(
 id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10ContactId>>, TError, TData>> & Pick<
        UndefinedInitialDataOptions<
          Awaited<ReturnType<typeof getApiV10ContactId>>,
          TError,
          Awaited<ReturnType<typeof getApiV10ContactId>>
        > , 'initialData'
      >, fetch?: RequestInit}
 , queryClient?: QueryClient
  ):  UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetApiV10ContactIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10ContactId>>>, TError = void>(
 id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10ContactId>>, TError, TData>>, fetch?: RequestInit}
 , queryClient?: QueryClient
  ):  UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
 * @summary Get contact by ID
 */

export function useGetApiV10ContactIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10ContactId>>>, TError = void>(
 id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10ContactId>>, TError, TData>>, fetch?: RequestInit}
 , queryClient?: QueryClient 
 ):  UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {

  const queryOptions = getGetApiV10ContactIdInfiniteQueryOptions(id,options)

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

  query.queryKey = queryOptions.queryKey ;

  return query;
}

/**
 * @summary Get contact by ID
 */
export const prefetchGetApiV10ContactIdInfiniteQuery = async <TData = Awaited<ReturnType<typeof getApiV10ContactId>>, TError = void>(
 queryClient: QueryClient, id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10ContactId>>, TError, TData>>, fetch?: RequestInit}

  ): Promise<QueryClient> => {

  const queryOptions = getGetApiV10ContactIdInfiniteQueryOptions(id,options)

  await queryClient.prefetchInfiniteQuery(queryOptions);

  return queryClient;
}



export const getGetApiV10ContactIdQueryOptions = <TData = Awaited<ReturnType<typeof getApiV10ContactId>>, TError = void>(id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10ContactId>>, TError, TData>>, fetch?: RequestInit}
) => {

const {query: queryOptions, fetch: fetchOptions} = options ?? {};

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

  

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

      

      

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

export type GetApiV10ContactIdQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10ContactId>>>
export type GetApiV10ContactIdQueryError = void


export function useGetApiV10ContactId<TData = Awaited<ReturnType<typeof getApiV10ContactId>>, TError = void>(
 id: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10ContactId>>, TError, TData>> & Pick<
        DefinedInitialDataOptions<
          Awaited<ReturnType<typeof getApiV10ContactId>>,
          TError,
          Awaited<ReturnType<typeof getApiV10ContactId>>
        > , 'initialData'
      >, fetch?: RequestInit}
 , queryClient?: QueryClient
  ):  DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetApiV10ContactId<TData = Awaited<ReturnType<typeof getApiV10ContactId>>, TError = void>(
 id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10ContactId>>, TError, TData>> & Pick<
        UndefinedInitialDataOptions<
          Awaited<ReturnType<typeof getApiV10ContactId>>,
          TError,
          Awaited<ReturnType<typeof getApiV10ContactId>>
        > , 'initialData'
      >, fetch?: RequestInit}
 , queryClient?: QueryClient
  ):  UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetApiV10ContactId<TData = Awaited<ReturnType<typeof getApiV10ContactId>>, TError = void>(
 id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10ContactId>>, TError, TData>>, fetch?: RequestInit}
 , queryClient?: QueryClient
  ):  UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
 * @summary Get contact by ID
 */

export function useGetApiV10ContactId<TData = Awaited<ReturnType<typeof getApiV10ContactId>>, TError = void>(
 id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10ContactId>>, TError, TData>>, fetch?: RequestInit}
 , queryClient?: QueryClient 
 ):  UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {

  const queryOptions = getGetApiV10ContactIdQueryOptions(id,options)

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

  query.queryKey = queryOptions.queryKey ;

  return query;
}

/**
 * @summary Get contact by ID
 */
export const prefetchGetApiV10ContactIdQuery = async <TData = Awaited<ReturnType<typeof getApiV10ContactId>>, TError = void>(
 queryClient: QueryClient, id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10ContactId>>, TError, TData>>, fetch?: RequestInit}

  ): Promise<QueryClient> => {

  const queryOptions = getGetApiV10ContactIdQueryOptions(id,options)

  await queryClient.prefetchQuery(queryOptions);

  return queryClient;
}



/**
 * Update a single contact record by its ID
 * @summary Update contact by ID
 */
export type putApiV10ContactIdResponse200 = {
  data: PutApiV10ContactId200
  status: 200
}

export type putApiV10ContactIdResponse404 = {
  data: void
  status: 404
}
    
export type putApiV10ContactIdResponseSuccess = (putApiV10ContactIdResponse200) & {
  headers: Headers;
};
export type putApiV10ContactIdResponseError = (putApiV10ContactIdResponse404) & {
  headers: Headers;
};

export type putApiV10ContactIdResponse = (putApiV10ContactIdResponseSuccess | putApiV10ContactIdResponseError)

export const getPutApiV10ContactIdUrl = (id: string,) => {


  

  return `/api/v1.0/contact/${id}`
}

export const putApiV10ContactId = async (id: string,
    contactMutate: ContactMutate, options?: RequestInit): Promise<putApiV10ContactIdResponse> => {
  
  const res = await fetch(getPutApiV10ContactIdUrl(id),
  {      
    ...options,
    method: 'PUT',
    headers: { 'Content-Type': 'application/json', ...options?.headers },
    body: JSON.stringify(
      contactMutate,)
  }
)

  const body = [204, 205, 304].includes(res.status) ? null : await res.text();
  
  const data: putApiV10ContactIdResponse['data'] = body ? JSON.parse(body) : {}
  return { data, status: res.status, headers: res.headers } as putApiV10ContactIdResponse
}




export const getPutApiV10ContactIdMutationOptions = <TError = void,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putApiV10ContactId>>, TError,{id: string;data: ContactMutate}, TContext>, fetch?: RequestInit}
): UseMutationOptions<Awaited<ReturnType<typeof putApiV10ContactId>>, TError,{id: string;data: ContactMutate}, TContext> => {

const mutationKey = ['putApiV10ContactId'];
const {mutation: mutationOptions, fetch: fetchOptions} = options ?
      options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
      options
      : {...options, mutation: {...options.mutation, mutationKey}}
      : {mutation: { mutationKey, }, fetch: undefined};

      


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

          return  putApiV10ContactId(id,data,fetchOptions)
        }

        


  return  { mutationFn, ...mutationOptions }}

    export type PutApiV10ContactIdMutationResult = NonNullable<Awaited<ReturnType<typeof putApiV10ContactId>>>
    export type PutApiV10ContactIdMutationBody = ContactMutate
    export type PutApiV10ContactIdMutationError = void

    /**
 * @summary Update contact by ID
 */
export const usePutApiV10ContactId = <TError = void,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putApiV10ContactId>>, TError,{id: string;data: ContactMutate}, TContext>, fetch?: RequestInit}
 , queryClient?: QueryClient): UseMutationResult<
        Awaited<ReturnType<typeof putApiV10ContactId>>,
        TError,
        {id: string;data: ContactMutate},
        TContext
      > => {

      const mutationOptions = getPutApiV10ContactIdMutationOptions(options);

      return useMutation(mutationOptions, queryClient);
    }
    /**
 * Delete a single contact record by its ID
 * @summary Delete contact by ID
 */
export type deleteApiV10ContactIdResponse200 = {
  data: DeleteApiV10ContactId200
  status: 200
}

export type deleteApiV10ContactIdResponse404 = {
  data: void
  status: 404
}
    
export type deleteApiV10ContactIdResponseSuccess = (deleteApiV10ContactIdResponse200) & {
  headers: Headers;
};
export type deleteApiV10ContactIdResponseError = (deleteApiV10ContactIdResponse404) & {
  headers: Headers;
};

export type deleteApiV10ContactIdResponse = (deleteApiV10ContactIdResponseSuccess | deleteApiV10ContactIdResponseError)

export const getDeleteApiV10ContactIdUrl = (id: string,) => {


  

  return `/api/v1.0/contact/${id}`
}

export const deleteApiV10ContactId = async (id: string, options?: RequestInit): Promise<deleteApiV10ContactIdResponse> => {
  
  const res = await fetch(getDeleteApiV10ContactIdUrl(id),
  {      
    ...options,
    method: 'DELETE'
    
    
  }
)

  const body = [204, 205, 304].includes(res.status) ? null : await res.text();
  
  const data: deleteApiV10ContactIdResponse['data'] = body ? JSON.parse(body) : {}
  return { data, status: res.status, headers: res.headers } as deleteApiV10ContactIdResponse
}




export const getDeleteApiV10ContactIdMutationOptions = <TError = void,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteApiV10ContactId>>, TError,{id: string}, TContext>, fetch?: RequestInit}
): UseMutationOptions<Awaited<ReturnType<typeof deleteApiV10ContactId>>, TError,{id: string}, TContext> => {

const mutationKey = ['deleteApiV10ContactId'];
const {mutation: mutationOptions, fetch: fetchOptions} = options ?
      options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
      options
      : {...options, mutation: {...options.mutation, mutationKey}}
      : {mutation: { mutationKey, }, fetch: undefined};

      


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

          return  deleteApiV10ContactId(id,fetchOptions)
        }

        


  return  { mutationFn, ...mutationOptions }}

    export type DeleteApiV10ContactIdMutationResult = NonNullable<Awaited<ReturnType<typeof deleteApiV10ContactId>>>
    
    export type DeleteApiV10ContactIdMutationError = void

    /**
 * @summary Delete contact by ID
 */
export const useDeleteApiV10ContactId = <TError = void,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteApiV10ContactId>>, TError,{id: string}, TContext>, fetch?: RequestInit}
 , queryClient?: QueryClient): UseMutationResult<
        Awaited<ReturnType<typeof deleteApiV10ContactId>>,
        TError,
        {id: string},
        TContext
      > => {

      const mutationOptions = getDeleteApiV10ContactIdMutationOptions(options);

      return useMutation(mutationOptions, queryClient);
    }
    /**
 * Retrieve a list of contact with pagination, filtering and sorting
 * @summary Get all contact
 */
export type getApiV10ContactResponse200 = {
  data: ResponseGetAllData
  status: 200
}
    
export type getApiV10ContactResponseSuccess = (getApiV10ContactResponse200) & {
  headers: Headers;
};
;

export type getApiV10ContactResponse = (getApiV10ContactResponseSuccess)

export const getGetApiV10ContactUrl = (params?: GetApiV10ContactParams,) => {
  const normalizedParams = new URLSearchParams();

  Object.entries(params || {}).forEach(([key, value]) => {
    
    if (value !== undefined) {
      normalizedParams.append(key, value === null ? 'null' : value.toString())
    }
  });

  const stringifiedParams = normalizedParams.toString();

  return stringifiedParams.length > 0 ? `/api/v1.0/contact?${stringifiedParams}` : `/api/v1.0/contact`
}

export const getApiV10Contact = async (params?: GetApiV10ContactParams, options?: RequestInit): Promise<getApiV10ContactResponse> => {
  
  const res = await fetch(getGetApiV10ContactUrl(params),
  {      
    ...options,
    method: 'GET'
    
    
  }
)

  const body = [204, 205, 304].includes(res.status) ? null : await res.text();
  
  const data: getApiV10ContactResponse['data'] = body ? JSON.parse(body) : {}
  return { data, status: res.status, headers: res.headers } as getApiV10ContactResponse
}





export const getGetApiV10ContactInfiniteQueryKey = (params?: GetApiV10ContactParams,) => {
    return [
    'infinite', `/api/v1.0/contact`, ...(params ? [params]: [])
    ] as const;
    }

export const getGetApiV10ContactQueryKey = (params?: GetApiV10ContactParams,) => {
    return [
    `/api/v1.0/contact`, ...(params ? [params]: [])
    ] as const;
    }

    
export const getGetApiV10ContactInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getApiV10Contact>>>, TError = unknown>(params?: GetApiV10ContactParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Contact>>, TError, TData>>, fetch?: RequestInit}
) => {

const {query: queryOptions, fetch: fetchOptions} = options ?? {};

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

  

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

      

      

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

export type GetApiV10ContactInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10Contact>>>
export type GetApiV10ContactInfiniteQueryError = unknown


export function useGetApiV10ContactInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10Contact>>>, TError = unknown>(
 params: undefined |  GetApiV10ContactParams, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Contact>>, TError, TData>> & Pick<
        DefinedInitialDataOptions<
          Awaited<ReturnType<typeof getApiV10Contact>>,
          TError,
          Awaited<ReturnType<typeof getApiV10Contact>>
        > , 'initialData'
      >, fetch?: RequestInit}
 , queryClient?: QueryClient
  ):  DefinedUseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetApiV10ContactInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10Contact>>>, TError = unknown>(
 params?: GetApiV10ContactParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Contact>>, TError, TData>> & Pick<
        UndefinedInitialDataOptions<
          Awaited<ReturnType<typeof getApiV10Contact>>,
          TError,
          Awaited<ReturnType<typeof getApiV10Contact>>
        > , 'initialData'
      >, fetch?: RequestInit}
 , queryClient?: QueryClient
  ):  UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetApiV10ContactInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10Contact>>>, TError = unknown>(
 params?: GetApiV10ContactParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Contact>>, TError, TData>>, fetch?: RequestInit}
 , queryClient?: QueryClient
  ):  UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
 * @summary Get all contact
 */

export function useGetApiV10ContactInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10Contact>>>, TError = unknown>(
 params?: GetApiV10ContactParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Contact>>, TError, TData>>, fetch?: RequestInit}
 , queryClient?: QueryClient 
 ):  UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {

  const queryOptions = getGetApiV10ContactInfiniteQueryOptions(params,options)

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

  query.queryKey = queryOptions.queryKey ;

  return query;
}

/**
 * @summary Get all contact
 */
export const prefetchGetApiV10ContactInfiniteQuery = async <TData = Awaited<ReturnType<typeof getApiV10Contact>>, TError = unknown>(
 queryClient: QueryClient, params?: GetApiV10ContactParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Contact>>, TError, TData>>, fetch?: RequestInit}

  ): Promise<QueryClient> => {

  const queryOptions = getGetApiV10ContactInfiniteQueryOptions(params,options)

  await queryClient.prefetchInfiniteQuery(queryOptions);

  return queryClient;
}



export const getGetApiV10ContactQueryOptions = <TData = Awaited<ReturnType<typeof getApiV10Contact>>, TError = unknown>(params?: GetApiV10ContactParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Contact>>, TError, TData>>, fetch?: RequestInit}
) => {

const {query: queryOptions, fetch: fetchOptions} = options ?? {};

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

  

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

      

      

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

export type GetApiV10ContactQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10Contact>>>
export type GetApiV10ContactQueryError = unknown


export function useGetApiV10Contact<TData = Awaited<ReturnType<typeof getApiV10Contact>>, TError = unknown>(
 params: undefined |  GetApiV10ContactParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Contact>>, TError, TData>> & Pick<
        DefinedInitialDataOptions<
          Awaited<ReturnType<typeof getApiV10Contact>>,
          TError,
          Awaited<ReturnType<typeof getApiV10Contact>>
        > , 'initialData'
      >, fetch?: RequestInit}
 , queryClient?: QueryClient
  ):  DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetApiV10Contact<TData = Awaited<ReturnType<typeof getApiV10Contact>>, TError = unknown>(
 params?: GetApiV10ContactParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Contact>>, TError, TData>> & Pick<
        UndefinedInitialDataOptions<
          Awaited<ReturnType<typeof getApiV10Contact>>,
          TError,
          Awaited<ReturnType<typeof getApiV10Contact>>
        > , 'initialData'
      >, fetch?: RequestInit}
 , queryClient?: QueryClient
  ):  UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetApiV10Contact<TData = Awaited<ReturnType<typeof getApiV10Contact>>, TError = unknown>(
 params?: GetApiV10ContactParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Contact>>, TError, TData>>, fetch?: RequestInit}
 , queryClient?: QueryClient
  ):  UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
 * @summary Get all contact
 */

export function useGetApiV10Contact<TData = Awaited<ReturnType<typeof getApiV10Contact>>, TError = unknown>(
 params?: GetApiV10ContactParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Contact>>, TError, TData>>, fetch?: RequestInit}
 , queryClient?: QueryClient 
 ):  UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {

  const queryOptions = getGetApiV10ContactQueryOptions(params,options)

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

  query.queryKey = queryOptions.queryKey ;

  return query;
}

/**
 * @summary Get all contact
 */
export const prefetchGetApiV10ContactQuery = async <TData = Awaited<ReturnType<typeof getApiV10Contact>>, TError = unknown>(
 queryClient: QueryClient, params?: GetApiV10ContactParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Contact>>, TError, TData>>, fetch?: RequestInit}

  ): Promise<QueryClient> => {

  const queryOptions = getGetApiV10ContactQueryOptions(params,options)

  await queryClient.prefetchQuery(queryOptions);

  return queryClient;
}



/**
 * Create a new contact record
 * @summary Create a contact
 */
export type postApiV10ContactResponse200 = {
  data: PostApiV10Contact200
  status: 200
}
    
export type postApiV10ContactResponseSuccess = (postApiV10ContactResponse200) & {
  headers: Headers;
};
;

export type postApiV10ContactResponse = (postApiV10ContactResponseSuccess)

export const getPostApiV10ContactUrl = () => {


  

  return `/api/v1.0/contact`
}

export const postApiV10Contact = async (contactMutate: ContactMutate, options?: RequestInit): Promise<postApiV10ContactResponse> => {
  
  const res = await fetch(getPostApiV10ContactUrl(),
  {      
    ...options,
    method: 'POST',
    headers: { 'Content-Type': 'application/json', ...options?.headers },
    body: JSON.stringify(
      contactMutate,)
  }
)

  const body = [204, 205, 304].includes(res.status) ? null : await res.text();
  
  const data: postApiV10ContactResponse['data'] = body ? JSON.parse(body) : {}
  return { data, status: res.status, headers: res.headers } as postApiV10ContactResponse
}




export const getPostApiV10ContactMutationOptions = <TError = unknown,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postApiV10Contact>>, TError,{data: ContactMutate}, TContext>, fetch?: RequestInit}
): UseMutationOptions<Awaited<ReturnType<typeof postApiV10Contact>>, TError,{data: ContactMutate}, TContext> => {

const mutationKey = ['postApiV10Contact'];
const {mutation: mutationOptions, fetch: fetchOptions} = options ?
      options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
      options
      : {...options, mutation: {...options.mutation, mutationKey}}
      : {mutation: { mutationKey, }, fetch: undefined};

      


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

          return  postApiV10Contact(data,fetchOptions)
        }

        


  return  { mutationFn, ...mutationOptions }}

    export type PostApiV10ContactMutationResult = NonNullable<Awaited<ReturnType<typeof postApiV10Contact>>>
    export type PostApiV10ContactMutationBody = ContactMutate
    export type PostApiV10ContactMutationError = unknown

    /**
 * @summary Create a contact
 */
export const usePostApiV10Contact = <TError = unknown,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postApiV10Contact>>, TError,{data: ContactMutate}, TContext>, fetch?: RequestInit}
 , queryClient?: QueryClient): UseMutationResult<
        Awaited<ReturnType<typeof postApiV10Contact>>,
        TError,
        {data: ContactMutate},
        TContext
      > => {

      const mutationOptions = getPostApiV10ContactMutationOptions(options);

      return useMutation(mutationOptions, queryClient);
    }
    