/* eslint-disable */
// This code is autogenerated using @harnessio/oats-cli.
// Please do not modify this code directly.
import { useMutation, UseMutationOptions } from '@tanstack/react-query';

import { fetcher, FetcherOptions } from 'services/fetcher';

export interface DeleteProjectMutationPathParams {
  project_id: string;
}

export type DeleteProjectOkResponse = {
  message?: string;
};

export type DeleteProjectErrorResponse = unknown;

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

export function deleteProject(props: DeleteProjectProps): Promise<DeleteProjectOkResponse> {
  return fetcher<DeleteProjectOkResponse, unknown, unknown>({
    url: `/auth/delete_project/${props.project_id}`,
    method: 'POST',
    ...props
  });
}

export type DeleteProjectMutationProps<T extends keyof DeleteProjectProps> = Omit<DeleteProjectProps, T> &
  Partial<Pick<DeleteProjectProps, T>>;

/**
 * This API is used to delete project, which helps owners to delete their projects.
 */
export function useDeleteProjectMutation<T extends keyof DeleteProjectProps>(
  props: Pick<Partial<DeleteProjectProps>, T>,
  options?: Omit<
    UseMutationOptions<DeleteProjectOkResponse, DeleteProjectErrorResponse, DeleteProjectMutationProps<T>>,
    'mutationKey' | 'mutationFn'
  >
) {
  return useMutation<DeleteProjectOkResponse, DeleteProjectErrorResponse, DeleteProjectMutationProps<T>>(
    (mutateProps: DeleteProjectMutationProps<T>) => deleteProject({ ...props, ...mutateProps } as DeleteProjectProps),
    options
  );
}
