/**
 * 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 {
  ApiSocialChatsListParams,
  ApiSocialMessagesListParams,
  Chat,
  ChatMember,
  Message,
  MessageSend,
  PaginatedChatList,
  PaginatedMessageList,
  PatchedChat,
  PatchedMessage,
} 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 chats the user is a member of. Superusers see all.
 * @summary List chats
 */
export const apiSocialChatsList = (
  params?: ApiSocialChatsListParams,
  signal?: AbortSignal,
) => {
  return privateMutator<PaginatedChatList>({
    url: `/api/social/chats/`,
    method: "GET",
    params,
    signal,
  });
};

export const getApiSocialChatsListQueryKey = (
  params?: ApiSocialChatsListParams,
) => {
  return [`/api/social/chats/`, ...(params ? [params] : [])] as const;
};

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

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

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

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

export type ApiSocialChatsListQueryResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialChatsList>>
>;
export type ApiSocialChatsListQueryError = unknown;

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

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

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

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

/**
 * Owner is set to the requesting user automatically.
 * @summary Create a chat
 */
export const apiSocialChatsCreate = (
  chat: NonReadonly<Chat>,
  signal?: AbortSignal,
) => {
  return privateMutator<Chat>({
    url: `/api/social/chats/`,
    method: "POST",
    headers: { "Content-Type": "application/json" },
    data: chat,
    signal,
  });
};

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

    return apiSocialChatsCreate(data);
  };

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

export type ApiSocialChatsCreateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialChatsCreate>>
>;
export type ApiSocialChatsCreateMutationBody = NonReadonly<Chat>;
export type ApiSocialChatsCreateMutationError = unknown;

/**
 * @summary Create a chat
 */
export const useApiSocialChatsCreate = <TError = unknown, TContext = unknown>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiSocialChatsCreate>>,
      TError,
      { data: NonReadonly<Chat> },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiSocialChatsCreate>>,
  TError,
  { data: NonReadonly<Chat> },
  TContext
> => {
  return useMutation(
    getApiSocialChatsCreateMutationOptions(options),
    queryClient,
  );
};
/**
 * @summary Retrieve a chat
 */
export const apiSocialChatsRetrieve = (id: string, signal?: AbortSignal) => {
  return privateMutator<Chat>({
    url: `/api/social/chats/${id}/`,
    method: "GET",
    signal,
  });
};

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

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

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

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

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

export type ApiSocialChatsRetrieveQueryResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialChatsRetrieve>>
>;
export type ApiSocialChatsRetrieveQueryError = unknown;

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

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

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

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

/**
 * Owner, moderator, or superuser only.
 * @summary Replace a chat
 */
export const apiSocialChatsUpdate = (
  id: string,
  chat: NonReadonly<Chat>,
  signal?: AbortSignal,
) => {
  return privateMutator<Chat>({
    url: `/api/social/chats/${id}/`,
    method: "PUT",
    headers: { "Content-Type": "application/json" },
    data: chat,
    signal,
  });
};

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

    return apiSocialChatsUpdate(id, data);
  };

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

export type ApiSocialChatsUpdateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialChatsUpdate>>
>;
export type ApiSocialChatsUpdateMutationBody = NonReadonly<Chat>;
export type ApiSocialChatsUpdateMutationError = unknown;

/**
 * @summary Replace a chat
 */
export const useApiSocialChatsUpdate = <TError = unknown, TContext = unknown>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiSocialChatsUpdate>>,
      TError,
      { id: string; data: NonReadonly<Chat> },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiSocialChatsUpdate>>,
  TError,
  { id: string; data: NonReadonly<Chat> },
  TContext
> => {
  return useMutation(
    getApiSocialChatsUpdateMutationOptions(options),
    queryClient,
  );
};
/**
 * Owner, moderator, or superuser only.
 * @summary Update a chat
 */
export const apiSocialChatsPartialUpdate = (
  id: string,
  patchedChat: NonReadonly<PatchedChat>,
  signal?: AbortSignal,
) => {
  return privateMutator<Chat>({
    url: `/api/social/chats/${id}/`,
    method: "PATCH",
    headers: { "Content-Type": "application/json" },
    data: patchedChat,
    signal,
  });
};

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

    return apiSocialChatsPartialUpdate(id, data);
  };

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

export type ApiSocialChatsPartialUpdateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialChatsPartialUpdate>>
>;
export type ApiSocialChatsPartialUpdateMutationBody = NonReadonly<PatchedChat>;
export type ApiSocialChatsPartialUpdateMutationError = unknown;

/**
 * @summary Update a chat
 */
export const useApiSocialChatsPartialUpdate = <
  TError = unknown,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiSocialChatsPartialUpdate>>,
      TError,
      { id: string; data: NonReadonly<PatchedChat> },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiSocialChatsPartialUpdate>>,
  TError,
  { id: string; data: NonReadonly<PatchedChat> },
  TContext
> => {
  return useMutation(
    getApiSocialChatsPartialUpdateMutationOptions(options),
    queryClient,
  );
};
/**
 * Soft-deletes. Owner or superuser only.
 * @summary Delete a chat
 */
export const apiSocialChatsDestroy = (id: string, signal?: AbortSignal) => {
  return privateMutator<void>({
    url: `/api/social/chats/${id}/`,
    method: "DELETE",
    signal,
  });
};

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

    return apiSocialChatsDestroy(id);
  };

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

export type ApiSocialChatsDestroyMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialChatsDestroy>>
>;

export type ApiSocialChatsDestroyMutationError = unknown;

/**
 * @summary Delete a chat
 */
export const useApiSocialChatsDestroy = <TError = unknown, TContext = unknown>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiSocialChatsDestroy>>,
      TError,
      { id: string },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiSocialChatsDestroy>>,
  TError,
  { id: string },
  TContext
> => {
  return useMutation(
    getApiSocialChatsDestroyMutationOptions(options),
    queryClient,
  );
};
/**
 * Owner, moderator, or superuser only.
 * @summary Add a member
 */
export const apiSocialChatsMembersAddCreate = (
  id: string,
  chatMember: ChatMember,
  signal?: AbortSignal,
) => {
  return privateMutator<Chat>({
    url: `/api/social/chats/${id}/members/add/`,
    method: "POST",
    headers: { "Content-Type": "application/json" },
    data: chatMember,
    signal,
  });
};

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

    return apiSocialChatsMembersAddCreate(id, data);
  };

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

export type ApiSocialChatsMembersAddCreateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialChatsMembersAddCreate>>
>;
export type ApiSocialChatsMembersAddCreateMutationBody = ChatMember;
export type ApiSocialChatsMembersAddCreateMutationError = unknown;

/**
 * @summary Add a member
 */
export const useApiSocialChatsMembersAddCreate = <
  TError = unknown,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiSocialChatsMembersAddCreate>>,
      TError,
      { id: string; data: ChatMember },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiSocialChatsMembersAddCreate>>,
  TError,
  { id: string; data: ChatMember },
  TContext
> => {
  return useMutation(
    getApiSocialChatsMembersAddCreateMutationOptions(options),
    queryClient,
  );
};
/**
 * Owner, moderator, or superuser only.
 * @summary Remove a member
 */
export const apiSocialChatsMembersRemoveCreate = (
  id: string,
  chatMember: ChatMember,
  signal?: AbortSignal,
) => {
  return privateMutator<void>({
    url: `/api/social/chats/${id}/members/remove/`,
    method: "POST",
    headers: { "Content-Type": "application/json" },
    data: chatMember,
    signal,
  });
};

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

    return apiSocialChatsMembersRemoveCreate(id, data);
  };

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

export type ApiSocialChatsMembersRemoveCreateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialChatsMembersRemoveCreate>>
>;
export type ApiSocialChatsMembersRemoveCreateMutationBody = ChatMember;
export type ApiSocialChatsMembersRemoveCreateMutationError = unknown;

/**
 * @summary Remove a member
 */
export const useApiSocialChatsMembersRemoveCreate = <
  TError = unknown,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiSocialChatsMembersRemoveCreate>>,
      TError,
      { id: string; data: ChatMember },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiSocialChatsMembersRemoveCreate>>,
  TError,
  { id: string; data: ChatMember },
  TContext
> => {
  return useMutation(
    getApiSocialChatsMembersRemoveCreateMutationOptions(options),
    queryClient,
  );
};
/**
 * Owner or superuser only.
 * @summary Add a moderator
 */
