/**
 * 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 {
  ApiSocialHubsListParams,
  ApiSocialHubsModeratorsListParams,
  ApiSocialHubsTagsListParams,
  Hub,
  HubPermission,
  PaginatedHubList,
  PaginatedHubPermissionList,
  PaginatedTagsList,
  PatchedHub,
  PatchedHubPermission,
  PatchedTags,
  Tags,
  TransferInit,
  TransferVerify,
} 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 all public hubs. Authenticated users also see hubs they are members of. Admins see all hubs regardless of visibility.
 * @summary List hubs
 */
export const apiSocialHubsList = (
  params?: ApiSocialHubsListParams,
  signal?: AbortSignal,
) => {
  return privateMutator<PaginatedHubList>({
    url: `/api/social/hubs/`,
    method: "GET",
    params,
    signal,
  });
};

export const getApiSocialHubsListQueryKey = (
  params?: ApiSocialHubsListParams,
) => {
  return [`/api/social/hubs/`, ...(params ? [params] : [])] as const;
};

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

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

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

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

export type ApiSocialHubsListQueryResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialHubsList>>
>;
export type ApiSocialHubsListQueryError = unknown;

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

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

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

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

/**
 * Creates a new hub. The requesting user is automatically set as the owner.
 * @summary Create a hub
 */
export const apiSocialHubsCreate = (
  hub: NonReadonly<Hub>,
  signal?: AbortSignal,
) => {
  return privateMutator<Hub>({
    url: `/api/social/hubs/`,
    method: "POST",
    headers: { "Content-Type": "application/json" },
    data: hub,
    signal,
  });
};

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

    return apiSocialHubsCreate(data);
  };

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

export type ApiSocialHubsCreateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialHubsCreate>>
>;
export type ApiSocialHubsCreateMutationBody = NonReadonly<Hub>;
export type ApiSocialHubsCreateMutationError = unknown;

/**
 * @summary Create a hub
 */
export const useApiSocialHubsCreate = <TError = unknown, TContext = unknown>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiSocialHubsCreate>>,
      TError,
      { data: NonReadonly<Hub> },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiSocialHubsCreate>>,
  TError,
  { data: NonReadonly<Hub> },
  TContext
> => {
  return useMutation(
    getApiSocialHubsCreateMutationOptions(options),
    queryClient,
  );
};
/**
 * @summary Retrieve a hub
 */
export const apiSocialHubsRetrieve = (name: string, signal?: AbortSignal) => {
  return privateMutator<Hub>({
    url: `/api/social/hubs/${name}/`,
    method: "GET",
    signal,
  });
};

export const getApiSocialHubsRetrieveQueryKey = (name: string) => {
  return [`/api/social/hubs/${name}/`] as const;
};

export const getApiSocialHubsRetrieveQueryOptions = <
  TData = Awaited<ReturnType<typeof apiSocialHubsRetrieve>>,
  TError = unknown,
