export type DeleteApiPayoutWalletUserTokenWalletTokenAutopayoutArgs = {token: string}; export type DeleteApiPayoutWalletUserTokenWalletTokenAutopayoutOptions = {baseUrl?: string | undefined, AUTHORIZERNAME?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete AutoPayout rule * * DELETE /payout/wallet/{user_token}/{wallet_token}/autopayout * * Also accepts auth: api_key */ export const deleteApiPayoutWalletUserTokenWalletTokenAutopayout = async (args: DeleteApiPayoutWalletUserTokenWalletTokenAutopayoutArgs, options?: DeleteApiPayoutWalletUserTokenWalletTokenAutopayoutOptions) => { const {baseUrl = "https://api.masspay.io/v1.0.0", fetch: fetchFn = fetch, AUTHORIZERNAME} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.token != null) query.append("token", String(args.token)) if (AUTHORIZERNAME !== undefined) headers.set("Authorization", AUTHORIZERNAME) const url = `${baseUrl.replace(/\/+$/, '')}/payout/wallet/${encodeURIComponent(String(args.user_token))}/${encodeURIComponent(String(args.wallet_token))}/autopayout${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };