/* eslint-disable */
// This code is autogenerated using @harnessio/oats-cli.
// Please do not modify this code directly.
import { useQuery, UseQueryOptions } from '@tanstack/react-query';

import { fetcher, FetcherOptions } from 'services/fetcher';

export type StatusOkResponse = {
  status?: string;
};

export type StatusErrorResponse = unknown;

export interface StatusProps extends Omit<FetcherOptions<unknown, unknown>, 'url'> {}

export function status(props: StatusProps): Promise<StatusOkResponse> {
  return fetcher<StatusOkResponse, unknown, unknown>({
    url: `/auth/status`,
    method: 'GET',
    ...props
  });
}

/**
 * This API is used to check the status of the server.
 */
export function useStatusQuery(
  props: StatusProps,
  options?: Omit<UseQueryOptions<StatusOkResponse, StatusErrorResponse>, 'queryKey' | 'queryFn'>
) {
  return useQuery<StatusOkResponse, StatusErrorResponse>(
    ['status'],
    ({ signal }) => status({ ...props, signal }),
    options
  );
}