export const apiSocialChatsModeratorsAddCreate = (
  id: string,
  chatMember: ChatMember,
  signal?: AbortSignal,
) => {
  return privateMutator<Chat>({
    url: `/api/social/chats/${id}/moderators/add/`,
    method: "POST",
    headers: { "Content-Type": "application/json" },
    data: chatMember,
    signal,
  });
};

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

    return apiSocialChatsModeratorsAddCreate(id, data);
  };

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

export type ApiSocialChatsModeratorsAddCreateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialChatsModeratorsAddCreate>>
>;
export type ApiSocialChatsModeratorsAddCreateMutationBody = ChatMember;
export type ApiSocialChatsModeratorsAddCreateMutationError = unknown;

/**
 * @summary Add a moderator
 */
export const useApiSocialChatsModeratorsAddCreate = <
  TError = unknown,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiSocialChatsModeratorsAddCreate>>,
      TError,
      { id: string; data: ChatMember },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiSocialChatsModeratorsAddCreate>>,
  TError,
  { id: string; data: ChatMember },
  TContext
> => {
  return useMutation(
    getApiSocialChatsModeratorsAddCreateMutationOptions(options),
    queryClient,
  );
};
/**
 * Owner or superuser only.
 * @summary Remove a moderator
 */
export const apiSocialChatsModeratorsRemoveCreate = (
  id: string,
  chatMember: ChatMember,
  signal?: AbortSignal,
) => {
  return privateMutator<void>({
    url: `/api/social/chats/${id}/moderators/remove/`,
    method: "POST",
    headers: { "Content-Type": "application/json" },
    data: chatMember,
    signal,
  });
};

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

    return apiSocialChatsModeratorsRemoveCreate(id, data);
  };

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

export type ApiSocialChatsModeratorsRemoveCreateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialChatsModeratorsRemoveCreate>>
>;
export type ApiSocialChatsModeratorsRemoveCreateMutationBody = ChatMember;
export type ApiSocialChatsModeratorsRemoveCreateMutationError = unknown;

/**
 * @summary Remove a moderator
 */
export const useApiSocialChatsModeratorsRemoveCreate = <
  TError = unknown,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiSocialChatsModeratorsRemoveCreate>>,
      TError,
      { id: string; data: ChatMember },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiSocialChatsModeratorsRemoveCreate>>,
  TError,
  { id: string; data: ChatMember },
  TContext
> => {
  return useMutation(
    getApiSocialChatsModeratorsRemoveCreateMutationOptions(options),
    queryClient,
  );
};
/**
 * Filter by `?chat=<id>`. Chat members only.
 * @summary List messages
 */
export const apiSocialMessagesList = (
  params?: ApiSocialMessagesListParams,
  signal?: AbortSignal,
) => {
  return privateMutator<PaginatedMessageList>({
    url: `/api/social/messages/`,
    method: "GET",
    params,
    signal,
  });
};

export const getApiSocialMessagesListQueryKey = (
  params?: ApiSocialMessagesListParams,
) => {
  return [`/api/social/messages/`, ...(params ? [params] : [])] as const;
};

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

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

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

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

export type ApiSocialMessagesListQueryResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialMessagesList>>
>;
export type ApiSocialMessagesListQueryError = unknown;

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

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

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

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

/**
 * @summary Retrieve a message
 */
export const apiSocialMessagesRetrieve = (id: string, signal?: AbortSignal) => {
  return privateMutator<Message>({
    url: `/api/social/messages/${id}/`,
    method: "GET",
    signal,
  });
};

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

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

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

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

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

export type ApiSocialMessagesRetrieveQueryResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialMessagesRetrieve>>
>;
export type ApiSocialMessagesRetrieveQueryError = unknown;

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

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

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

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

/**
 * Sender only.
 * @summary Replace a message
 */
export const apiSocialMessagesUpdate = (
  id: string,
  message: NonReadonly<Message>,
  signal?: AbortSignal,
) => {
  return privateMutator<Message>({
    url: `/api/social/messages/${id}/`,
    method: "PUT",
    headers: { "Content-Type": "application/json" },
    data: message,
    signal,
  });
};

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

    return apiSocialMessagesUpdate(id, data);
  };

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

export type ApiSocialMessagesUpdateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialMessagesUpdate>>
>;
export type ApiSocialMessagesUpdateMutationBody = NonReadonly<Message>;
export type ApiSocialMessagesUpdateMutationError = unknown;

