/**
 * Generated by orval v8.0.0-rc.0 🍺
 * Do not edit manually.
 * Backend Template
 * 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 {
  BannerMutate,
  DeleteBannerId200,
  GetBannerId200,
  GetBannerParams,
  PostBanner200,
  PutBannerId200,
  ResponseGetAllData
} 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];



/**
 * Retrieve a single banner record by its ID
 * @summary Get banner by ID
 */
export type getBannerIdResponse200 = {
  data: GetBannerId200
  status: 200
}

export type getBannerIdResponse404 = {
  data: void
  status: 404
}
    
export type getBannerIdResponseSuccess = (getBannerIdResponse200) & {
  headers: Headers;
};
export type getBannerIdResponseError = (getBannerIdResponse404) & {
  headers: Headers;
};

export type getBannerIdResponse = (getBannerIdResponseSuccess | getBannerIdResponseError)

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


  

  return `/banner/${id}`
}

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





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

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

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

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

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

  

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

      

      

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

export type GetBannerIdInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getBannerId>>>
export type GetBannerIdInfiniteQueryError = ErrorType<void>


export function useGetBannerIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getBannerId>>>, TError = ErrorType<void>>(
 id: string, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getBannerId>>, TError, TData>> & Pick<
        DefinedInitialDataOptions<
          Awaited<ReturnType<typeof getBannerId>>,
          TError,
          Awaited<ReturnType<typeof getBannerId>>
        > , 'initialData'
      >, request?: SecondParameter<typeof useCustomClient>}
 , queryClient?: QueryClient
  ):  DefinedUseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetBannerIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getBannerId>>>, TError = ErrorType<void>>(
 id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getBannerId>>, TError, TData>> & Pick<
        UndefinedInitialDataOptions<
          Awaited<ReturnType<typeof getBannerId>>,
          TError,
          Awaited<ReturnType<typeof getBannerId>>
        > , 'initialData'
      >, request?: SecondParameter<typeof useCustomClient>}
 , queryClient?: QueryClient
  ):  UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetBannerIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getBannerId>>>, TError = ErrorType<void>>(
 id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getBannerId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
 , queryClient?: QueryClient
  ):  UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
 * @summary Get banner by ID
 */

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

  const queryOptions = getGetBannerIdInfiniteQueryOptions(id,options)

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

  query.queryKey = queryOptions.queryKey ;

  return query;
}

/**
 * @summary Get banner by ID
 */
export const prefetchGetBannerIdInfiniteQuery = async <TData = Awaited<ReturnType<typeof getBannerId>>, TError = ErrorType<void>>(
 queryClient: QueryClient, id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getBannerId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}

  ): Promise<QueryClient> => {

  const queryOptions = getGetBannerIdInfiniteQueryOptions(id,options)

  await queryClient.prefetchInfiniteQuery(queryOptions);

  return queryClient;
}



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

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

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

  

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

      

      

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

export type GetBannerIdQueryResult = NonNullable<Awaited<ReturnType<typeof getBannerId>>>
export type GetBannerIdQueryError = ErrorType<void>


export function useGetBannerId<TData = Awaited<ReturnType<typeof getBannerId>>, TError = ErrorType<void>>(
 id: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getBannerId>>, TError, TData>> & Pick<
        DefinedInitialDataOptions<
          Awaited<ReturnType<typeof getBannerId>>,
          TError,
          Awaited<ReturnType<typeof getBannerId>>
        > , 'initialData'
      >, request?: SecondParameter<typeof useCustomClient>}
 , queryClient?: QueryClient
  ):  DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetBannerId<TData = Awaited<ReturnType<typeof getBannerId>>, TError = ErrorType<void>>(
 id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getBannerId>>, TError, TData>> & Pick<
        UndefinedInitialDataOptions<
          Awaited<ReturnType<typeof getBannerId>>,
          TError,
          Awaited<ReturnType<typeof getBannerId>>
        > , 'initialData'
      >, request?: SecondParameter<typeof useCustomClient>}
 , queryClient?: QueryClient
  ):  UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetBannerId<TData = Awaited<ReturnType<typeof getBannerId>>, TError = ErrorType<void>>(
 id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getBannerId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
 , queryClient?: QueryClient
  ):  UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
 * @summary Get banner by ID
 */

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

  const queryOptions = getGetBannerIdQueryOptions(id,options)

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

  query.queryKey = queryOptions.queryKey ;

  return query;
}

/**
 * @summary Get banner by ID
 */
export const prefetchGetBannerIdQuery = async <TData = Awaited<ReturnType<typeof getBannerId>>, TError = ErrorType<void>>(
 queryClient: QueryClient, id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getBannerId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}

  ): Promise<QueryClient> => {

  const queryOptions = getGetBannerIdQueryOptions(id,options)

  await queryClient.prefetchQuery(queryOptions);

  return queryClient;
}



