'use client';

// AUTO-GENERATED by openapi_processor / ts.hooks
// DELETE /cfg/totp/devices/{id}/
// DO NOT EDIT — re-run `make gen`.

import useSWRMutation from "swr/mutation";
import type { SWRMutationConfiguration } from "swr/mutation";
import { CfgTotp } from "../../sdk.gen";
import type { CfgTotpDevicesDestroyData, CfgTotpDevicesDestroyResponses } from "../../types.gen";


type Args = Omit<CfgTotpDevicesDestroyData, "url">;
type Result = CfgTotpDevicesDestroyResponses[keyof CfgTotpDevicesDestroyResponses];

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