/**
 * Generated by orval v8.3.0 🍺
 * Do not edit manually.
 * Mission Control API
 * OpenAPI spec version: 0.1.0
 */
import { useMutation, useQuery } from "@tanstack/react-query";
import type {
  DataTag,
  DefinedInitialDataOptions,
  DefinedUseQueryResult,
  MutationFunction,
  QueryClient,
  QueryFunction,
  QueryKey,
  UndefinedInitialDataOptions,
  UseMutationOptions,
  UseMutationResult,
  UseQueryOptions,
  UseQueryResult,
} from "@tanstack/react-query";

import type {
  CloseIssueResponse,
  ForgejoIssueListResponse,
  ForgejoIssueRead,
  HTTPValidationError,
  ListBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGetParams,
} from ".././model";

import { customFetch } from "../../mutator";

type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];

/**
 * List Forgejo issues from repositories linked to the specified board.

Use this endpoint when an agent needs to discover issues across all repositories associated with its assigned board.

LLM Routing Guidance:
- Use when you need to list issues for a specific board's repositories
- Filter by state, search text, or assignee for targeted results
- Use this instead of generic issue lists when board context matters
- Exclude pull requests automatically
 * @summary List issues for board's linked repositories
 */
export type listBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGetResponse200 = {
  data: ForgejoIssueListResponse;
  status: 200;
};

export type listBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGetResponse422 = {
  data: HTTPValidationError;
  status: 422;
};

export type listBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGetResponseSuccess =
  listBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGetResponse200 & {
    headers: Headers;
  };
export type listBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGetResponseError =
  listBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGetResponse422 & {
    headers: Headers;
  };

export type listBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGetResponse =
  | listBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGetResponseSuccess
  | listBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGetResponseError;

export const getListBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGetUrl = (
  boardId: string,
  params?: ListBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGetParams,
) => {
  const normalizedParams = new URLSearchParams();

  Object.entries(params || {}).forEach(([key, value]) => {
    if (value !== undefined) {
      normalizedParams.append(key, value === null ? "null" : value.toString());
    }
  });

  const stringifiedParams = normalizedParams.toString();

  return stringifiedParams.length > 0
    ? `/api/v1/agent/boards/${boardId}/git/issues?${stringifiedParams}`
    : `/api/v1/agent/boards/${boardId}/git/issues`;
};

export const listBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGet = async (
  boardId: string,
  params?: ListBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGetParams,
  options?: RequestInit,
): Promise<listBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGetResponse> => {
  return customFetch<listBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGetResponse>(
    getListBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGetUrl(boardId, params),
    {
      ...options,
      method: "GET",
    },
  );
};

export const getListBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGetQueryKey = (
  boardId: string,
  params?: ListBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGetParams,
) => {
  return [
    `/api/v1/agent/boards/${boardId}/git/issues`,
    ...(params ? [params] : []),
  ] as const;
};

export const getListBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGetQueryOptions =
  <
    TData = Awaited<
      ReturnType<typeof listBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGet>
    >,
    TError = HTTPValidationError,
  >(
    boardId: string,
    params?: ListBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGetParams,
    options?: {
      query?: Partial<
        UseQueryOptions<
          Awaited<
            ReturnType<
              typeof listBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGet
            >
          >,
          TError,
          TData
        >
      >;
      request?: SecondParameter<typeof customFetch>;
    },
  ) => {
    const { query: queryOptions, request: requestOptions } = options ?? {};

    const queryKey =
      queryOptions?.queryKey ??
      getListBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGetQueryKey(
        boardId,
        params,
      );

    const queryFn: QueryFunction<
      Awaited<
        ReturnType<typeof listBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGet>
      >
    > = ({ signal }) =>
      listBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGet(boardId, params, {
        signal,
        ...requestOptions,
      });

    return {
      queryKey,
      queryFn,
      enabled: !!boardId,
      ...queryOptions,
    } as UseQueryOptions<
      Awaited<
        ReturnType<typeof listBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGet>
      >,
      TError,
      TData
    > & { queryKey: DataTag<QueryKey, TData, TError> };
  };

