/**
 * Generated by orval v8.8.0 🍺
 * Do not edit manually.
 * OpenAPI spec version: 0.0.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 {
  ApiAdvertisementContactMessagesListParams,
  ContactMe,
  PaginatedContactMeList,
  PatchedContactMe,
} from "../models";

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

// https://stackoverflow.com/questions/49579094/typescript-conditional-types-filter-out-readonly-properties-pick-only-requir/49579497#49579497
type IfEquals<X, Y, A = X, B = never> =
  (<T>() => T extends X ? 1 : 2) extends <T>() => T extends Y ? 1 : 2 ? A : B;

type WritableKeys<T> = {
  [P in keyof T]-?: IfEquals<
    { [Q in P]: T[P] },
    { -readonly [Q in P]: T[P] },
    P
  >;
}[keyof T];

type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (
  k: infer I,
) => void
  ? I
  : never;
type DistributeReadOnlyOverUnions<T> = T extends any ? NonReadonly<T> : never;

type Writable<T> = Pick<T, WritableKeys<T>>;
type NonReadonly<T> = [T] extends [UnionToIntersection<T>]
  ? {
      [P in keyof Writable<T>]: T[P] extends object
        ? NonReadonly<NonNullable<T[P]>>
        : T[P];
    }
  : DistributeReadOnlyOverUnions<T>;

/**
 * @summary List contact messages (admin)
 */
export const apiAdvertisementContactMessagesList = (
  params?: ApiAdvertisementContactMessagesListParams,
  signal?: AbortSignal,
) => {
  return privateMutator<PaginatedContactMeList>({
    url: `/api/advertisement/contact-messages/`,
    method: "GET",
    params,
    signal,
  });
};

export const getApiAdvertisementContactMessagesListQueryKey = (
  params?: ApiAdvertisementContactMessagesListParams,
) => {
  return [
    `/api/advertisement/contact-messages/`,
    ...(params ? [params] : []),
  ] as const;
};

export const getApiAdvertisementContactMessagesListQueryOptions = <
  TData = Awaited<ReturnType<typeof apiAdvertisementContactMessagesList>>,
  TError = unknown,
