/**
 * 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 {
  GetApiV10PageConfigParams,
  PostApiV10PageConfigBody,
  PutApiV10PageConfigIdBody
} from '../models';






/**
 * Retrieve hierarchical page config by its ID
 * @summary Get hierarchical pageConfig by ID
 */
export type getApiV10PageConfigIdResponse200 = {
  data: void
  status: 200
}

export type getApiV10PageConfigIdResponse404 = {
  data: void
  status: 404
}
    
export type getApiV10PageConfigIdResponseSuccess = (getApiV10PageConfigIdResponse200) & {
  headers: Headers;
};
export type getApiV10PageConfigIdResponseError = (getApiV10PageConfigIdResponse404) & {
  headers: Headers;
};

export type getApiV10PageConfigIdResponse = (getApiV10PageConfigIdResponseSuccess | getApiV10PageConfigIdResponseError)

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


  

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

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

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





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

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

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

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

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

  

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

      

      

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

export type GetApiV10PageConfigIdInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10PageConfigId>>>
export type GetApiV10PageConfigIdInfiniteQueryError = void


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

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

  const queryOptions = getGetApiV10PageConfigIdInfiniteQueryOptions(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 prefetchGetApiV10PageConfigIdInfiniteQuery = async <TData = Awaited<ReturnType<typeof getApiV10PageConfigId>>, TError = void>(
 queryClient: QueryClient, id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfigId>>, TError, TData>>, fetch?: RequestInit}

  ): Promise<QueryClient> => {

  const queryOptions = getGetApiV10PageConfigIdInfiniteQueryOptions(id,options)

  await queryClient.prefetchInfiniteQuery(queryOptions);

  return queryClient;
}



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

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

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

  

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

      

      

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