export type ListBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGetQueryResult =
  NonNullable<
    Awaited<
      ReturnType<typeof listBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGet>
    >
  >;
export type ListBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGetQueryError =
  HTTPValidationError;

export function useListBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGet<
  TData = Awaited<
    ReturnType<typeof listBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGet>
  >,
  TError = HTTPValidationError,
>(
  boardId: string,
  params: undefined | ListBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGetParams,
  options: {
    query: Partial<
      UseQueryOptions<
        Awaited<
          ReturnType<typeof listBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGet>
        >,
        TError,
        TData
      >
    > &
      Pick<
        DefinedInitialDataOptions<
          Awaited<
            ReturnType<
              typeof listBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGet
            >
          >,
          TError,
          Awaited<
            ReturnType<
              typeof listBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGet
            >
          >
        >,
        "initialData"
      >;
    request?: SecondParameter<typeof customFetch>;
  },
  queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useListBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGet<
  TData = Awaited<
    ReturnType<typeof listBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGet>
  >,
  TError = HTTPValidationError,
>(
  boardId: string,
  params?: ListBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGetParams,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<
          ReturnType<typeof listBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGet>
        >,
        TError,
        TData
      >
    > &
      Pick<
        UndefinedInitialDataOptions<
          Awaited<
            ReturnType<
              typeof listBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGet
            >
          >,
          TError,
          Awaited<
            ReturnType<
              typeof listBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGet
            >
          >
        >,
        "initialData"
      >;
    request?: SecondParameter<typeof customFetch>;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useListBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGet<
  TData = Awaited<
    ReturnType<typeof listBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGet>
  >,
  TError = HTTPValidationError,
>(
  boardId: string,
  params?: ListBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGetParams,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<
          ReturnType<typeof listBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGet>
        >,
        TError,
        TData
      >
    >;
    request?: SecondParameter<typeof customFetch>;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
/**
 * @summary List issues for board's linked repositories
 */

export function useListBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGet<
  TData = Awaited<
    ReturnType<typeof listBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGet>
  >,
  TError = HTTPValidationError,
>(
  boardId: string,
  params?: ListBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGetParams,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<
          ReturnType<typeof listBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGet>
        >,
        TError,
        TData
      >
    >;
    request?: SecondParameter<typeof customFetch>;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
} {
  const queryOptions =
    getListBoardIssuesApiV1AgentBoardsBoardIdGitIssuesGetQueryOptions(
      boardId,
      params,
      options,
    );

  const query = useQuery(queryOptions, queryClient) as UseQueryResult<
    TData,
    TError
  > & { queryKey: DataTag<QueryKey, TData, TError> };

  return { ...query, queryKey: queryOptions.queryKey };
}

/**
 * Read a specific Forgejo issue by id, ensuring it belongs to a repository linked to the specified board.

Use this endpoint when an agent needs to inspect a specific issue within the context of a board's repositories.
 * @summary Read one issue from board-linked repositories
 */
export type readBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGetResponse200 =
  {
    data: ForgejoIssueRead;
    status: 200;
  };

export type readBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGetResponse422 =
  {
    data: HTTPValidationError;
    status: 422;
  };

export type readBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGetResponseSuccess =
  readBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGetResponse200 & {
    headers: Headers;
  };
export type readBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGetResponseError =
  readBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGetResponse422 & {
    headers: Headers;
  };

export type readBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGetResponse =
  | readBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGetResponseSuccess
  | readBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGetResponseError;

export const getReadBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGetUrl = (
  boardId: string,
  issueId: string,
) => {
  return `/api/v1/agent/boards/${boardId}/git/issues/${issueId}`;
};

export const readBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGet = async (
  boardId: string,
  issueId: string,
  options?: RequestInit,
): Promise<readBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGetResponse> => {
  return customFetch<readBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGetResponse>(
    getReadBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGetUrl(
      boardId,
      issueId,
    ),
    {
      ...options,
      method: "GET",
    },
  );
};

export const getReadBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGetQueryKey =
  (boardId: string, issueId: string) => {
    return [`/api/v1/agent/boards/${boardId}/git/issues/${issueId}`] as const;
  };

export const getReadBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGetQueryOptions =
  <
    TData = Awaited<
      ReturnType<
        typeof readBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGet
      >
    >,
    TError = HTTPValidationError,
  >(
    boardId: string,
    issueId: string,
    options?: {
      query?: Partial<
        UseQueryOptions<
          Awaited<
            ReturnType<
              typeof readBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGet
            >
          >,
          TError,
          TData
        >
      >;
      request?: SecondParameter<typeof customFetch>;
    },
  ) => {
    const { query: queryOptions, request: requestOptions } = options ?? {};

    const queryKey =
      queryOptions?.queryKey ??
      getReadBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGetQueryKey(
        boardId,
        issueId,
      );

    const queryFn: QueryFunction<
      Awaited<
        ReturnType<
          typeof readBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGet
        >
      >
    > = ({ signal }) =>
      readBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGet(
        boardId,
        issueId,
        { signal, ...requestOptions },
      );

    return {
      queryKey,
      queryFn,
      enabled: !!(boardId && issueId),
      ...queryOptions,
    } as UseQueryOptions<
      Awaited<
        ReturnType<
          typeof readBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGet
        >
      >,
      TError,
      TData
    > & { queryKey: DataTag<QueryKey, TData, TError> };
  };

export type ReadBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGetQueryResult =
  NonNullable<
    Awaited<
      ReturnType<
        typeof readBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGet
      >
    >
  >;
export type ReadBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGetQueryError =
  HTTPValidationError;

export function useReadBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGet<
  TData = Awaited<
    ReturnType<typeof readBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGet>
  >,
  TError = HTTPValidationError,
>(
  boardId: string,
  issueId: string,
  options: {
    query: Partial<
      UseQueryOptions<
        Awaited<
          ReturnType<
            typeof readBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGet
          >
        >,
        TError,
        TData
      >
    > &
      Pick<
        DefinedInitialDataOptions<
          Awaited<
            ReturnType<
              typeof readBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGet
            >
          >,
          TError,
          Awaited<
            ReturnType<
              typeof readBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGet
            >
          >
        >,
        "initialData"
      >;
    request?: SecondParameter<typeof customFetch>;
  },
  queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useReadBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGet<
  TData = Awaited<
    ReturnType<typeof readBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGet>
  >,
  TError = HTTPValidationError,
>(
  boardId: string,
  issueId: string,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<
          ReturnType<
            typeof readBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGet
          >
        >,
        TError,
        TData
      >
    > &
      Pick<
        UndefinedInitialDataOptions<
          Awaited<
            ReturnType<
              typeof readBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGet
            >
          >,
          TError,
          Awaited<
            ReturnType<
              typeof readBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGet
            >
          >
        >,
        "initialData"
      >;
    request?: SecondParameter<typeof customFetch>;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useReadBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGet<
  TData = Awaited<
    ReturnType<typeof readBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGet>
  >,
  TError = HTTPValidationError,
>(
  boardId: string,
  issueId: string,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<
          ReturnType<
            typeof readBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGet
          >
        >,
        TError,
        TData
      >
    >;
    request?: SecondParameter<typeof customFetch>;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
/**
 * @summary Read one issue from board-linked repositories
 */

export function useReadBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGet<
  TData = Awaited<
    ReturnType<typeof readBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGet>
  >,
  TError = HTTPValidationError,
>(
  boardId: string,
  issueId: string,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<
          ReturnType<
            typeof readBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGet
          >
        >,
        TError,
        TData
      >
    >;
    request?: SecondParameter<typeof customFetch>;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
} {
  const queryOptions =
    getReadBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdGetQueryOptions(
      boardId,
      issueId,
      options,
    );

  const query = useQuery(queryOptions, queryClient) as UseQueryResult<
    TData,
    TError
  > & { queryKey: DataTag<QueryKey, TData, TError> };

  return { ...query, queryKey: queryOptions.queryKey };
}

/**
 * Close a Forgejo issue by its local ID as a board-lead agent. Only board lead agents can close issues. The issue must belong to a repository linked to the target board.
 * @summary Close a Forgejo issue (agent)
 */
export type closeBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePostResponse200 =
  {
    data: CloseIssueResponse;
    status: 200;
  };

export type closeBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePostResponse403 =
  {
    data: void;
    status: 403;
  };

export type closeBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePostResponse404 =
  {
    data: void;
    status: 404;
  };

export type closeBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePostResponse409 =
  {
    data: void;
    status: 409;
  };

export type closeBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePostResponse422 =
  {
    data: HTTPValidationError;
    status: 422;
  };

export type closeBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePostResponse502 =
  {
    data: void;
    status: 502;
  };

export type closeBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePostResponseSuccess =
  closeBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePostResponse200 & {
    headers: Headers;
  };
export type closeBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePostResponseError =
  (
    | closeBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePostResponse403
    | closeBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePostResponse404
    | closeBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePostResponse409
    | closeBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePostResponse422
    | closeBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePostResponse502
  ) & {
    headers: Headers;
  };

export type closeBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePostResponse =

    | closeBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePostResponseSuccess
    | closeBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePostResponseError;

export const getCloseBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePostUrl =
  (boardId: string, issueId: string) => {
    return `/api/v1/agent/boards/${boardId}/git/issues/${issueId}/close`;
  };

export const closeBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePost =
  async (
    boardId: string,
    issueId: string,
    options?: RequestInit,
  ): Promise<closeBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePostResponse> => {
    return customFetch<closeBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePostResponse>(
      getCloseBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePostUrl(
        boardId,
        issueId,
      ),
      {
        ...options,
        method: "POST",
      },
    );
  };

export const getCloseBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePostMutationOptions =
  <TError = void | HTTPValidationError, TContext = unknown>(options?: {
    mutation?: UseMutationOptions<
      Awaited<
        ReturnType<
          typeof closeBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePost
        >
      >,
      TError,
      { boardId: string; issueId: string },
      TContext
    >;
    request?: SecondParameter<typeof customFetch>;
  }): UseMutationOptions<
    Awaited<
      ReturnType<
        typeof closeBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePost
      >
    >,
    TError,
    { boardId: string; issueId: string },
    TContext
  > => {
    const mutationKey = [
      "closeBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePost",
    ];
    const { mutation: mutationOptions, request: requestOptions } = options
      ? options.mutation &&
        "mutationKey" in options.mutation &&
        options.mutation.mutationKey
        ? options
        : { ...options, mutation: { ...options.mutation, mutationKey } }
      : { mutation: { mutationKey }, request: undefined };

    const mutationFn: MutationFunction<
      Awaited<
        ReturnType<
          typeof closeBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePost
        >
      >,
      { boardId: string; issueId: string }
    > = (props) => {
      const { boardId, issueId } = props ?? {};

      return closeBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePost(
        boardId,
        issueId,
        requestOptions,
      );
    };

    return { mutationFn, ...mutationOptions };
  };

export type CloseBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePostMutationResult =
  NonNullable<
    Awaited<
      ReturnType<
        typeof closeBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePost
      >
    >
  >;

export type CloseBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePostMutationError =
  void | HTTPValidationError;

/**
 * @summary Close a Forgejo issue (agent)
 */
export const useCloseBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePost =
  <TError = void | HTTPValidationError, TContext = unknown>(
    options?: {
      mutation?: UseMutationOptions<
        Awaited<
          ReturnType<
            typeof closeBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePost
          >
        >,
        TError,
        { boardId: string; issueId: string },
        TContext
      >;
      request?: SecondParameter<typeof customFetch>;
    },
    queryClient?: QueryClient,
  ): UseMutationResult<
    Awaited<
      ReturnType<
        typeof closeBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePost
      >
    >,
    TError,
    { boardId: string; issueId: string },
    TContext
  > => {
    return useMutation(
      getCloseBoardIssueApiV1AgentBoardsBoardIdGitIssuesIssueIdClosePostMutationOptions(
        options,
      ),
      queryClient,
    );
  };
