'use client';

// AUTO-GENERATED by openapi_processor / ts.hooks
// POST /cfg/accounts/token/blacklist/
// DO NOT EDIT — re-run `make gen`.

import useSWRMutation from "swr/mutation";
import type { SWRMutationConfiguration } from "swr/mutation";
import { CfgAccountsAuth } from "../../sdk.gen";
import type { CfgAccountsTokenBlacklistCreateData, CfgAccountsTokenBlacklistCreateResponses } from "../../types.gen";


type Args = Omit<CfgAccountsTokenBlacklistCreateData, "url">;
type Result = CfgAccountsTokenBlacklistCreateResponses[keyof CfgAccountsTokenBlacklistCreateResponses];

export function useCfgAccountsTokenBlacklistCreate(
  config?: SWRMutationConfiguration<Result, Error, readonly ["cfg_accounts_token_blacklist_create"], Args>,
) {
  return useSWRMutation<Result, Error, readonly ["cfg_accounts_token_blacklist_create"], Args>(
    ["cfg_accounts_token_blacklist_create"] as const,
    async (_key, { arg }: { arg: Args }) => {
      const res = await CfgAccountsAuth.cfgAccountsTokenBlacklistCreate({ ...arg, throwOnError: true } as never);
      const data = res.data as Result;
      return data;
    },
    config,
  );
}