>(
  params?: ApiAdvertisementContactMessagesListParams,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiAdvertisementContactMessagesList>>,
        TError,
        TData
      >
    >;
  },
) => {
  const { query: queryOptions } = options ?? {};

  const queryKey =
    queryOptions?.queryKey ??
    getApiAdvertisementContactMessagesListQueryKey(params);

  const queryFn: QueryFunction<
    Awaited<ReturnType<typeof apiAdvertisementContactMessagesList>>
  > = ({ signal }) => apiAdvertisementContactMessagesList(params, signal);

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

export type ApiAdvertisementContactMessagesListQueryResult = NonNullable<
  Awaited<ReturnType<typeof apiAdvertisementContactMessagesList>>
>;
export type ApiAdvertisementContactMessagesListQueryError = unknown;

export function useApiAdvertisementContactMessagesList<
  TData = Awaited<ReturnType<typeof apiAdvertisementContactMessagesList>>,
  TError = unknown,
>(
  params: undefined | ApiAdvertisementContactMessagesListParams,
  options: {
    query: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiAdvertisementContactMessagesList>>,
        TError,
        TData
      >
    > &
      Pick<
        DefinedInitialDataOptions<
          Awaited<ReturnType<typeof apiAdvertisementContactMessagesList>>,
          TError,
          Awaited<ReturnType<typeof apiAdvertisementContactMessagesList>>
        >,
        "initialData"
      >;
  },
  queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useApiAdvertisementContactMessagesList<
  TData = Awaited<ReturnType<typeof apiAdvertisementContactMessagesList>>,
  TError = unknown,
>(
  params?: ApiAdvertisementContactMessagesListParams,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiAdvertisementContactMessagesList>>,
        TError,
        TData
      >
    > &
      Pick<
        UndefinedInitialDataOptions<
          Awaited<ReturnType<typeof apiAdvertisementContactMessagesList>>,
          TError,
          Awaited<ReturnType<typeof apiAdvertisementContactMessagesList>>
        >,
        "initialData"
      >;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useApiAdvertisementContactMessagesList<
  TData = Awaited<ReturnType<typeof apiAdvertisementContactMessagesList>>,
  TError = unknown,
>(
  params?: ApiAdvertisementContactMessagesListParams,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiAdvertisementContactMessagesList>>,
        TError,
        TData
      >
    >;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
/**
 * @summary List contact messages (admin)
 */

export function useApiAdvertisementContactMessagesList<
  TData = Awaited<ReturnType<typeof apiAdvertisementContactMessagesList>>,
  TError = unknown,
>(
  params?: ApiAdvertisementContactMessagesListParams,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiAdvertisementContactMessagesList>>,
        TError,
        TData
      >
    >;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
} {
  const queryOptions = getApiAdvertisementContactMessagesListQueryOptions(
    params,
    options,
  );

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

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

/**
 * @summary Create contact message (admin)
 */
export const apiAdvertisementContactMessagesCreate = (
  contactMe: NonReadonly<ContactMe>,
  signal?: AbortSignal,
) => {
  return privateMutator<ContactMe>({
    url: `/api/advertisement/contact-messages/`,
    method: "POST",
    headers: { "Content-Type": "application/json" },
    data: contactMe,
    signal,
  });
};

export const getApiAdvertisementContactMessagesCreateMutationOptions = <
  TError = unknown,
  TContext = unknown,
>(options?: {
  mutation?: UseMutationOptions<
    Awaited<ReturnType<typeof apiAdvertisementContactMessagesCreate>>,
    TError,
    { data: NonReadonly<ContactMe> },
    TContext
  >;
}): UseMutationOptions<
  Awaited<ReturnType<typeof apiAdvertisementContactMessagesCreate>>,
  TError,
  { data: NonReadonly<ContactMe> },
  TContext
> => {
  const mutationKey = ["apiAdvertisementContactMessagesCreate"];
  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 apiAdvertisementContactMessagesCreate>>,
    { data: NonReadonly<ContactMe> }
  > = (props) => {
    const { data } = props ?? {};

    return apiAdvertisementContactMessagesCreate(data);
  };

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

export type ApiAdvertisementContactMessagesCreateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiAdvertisementContactMessagesCreate>>
>;
export type ApiAdvertisementContactMessagesCreateMutationBody =
  NonReadonly<ContactMe>;
export type ApiAdvertisementContactMessagesCreateMutationError = unknown;

/**
 * @summary Create contact message (admin)
 */
export const useApiAdvertisementContactMessagesCreate = <
  TError = unknown,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiAdvertisementContactMessagesCreate>>,
      TError,
      { data: NonReadonly<ContactMe> },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiAdvertisementContactMessagesCreate>>,
  TError,
  { data: NonReadonly<ContactMe> },
  TContext
> => {
  return useMutation(
    getApiAdvertisementContactMessagesCreateMutationOptions(options),
    queryClient,
  );
};
/**
 * @summary Retrieve contact message (admin)
 */
export const apiAdvertisementContactMessagesRetrieve = (
  id: number,
  signal?: AbortSignal,
) => {
  return privateMutator<ContactMe>({
    url: `/api/advertisement/contact-messages/${id}/`,
    method: "GET",
    signal,
  });
};

export const getApiAdvertisementContactMessagesRetrieveQueryKey = (
  id: number,
) => {
  return [`/api/advertisement/contact-messages/${id}/`] as const;
};

export const getApiAdvertisementContactMessagesRetrieveQueryOptions = <
  TData = Awaited<ReturnType<typeof apiAdvertisementContactMessagesRetrieve>>,
  TError = unknown,
>(
  id: number,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiAdvertisementContactMessagesRetrieve>>,
        TError,
        TData
      >
    >;
  },
) => {
  const { query: queryOptions } = options ?? {};

  const queryKey =
    queryOptions?.queryKey ??
    getApiAdvertisementContactMessagesRetrieveQueryKey(id);

  const queryFn: QueryFunction<
    Awaited<ReturnType<typeof apiAdvertisementContactMessagesRetrieve>>
  > = ({ signal }) => apiAdvertisementContactMessagesRetrieve(id, signal);

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

export type ApiAdvertisementContactMessagesRetrieveQueryResult = NonNullable<
  Awaited<ReturnType<typeof apiAdvertisementContactMessagesRetrieve>>
>;
export type ApiAdvertisementContactMessagesRetrieveQueryError = unknown;

export function useApiAdvertisementContactMessagesRetrieve<
  TData = Awaited<ReturnType<typeof apiAdvertisementContactMessagesRetrieve>>,
  TError = unknown,
>(
  id: number,
  options: {
    query: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiAdvertisementContactMessagesRetrieve>>,
        TError,
        TData
      >
    > &
      Pick<
        DefinedInitialDataOptions<
          Awaited<ReturnType<typeof apiAdvertisementContactMessagesRetrieve>>,
          TError,
          Awaited<ReturnType<typeof apiAdvertisementContactMessagesRetrieve>>
        >,
        "initialData"
      >;
  },
  queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useApiAdvertisementContactMessagesRetrieve<
  TData = Awaited<ReturnType<typeof apiAdvertisementContactMessagesRetrieve>>,
  TError = unknown,
>(
  id: number,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiAdvertisementContactMessagesRetrieve>>,
        TError,
        TData
      >
    > &
      Pick<
        UndefinedInitialDataOptions<
          Awaited<ReturnType<typeof apiAdvertisementContactMessagesRetrieve>>,
          TError,
          Awaited<ReturnType<typeof apiAdvertisementContactMessagesRetrieve>>
        >,
        "initialData"
      >;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useApiAdvertisementContactMessagesRetrieve<
  TData = Awaited<ReturnType<typeof apiAdvertisementContactMessagesRetrieve>>,
  TError = unknown,
>(
  id: number,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiAdvertisementContactMessagesRetrieve>>,
        TError,
        TData
      >
    >;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
/**
 * @summary Retrieve contact message (admin)
 */

export function useApiAdvertisementContactMessagesRetrieve<
  TData = Awaited<ReturnType<typeof apiAdvertisementContactMessagesRetrieve>>,
  TError = unknown,
>(
  id: number,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiAdvertisementContactMessagesRetrieve>>,
        TError,
        TData
      >
    >;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
} {
  const queryOptions = getApiAdvertisementContactMessagesRetrieveQueryOptions(
    id,
    options,
  );

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

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

/**
 * @summary Replace contact message (admin)
 */
export const apiAdvertisementContactMessagesUpdate = (
  id: number,
  contactMe: NonReadonly<ContactMe>,
  signal?: AbortSignal,
) => {
  return privateMutator<ContactMe>({
    url: `/api/advertisement/contact-messages/${id}/`,
    method: "PUT",
    headers: { "Content-Type": "application/json" },
    data: contactMe,
    signal,
  });
};

export const getApiAdvertisementContactMessagesUpdateMutationOptions = <
  TError = unknown,
  TContext = unknown,
>(options?: {
  mutation?: UseMutationOptions<
    Awaited<ReturnType<typeof apiAdvertisementContactMessagesUpdate>>,
    TError,
    { id: number; data: NonReadonly<ContactMe> },
    TContext
  >;
}): UseMutationOptions<
  Awaited<ReturnType<typeof apiAdvertisementContactMessagesUpdate>>,
  TError,
  { id: number; data: NonReadonly<ContactMe> },
  TContext
> => {
  const mutationKey = ["apiAdvertisementContactMessagesUpdate"];
  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 apiAdvertisementContactMessagesUpdate>>,
    { id: number; data: NonReadonly<ContactMe> }
  > = (props) => {
    const { id, data } = props ?? {};

    return apiAdvertisementContactMessagesUpdate(id, data);
  };

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

export type ApiAdvertisementContactMessagesUpdateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiAdvertisementContactMessagesUpdate>>
>;
export type ApiAdvertisementContactMessagesUpdateMutationBody =
  NonReadonly<ContactMe>;
export type ApiAdvertisementContactMessagesUpdateMutationError = unknown;

/**
 * @summary Replace contact message (admin)
 */
export const useApiAdvertisementContactMessagesUpdate = <
  TError = unknown,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiAdvertisementContactMessagesUpdate>>,
      TError,
      { id: number; data: NonReadonly<ContactMe> },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiAdvertisementContactMessagesUpdate>>,
  TError,
  { id: number; data: NonReadonly<ContactMe> },
  TContext
> => {
  return useMutation(
    getApiAdvertisementContactMessagesUpdateMutationOptions(options),
    queryClient,
  );
};
/**
 * @summary Update contact message (admin)
 */
export const apiAdvertisementContactMessagesPartialUpdate = (
  id: number,
  patchedContactMe: NonReadonly<PatchedContactMe>,
  signal?: AbortSignal,
) => {
  return privateMutator<ContactMe>({
    url: `/api/advertisement/contact-messages/${id}/`,
    method: "PATCH",
    headers: { "Content-Type": "application/json" },
    data: patchedContactMe,
    signal,
  });
};

export const getApiAdvertisementContactMessagesPartialUpdateMutationOptions = <
  TError = unknown,
  TContext = unknown,
>(options?: {
  mutation?: UseMutationOptions<
    Awaited<ReturnType<typeof apiAdvertisementContactMessagesPartialUpdate>>,
    TError,
    { id: number; data: NonReadonly<PatchedContactMe> },
    TContext
  >;
}): UseMutationOptions<
  Awaited<ReturnType<typeof apiAdvertisementContactMessagesPartialUpdate>>,
  TError,
  { id: number; data: NonReadonly<PatchedContactMe> },
  TContext
> => {
  const mutationKey = ["apiAdvertisementContactMessagesPartialUpdate"];
  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 apiAdvertisementContactMessagesPartialUpdate>>,
    { id: number; data: NonReadonly<PatchedContactMe> }
  > = (props) => {
    const { id, data } = props ?? {};

    return apiAdvertisementContactMessagesPartialUpdate(id, data);
  };

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

export type ApiAdvertisementContactMessagesPartialUpdateMutationResult =
  NonNullable<
    Awaited<ReturnType<typeof apiAdvertisementContactMessagesPartialUpdate>>
  >;
export type ApiAdvertisementContactMessagesPartialUpdateMutationBody =
  NonReadonly<PatchedContactMe>;
export type ApiAdvertisementContactMessagesPartialUpdateMutationError = unknown;

/**
 * @summary Update contact message (admin)
 */
export const useApiAdvertisementContactMessagesPartialUpdate = <
  TError = unknown,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiAdvertisementContactMessagesPartialUpdate>>,
      TError,
      { id: number; data: NonReadonly<PatchedContactMe> },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiAdvertisementContactMessagesPartialUpdate>>,
  TError,
  { id: number; data: NonReadonly<PatchedContactMe> },
  TContext
> => {
  return useMutation(
    getApiAdvertisementContactMessagesPartialUpdateMutationOptions(options),
    queryClient,
  );
};
/**
 * @summary Delete contact message (admin)
 */
export const apiAdvertisementContactMessagesDestroy = (
  id: number,
  signal?: AbortSignal,
) => {
  return privateMutator<void>({
    url: `/api/advertisement/contact-messages/${id}/`,
    method: "DELETE",
    signal,
  });
};

export const getApiAdvertisementContactMessagesDestroyMutationOptions = <
  TError = unknown,
  TContext = unknown,
>(options?: {
  mutation?: UseMutationOptions<
    Awaited<ReturnType<typeof apiAdvertisementContactMessagesDestroy>>,
    TError,
    { id: number },
    TContext
  >;
}): UseMutationOptions<
  Awaited<ReturnType<typeof apiAdvertisementContactMessagesDestroy>>,
  TError,
  { id: number },
  TContext
> => {
  const mutationKey = ["apiAdvertisementContactMessagesDestroy"];
  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 apiAdvertisementContactMessagesDestroy>>,
    { id: number }
  > = (props) => {
    const { id } = props ?? {};

    return apiAdvertisementContactMessagesDestroy(id);
  };

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

export type ApiAdvertisementContactMessagesDestroyMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiAdvertisementContactMessagesDestroy>>
>;

export type ApiAdvertisementContactMessagesDestroyMutationError = unknown;

/**
 * @summary Delete contact message (admin)
 */
export const useApiAdvertisementContactMessagesDestroy = <
  TError = unknown,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiAdvertisementContactMessagesDestroy>>,
      TError,
      { id: number },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiAdvertisementContactMessagesDestroy>>,
  TError,
  { id: number },
  TContext
> => {
  return useMutation(
    getApiAdvertisementContactMessagesDestroyMutationOptions(options),
    queryClient,
  );
};
/**
 * Triggers the weekly email task that sends a summary of newly added products from the last week. Only accessible by admin users.
 * @summary Manually trigger weekly new items email
 */
export const apiAdvertisementTriggerWeeklyEmailCreate = (
  signal?: AbortSignal,
) => {
  return privateMutator<void>({
    url: `/api/advertisement/trigger-weekly-email/`,
    method: "POST",
    signal,
  });
};

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

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

export type ApiAdvertisementTriggerWeeklyEmailCreateMutationResult =
  NonNullable<
    Awaited<ReturnType<typeof apiAdvertisementTriggerWeeklyEmailCreate>>
  >;

export type ApiAdvertisementTriggerWeeklyEmailCreateMutationError = unknown;

/**
 * @summary Manually trigger weekly new items email
 */
export const useApiAdvertisementTriggerWeeklyEmailCreate = <
  TError = unknown,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiAdvertisementTriggerWeeklyEmailCreate>>,
      TError,
      void,
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiAdvertisementTriggerWeeklyEmailCreate>>,
  TError,
  void,
  TContext
> => {
  return useMutation(
    getApiAdvertisementTriggerWeeklyEmailCreateMutationOptions(options),
    queryClient,
  );
};
