/**
 * 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 {
  GetPageConfigParams,
  PostPageConfigBody,
  PutPageConfigIdBody
} 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 hierarchical page config by its ID
 * @summary Get hierarchical pageConfig by ID
 */
export type getPageConfigIdResponse200 = {
  data: void
  status: 200
}

export type getPageConfigIdResponse404 = {
  data: void
  status: 404
}
    
export type getPageConfigIdResponseSuccess = (getPageConfigIdResponse200) & {
  headers: Headers;
};
export type getPageConfigIdResponseError = (getPageConfigIdResponse404) & {
  headers: Headers;
};

export type getPageConfigIdResponse = (getPageConfigIdResponseSuccess | getPageConfigIdResponseError)

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


  

  return `/pageConfig/${id}`
}

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





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

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

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

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

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

  

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

      

      

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

export type GetPageConfigIdInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getPageConfigId>>>
export type GetPageConfigIdInfiniteQueryError = ErrorType<void>


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

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

  const queryOptions = getGetPageConfigIdInfiniteQueryOptions(id,options)

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

  query.queryKey = queryOptions.queryKey ;

  return query;
}

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

  ): Promise<QueryClient> => {

  const queryOptions = getGetPageConfigIdInfiniteQueryOptions(id,options)

  await queryClient.prefetchInfiniteQuery(queryOptions);

  return queryClient;
}



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

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

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

  

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

      

      

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

export type GetPageConfigIdQueryResult = NonNullable<Awaited<ReturnType<typeof getPageConfigId>>>
export type GetPageConfigIdQueryError = ErrorType<void>


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

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

  const queryOptions = getGetPageConfigIdQueryOptions(id,options)

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

  query.queryKey = queryOptions.queryKey ;

  return query;
}

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

  ): Promise<QueryClient> => {

  const queryOptions = getGetPageConfigIdQueryOptions(id,options)

  await queryClient.prefetchQuery(queryOptions);

  return queryClient;
}



/**
 * Update a single pageConfig record by its ID. level is computed if parent_id changes and must not be sent.
 * @summary Update pageConfig by ID
 */
export type putPageConfigIdResponse200 = {
  data: void
  status: 200
}

export type putPageConfigIdResponse404 = {
  data: void
  status: 404
}
    
export type putPageConfigIdResponseSuccess = (putPageConfigIdResponse200) & {
  headers: Headers;
};
export type putPageConfigIdResponseError = (putPageConfigIdResponse404) & {
  headers: Headers;
};

export type putPageConfigIdResponse = (putPageConfigIdResponseSuccess | putPageConfigIdResponseError)

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


  

  return `/pageConfig/${id}`
}

export const putPageConfigId = async (id: string,
    putPageConfigIdBody: PutPageConfigIdBody, options?: RequestInit): Promise<putPageConfigIdResponse> => {
  
  return useCustomClient<putPageConfigIdResponse>(getPutPageConfigIdUrl(id),
  {      
    ...options,
    method: 'PUT',
    headers: { 'Content-Type': 'application/json', ...options?.headers },
    body: JSON.stringify(
      putPageConfigIdBody,)
  }
);}




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

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

          return  putPageConfigId(id,data,requestOptions)
        }

        


  return  { mutationFn, ...mutationOptions }}

    export type PutPageConfigIdMutationResult = NonNullable<Awaited<ReturnType<typeof putPageConfigId>>>
    export type PutPageConfigIdMutationBody = BodyType<PutPageConfigIdBody>
    export type PutPageConfigIdMutationError = ErrorType<void>

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

      const mutationOptions = getPutPageConfigIdMutationOptions(options);

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

export type deletePageConfigIdResponse404 = {
  data: void
  status: 404
}
    
export type deletePageConfigIdResponseSuccess = (deletePageConfigIdResponse200) & {
  headers: Headers;
};
export type deletePageConfigIdResponseError = (deletePageConfigIdResponse404) & {
  headers: Headers;
};

export type deletePageConfigIdResponse = (deletePageConfigIdResponseSuccess | deletePageConfigIdResponseError)

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


  

  return `/pageConfig/${id}`
}

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




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

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

          return  deletePageConfigId(id,requestOptions)
        }

        


  return  { mutationFn, ...mutationOptions }}

    export type DeletePageConfigIdMutationResult = NonNullable<Awaited<ReturnType<typeof deletePageConfigId>>>
    
    export type DeletePageConfigIdMutationError = ErrorType<void>

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

      const mutationOptions = getDeletePageConfigIdMutationOptions(options);

      return useMutation(mutationOptions, queryClient);
    }
    /**
 * Retrieve hierarchical page config by id, static_link, or code. If no parameters are provided, returns the root hierarchical structure.
 * @summary Get hierarchical pageConfig
 */
