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

export interface GetUserQueryPathParams {
  user_id: string;
}

export type GetUserOkResponse = User;

export type GetUserErrorResponse = unknown;

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

export function getUser(props: GetUserProps): Promise<GetUserOkResponse> {
  return fetcher<GetUserOkResponse, unknown, unknown>({
    url: `/auth/get_user/${props.user_id}`,
    method: 'GET',
    ...props
  });
}

/**
 * This API is used to get the details of an user by passing uid in the URL
 */
export function useGetUserQuery(
  props: GetUserProps,
  options?: Omit<UseQueryOptions<GetUserOkResponse, GetUserErrorResponse>, 'queryKey' | 'queryFn'>
) {
  return useQuery<GetUserOkResponse, GetUserErrorResponse>(
    ['getUser', props.user_id],
    ({ signal }) => getUser({ ...props, signal }),
    options
  );
}
