/* 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 GetUsersForInvitationQueryPathParams {
  project_id: string;
}

export type GetUsersForInvitationOkResponse = {
  data?: User[];
};

export type GetUsersForInvitationErrorResponse = unknown;

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

export function getUsersForInvitation(props: GetUsersForInvitationProps): Promise<GetUsersForInvitationOkResponse> {
  return fetcher<GetUsersForInvitationOkResponse, unknown, unknown>({
    url: `/auth/invite_users/${props.project_id}`,
    method: 'GET',
    ...props
  });
}

/**
 * This API is used to fetch users who can be invited
 */
export function useGetUsersForInvitationQuery(
  props: GetUsersForInvitationProps,
  options?: Omit<
    UseQueryOptions<GetUsersForInvitationOkResponse, GetUsersForInvitationErrorResponse>,
    'queryKey' | 'queryFn'
  >
) {
  return useQuery<GetUsersForInvitationOkResponse, GetUsersForInvitationErrorResponse>(
    ['getUsersForInvitation', props.project_id],
    ({ signal }) => getUsersForInvitation({ ...props, signal }),
    options
  );
}