/**
 * Update a single banner record by its ID
 * @summary Update banner by ID
 */
export type putBannerIdResponse200 = {
  data: PutBannerId200
  status: 200
}

export type putBannerIdResponse404 = {
  data: void
  status: 404
}
    
export type putBannerIdResponseSuccess = (putBannerIdResponse200) & {
  headers: Headers;
};
export type putBannerIdResponseError = (putBannerIdResponse404) & {
  headers: Headers;
};

export type putBannerIdResponse = (putBannerIdResponseSuccess | putBannerIdResponseError)

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


  

  return `/banner/${id}`
}

export const putBannerId = async (id: string,
    bannerMutate: BannerMutate, options?: RequestInit): Promise<putBannerIdResponse> => {
  
  return useCustomClient<putBannerIdResponse>(getPutBannerIdUrl(id),
  {      
    ...options,
    method: 'PUT',
    headers: { 'Content-Type': 'application/json', ...options?.headers },
    body: JSON.stringify(
      bannerMutate,)
  }
);}




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

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

          return  putBannerId(id,data,requestOptions)
        }

        


  return  { mutationFn, ...mutationOptions }}

    export type PutBannerIdMutationResult = NonNullable<Awaited<ReturnType<typeof putBannerId>>>
    export type PutBannerIdMutationBody = BodyType<BannerMutate>
    export type PutBannerIdMutationError = ErrorType<void>

    /**
 * @summary Update banner by ID
 */
export const usePutBannerId = <TError = ErrorType<void>,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putBannerId>>, TError,{id: string;data: BodyType<BannerMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
 , queryClient?: QueryClient): UseMutationResult<
        Awaited<ReturnType<typeof putBannerId>>,
        TError,
        {id: string;data: BodyType<BannerMutate>},
        TContext
      > => {

      const mutationOptions = getPutBannerIdMutationOptions(options);

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

export type deleteBannerIdResponse404 = {
  data: void
  status: 404
}
    
export type deleteBannerIdResponseSuccess = (deleteBannerIdResponse200) & {
  headers: Headers;
};
export type deleteBannerIdResponseError = (deleteBannerIdResponse404) & {
  headers: Headers;
};

export type deleteBannerIdResponse = (deleteBannerIdResponseSuccess | deleteBannerIdResponseError)

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


  

  return `/banner/${id}`
}

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




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

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

          return  deleteBannerId(id,requestOptions)
        }

        


  return  { mutationFn, ...mutationOptions }}

    export type DeleteBannerIdMutationResult = NonNullable<Awaited<ReturnType<typeof deleteBannerId>>>
    
    export type DeleteBannerIdMutationError = ErrorType<void>

    /**
 * @summary Delete banner by ID
 */
export const useDeleteBannerId = <TError = ErrorType<void>,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteBannerId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
 , queryClient?: QueryClient): UseMutationResult<
        Awaited<ReturnType<typeof deleteBannerId>>,
        TError,
        {id: string},
        TContext
      > => {

      const mutationOptions = getDeleteBannerIdMutationOptions(options);

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

export type getBannerResponse = (getBannerResponseSuccess)

export const getGetBannerUrl = (params?: GetBannerParams,) => {
  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 ? `/banner?${stringifiedParams}` : `/banner`
}

export const getBanner = async (params?: GetBannerParams, options?: RequestInit): Promise<getBannerResponse> => {
  
  return useCustomClient<getBannerResponse>(getGetBannerUrl(params),
  {      
    ...options,
    method: 'GET'
    
    
  }
);}





export const getGetBannerInfiniteQueryKey = (params?: GetBannerParams,) => {
    return [
    'infinite', `/banner`, ...(params ? [params]: [])
    ] as const;
    }

export const getGetBannerQueryKey = (params?: GetBannerParams,) => {
    return [
    `/banner`, ...(params ? [params]: [])
    ] as const;
    }

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

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

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

  

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

      

      

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

export type GetBannerInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getBanner>>>
export type GetBannerInfiniteQueryError = ErrorType<unknown>


export function useGetBannerInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getBanner>>>, TError = ErrorType<unknown>>(
 params: undefined |  GetBannerParams, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getBanner>>, TError, TData>> & Pick<
        DefinedInitialDataOptions<
          Awaited<ReturnType<typeof getBanner>>,
          TError,
          Awaited<ReturnType<typeof getBanner>>
        > , 'initialData'
      >, request?: SecondParameter<typeof useCustomClient>}
 , queryClient?: QueryClient
  ):  DefinedUseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetBannerInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getBanner>>>, TError = ErrorType<unknown>>(
 params?: GetBannerParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getBanner>>, TError, TData>> & Pick<
        UndefinedInitialDataOptions<
          Awaited<ReturnType<typeof getBanner>>,
          TError,
          Awaited<ReturnType<typeof getBanner>>
        > , 'initialData'
      >, request?: SecondParameter<typeof useCustomClient>}
 , queryClient?: QueryClient
  ):  UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetBannerInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getBanner>>>, TError = ErrorType<unknown>>(
 params?: GetBannerParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getBanner>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
 , queryClient?: QueryClient
  ):  UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
 * @summary Get all banner
 */

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

  const queryOptions = getGetBannerInfiniteQueryOptions(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 banner
 */
export const prefetchGetBannerInfiniteQuery = async <TData = Awaited<ReturnType<typeof getBanner>>, TError = ErrorType<unknown>>(
 queryClient: QueryClient, params?: GetBannerParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getBanner>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}

  ): Promise<QueryClient> => {

  const queryOptions = getGetBannerInfiniteQueryOptions(params,options)

  await queryClient.prefetchInfiniteQuery(queryOptions);

  return queryClient;
}



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

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

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

  

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

      

      

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

