/**
 * 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 {
  BoardOnboardingAgentComplete,
  BoardOnboardingAgentQuestion,
  BoardOnboardingAnswer,
  BoardOnboardingConfirm,
  BoardOnboardingRead,
  BoardOnboardingStart,
  BoardRead,
  HTTPValidationError,
} from ".././model";

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

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

/**
 * Get the latest onboarding session for a board.
 * @summary Get Onboarding
 */
export type getOnboardingApiV1BoardsBoardIdOnboardingGetResponse200 = {
  data: BoardOnboardingRead;
  status: 200;
};

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

export type getOnboardingApiV1BoardsBoardIdOnboardingGetResponseSuccess =
  getOnboardingApiV1BoardsBoardIdOnboardingGetResponse200 & {
    headers: Headers;
  };
export type getOnboardingApiV1BoardsBoardIdOnboardingGetResponseError =
  getOnboardingApiV1BoardsBoardIdOnboardingGetResponse422 & {
    headers: Headers;
  };

export type getOnboardingApiV1BoardsBoardIdOnboardingGetResponse =
  | getOnboardingApiV1BoardsBoardIdOnboardingGetResponseSuccess
  | getOnboardingApiV1BoardsBoardIdOnboardingGetResponseError;

export const getGetOnboardingApiV1BoardsBoardIdOnboardingGetUrl = (
  boardId: string,
) => {
  return `/api/v1/boards/${boardId}/onboarding`;
};

export const getOnboardingApiV1BoardsBoardIdOnboardingGet = async (
  boardId: string,
  options?: RequestInit,
): Promise<getOnboardingApiV1BoardsBoardIdOnboardingGetResponse> => {
  return customFetch<getOnboardingApiV1BoardsBoardIdOnboardingGetResponse>(
    getGetOnboardingApiV1BoardsBoardIdOnboardingGetUrl(boardId),
    {
      ...options,
      method: "GET",
    },
  );
};

export const getGetOnboardingApiV1BoardsBoardIdOnboardingGetQueryKey = (
  boardId: string,
) => {
  return [`/api/v1/boards/${boardId}/onboarding`] as const;
};

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

  const queryKey =
    queryOptions?.queryKey ??
    getGetOnboardingApiV1BoardsBoardIdOnboardingGetQueryKey(boardId);

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

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

export type GetOnboardingApiV1BoardsBoardIdOnboardingGetQueryResult =
  NonNullable<
    Awaited<ReturnType<typeof getOnboardingApiV1BoardsBoardIdOnboardingGet>>
  >;
export type GetOnboardingApiV1BoardsBoardIdOnboardingGetQueryError =
  HTTPValidationError;

export function useGetOnboardingApiV1BoardsBoardIdOnboardingGet<
  TData = Awaited<
    ReturnType<typeof getOnboardingApiV1BoardsBoardIdOnboardingGet>
  >,
  TError = HTTPValidationError,
>(
  boardId: string,
  options: {
    query: Partial<
      UseQueryOptions<
        Awaited<
          ReturnType<typeof getOnboardingApiV1BoardsBoardIdOnboardingGet>
        >,
        TError,
        TData
      >
    > &
      Pick<
        DefinedInitialDataOptions<
          Awaited<
            ReturnType<typeof getOnboardingApiV1BoardsBoardIdOnboardingGet>
          >,
          TError,
          Awaited<
            ReturnType<typeof getOnboardingApiV1BoardsBoardIdOnboardingGet>
          >
        >,
        "initialData"
      >;
    request?: SecondParameter<typeof customFetch>;
  },
  queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetOnboardingApiV1BoardsBoardIdOnboardingGet<
  TData = Awaited<
    ReturnType<typeof getOnboardingApiV1BoardsBoardIdOnboardingGet>
  >,
  TError = HTTPValidationError,
>(
  boardId: string,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<
          ReturnType<typeof getOnboardingApiV1BoardsBoardIdOnboardingGet>
        >,
        TError,
        TData
      >
    > &
      Pick<
        UndefinedInitialDataOptions<
          Awaited<
            ReturnType<typeof getOnboardingApiV1BoardsBoardIdOnboardingGet>
          >,
          TError,
          Awaited<
            ReturnType<typeof getOnboardingApiV1BoardsBoardIdOnboardingGet>
          >
        >,
        "initialData"
      >;
    request?: SecondParameter<typeof customFetch>;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useGetOnboardingApiV1BoardsBoardIdOnboardingGet<
  TData = Awaited<
    ReturnType<typeof getOnboardingApiV1BoardsBoardIdOnboardingGet>
  >,
  TError = HTTPValidationError,
>(
  boardId: string,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<
          ReturnType<typeof getOnboardingApiV1BoardsBoardIdOnboardingGet>
        >,
        TError,
        TData
      >
    >;
    request?: SecondParameter<typeof customFetch>;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
/**
 * @summary Get Onboarding
 */

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

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

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

/**
 * Start onboarding and send instructions to the gateway agent.
 * @summary Start Onboarding
 */
export type startOnboardingApiV1BoardsBoardIdOnboardingStartPostResponse200 = {
  data: BoardOnboardingRead;
  status: 200;
};

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

export type startOnboardingApiV1BoardsBoardIdOnboardingStartPostResponseSuccess =
  startOnboardingApiV1BoardsBoardIdOnboardingStartPostResponse200 & {
    headers: Headers;
  };
export type startOnboardingApiV1BoardsBoardIdOnboardingStartPostResponseError =
  startOnboardingApiV1BoardsBoardIdOnboardingStartPostResponse422 & {
    headers: Headers;
  };

export type startOnboardingApiV1BoardsBoardIdOnboardingStartPostResponse =
  | startOnboardingApiV1BoardsBoardIdOnboardingStartPostResponseSuccess
  | startOnboardingApiV1BoardsBoardIdOnboardingStartPostResponseError;

export const getStartOnboardingApiV1BoardsBoardIdOnboardingStartPostUrl = (
  boardId: string,
) => {
  return `/api/v1/boards/${boardId}/onboarding/start`;
};

export const startOnboardingApiV1BoardsBoardIdOnboardingStartPost = async (
  boardId: string,
  boardOnboardingStart: BoardOnboardingStart,
  options?: RequestInit,
): Promise<startOnboardingApiV1BoardsBoardIdOnboardingStartPostResponse> => {
  return customFetch<startOnboardingApiV1BoardsBoardIdOnboardingStartPostResponse>(
    getStartOnboardingApiV1BoardsBoardIdOnboardingStartPostUrl(boardId),
    {
      ...options,
      method: "POST",
      headers: { "Content-Type": "application/json", ...options?.headers },
      body: JSON.stringify(boardOnboardingStart),
    },
  );
};

export const getStartOnboardingApiV1BoardsBoardIdOnboardingStartPostMutationOptions =
  <TError = HTTPValidationError, TContext = unknown>(options?: {
    mutation?: UseMutationOptions<
      Awaited<
        ReturnType<typeof startOnboardingApiV1BoardsBoardIdOnboardingStartPost>
      >,
      TError,
      { boardId: string; data: BoardOnboardingStart },
      TContext
    >;
    request?: SecondParameter<typeof customFetch>;
  }): UseMutationOptions<
    Awaited<
      ReturnType<typeof startOnboardingApiV1BoardsBoardIdOnboardingStartPost>
    >,
    TError,
    { boardId: string; data: BoardOnboardingStart },
    TContext
  > => {
    const mutationKey = [
      "startOnboardingApiV1BoardsBoardIdOnboardingStartPost",
    ];
    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 startOnboardingApiV1BoardsBoardIdOnboardingStartPost>
      >,
      { boardId: string; data: BoardOnboardingStart }
    > = (props) => {
      const { boardId, data } = props ?? {};

      return startOnboardingApiV1BoardsBoardIdOnboardingStartPost(
        boardId,
        data,
        requestOptions,
      );
    };

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

export type StartOnboardingApiV1BoardsBoardIdOnboardingStartPostMutationResult =
  NonNullable<
    Awaited<
      ReturnType<typeof startOnboardingApiV1BoardsBoardIdOnboardingStartPost>
    >
  >;
export type StartOnboardingApiV1BoardsBoardIdOnboardingStartPostMutationBody =
  BoardOnboardingStart;
export type StartOnboardingApiV1BoardsBoardIdOnboardingStartPostMutationError =
  HTTPValidationError;

/**
 * @summary Start Onboarding
 */
export const useStartOnboardingApiV1BoardsBoardIdOnboardingStartPost = <
  TError = HTTPValidationError,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<
        ReturnType<typeof startOnboardingApiV1BoardsBoardIdOnboardingStartPost>
      >,
      TError,
      { boardId: string; data: BoardOnboardingStart },
      TContext
    >;
    request?: SecondParameter<typeof customFetch>;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<
    ReturnType<typeof startOnboardingApiV1BoardsBoardIdOnboardingStartPost>
  >,
  TError,
  { boardId: string; data: BoardOnboardingStart },
  TContext
> => {
  return useMutation(
    getStartOnboardingApiV1BoardsBoardIdOnboardingStartPostMutationOptions(
      options,
    ),
    queryClient,
  );
};
/**
 * Send a user onboarding answer to the gateway agent.
 * @summary Answer Onboarding
 */
export type answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostResponse200 =
  {
    data: BoardOnboardingRead;
    status: 200;
  };

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

export type answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostResponseSuccess =
  answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostResponse200 & {
    headers: Headers;
  };
export type answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostResponseError =
  answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostResponse422 & {
    headers: Headers;
  };

export type answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostResponse =
  | answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostResponseSuccess
  | answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostResponseError;

export const getAnswerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostUrl = (
  boardId: string,
) => {
  return `/api/v1/boards/${boardId}/onboarding/answer`;
};

export const answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPost = async (
  boardId: string,
  boardOnboardingAnswer: BoardOnboardingAnswer,
  options?: RequestInit,
): Promise<answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostResponse> => {
  return customFetch<answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostResponse>(
    getAnswerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostUrl(boardId),
    {
      ...options,
      method: "POST",
      headers: { "Content-Type": "application/json", ...options?.headers },
      body: JSON.stringify(boardOnboardingAnswer),
    },
  );
};

export const getAnswerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostMutationOptions =
  <TError = HTTPValidationError, TContext = unknown>(options?: {
    mutation?: UseMutationOptions<
      Awaited<
        ReturnType<
          typeof answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPost
        >
      >,
      TError,
      { boardId: string; data: BoardOnboardingAnswer },
      TContext
    >;
    request?: SecondParameter<typeof customFetch>;
  }): UseMutationOptions<
    Awaited<
      ReturnType<typeof answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPost>
    >,
    TError,
    { boardId: string; data: BoardOnboardingAnswer },
    TContext
  > => {
    const mutationKey = [
      "answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPost",
    ];
    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 answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPost
        >
      >,
      { boardId: string; data: BoardOnboardingAnswer }
    > = (props) => {
      const { boardId, data } = props ?? {};

      return answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPost(
        boardId,
        data,
        requestOptions,
      );
    };

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

export type AnswerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostMutationResult =
  NonNullable<
    Awaited<
      ReturnType<typeof answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPost>
    >
  >;
export type AnswerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostMutationBody =
  BoardOnboardingAnswer;
export type AnswerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostMutationError =
  HTTPValidationError;

/**
 * @summary Answer Onboarding
 */
export const useAnswerOnboardingApiV1BoardsBoardIdOnboardingAnswerPost = <
  TError = HTTPValidationError,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<
        ReturnType<
          typeof answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPost
        >
      >,
      TError,
      { boardId: string; data: BoardOnboardingAnswer },
      TContext
    >;
    request?: SecondParameter<typeof customFetch>;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<
    ReturnType<typeof answerOnboardingApiV1BoardsBoardIdOnboardingAnswerPost>
  >,
  TError,
  { boardId: string; data: BoardOnboardingAnswer },
  TContext
> => {
  return useMutation(
    getAnswerOnboardingApiV1BoardsBoardIdOnboardingAnswerPostMutationOptions(
      options,
    ),
    queryClient,
  );
};
/**
 * Store onboarding updates submitted by the gateway agent.
 * @summary Agent Onboarding Update
 */
export type agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostResponse200 =
  {
    data: BoardOnboardingRead;
    status: 200;
  };

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

export type agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostResponseSuccess =
  agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostResponse200 & {
    headers: Headers;
  };
export type agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostResponseError =
  agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostResponse422 & {
    headers: Headers;
  };

export type agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostResponse =
  | agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostResponseSuccess
  | agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostResponseError;

export const getAgentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostUrl =
  (boardId: string) => {
    return `/api/v1/boards/${boardId}/onboarding/agent`;
  };

export const agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPost =
  async (
    boardId: string,
    boardOnboardingAgentCompleteBoardOnboardingAgentQuestion:
      | BoardOnboardingAgentComplete
      | BoardOnboardingAgentQuestion,
    options?: RequestInit,
  ): Promise<agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostResponse> => {
    return customFetch<agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostResponse>(
      getAgentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostUrl(boardId),
      {
        ...options,
        method: "POST",
        headers: { "Content-Type": "application/json", ...options?.headers },
        body: JSON.stringify(
          boardOnboardingAgentCompleteBoardOnboardingAgentQuestion,
        ),
      },
    );
  };

export const getAgentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostMutationOptions =
  <TError = HTTPValidationError, TContext = unknown>(options?: {
    mutation?: UseMutationOptions<
      Awaited<
        ReturnType<
          typeof agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPost
        >
      >,
      TError,
      {
        boardId: string;
        data: BoardOnboardingAgentComplete | BoardOnboardingAgentQuestion;
      },
      TContext
    >;
    request?: SecondParameter<typeof customFetch>;
  }): UseMutationOptions<
    Awaited<
      ReturnType<
        typeof agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPost
      >
    >,
    TError,
    {
      boardId: string;
      data: BoardOnboardingAgentComplete | BoardOnboardingAgentQuestion;
    },
    TContext
  > => {
    const mutationKey = [
      "agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPost",
    ];
    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 agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPost
        >
      >,
      {
        boardId: string;
        data: BoardOnboardingAgentComplete | BoardOnboardingAgentQuestion;
      }
    > = (props) => {
      const { boardId, data } = props ?? {};

      return agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPost(
        boardId,
        data,
        requestOptions,
      );
    };

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

export type AgentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostMutationResult =
  NonNullable<
    Awaited<
      ReturnType<
        typeof agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPost
      >
    >
  >;
export type AgentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostMutationBody =
  BoardOnboardingAgentComplete | BoardOnboardingAgentQuestion;
export type AgentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostMutationError =
  HTTPValidationError;

/**
 * @summary Agent Onboarding Update
 */
export const useAgentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPost = <
  TError = HTTPValidationError,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<
        ReturnType<
          typeof agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPost
        >
      >,
      TError,
      {
        boardId: string;
        data: BoardOnboardingAgentComplete | BoardOnboardingAgentQuestion;
      },
      TContext
    >;
    request?: SecondParameter<typeof customFetch>;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<
    ReturnType<
      typeof agentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPost
    >
  >,
  TError,
  {
    boardId: string;
    data: BoardOnboardingAgentComplete | BoardOnboardingAgentQuestion;
  },
  TContext
> => {
  return useMutation(
    getAgentOnboardingUpdateApiV1BoardsBoardIdOnboardingAgentPostMutationOptions(
      options,
    ),
    queryClient,
  );
};
/**
 * Confirm onboarding results and provision the board lead agent.
 * @summary Confirm Onboarding
 */
export type confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostResponse200 =
  {
    data: BoardRead;
    status: 200;
  };

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

export type confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostResponseSuccess =
  confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostResponse200 & {
    headers: Headers;
  };
export type confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostResponseError =
  confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostResponse422 & {
    headers: Headers;
  };

export type confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostResponse =
  | confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostResponseSuccess
  | confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostResponseError;

export const getConfirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostUrl = (
  boardId: string,
) => {
  return `/api/v1/boards/${boardId}/onboarding/confirm`;
};

export const confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPost = async (
  boardId: string,
  boardOnboardingConfirm: BoardOnboardingConfirm,
  options?: RequestInit,
): Promise<confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostResponse> => {
  return customFetch<confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostResponse>(
    getConfirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostUrl(boardId),
    {
      ...options,
      method: "POST",
      headers: { "Content-Type": "application/json", ...options?.headers },
      body: JSON.stringify(boardOnboardingConfirm),
    },
  );
};

export const getConfirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostMutationOptions =
  <TError = HTTPValidationError, TContext = unknown>(options?: {
    mutation?: UseMutationOptions<
      Awaited<
        ReturnType<
          typeof confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPost
        >
      >,
      TError,
      { boardId: string; data: BoardOnboardingConfirm },
      TContext
    >;
    request?: SecondParameter<typeof customFetch>;
  }): UseMutationOptions<
    Awaited<
      ReturnType<
        typeof confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPost
      >
    >,
    TError,
    { boardId: string; data: BoardOnboardingConfirm },
    TContext
  > => {
    const mutationKey = [
      "confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPost",
    ];
    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 confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPost
        >
      >,
      { boardId: string; data: BoardOnboardingConfirm }
    > = (props) => {
      const { boardId, data } = props ?? {};

      return confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPost(
        boardId,
        data,
        requestOptions,
      );
    };

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

export type ConfirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostMutationResult =
  NonNullable<
    Awaited<
      ReturnType<
        typeof confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPost
      >
    >
  >;
export type ConfirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostMutationBody =
  BoardOnboardingConfirm;
export type ConfirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostMutationError =
  HTTPValidationError;

/**
 * @summary Confirm Onboarding
 */
export const useConfirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPost = <
  TError = HTTPValidationError,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<
        ReturnType<
          typeof confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPost
        >
      >,
      TError,
      { boardId: string; data: BoardOnboardingConfirm },
      TContext
    >;
    request?: SecondParameter<typeof customFetch>;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<
    ReturnType<typeof confirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPost>
  >,
  TError,
  { boardId: string; data: BoardOnboardingConfirm },
  TContext
> => {
  return useMutation(
    getConfirmOnboardingApiV1BoardsBoardIdOnboardingConfirmPostMutationOptions(
      options,
    ),
    queryClient,
  );
};
