/**
 * Generated by orval v7.17.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 {
  ApiAccountUsersListParams,
  CustomUser,
  PaginatedCustomUserList,
  PatchedCustomUser,
} 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>;

/**
 * Returns details of the currently authenticated user based on JWT token or session.
 * @summary Get current authenticated user
 */
export const apiAccountUserMeRetrieve = (signal?: AbortSignal) => {
  return privateMutator<CustomUser>({
    url: `/api/account/user/me/`,
    method: "GET",
    signal,
  });
};

export const getApiAccountUserMeRetrieveQueryKey = () => {
  return [`/api/account/user/me/`] as const;
};

export const getApiAccountUserMeRetrieveQueryOptions = <
  TData = Awaited<ReturnType<typeof apiAccountUserMeRetrieve>>,
  TError = void,
>(options?: {
  query?: Partial<
    UseQueryOptions<
      Awaited<ReturnType<typeof apiAccountUserMeRetrieve>>,
      TError,
      TData
    >
  >;
}) => {
  const { query: queryOptions } = options ?? {};

  const queryKey =
    queryOptions?.queryKey ?? getApiAccountUserMeRetrieveQueryKey();

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

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

export type ApiAccountUserMeRetrieveQueryResult = NonNullable<
  Awaited<ReturnType<typeof apiAccountUserMeRetrieve>>
>;
export type ApiAccountUserMeRetrieveQueryError = void;

export function useApiAccountUserMeRetrieve<
  TData = Awaited<ReturnType<typeof apiAccountUserMeRetrieve>>,
  TError = void,
>(
  options: {
    query: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiAccountUserMeRetrieve>>,
        TError,
        TData
      >
    > &
      Pick<
        DefinedInitialDataOptions<
          Awaited<ReturnType<typeof apiAccountUserMeRetrieve>>,
          TError,
          Awaited<ReturnType<typeof apiAccountUserMeRetrieve>>
        >,
        "initialData"
      >;
  },
  queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useApiAccountUserMeRetrieve<
  TData = Awaited<ReturnType<typeof apiAccountUserMeRetrieve>>,
  TError = void,
>(
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiAccountUserMeRetrieve>>,
        TError,
        TData
      >
    > &
      Pick<
        UndefinedInitialDataOptions<
          Awaited<ReturnType<typeof apiAccountUserMeRetrieve>>,
          TError,
          Awaited<ReturnType<typeof apiAccountUserMeRetrieve>>
        >,
        "initialData"
      >;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useApiAccountUserMeRetrieve<
  TData = Awaited<ReturnType<typeof apiAccountUserMeRetrieve>>,
  TError = void,
>(
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiAccountUserMeRetrieve>>,
        TError,
        TData
      >
    >;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
/**
 * @summary Get current authenticated user
 */

export function useApiAccountUserMeRetrieve<
  TData = Awaited<ReturnType<typeof apiAccountUserMeRetrieve>>,
  TError = void,
>(
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiAccountUserMeRetrieve>>,
        TError,
        TData
      >
    >;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
} {
  const queryOptions = getApiAccountUserMeRetrieveQueryOptions(options);

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

  query.queryKey = queryOptions.queryKey;

  return query;
}

/**
 * Displays all users with filtering and ordering options. Requires authentication and appropriate role.
 * @summary List, retrieve, update, and delete users.
 */
export const apiAccountUsersList = (
  params?: ApiAccountUsersListParams,
  signal?: AbortSignal,
) => {
  return privateMutator<PaginatedCustomUserList>({
    url: `/api/account/users/`,
    method: "GET",
    params,
    signal,
  });
};

export const getApiAccountUsersListQueryKey = (
  params?: ApiAccountUsersListParams,
) => {
  return [`/api/account/users/`, ...(params ? [params] : [])] as const;
};

export const getApiAccountUsersListQueryOptions = <
  TData = Awaited<ReturnType<typeof apiAccountUsersList>>,
  TError = void,
>(
  params?: ApiAccountUsersListParams,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiAccountUsersList>>,
        TError,
        TData
      >
    >;
  },
) => {
  const { query: queryOptions } = options ?? {};

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

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

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

export type ApiAccountUsersListQueryResult = NonNullable<
  Awaited<ReturnType<typeof apiAccountUsersList>>
>;
export type ApiAccountUsersListQueryError = void;

export function useApiAccountUsersList<
  TData = Awaited<ReturnType<typeof apiAccountUsersList>>,
  TError = void,
>(
  params: undefined | ApiAccountUsersListParams,
  options: {
    query: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiAccountUsersList>>,
        TError,
        TData
      >
    > &
      Pick<
        DefinedInitialDataOptions<
          Awaited<ReturnType<typeof apiAccountUsersList>>,
          TError,
          Awaited<ReturnType<typeof apiAccountUsersList>>
        >,
        "initialData"
      >;
  },
  queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useApiAccountUsersList<
  TData = Awaited<ReturnType<typeof apiAccountUsersList>>,
  TError = void,
>(
  params?: ApiAccountUsersListParams,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiAccountUsersList>>,
        TError,
        TData
      >
    > &
      Pick<
        UndefinedInitialDataOptions<
          Awaited<ReturnType<typeof apiAccountUsersList>>,
          TError,
          Awaited<ReturnType<typeof apiAccountUsersList>>
        >,
        "initialData"
      >;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useApiAccountUsersList<
  TData = Awaited<ReturnType<typeof apiAccountUsersList>>,
  TError = void,
>(
  params?: ApiAccountUsersListParams,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiAccountUsersList>>,
        TError,
        TData
      >
    >;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
/**
 * @summary List, retrieve, update, and delete users.
 */

export function useApiAccountUsersList<
  TData = Awaited<ReturnType<typeof apiAccountUsersList>>,
  TError = void,
>(
  params?: ApiAccountUsersListParams,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiAccountUsersList>>,
        TError,
        TData
      >
    >;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
} {
  const queryOptions = getApiAccountUsersListQueryOptions(params, options);

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

  query.queryKey = queryOptions.queryKey;

  return query;
}

/**
 * Displays all users with filtering and ordering options. Requires authentication and appropriate role.
 * @summary List, retrieve, update, and delete users.
 */
export const apiAccountUsersCreate = (
  customUser: NonReadonly<CustomUser>,
  signal?: AbortSignal,
) => {
  return privateMutator<CustomUser>({
    url: `/api/account/users/`,
    method: "POST",
    headers: { "Content-Type": "application/json" },
    data: customUser,
    signal,
  });
};

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

    return apiAccountUsersCreate(data);
  };

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

export type ApiAccountUsersCreateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiAccountUsersCreate>>
>;
export type ApiAccountUsersCreateMutationBody = NonReadonly<CustomUser>;
export type ApiAccountUsersCreateMutationError = void;

/**
 * @summary List, retrieve, update, and delete users.
 */
export const useApiAccountUsersCreate = <TError = void, TContext = unknown>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiAccountUsersCreate>>,
      TError,
      { data: NonReadonly<CustomUser> },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiAccountUsersCreate>>,
  TError,
  { data: NonReadonly<CustomUser> },
  TContext
> => {
  const mutationOptions = getApiAccountUsersCreateMutationOptions(options);

  return useMutation(mutationOptions, queryClient);
};
/**
 * Displays all users with filtering and ordering options. Requires authentication and appropriate role.
 * @summary List, retrieve, update, and delete users.
 */
export const apiAccountUsersRetrieve = (id: number, signal?: AbortSignal) => {
  return privateMutator<CustomUser>({
    url: `/api/account/users/${id}/`,
    method: "GET",
    signal,
  });
};

export const getApiAccountUsersRetrieveQueryKey = (id?: number) => {
  return [`/api/account/users/${id}/`] as const;
};

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

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

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

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

export type ApiAccountUsersRetrieveQueryResult = NonNullable<
  Awaited<ReturnType<typeof apiAccountUsersRetrieve>>
>;
export type ApiAccountUsersRetrieveQueryError = void;

export function useApiAccountUsersRetrieve<
  TData = Awaited<ReturnType<typeof apiAccountUsersRetrieve>>,
  TError = void,
>(
  id: number,
  options: {
    query: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiAccountUsersRetrieve>>,
        TError,
        TData
      >
    > &
      Pick<
        DefinedInitialDataOptions<
          Awaited<ReturnType<typeof apiAccountUsersRetrieve>>,
          TError,
          Awaited<ReturnType<typeof apiAccountUsersRetrieve>>
        >,
        "initialData"
      >;
  },
  queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useApiAccountUsersRetrieve<
  TData = Awaited<ReturnType<typeof apiAccountUsersRetrieve>>,
  TError = void,
>(
  id: number,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiAccountUsersRetrieve>>,
        TError,
        TData
      >
    > &
      Pick<
        UndefinedInitialDataOptions<
          Awaited<ReturnType<typeof apiAccountUsersRetrieve>>,
          TError,
          Awaited<ReturnType<typeof apiAccountUsersRetrieve>>
        >,
        "initialData"
      >;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useApiAccountUsersRetrieve<
  TData = Awaited<ReturnType<typeof apiAccountUsersRetrieve>>,
  TError = void,
>(
  id: number,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiAccountUsersRetrieve>>,
        TError,
        TData
      >
    >;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
/**
 * @summary List, retrieve, update, and delete users.
 */

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

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

  query.queryKey = queryOptions.queryKey;

  return query;
}

/**
 * Displays all users with filtering and ordering options. Requires authentication and appropriate role.
 * @summary List, retrieve, update, and delete users.
 */
export const apiAccountUsersUpdate = (
  id: number,
  customUser: NonReadonly<CustomUser>,
) => {
  return privateMutator<CustomUser>({
    url: `/api/account/users/${id}/`,
    method: "PUT",
    headers: { "Content-Type": "application/json" },
    data: customUser,
  });
};

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

    return apiAccountUsersUpdate(id, data);
  };

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

export type ApiAccountUsersUpdateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiAccountUsersUpdate>>
>;
export type ApiAccountUsersUpdateMutationBody = NonReadonly<CustomUser>;
export type ApiAccountUsersUpdateMutationError = void;

/**
 * @summary List, retrieve, update, and delete users.
 */
export const useApiAccountUsersUpdate = <TError = void, TContext = unknown>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiAccountUsersUpdate>>,
      TError,
      { id: number; data: NonReadonly<CustomUser> },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiAccountUsersUpdate>>,
  TError,
  { id: number; data: NonReadonly<CustomUser> },
  TContext
> => {
  const mutationOptions = getApiAccountUsersUpdateMutationOptions(options);

  return useMutation(mutationOptions, queryClient);
};
/**
 * Displays all users with filtering and ordering options. Requires authentication and appropriate role.
 * @summary List, retrieve, update, and delete users.
 */
export const apiAccountUsersPartialUpdate = (
  id: number,
  patchedCustomUser: NonReadonly<PatchedCustomUser>,
) => {
  return privateMutator<CustomUser>({
    url: `/api/account/users/${id}/`,
    method: "PATCH",
    headers: { "Content-Type": "application/json" },
    data: patchedCustomUser,
  });
};

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

    return apiAccountUsersPartialUpdate(id, data);
  };

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

export type ApiAccountUsersPartialUpdateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiAccountUsersPartialUpdate>>
>;
export type ApiAccountUsersPartialUpdateMutationBody =
  NonReadonly<PatchedCustomUser>;
export type ApiAccountUsersPartialUpdateMutationError = void;

/**
 * @summary List, retrieve, update, and delete users.
 */
export const useApiAccountUsersPartialUpdate = <
  TError = void,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiAccountUsersPartialUpdate>>,
      TError,
      { id: number; data: NonReadonly<PatchedCustomUser> },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiAccountUsersPartialUpdate>>,
  TError,
  { id: number; data: NonReadonly<PatchedCustomUser> },
  TContext
> => {
  const mutationOptions =
    getApiAccountUsersPartialUpdateMutationOptions(options);

  return useMutation(mutationOptions, queryClient);
};
/**
 * Displays all users with filtering and ordering options. Requires authentication and appropriate role.
 * @summary List, retrieve, update, and delete users.
 */
export const apiAccountUsersDestroy = (id: number) => {
  return privateMutator<CustomUser>({
    url: `/api/account/users/${id}/`,
    method: "DELETE",
  });
};

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

    return apiAccountUsersDestroy(id);
  };

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

export type ApiAccountUsersDestroyMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiAccountUsersDestroy>>
>;

export type ApiAccountUsersDestroyMutationError = void;

/**
 * @summary List, retrieve, update, and delete users.
 */
export const useApiAccountUsersDestroy = <TError = void, TContext = unknown>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiAccountUsersDestroy>>,
      TError,
      { id: number },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiAccountUsersDestroy>>,
  TError,
  { id: number },
  TContext
> => {
  const mutationOptions = getApiAccountUsersDestroyMutationOptions(options);

  return useMutation(mutationOptions, queryClient);
};
