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

export interface GetUserWithProjectQueryPathParams {
  username: string;
}

export type GetUserWithProjectOkResponse = {
  data?: GetUserWithProject;
};

export type GetUserWithProjectErrorResponse = unknown;

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

export function getUserWithProject(props: GetUserWithProjectProps): Promise<GetUserWithProjectOkResponse> {
  return fetcher<GetUserWithProjectOkResponse, unknown, unknown>({
    url: `/auth/get_user_with_project/${props.username}`,
    method: 'GET',
    ...props
  });
}

/**
 * This API is used to get details of a project for a user
 *
 */
export function useGetUserWithProjectQuery(
  props: GetUserWithProjectProps,
  options?: Omit<UseQueryOptions<GetUserWithProjectOkResponse, GetUserWithProjectErrorResponse>, 'queryKey' | 'queryFn'>
) {
  return useQuery<GetUserWithProjectOkResponse, GetUserWithProjectErrorResponse>(
    ['getUserWithProject', props.username],
    ({ signal }) => getUserWithProject({ ...props, signal }),
    options
  );
}