export type getPageConfigResponse200 = {
  data: void
  status: 200
}
    
export type getPageConfigResponseSuccess = (getPageConfigResponse200) & {
  headers: Headers;
};
;

export type getPageConfigResponse = (getPageConfigResponseSuccess)

export const getGetPageConfigUrl = (params?: GetPageConfigParams,) => {
  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 ? `/pageConfig?${stringifiedParams}` : `/pageConfig`
}

export const getPageConfig = async (params?: GetPageConfigParams, options?: RequestInit): Promise<getPageConfigResponse> => {
  
  return useCustomClient<getPageConfigResponse>(getGetPageConfigUrl(params),
  {      
    ...options,
    method: 'GET'
    
    
  }
);}





export const getGetPageConfigInfiniteQueryKey = (params?: GetPageConfigParams,) => {
    return [
    'infinite', `/pageConfig`, ...(params ? [params]: [])
    ] as const;
    }

export const getGetPageConfigQueryKey = (params?: GetPageConfigParams,) => {
    return [
    `/pageConfig`, ...(params ? [params]: [])
    ] as const;
    }

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

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

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

  

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

      

      

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

export type GetPageConfigInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getPageConfig>>>
export type GetPageConfigInfiniteQueryError = ErrorType<unknown>


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

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

  const queryOptions = getGetPageConfigInfiniteQueryOptions(params,options)

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

  query.queryKey = queryOptions.queryKey ;

  return query;
}

/**
 * @summary Get hierarchical pageConfig
 */
export const prefetchGetPageConfigInfiniteQuery = async <TData = Awaited<ReturnType<typeof getPageConfig>>, TError = ErrorType<unknown>>(
 queryClient: QueryClient, params?: GetPageConfigParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getPageConfig>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}

  ): Promise<QueryClient> => {

  const queryOptions = getGetPageConfigInfiniteQueryOptions(params,options)

  await queryClient.prefetchInfiniteQuery(queryOptions);

  return queryClient;
}



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

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

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

  

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

      

      

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

export type GetPageConfigQueryResult = NonNullable<Awaited<ReturnType<typeof getPageConfig>>>
export type GetPageConfigQueryError = ErrorType<unknown>


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

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

  const queryOptions = getGetPageConfigQueryOptions(params,options)

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

  query.queryKey = queryOptions.queryKey ;

  return query;
}

/**
 * @summary Get hierarchical pageConfig
 */
export const prefetchGetPageConfigQuery = async <TData = Awaited<ReturnType<typeof getPageConfig>>, TError = ErrorType<unknown>>(
 queryClient: QueryClient, params?: GetPageConfigParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getPageConfig>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}

  ): Promise<QueryClient> => {

  const queryOptions = getGetPageConfigQueryOptions(params,options)

  await queryClient.prefetchQuery(queryOptions);

  return queryClient;
}



/**
 * Create a new pageConfig record. parent_id is required. level is computed from parent and must not be sent.
 * @summary Create a pageConfig
 */
export type postPageConfigResponse200 = {
  data: void
  status: 200
}
    
export type postPageConfigResponseSuccess = (postPageConfigResponse200) & {
  headers: Headers;
};
;

export type postPageConfigResponse = (postPageConfigResponseSuccess)

export const getPostPageConfigUrl = () => {


  

  return `/pageConfig`
}

export const postPageConfig = async (postPageConfigBody: PostPageConfigBody, options?: RequestInit): Promise<postPageConfigResponse> => {
  
  return useCustomClient<postPageConfigResponse>(getPostPageConfigUrl(),
  {      
    ...options,
    method: 'POST',
    headers: { 'Content-Type': 'application/json', ...options?.headers },
    body: JSON.stringify(
      postPageConfigBody,)
  }
);}




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

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

          return  postPageConfig(data,requestOptions)
        }

        


  return  { mutationFn, ...mutationOptions }}

    export type PostPageConfigMutationResult = NonNullable<Awaited<ReturnType<typeof postPageConfig>>>
    export type PostPageConfigMutationBody = BodyType<PostPageConfigBody>
    export type PostPageConfigMutationError = ErrorType<unknown>

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

      const mutationOptions = getPostPageConfigMutationOptions(options);

      return useMutation(mutationOptions, queryClient);
    }
    