export type GetApiV10PageConfigIdQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10PageConfigId>>>
export type GetApiV10PageConfigIdQueryError = void


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

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

  const queryOptions = getGetApiV10PageConfigIdQueryOptions(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 prefetchGetApiV10PageConfigIdQuery = async <TData = Awaited<ReturnType<typeof getApiV10PageConfigId>>, TError = void>(
 queryClient: QueryClient, id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfigId>>, TError, TData>>, fetch?: RequestInit}

  ): Promise<QueryClient> => {

  const queryOptions = getGetApiV10PageConfigIdQueryOptions(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 putApiV10PageConfigIdResponse200 = {
  data: void
  status: 200
}

export type putApiV10PageConfigIdResponse404 = {
  data: void
  status: 404
}
    
export type putApiV10PageConfigIdResponseSuccess = (putApiV10PageConfigIdResponse200) & {
  headers: Headers;
};
export type putApiV10PageConfigIdResponseError = (putApiV10PageConfigIdResponse404) & {
  headers: Headers;
};

export type putApiV10PageConfigIdResponse = (putApiV10PageConfigIdResponseSuccess | putApiV10PageConfigIdResponseError)

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


  

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

export const putApiV10PageConfigId = async (id: string,
    putApiV10PageConfigIdBody: PutApiV10PageConfigIdBody, options?: RequestInit): Promise<putApiV10PageConfigIdResponse> => {
  
  const res = await fetch(getPutApiV10PageConfigIdUrl(id),
  {      
    ...options,
    method: 'PUT',
    headers: { 'Content-Type': 'application/json', ...options?.headers },
    body: JSON.stringify(
      putApiV10PageConfigIdBody,)
  }
)

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




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

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

          return  putApiV10PageConfigId(id,data,fetchOptions)
        }

        


  return  { mutationFn, ...mutationOptions }}

    export type PutApiV10PageConfigIdMutationResult = NonNullable<Awaited<ReturnType<typeof putApiV10PageConfigId>>>
    export type PutApiV10PageConfigIdMutationBody = PutApiV10PageConfigIdBody
    export type PutApiV10PageConfigIdMutationError = void

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

      const mutationOptions = getPutApiV10PageConfigIdMutationOptions(options);

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

export type deleteApiV10PageConfigIdResponse404 = {
  data: void
  status: 404
}
    
export type deleteApiV10PageConfigIdResponseSuccess = (deleteApiV10PageConfigIdResponse200) & {
  headers: Headers;
};
export type deleteApiV10PageConfigIdResponseError = (deleteApiV10PageConfigIdResponse404) & {
  headers: Headers;
};

export type deleteApiV10PageConfigIdResponse = (deleteApiV10PageConfigIdResponseSuccess | deleteApiV10PageConfigIdResponseError)

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


  

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

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

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




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

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

          return  deleteApiV10PageConfigId(id,fetchOptions)
        }

        


  return  { mutationFn, ...mutationOptions }}

    export type DeleteApiV10PageConfigIdMutationResult = NonNullable<Awaited<ReturnType<typeof deleteApiV10PageConfigId>>>
    
    export type DeleteApiV10PageConfigIdMutationError = void

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

      const mutationOptions = getDeleteApiV10PageConfigIdMutationOptions(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 getApiV10PageConfigResponse200 = {
  data: void
  status: 200
}
    
export type getApiV10PageConfigResponseSuccess = (getApiV10PageConfigResponse200) & {
  headers: Headers;
};
;

export type getApiV10PageConfigResponse = (getApiV10PageConfigResponseSuccess)

export const getGetApiV10PageConfigUrl = (params?: GetApiV10PageConfigParams,) => {
  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/pageConfig?${stringifiedParams}` : `/api/v1.0/pageConfig`
}

export const getApiV10PageConfig = async (params?: GetApiV10PageConfigParams, options?: RequestInit): Promise<getApiV10PageConfigResponse> => {
  
  const res = await fetch(getGetApiV10PageConfigUrl(params),
  {      
    ...options,
    method: 'GET'
    
    
  }
)

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





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

export const getGetApiV10PageConfigQueryKey = (params?: GetApiV10PageConfigParams,) => {
    return [
    `/api/v1.0/pageConfig`, ...(params ? [params]: [])
    ] as const;
    }

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

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

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

  

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

      

      

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

export type GetApiV10PageConfigInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10PageConfig>>>
export type GetApiV10PageConfigInfiniteQueryError = unknown


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

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

  const queryOptions = getGetApiV10PageConfigInfiniteQueryOptions(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 prefetchGetApiV10PageConfigInfiniteQuery = async <TData = Awaited<ReturnType<typeof getApiV10PageConfig>>, TError = unknown>(
 queryClient: QueryClient, params?: GetApiV10PageConfigParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfig>>, TError, TData>>, fetch?: RequestInit}

  ): Promise<QueryClient> => {

  const queryOptions = getGetApiV10PageConfigInfiniteQueryOptions(params,options)

  await queryClient.prefetchInfiniteQuery(queryOptions);

  return queryClient;
}



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

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

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

  

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

      

      

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

export type GetApiV10PageConfigQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10PageConfig>>>
export type GetApiV10PageConfigQueryError = unknown


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

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

  const queryOptions = getGetApiV10PageConfigQueryOptions(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 prefetchGetApiV10PageConfigQuery = async <TData = Awaited<ReturnType<typeof getApiV10PageConfig>>, TError = unknown>(
 queryClient: QueryClient, params?: GetApiV10PageConfigParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfig>>, TError, TData>>, fetch?: RequestInit}

  ): Promise<QueryClient> => {

  const queryOptions = getGetApiV10PageConfigQueryOptions(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 postApiV10PageConfigResponse200 = {
  data: void
  status: 200
}
    
export type postApiV10PageConfigResponseSuccess = (postApiV10PageConfigResponse200) & {
  headers: Headers;
};
;

export type postApiV10PageConfigResponse = (postApiV10PageConfigResponseSuccess)

export const getPostApiV10PageConfigUrl = () => {


  

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

export const postApiV10PageConfig = async (postApiV10PageConfigBody: PostApiV10PageConfigBody, options?: RequestInit): Promise<postApiV10PageConfigResponse> => {
  
  const res = await fetch(getPostApiV10PageConfigUrl(),
  {      
    ...options,
    method: 'POST',
    headers: { 'Content-Type': 'application/json', ...options?.headers },
    body: JSON.stringify(
      postApiV10PageConfigBody,)
  }
)

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




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

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

          return  postApiV10PageConfig(data,fetchOptions)
        }

        


  return  { mutationFn, ...mutationOptions }}

    export type PostApiV10PageConfigMutationResult = NonNullable<Awaited<ReturnType<typeof postApiV10PageConfig>>>
    export type PostApiV10PageConfigMutationBody = PostApiV10PageConfigBody
    export type PostApiV10PageConfigMutationError = unknown

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

      const mutationOptions = getPostApiV10PageConfigMutationOptions(options);

      return useMutation(mutationOptions, queryClient);
    }
    