/**
 * Generated by orval v8.8.0 🍺
 * Do not edit manually.
 * OpenAPI spec version: 0.0.0
 */
import { useMutation } from "@tanstack/react-query";
import type {
  MutationFunction,
  QueryClient,
  UseMutationOptions,
  UseMutationResult,
} from "@tanstack/react-query";

import { privateMutator } from "../../../privateClient";

export const apiStripeStripeWebhookCreate = (signal?: AbortSignal) => {
  return privateMutator<void>({
    url: `/api/stripe/stripe-webhook/`,
    method: "POST",
    signal,
  });
};

export const getApiStripeStripeWebhookCreateMutationOptions = <
  TError = unknown,
  TContext = unknown,
>(options?: {
  mutation?: UseMutationOptions<
    Awaited<ReturnType<typeof apiStripeStripeWebhookCreate>>,
    TError,
    void,
    TContext
  >;
}): UseMutationOptions<
  Awaited<ReturnType<typeof apiStripeStripeWebhookCreate>>,
  TError,
  void,
  TContext
> => {
  const mutationKey = ["apiStripeStripeWebhookCreate"];
  const { mutation: mutationOptions } = options
    ? options.mutation &&
      "mutationKey" in options.mutation &&
      options.mutation.mutationKey
      ? options
      : { ...options, mutation: { ...options.mutation, mutationKey } }
    : { mutation: { mutationKey } };

  const mutationFn: MutationFunction<
    Awaited<ReturnType<typeof apiStripeStripeWebhookCreate>>,
    void
  > = () => {
    return apiStripeStripeWebhookCreate();
  };

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

export type ApiStripeStripeWebhookCreateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiStripeStripeWebhookCreate>>
>;

export type ApiStripeStripeWebhookCreateMutationError = unknown;

export const useApiStripeStripeWebhookCreate = <
  TError = unknown,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiStripeStripeWebhookCreate>>,
      TError,
      void,
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiStripeStripeWebhookCreate>>,
  TError,
  void,
  TContext
> => {
  return useMutation(
    getApiStripeStripeWebhookCreateMutationOptions(options),
    queryClient,
  );
};
