/**
 * 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 {
  Footer,
  FooterBody,
  GetFooterParams,
  PutFooterParams,
  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 getFooterIdResponse200 = {
  data: Response
  status: 200
}
    
export type getFooterIdResponseSuccess = (getFooterIdResponse200) & {
  headers: Headers;
};
;

export type getFooterIdResponse = (getFooterIdResponseSuccess)

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


  

  return `/footer/${id}`
}

export const getFooterId = async (id: string, options?: RequestInit): Promise<getFooterIdResponse> => {
  
  return useCustomClient<getFooterIdResponse>(getGetFooterIdUrl(id),
  {      
    ...options,
    method: 'GET'
    
    
  }
);}





export const getGetFooterIdInfiniteQueryKey = (id?: string,) => {
    return [
    'infinite', `/footer/${id}`
    ] as const;
    }

export const getGetFooterIdQueryKey = (id?: string,) => {
    return [
    `/footer/${id}`
    ] as const;
    }

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

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

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

  

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

      

      

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

export type GetFooterIdInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getFooterId>>>
export type GetFooterIdInfiniteQueryError = ErrorType<unknown>


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

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

  const queryOptions = getGetFooterIdInfiniteQueryOptions(id,options)

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

  query.queryKey = queryOptions.queryKey ;

  return query;
}

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

  ): Promise<QueryClient> => {

  const queryOptions = getGetFooterIdInfiniteQueryOptions(id,options)

  await queryClient.prefetchInfiniteQuery(queryOptions);

  return queryClient;
}



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

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

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

  

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

      

      

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

export type GetFooterIdQueryResult = NonNullable<Awaited<ReturnType<typeof getFooterId>>>
export type GetFooterIdQueryError = ErrorType<unknown>


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

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

  const queryOptions = getGetFooterIdQueryOptions(id,options)

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

  query.queryKey = queryOptions.queryKey ;

  return query;
}

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

  ): Promise<QueryClient> => {

  const queryOptions = getGetFooterIdQueryOptions(id,options)

  await queryClient.prefetchQuery(queryOptions);

  return queryClient;
}



/**
 * Put
 */
export type putFooterIdResponse200 = {
  data: Response
  status: 200
}
    
export type putFooterIdResponseSuccess = (putFooterIdResponse200) & {
  headers: Headers;
};
;

export type putFooterIdResponse = (putFooterIdResponseSuccess)

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


  

  return `/footer/${id}`
}

export const putFooterId = async (id: string,
    footerBody: FooterBody, options?: RequestInit): Promise<putFooterIdResponse> => {
  
  return useCustomClient<putFooterIdResponse>(getPutFooterIdUrl(id),
  {      
    ...options,
    method: 'PUT',
    headers: { 'Content-Type': 'application/json', ...options?.headers },
    body: JSON.stringify(
      footerBody,)
  }
);}




export const getPutFooterIdMutationOptions = <TError = ErrorType<unknown>,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putFooterId>>, TError,{id: string;data: BodyType<FooterBody>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof putFooterId>>, TError,{id: string;data: BodyType<FooterBody>}, TContext> => {

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

          return  putFooterId(id,data,requestOptions)
        }

        


  return  { mutationFn, ...mutationOptions }}

    export type PutFooterIdMutationResult = NonNullable<Awaited<ReturnType<typeof putFooterId>>>
    export type PutFooterIdMutationBody = BodyType<FooterBody>
    export type PutFooterIdMutationError = ErrorType<unknown>

    export const usePutFooterId = <TError = ErrorType<unknown>,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putFooterId>>, TError,{id: string;data: BodyType<FooterBody>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
 , queryClient?: QueryClient): UseMutationResult<
        Awaited<ReturnType<typeof putFooterId>>,
        TError,
        {id: string;data: BodyType<FooterBody>},
        TContext
      > => {

      const mutationOptions = getPutFooterIdMutationOptions(options);

      return useMutation(mutationOptions, queryClient);
    }
    /**
 * Delete
 */
export type deleteFooterIdResponse200 = {
  data: Response
  status: 200
}
    
export type deleteFooterIdResponseSuccess = (deleteFooterIdResponse200) & {
  headers: Headers;
};
;

export type deleteFooterIdResponse = (deleteFooterIdResponseSuccess)

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


  

  return `/footer/${id}`
}

export const deleteFooterId = async (id: string, options?: RequestInit): Promise<deleteFooterIdResponse> => {
  
  return useCustomClient<deleteFooterIdResponse>(getDeleteFooterIdUrl(id),
  {      
    ...options,
    method: 'DELETE'
    
    
  }
);}




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

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

          return  deleteFooterId(id,requestOptions)
        }

        


  return  { mutationFn, ...mutationOptions }}

    export type DeleteFooterIdMutationResult = NonNullable<Awaited<ReturnType<typeof deleteFooterId>>>
    
    export type DeleteFooterIdMutationError = ErrorType<unknown>

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

      const mutationOptions = getDeleteFooterIdMutationOptions(options);

      return useMutation(mutationOptions, queryClient);
    }
    /**
 * Get
 */
export type getFooterResponse200 = {
  data: Response
  status: 200
}
    
export type getFooterResponseSuccess = (getFooterResponse200) & {
  headers: Headers;
};
;

export type getFooterResponse = (getFooterResponseSuccess)

export const getGetFooterUrl = (params?: GetFooterParams,) => {
  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 ? `/footer?${stringifiedParams}` : `/footer`
}