/**
 * @summary Replace a message
 */
export const useApiSocialMessagesUpdate = <
  TError = unknown,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiSocialMessagesUpdate>>,
      TError,
      { id: string; data: NonReadonly<Message> },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiSocialMessagesUpdate>>,
  TError,
  { id: string; data: NonReadonly<Message> },
  TContext
> => {
  return useMutation(
    getApiSocialMessagesUpdateMutationOptions(options),
    queryClient,
  );
};
/**
 * Sender only. Broadcasts `edit.message` to the chat channel group in real time.
 * @summary Edit a message
 */
export const apiSocialMessagesPartialUpdate = (
  id: string,
  patchedMessage: NonReadonly<PatchedMessage>,
  signal?: AbortSignal,
) => {
  return privateMutator<Message>({
    url: `/api/social/messages/${id}/`,
    method: "PATCH",
    headers: { "Content-Type": "application/json" },
    data: patchedMessage,
    signal,
  });
};

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

    return apiSocialMessagesPartialUpdate(id, data);
  };

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

export type ApiSocialMessagesPartialUpdateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialMessagesPartialUpdate>>
>;
export type ApiSocialMessagesPartialUpdateMutationBody =
  NonReadonly<PatchedMessage>;
export type ApiSocialMessagesPartialUpdateMutationError = unknown;

/**
 * @summary Edit a message
 */
export const useApiSocialMessagesPartialUpdate = <
  TError = unknown,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiSocialMessagesPartialUpdate>>,
      TError,
      { id: string; data: NonReadonly<PatchedMessage> },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiSocialMessagesPartialUpdate>>,
  TError,
  { id: string; data: NonReadonly<PatchedMessage> },
  TContext
> => {
  return useMutation(
    getApiSocialMessagesPartialUpdateMutationOptions(options),
    queryClient,
  );
};
/**
 * Sender, chat owner, moderator, or superuser. Broadcasts `delete.message` to the chat channel group in real time.
 * @summary Delete a message
 */
export const apiSocialMessagesDestroy = (id: string, signal?: AbortSignal) => {
  return privateMutator<void>({
    url: `/api/social/messages/${id}/`,
    method: "DELETE",
    signal,
  });
};

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

    return apiSocialMessagesDestroy(id);
  };

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

export type ApiSocialMessagesDestroyMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialMessagesDestroy>>
>;

export type ApiSocialMessagesDestroyMutationError = unknown;

/**
 * @summary Delete a message
 */
export const useApiSocialMessagesDestroy = <
  TError = unknown,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiSocialMessagesDestroy>>,
      TError,
      { id: string },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiSocialMessagesDestroy>>,
  TError,
  { id: string },
  TContext
> => {
  return useMutation(
    getApiSocialMessagesDestroyMutationOptions(options),
    queryClient,
  );
};
/**
 * Creates a message with optional file attachments and broadcasts it to all connected WebSocket clients in the chat. Use this for all messages that include files, and optionally for text-only messages too. Chat members only.
 * @summary Send a message
 */
export const apiSocialMessagesSendCreate = (
  messageSend: MessageSend,
  signal?: AbortSignal,
) => {
  return privateMutator<Message>({
    url: `/api/social/messages/send/`,
    method: "POST",
    headers: { "Content-Type": "application/json" },
    data: messageSend,
    signal,
  });
};

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

    return apiSocialMessagesSendCreate(data);
  };

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

export type ApiSocialMessagesSendCreateMutationResult = NonNullable<
  Awaited<ReturnType<typeof apiSocialMessagesSendCreate>>
>;
export type ApiSocialMessagesSendCreateMutationBody = MessageSend;
export type ApiSocialMessagesSendCreateMutationError = unknown;

/**
 * @summary Send a message
 */
export const useApiSocialMessagesSendCreate = <
  TError = unknown,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<ReturnType<typeof apiSocialMessagesSendCreate>>,
      TError,
      { data: MessageSend },
      TContext
    >;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<ReturnType<typeof apiSocialMessagesSendCreate>>,
  TError,
  { data: MessageSend },
  TContext
> => {
  return useMutation(
    getApiSocialMessagesSendCreateMutationOptions(options),
    queryClient,
  );
};
