export type DeleteApiPaymentsPreChargebackAlertsMerchantsMerchantIdRulesRuleIdArgs = {merchant_id: string, rule_id: string}; export type DeleteApiPaymentsPreChargebackAlertsMerchantsMerchantIdRulesRuleIdOptions = {baseUrl?: string | undefined, ApiKey?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Delete a Pre-Chargeback Rule * * DELETE /payments/pre-chargeback-alerts/merchants/{merchant_id}/rules/{rule_id} */ export const deleteApiPaymentsPreChargebackAlertsMerchantsMerchantIdRulesRuleId = async (args: DeleteApiPaymentsPreChargebackAlertsMerchantsMerchantIdRulesRuleIdArgs, options?: DeleteApiPaymentsPreChargebackAlertsMerchantsMerchantIdRulesRuleIdOptions) => { const {baseUrl = "https://api.evervault.com", fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiKey !== undefined) headers.set('authorization', `Basic ${btoa(`${ApiKey.username}:${ApiKey.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/payments/pre-chargeback-alerts/merchants/${encodeURIComponent(String(args.merchant_id))}/rules/${encodeURIComponent(String(args.rule_id))}${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 };