export const getFooter = async (params?: GetFooterParams, options?: RequestInit): Promise<getFooterResponse> => {
  
  return useCustomClient<getFooterResponse>(getGetFooterUrl(params),
  {      
    ...options,
    method: 'GET'
    
    
  }
);}





export const getGetFooterInfiniteQueryKey = (params?: GetFooterParams,) => {
    return [
    'infinite', `/footer`, ...(params ? [params]: [])
    ] as const;
    }

export const getGetFooterQueryKey = (params?: GetFooterParams,) => {
    return [
    `/footer`, ...(params ? [params]: [])
    ] as const;
    }

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

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

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

  

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

      

      

   return  { queryKey, queryFn, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getFooter>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}

export type GetFooterInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getFooter>>>
export type GetFooterInfiniteQueryError = ErrorType<unknown>


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

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

  const queryOptions = getGetFooterInfiniteQueryOptions(params,options)

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

  query.queryKey = queryOptions.queryKey ;

  return query;
}

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

  ): Promise<QueryClient> => {

  const queryOptions = getGetFooterInfiniteQueryOptions(params,options)

  await queryClient.prefetchInfiniteQuery(queryOptions);

  return queryClient;
}



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

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

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

  

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

      

      

   return  { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getFooter>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}

export type GetFooterQueryResult = NonNullable<Awaited<ReturnType<typeof getFooter>>>
export type GetFooterQueryError = ErrorType<unknown>


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

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

  const queryOptions = getGetFooterQueryOptions(params,options)

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

  query.queryKey = queryOptions.queryKey ;

  return query;
}

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

  ): Promise<QueryClient> => {

  const queryOptions = getGetFooterQueryOptions(params,options)

  await queryClient.prefetchQuery(queryOptions);

  return queryClient;
}



/**
 * Post
 */
export type postFooterResponse200 = {
  data: Response
  status: 200
}
    
export type postFooterResponseSuccess = (postFooterResponse200) & {
  headers: Headers;
};
;

export type postFooterResponse = (postFooterResponseSuccess)

export const getPostFooterUrl = () => {


  

  return `/footer`
}

export const postFooter = async (footer: Footer[], options?: RequestInit): Promise<postFooterResponse> => {
  
  return useCustomClient<postFooterResponse>(getPostFooterUrl(),
  {      
    ...options,
    method: 'POST',
    headers: { 'Content-Type': 'application/json', ...options?.headers },
    body: JSON.stringify(
      footer,)
  }
);}




export const getPostFooterMutationOptions = <TError = ErrorType<unknown>,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postFooter>>, TError,{data: BodyType<Footer[]>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof postFooter>>, TError,{data: BodyType<Footer[]>}, TContext> => {

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

          return  postFooter(data,requestOptions)
        }

        


  return  { mutationFn, ...mutationOptions }}

    export type PostFooterMutationResult = NonNullable<Awaited<ReturnType<typeof postFooter>>>
    export type PostFooterMutationBody = BodyType<Footer[]>
    export type PostFooterMutationError = ErrorType<unknown>

    export const usePostFooter = <TError = ErrorType<unknown>,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postFooter>>, TError,{data: BodyType<Footer[]>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
 , queryClient?: QueryClient): UseMutationResult<
        Awaited<ReturnType<typeof postFooter>>,
        TError,
        {data: BodyType<Footer[]>},
        TContext
      > => {

      const mutationOptions = getPostFooterMutationOptions(options);

      return useMutation(mutationOptions, queryClient);
    }
    /**
 * Put
 */
export type putFooterResponse200 = {
  data: Response
  status: 200
}
    
export type putFooterResponseSuccess = (putFooterResponse200) & {
  headers: Headers;
};
;

export type putFooterResponse = (putFooterResponseSuccess)

export const getPutFooterUrl = (params: PutFooterParams,) => {
  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 ? `/footer?${stringifiedParams}` : `/footer`
}

export const putFooter = async (footerBody: FooterBody,
    params: PutFooterParams, options?: RequestInit): Promise<putFooterResponse> => {
  
  return useCustomClient<putFooterResponse>(getPutFooterUrl(params),
  {      
    ...options,
    method: 'PUT',
    headers: { 'Content-Type': 'application/json', ...options?.headers },
    body: JSON.stringify(
      footerBody,)
  }
);}




export const getPutFooterMutationOptions = <TError = ErrorType<unknown>,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putFooter>>, TError,{data: BodyType<FooterBody>;params: PutFooterParams}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof putFooter>>, TError,{data: BodyType<FooterBody>;params: PutFooterParams}, TContext> => {

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

          return  putFooter(data,params,requestOptions)
        }

        


  return  { mutationFn, ...mutationOptions }}

    export type PutFooterMutationResult = NonNullable<Awaited<ReturnType<typeof putFooter>>>
    export type PutFooterMutationBody = BodyType<FooterBody>
    export type PutFooterMutationError = ErrorType<unknown>

    export const usePutFooter = <TError = ErrorType<unknown>,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putFooter>>, TError,{data: BodyType<FooterBody>;params: PutFooterParams}, TContext>, request?: SecondParameter<typeof useCustomClient>}
 , queryClient?: QueryClient): UseMutationResult<
        Awaited<ReturnType<typeof putFooter>>,
        TError,
        {data: BodyType<FooterBody>;params: PutFooterParams},
        TContext
      > => {

      const mutationOptions = getPutFooterMutationOptions(options);

      return useMutation(mutationOptions, queryClient);
    }
    