/* 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 type { Users } from '../schemas/Users';
import { fetcher, FetcherOptions } from 'services/fetcher';

export type UsersOkResponse = Users;

export type UsersErrorResponse = unknown;

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

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

/**
 * This API is used to get the list of users
 */
export function useUsersQuery(
  props: UsersProps,
  options?: Omit<UseQueryOptions<UsersOkResponse, UsersErrorResponse>, 'queryKey' | 'queryFn'>
) {
  return useQuery<UsersOkResponse, UsersErrorResponse>(['users'], ({ signal }) => users({ ...props, signal }), options);
}