>(
  name: string,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiSocialHubsRetrieve>>,
        TError,
        TData
      >
    >;
  },
) => {
  const { query: queryOptions } = options ?? {};

  const queryKey =
    queryOptions?.queryKey ?? getApiSocialHubsRetrieveQueryKey(name);

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

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

export type ApiSocialHubsRetrieveQueryResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialHubsRetrieve>>
>;
export type ApiSocialHubsRetrieveQueryError = unknown;

export function useApiSocialHubsRetrieve<
  TData = Awaited<ReturnType<typeof apiSocialHubsRetrieve>>,
  TError = unknown,
>(
  name: string,
  options: {
    query: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiSocialHubsRetrieve>>,
        TError,
        TData
      >
    > &
      Pick<
        DefinedInitialDataOptions<
          Awaited<ReturnType<typeof apiSocialHubsRetrieve>>,
          TError,
          Awaited<ReturnType<typeof apiSocialHubsRetrieve>>
        >,
        "initialData"
      >;
  },
  queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useApiSocialHubsRetrieve<
  TData = Awaited<ReturnType<typeof apiSocialHubsRetrieve>>,
  TError = unknown,
>(
  name: string,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiSocialHubsRetrieve>>,
        TError,
        TData
      >
    > &
      Pick<
        UndefinedInitialDataOptions<
          Awaited<ReturnType<typeof apiSocialHubsRetrieve>>,
          TError,
          Awaited<ReturnType<typeof apiSocialHubsRetrieve>>
        >,
        "initialData"
      >;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useApiSocialHubsRetrieve<
  TData = Awaited<ReturnType<typeof apiSocialHubsRetrieve>>,
  TError = unknown,
>(
  name: string,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiSocialHubsRetrieve>>,
        TError,
        TData
      >
    >;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
/**
 * @summary Retrieve a hub
 */

export function useApiSocialHubsRetrieve<
  TData = Awaited<ReturnType<typeof apiSocialHubsRetrieve>>,
  TError = unknown,
>(
  name: string,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiSocialHubsRetrieve>>,
        TError,
        TData
      >
    >;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
} {
  const queryOptions = getApiSocialHubsRetrieveQueryOptions(name, options);

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

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

/**
 * Full update. Restricted to the owner, site admin, or moderators (per-field permission flags are enforced).
 * @summary Replace a hub
 */
export const apiSocialHubsUpdate = (
  name: string,
  hub: NonReadonly<Hub>,
  signal?: AbortSignal,
) => {
  return privateMutator<Hub>({
    url: `/api/social/hubs/${name}/`,
    method: "PUT",
    headers: { "Content-Type": "application/json" },
    data: hub,
    signal,
  });
};

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

    return apiSocialHubsUpdate(name, data);
  };

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

export type ApiSocialHubsUpdateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialHubsUpdate>>
>;
export type ApiSocialHubsUpdateMutationBody = NonReadonly<Hub>;
export type ApiSocialHubsUpdateMutationError = unknown;

/**
 * @summary Replace a hub
 */
export const useApiSocialHubsUpdate = <TError = unknown, TContext = unknown>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiSocialHubsUpdate>>,
      TError,
      { name: string; data: NonReadonly<Hub> },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiSocialHubsUpdate>>,
  TError,
  { name: string; data: NonReadonly<Hub> },
  TContext
> => {
  return useMutation(
    getApiSocialHubsUpdateMutationOptions(options),
    queryClient,
  );
};
/**
 * Partial update. Restricted to the owner, site admin, or moderators (per-field permission flags are enforced).
 * @summary Update a hub
 */
export const apiSocialHubsPartialUpdate = (
  name: string,
  patchedHub: NonReadonly<PatchedHub>,
  signal?: AbortSignal,
) => {
  return privateMutator<Hub>({
    url: `/api/social/hubs/${name}/`,
    method: "PATCH",
    headers: { "Content-Type": "application/json" },
    data: patchedHub,
    signal,
  });
};

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

    return apiSocialHubsPartialUpdate(name, data);
  };

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

export type ApiSocialHubsPartialUpdateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialHubsPartialUpdate>>
>;
export type ApiSocialHubsPartialUpdateMutationBody = NonReadonly<PatchedHub>;
export type ApiSocialHubsPartialUpdateMutationError = unknown;

/**
 * @summary Update a hub
 */
export const useApiSocialHubsPartialUpdate = <
  TError = unknown,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiSocialHubsPartialUpdate>>,
      TError,
      { name: string; data: NonReadonly<PatchedHub> },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiSocialHubsPartialUpdate>>,
  TError,
  { name: string; data: NonReadonly<PatchedHub> },
  TContext
> => {
  return useMutation(
    getApiSocialHubsPartialUpdateMutationOptions(options),
    queryClient,
  );
};
/**
 * Soft-deletes the hub. Owner or admin only.
 * @summary Delete a hub
 */
export const apiSocialHubsDestroy = (name: string, signal?: AbortSignal) => {
  return privateMutator<void>({
    url: `/api/social/hubs/${name}/`,
    method: "DELETE",
    signal,
  });
};

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

    return apiSocialHubsDestroy(name);
  };

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

export type ApiSocialHubsDestroyMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialHubsDestroy>>
>;

export type ApiSocialHubsDestroyMutationError = unknown;

/**
 * @summary Delete a hub
 */
export const useApiSocialHubsDestroy = <TError = unknown, TContext = unknown>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiSocialHubsDestroy>>,
      TError,
      { name: string },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiSocialHubsDestroy>>,
  TError,
  { name: string },
  TContext
> => {
  return useMutation(
    getApiSocialHubsDestroyMutationOptions(options),
    queryClient,
  );
};
/**
 * Adds the authenticated user as a member. Private hubs reject this request.
 * @summary Join a hub
 */
export const apiSocialHubsJoinCreate = (name: string, signal?: AbortSignal) => {
  return privateMutator<Hub>({
    url: `/api/social/hubs/${name}/join/`,
    method: "POST",
    signal,
  });
};

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

    return apiSocialHubsJoinCreate(name);
  };

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

export type ApiSocialHubsJoinCreateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialHubsJoinCreate>>
>;

export type ApiSocialHubsJoinCreateMutationError = unknown;

/**
 * @summary Join a hub
 */
export const useApiSocialHubsJoinCreate = <
  TError = unknown,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiSocialHubsJoinCreate>>,
      TError,
      { name: string },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiSocialHubsJoinCreate>>,
  TError,
  { name: string },
  TContext
> => {
  return useMutation(
    getApiSocialHubsJoinCreateMutationOptions(options),
    queryClient,
  );
};
/**
 * Removes the authenticated user from the hub's members.
 * @summary Leave a hub
 */
export const apiSocialHubsLeaveCreate = (
  name: string,
  signal?: AbortSignal,
) => {
  return privateMutator<void>({
    url: `/api/social/hubs/${name}/leave/`,
    method: "POST",
    signal,
  });
};

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

    return apiSocialHubsLeaveCreate(name);
  };

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

export type ApiSocialHubsLeaveCreateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialHubsLeaveCreate>>
>;

export type ApiSocialHubsLeaveCreateMutationError = unknown;

/**
 * @summary Leave a hub
 */
export const useApiSocialHubsLeaveCreate = <
  TError = unknown,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiSocialHubsLeaveCreate>>,
      TError,
      { name: string },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiSocialHubsLeaveCreate>>,
  TError,
  { name: string },
  TContext
> => {
  return useMutation(
    getApiSocialHubsLeaveCreateMutationOptions(options),
    queryClient,
  );
};
/**
 * Cancels a pending transfer, clearing the token and recipient. Owner or admin only.
 * @summary Cancel ownership transfer
 */
export const apiSocialHubsTransferCancelCreate = (
  name: string,
  signal?: AbortSignal,
) => {
  return privateMutator<void>({
    url: `/api/social/hubs/${name}/transfer/cancel/`,
    method: "POST",
    signal,
  });
};

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

    return apiSocialHubsTransferCancelCreate(name);
  };

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

export type ApiSocialHubsTransferCancelCreateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialHubsTransferCancelCreate>>
>;

export type ApiSocialHubsTransferCancelCreateMutationError = unknown;

/**
 * @summary Cancel ownership transfer
 */
export const useApiSocialHubsTransferCancelCreate = <
  TError = unknown,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiSocialHubsTransferCancelCreate>>,
      TError,
      { name: string },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiSocialHubsTransferCancelCreate>>,
  TError,
  { name: string },
  TContext
> => {
  return useMutation(
    getApiSocialHubsTransferCancelCreateMutationOptions(options),
    queryClient,
  );
};
/**
 * Generates a transfer token and records the intended new owner. Only the current hub owner can initiate. The recipient must call `transfer/verify` with the token to complete the transfer.
 * @summary Initiate ownership transfer
 */
export const apiSocialHubsTransferInitiateCreate = (
  name: string,
  transferInit: TransferInit,
  signal?: AbortSignal,
) => {
  return privateMutator<TransferInit>({
    url: `/api/social/hubs/${name}/transfer/initiate/`,
    method: "POST",
    headers: { "Content-Type": "application/json" },
    data: transferInit,
    signal,
  });
};

