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

export interface GetProjectQueryPathParams {
  project_id: string;
}

export type GetProjectOkResponse = {
  data?: Project;
};

export type GetProjectErrorResponse = unknown;

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

export function getProject(props: GetProjectProps): Promise<GetProjectOkResponse> {
  return fetcher<GetProjectOkResponse, unknown, unknown>({
    url: `/auth/get_project/${props.project_id}`,
    method: 'GET',
    ...props
  });
}

/**
 * This API is used to get details of a project with given project ID
 */
export function useGetProjectQuery(
  props: GetProjectProps,
  options?: Omit<UseQueryOptions<GetProjectOkResponse, GetProjectErrorResponse>, 'queryKey' | 'queryFn'>
) {
  return useQuery<GetProjectOkResponse, GetProjectErrorResponse>(
    ['getProject', props.project_id],
    ({ signal }) => getProject({ ...props, signal }),
    options
  );
}