export type GetBannerQueryResult = NonNullable<Awaited<ReturnType<typeof getBanner>>>
export type GetBannerQueryError = ErrorType<unknown>


export function useGetBanner<TData = Awaited<ReturnType<typeof getBanner>>, TError = ErrorType<unknown>>(
 params: undefined |  GetBannerParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getBanner>>, TError, TData>> & Pick<
        DefinedInitialDataOptions<
          Awaited<ReturnType<typeof getBanner>>,
          TError,
          Awaited<ReturnType<typeof getBanner>>
        > , 'initialData'
      >, request?: SecondParameter<typeof useCustomClient>}
 , queryClient?: QueryClient
  ):  DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetBanner<TData = Awaited<ReturnType<typeof getBanner>>, TError = ErrorType<unknown>>(
 params?: GetBannerParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getBanner>>, TError, TData>> & Pick<
        UndefinedInitialDataOptions<
          Awaited<ReturnType<typeof getBanner>>,
          TError,
          Awaited<ReturnType<typeof getBanner>>
        > , 'initialData'
      >, request?: SecondParameter<typeof useCustomClient>}
 , queryClient?: QueryClient
  ):  UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetBanner<TData = Awaited<ReturnType<typeof getBanner>>, TError = ErrorType<unknown>>(
 params?: GetBannerParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getBanner>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
 , queryClient?: QueryClient
  ):  UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
 * @summary Get all banner
 */

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

  const queryOptions = getGetBannerQueryOptions(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 banner
 */
export const prefetchGetBannerQuery = async <TData = Awaited<ReturnType<typeof getBanner>>, TError = ErrorType<unknown>>(
 queryClient: QueryClient, params?: GetBannerParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getBanner>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}

  ): Promise<QueryClient> => {

  const queryOptions = getGetBannerQueryOptions(params,options)

  await queryClient.prefetchQuery(queryOptions);

  return queryClient;
}



/**
 * Create a new banner record
 * @summary Create a banner
 */
export type postBannerResponse200 = {
  data: PostBanner200
  status: 200
}
    
export type postBannerResponseSuccess = (postBannerResponse200) & {
  headers: Headers;
};
;

export type postBannerResponse = (postBannerResponseSuccess)

export const getPostBannerUrl = () => {


  

  return `/banner`
}

export const postBanner = async (bannerMutate: BannerMutate, options?: RequestInit): Promise<postBannerResponse> => {
  
  return useCustomClient<postBannerResponse>(getPostBannerUrl(),
  {      
    ...options,
    method: 'POST',
    headers: { 'Content-Type': 'application/json', ...options?.headers },
    body: JSON.stringify(
      bannerMutate,)
  }
);}




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

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

          return  postBanner(data,requestOptions)
        }

        


  return  { mutationFn, ...mutationOptions }}

    export type PostBannerMutationResult = NonNullable<Awaited<ReturnType<typeof postBanner>>>
    export type PostBannerMutationBody = BodyType<BannerMutate>
    export type PostBannerMutationError = ErrorType<unknown>

    /**
 * @summary Create a banner
 */
export const usePostBanner = <TError = ErrorType<unknown>,
    TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postBanner>>, TError,{data: BodyType<BannerMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
 , queryClient?: QueryClient): UseMutationResult<
        Awaited<ReturnType<typeof postBanner>>,
        TError,
        {data: BodyType<BannerMutate>},
        TContext
      > => {

      const mutationOptions = getPostBannerMutationOptions(options);

      return useMutation(mutationOptions, queryClient);
    }
    