export const getApiSocialHubsTransferInitiateCreateMutationOptions = <
  TError = unknown,
  TContext = unknown,
>(options?: {
  mutation?: UseMutationOptions<
    Awaited<ReturnType<typeof apiSocialHubsTransferInitiateCreate>>,
    TError,
    { name: string; data: TransferInit },
    TContext
  >;
}): UseMutationOptions<
  Awaited<ReturnType<typeof apiSocialHubsTransferInitiateCreate>>,
  TError,
  { name: string; data: TransferInit },
  TContext
> => {
  const mutationKey = ["apiSocialHubsTransferInitiateCreate"];
  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 apiSocialHubsTransferInitiateCreate>>,
    { name: string; data: TransferInit }
  > = (props) => {
    const { name, data } = props ?? {};

    return apiSocialHubsTransferInitiateCreate(name, data);
  };

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

export type ApiSocialHubsTransferInitiateCreateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialHubsTransferInitiateCreate>>
>;
export type ApiSocialHubsTransferInitiateCreateMutationBody = TransferInit;
export type ApiSocialHubsTransferInitiateCreateMutationError = unknown;

/**
 * @summary Initiate ownership transfer
 */
export const useApiSocialHubsTransferInitiateCreate = <
  TError = unknown,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiSocialHubsTransferInitiateCreate>>,
      TError,
      { name: string; data: TransferInit },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiSocialHubsTransferInitiateCreate>>,
  TError,
  { name: string; data: TransferInit },
  TContext
> => {
  return useMutation(
    getApiSocialHubsTransferInitiateCreateMutationOptions(options),
    queryClient,
  );
};
/**
 * Completes the transfer when the intended new owner supplies the correct token. Must be called by the transfer recipient.
 * @summary Verify ownership transfer
 */
export const apiSocialHubsTransferVerifyCreate = (
  name: string,
  transferVerify: TransferVerify,
  signal?: AbortSignal,
) => {
  return privateMutator<Hub>({
    url: `/api/social/hubs/${name}/transfer/verify/`,
    method: "POST",
    headers: { "Content-Type": "application/json" },
    data: transferVerify,
    signal,
  });
};

export const getApiSocialHubsTransferVerifyCreateMutationOptions = <
  TError = unknown,
  TContext = unknown,
>(options?: {
  mutation?: UseMutationOptions<
    Awaited<ReturnType<typeof apiSocialHubsTransferVerifyCreate>>,
    TError,
    { name: string; data: TransferVerify },
    TContext
  >;
}): UseMutationOptions<
  Awaited<ReturnType<typeof apiSocialHubsTransferVerifyCreate>>,
  TError,
  { name: string; data: TransferVerify },
  TContext
> => {
  const mutationKey = ["apiSocialHubsTransferVerifyCreate"];
  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 apiSocialHubsTransferVerifyCreate>>,
    { name: string; data: TransferVerify }
  > = (props) => {
    const { name, data } = props ?? {};

    return apiSocialHubsTransferVerifyCreate(name, data);
  };

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

export type ApiSocialHubsTransferVerifyCreateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialHubsTransferVerifyCreate>>
>;
export type ApiSocialHubsTransferVerifyCreateMutationBody = TransferVerify;
export type ApiSocialHubsTransferVerifyCreateMutationError = unknown;

/**
 * @summary Verify ownership transfer
 */
export const useApiSocialHubsTransferVerifyCreate = <
  TError = unknown,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiSocialHubsTransferVerifyCreate>>,
      TError,
      { name: string; data: TransferVerify },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiSocialHubsTransferVerifyCreate>>,
  TError,
  { name: string; data: TransferVerify },
  TContext
> => {
  return useMutation(
    getApiSocialHubsTransferVerifyCreateMutationOptions(options),
    queryClient,
  );
};
/**
 * Returns all moderators and their permission flags for a given hub. Pass `hub` as a query param.
 * @summary List hub moderators
 */
export const apiSocialHubsModeratorsList = (
  params?: ApiSocialHubsModeratorsListParams,
  signal?: AbortSignal,
) => {
  return privateMutator<PaginatedHubPermissionList>({
    url: `/api/social/hubs/moderators/`,
    method: "GET",
    params,
    signal,
  });
};

export const getApiSocialHubsModeratorsListQueryKey = (
  params?: ApiSocialHubsModeratorsListParams,
) => {
  return [`/api/social/hubs/moderators/`, ...(params ? [params] : [])] as const;
};

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

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

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

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

export type ApiSocialHubsModeratorsListQueryResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialHubsModeratorsList>>
>;
export type ApiSocialHubsModeratorsListQueryError = unknown;

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

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

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

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

/**
 * Grants a user moderator permissions on the hub. Owner or admin only.
 * @summary Add a hub moderator
 */
export const apiSocialHubsModeratorsCreate = (
  hubPermission: NonReadonly<HubPermission>,
  signal?: AbortSignal,
) => {
  return privateMutator<HubPermission>({
    url: `/api/social/hubs/moderators/`,
    method: "POST",
    headers: { "Content-Type": "application/json" },
    data: hubPermission,
    signal,
  });
};

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

    return apiSocialHubsModeratorsCreate(data);
  };

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

export type ApiSocialHubsModeratorsCreateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialHubsModeratorsCreate>>
>;
export type ApiSocialHubsModeratorsCreateMutationBody =
  NonReadonly<HubPermission>;
export type ApiSocialHubsModeratorsCreateMutationError = unknown;

/**
 * @summary Add a hub moderator
 */
export const useApiSocialHubsModeratorsCreate = <
  TError = unknown,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiSocialHubsModeratorsCreate>>,
      TError,
      { data: NonReadonly<HubPermission> },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiSocialHubsModeratorsCreate>>,
  TError,
  { data: NonReadonly<HubPermission> },
  TContext
> => {
  return useMutation(
    getApiSocialHubsModeratorsCreateMutationOptions(options),
    queryClient,
  );
};
/**
 * @summary Retrieve a hub moderator
 */
export const apiSocialHubsModeratorsRetrieve = (
  id: string,
  signal?: AbortSignal,
) => {
  return privateMutator<HubPermission>({
    url: `/api/social/hubs/moderators/${id}/`,
    method: "GET",
    signal,
  });
};

export const getApiSocialHubsModeratorsRetrieveQueryKey = (id: string) => {
  return [`/api/social/hubs/moderators/${id}/`] as const;
};

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

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

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

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

export type ApiSocialHubsModeratorsRetrieveQueryResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialHubsModeratorsRetrieve>>
>;
export type ApiSocialHubsModeratorsRetrieveQueryError = unknown;

export function useApiSocialHubsModeratorsRetrieve<
  TData = Awaited<ReturnType<typeof apiSocialHubsModeratorsRetrieve>>,
  TError = unknown,
>(
  id: string,
  options: {
    query: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiSocialHubsModeratorsRetrieve>>,
        TError,
        TData
      >
    > &
      Pick<
        DefinedInitialDataOptions<
          Awaited<ReturnType<typeof apiSocialHubsModeratorsRetrieve>>,
          TError,
          Awaited<ReturnType<typeof apiSocialHubsModeratorsRetrieve>>
        >,
        "initialData"
      >;
  },
  queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useApiSocialHubsModeratorsRetrieve<
  TData = Awaited<ReturnType<typeof apiSocialHubsModeratorsRetrieve>>,
  TError = unknown,
>(
  id: string,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiSocialHubsModeratorsRetrieve>>,
        TError,
        TData
      >
    > &
      Pick<
        UndefinedInitialDataOptions<
          Awaited<ReturnType<typeof apiSocialHubsModeratorsRetrieve>>,
          TError,
          Awaited<ReturnType<typeof apiSocialHubsModeratorsRetrieve>>
        >,
        "initialData"
      >;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useApiSocialHubsModeratorsRetrieve<
  TData = Awaited<ReturnType<typeof apiSocialHubsModeratorsRetrieve>>,
  TError = unknown,
>(
  id: string,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiSocialHubsModeratorsRetrieve>>,
        TError,
        TData
      >
    >;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
/**
 * @summary Retrieve a hub moderator
 */

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

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

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

/**
 * Replaces all permission flags for a moderator. Owner or admin only.
 * @summary Replace moderator permissions
 */
export const apiSocialHubsModeratorsUpdate = (
  id: string,
  hubPermission: NonReadonly<HubPermission>,
  signal?: AbortSignal,
) => {
  return privateMutator<HubPermission>({
    url: `/api/social/hubs/moderators/${id}/`,
    method: "PUT",
    headers: { "Content-Type": "application/json" },
    data: hubPermission,
    signal,
  });
};

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

    return apiSocialHubsModeratorsUpdate(id, data);
  };

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

export type ApiSocialHubsModeratorsUpdateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialHubsModeratorsUpdate>>
>;
export type ApiSocialHubsModeratorsUpdateMutationBody =
  NonReadonly<HubPermission>;
export type ApiSocialHubsModeratorsUpdateMutationError = unknown;

/**
 * @summary Replace moderator permissions
 */
export const useApiSocialHubsModeratorsUpdate = <
  TError = unknown,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiSocialHubsModeratorsUpdate>>,
      TError,
      { id: string; data: NonReadonly<HubPermission> },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiSocialHubsModeratorsUpdate>>,
  TError,
  { id: string; data: NonReadonly<HubPermission> },
  TContext
> => {
  return useMutation(
    getApiSocialHubsModeratorsUpdateMutationOptions(options),
    queryClient,
  );
};
/**
 * Updates one or more permission flags for a moderator. Owner or admin only.
 * @summary Update moderator permissions
 */
export const apiSocialHubsModeratorsPartialUpdate = (
  id: string,
  patchedHubPermission: NonReadonly<PatchedHubPermission>,
  signal?: AbortSignal,
) => {
  return privateMutator<HubPermission>({
    url: `/api/social/hubs/moderators/${id}/`,
    method: "PATCH",
    headers: { "Content-Type": "application/json" },
    data: patchedHubPermission,
    signal,
  });
};

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

    return apiSocialHubsModeratorsPartialUpdate(id, data);
  };

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

export type ApiSocialHubsModeratorsPartialUpdateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialHubsModeratorsPartialUpdate>>
>;
export type ApiSocialHubsModeratorsPartialUpdateMutationBody =
  NonReadonly<PatchedHubPermission>;
export type ApiSocialHubsModeratorsPartialUpdateMutationError = unknown;

/**
 * @summary Update moderator permissions
 */
export const useApiSocialHubsModeratorsPartialUpdate = <
  TError = unknown,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiSocialHubsModeratorsPartialUpdate>>,
      TError,
      { id: string; data: NonReadonly<PatchedHubPermission> },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiSocialHubsModeratorsPartialUpdate>>,
  TError,
  { id: string; data: NonReadonly<PatchedHubPermission> },
  TContext
> => {
  return useMutation(
    getApiSocialHubsModeratorsPartialUpdateMutationOptions(options),
    queryClient,
  );
};
/**
 * Revokes all moderator permissions from a user. Owner or admin only.
 * @summary Remove a hub moderator
 */
export const apiSocialHubsModeratorsDestroy = (
  id: string,
  signal?: AbortSignal,
) => {
  return privateMutator<void>({
    url: `/api/social/hubs/moderators/${id}/`,
    method: "DELETE",
    signal,
  });
};

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

    return apiSocialHubsModeratorsDestroy(id);
  };

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

export type ApiSocialHubsModeratorsDestroyMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialHubsModeratorsDestroy>>
>;

export type ApiSocialHubsModeratorsDestroyMutationError = unknown;

/**
 * @summary Remove a hub moderator
 */
export const useApiSocialHubsModeratorsDestroy = <
  TError = unknown,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiSocialHubsModeratorsDestroy>>,
      TError,
      { id: string },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiSocialHubsModeratorsDestroy>>,
  TError,
  { id: string },
  TContext
> => {
  return useMutation(
    getApiSocialHubsModeratorsDestroyMutationOptions(options),
    queryClient,
  );
};
/**
 * Returns all tags for a given hub. Pass `hub` as a query param.
 * @summary List hub tags
 */
export const apiSocialHubsTagsList = (
  params?: ApiSocialHubsTagsListParams,
  signal?: AbortSignal,
) => {
  return privateMutator<PaginatedTagsList>({
    url: `/api/social/hubs/tags/`,
    method: "GET",
    params,
    signal,
  });
};

export const getApiSocialHubsTagsListQueryKey = (
  params?: ApiSocialHubsTagsListParams,
) => {
  return [`/api/social/hubs/tags/`, ...(params ? [params] : [])] as const;
};

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

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

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

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

export type ApiSocialHubsTagsListQueryResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialHubsTagsList>>
>;
export type ApiSocialHubsTagsListQueryError = unknown;

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

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

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

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

/**
 * Adds a tag to the hub. Owner, site admin, or moderator with `managing_posts`.
 * @summary Create a hub tag
 */
export const apiSocialHubsTagsCreate = (
  tags: NonReadonly<Tags>,
  signal?: AbortSignal,
) => {
  return privateMutator<Tags>({
    url: `/api/social/hubs/tags/`,
    method: "POST",
    headers: { "Content-Type": "application/json" },
    data: tags,
    signal,
  });
};

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

    return apiSocialHubsTagsCreate(data);
  };

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

export type ApiSocialHubsTagsCreateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialHubsTagsCreate>>
>;
export type ApiSocialHubsTagsCreateMutationBody = NonReadonly<Tags>;
export type ApiSocialHubsTagsCreateMutationError = unknown;

/**
 * @summary Create a hub tag
 */
export const useApiSocialHubsTagsCreate = <
  TError = unknown,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiSocialHubsTagsCreate>>,
      TError,
      { data: NonReadonly<Tags> },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiSocialHubsTagsCreate>>,
  TError,
  { data: NonReadonly<Tags> },
  TContext
> => {
  return useMutation(
    getApiSocialHubsTagsCreateMutationOptions(options),
    queryClient,
  );
};
/**
 * @summary Retrieve a hub tag
 */
export const apiSocialHubsTagsRetrieve = (id: string, signal?: AbortSignal) => {
  return privateMutator<Tags>({
    url: `/api/social/hubs/tags/${id}/`,
    method: "GET",
    signal,
  });
};

export const getApiSocialHubsTagsRetrieveQueryKey = (id: string) => {
  return [`/api/social/hubs/tags/${id}/`] as const;
};

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

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

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

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

export type ApiSocialHubsTagsRetrieveQueryResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialHubsTagsRetrieve>>
>;
export type ApiSocialHubsTagsRetrieveQueryError = unknown;

