/**
 * 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 { publicMutator } from "../../publicClient";

export const apiAdvertisementContactMeCreate = (signal?: AbortSignal) => {
  return publicMutator<void>({
    url: `/api/advertisement/contact-me/`,
    method: "POST",
    signal,
  });
};

export const getApiAdvertisementContactMeCreateMutationOptions = <
  TError = unknown,
  TContext = unknown,
>(options?: {
  mutation?: UseMutationOptions<
    Awaited<ReturnType<typeof apiAdvertisementContactMeCreate>>,
    TError,
    void,
    TContext
  >;
}): UseMutationOptions<
  Awaited<ReturnType<typeof apiAdvertisementContactMeCreate>>,
  TError,
  void,
  TContext
> => {
  const mutationKey = ["apiAdvertisementContactMeCreate"];
  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 apiAdvertisementContactMeCreate>>,
    void
  > = () => {
    return apiAdvertisementContactMeCreate();
  };

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

export type ApiAdvertisementContactMeCreateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiAdvertisementContactMeCreate>>
>;

export type ApiAdvertisementContactMeCreateMutationError = unknown;

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