export function useApiSocialHubsTagsRetrieve<
  TData = Awaited<ReturnType<typeof apiSocialHubsTagsRetrieve>>,
  TError = unknown,
>(
  id: string,
  options: {
    query: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiSocialHubsTagsRetrieve>>,
        TError,
        TData
      >
    > &
      Pick<
        DefinedInitialDataOptions<
          Awaited<ReturnType<typeof apiSocialHubsTagsRetrieve>>,
          TError,
          Awaited<ReturnType<typeof apiSocialHubsTagsRetrieve>>
        >,
        "initialData"
      >;
  },
  queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useApiSocialHubsTagsRetrieve<
  TData = Awaited<ReturnType<typeof apiSocialHubsTagsRetrieve>>,
  TError = unknown,
>(
  id: string,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiSocialHubsTagsRetrieve>>,
        TError,
        TData
      >
    > &
      Pick<
        UndefinedInitialDataOptions<
          Awaited<ReturnType<typeof apiSocialHubsTagsRetrieve>>,
          TError,
          Awaited<ReturnType<typeof apiSocialHubsTagsRetrieve>>
        >,
        "initialData"
      >;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useApiSocialHubsTagsRetrieve<
  TData = Awaited<ReturnType<typeof apiSocialHubsTagsRetrieve>>,
  TError = unknown,
>(
  id: string,
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<ReturnType<typeof apiSocialHubsTagsRetrieve>>,
        TError,
        TData
      >
    >;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
/**
 * @summary Retrieve a hub tag
 */

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

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

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

/**
 * Replaces a tag on the hub. Owner, site admin, or moderator with `managing_posts`.
 * @summary Replace a hub tag
 */
export const apiSocialHubsTagsUpdate = (
  id: string,
  tags: NonReadonly<Tags>,
  signal?: AbortSignal,
) => {
  return privateMutator<Tags>({
    url: `/api/social/hubs/tags/${id}/`,
    method: "PUT",
    headers: { "Content-Type": "application/json" },
    data: tags,
    signal,
  });
};

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

    return apiSocialHubsTagsUpdate(id, data);
  };

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

export type ApiSocialHubsTagsUpdateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialHubsTagsUpdate>>
>;
export type ApiSocialHubsTagsUpdateMutationBody = NonReadonly<Tags>;
export type ApiSocialHubsTagsUpdateMutationError = unknown;

/**
 * @summary Replace a hub tag
 */
export const useApiSocialHubsTagsUpdate = <
  TError = unknown,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiSocialHubsTagsUpdate>>,
      TError,
      { id: string; data: NonReadonly<Tags> },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiSocialHubsTagsUpdate>>,
  TError,
  { id: string; data: NonReadonly<Tags> },
  TContext
> => {
  return useMutation(
    getApiSocialHubsTagsUpdateMutationOptions(options),
    queryClient,
  );
};
/**
 * Updates a tag on the hub. Owner, site admin, or moderator with `managing_posts`.
 * @summary Update a hub tag
 */
export const apiSocialHubsTagsPartialUpdate = (
  id: string,
  patchedTags: NonReadonly<PatchedTags>,
  signal?: AbortSignal,
) => {
  return privateMutator<Tags>({
    url: `/api/social/hubs/tags/${id}/`,
    method: "PATCH",
    headers: { "Content-Type": "application/json" },
    data: patchedTags,
    signal,
  });
};

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

    return apiSocialHubsTagsPartialUpdate(id, data);
  };

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

export type ApiSocialHubsTagsPartialUpdateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialHubsTagsPartialUpdate>>
>;
export type ApiSocialHubsTagsPartialUpdateMutationBody =
  NonReadonly<PatchedTags>;
export type ApiSocialHubsTagsPartialUpdateMutationError = unknown;

/**
 * @summary Update a hub tag
 */
export const useApiSocialHubsTagsPartialUpdate = <
  TError = unknown,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiSocialHubsTagsPartialUpdate>>,
      TError,
      { id: string; data: NonReadonly<PatchedTags> },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiSocialHubsTagsPartialUpdate>>,
  TError,
  { id: string; data: NonReadonly<PatchedTags> },
  TContext
> => {
  return useMutation(
    getApiSocialHubsTagsPartialUpdateMutationOptions(options),
    queryClient,
  );
};
/**
 * Removes a tag from the hub. Owner, site admin, or moderator with `managing_posts`.
 * @summary Delete a hub tag
 */
export const apiSocialHubsTagsDestroy = (id: string, signal?: AbortSignal) => {
  return privateMutator<void>({
    url: `/api/social/hubs/tags/${id}/`,
    method: "DELETE",
    signal,
  });
};

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

    return apiSocialHubsTagsDestroy(id);
  };

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

export type ApiSocialHubsTagsDestroyMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialHubsTagsDestroy>>
>;

export type ApiSocialHubsTagsDestroyMutationError = unknown;

/**
 * @summary Delete a hub tag
 */
export const useApiSocialHubsTagsDestroy = <
  TError = unknown,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiSocialHubsTagsDestroy>>,
      TError,
      { id: string },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiSocialHubsTagsDestroy>>,
  TError,
  { id: string },
  TContext
> => {
  return useMutation(
    getApiSocialHubsTagsDestroyMutationOptions(options),
    queryClient,
  );
};
