export type DeleteApiPublicConsoleV2ChargebackCostChargebackCostNameArgs = {'chargeback-cost-name': string}; export type DeleteApiPublicConsoleV2ChargebackCostChargebackCostNameOptions = {baseUrl: string, httpAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a ChargebackCost * * DELETE /public/console/v2/chargeback-cost/{chargeback-cost-name} */ export const deleteApiPublicConsoleV2ChargebackCostChargebackCostName = async (args: DeleteApiPublicConsoleV2ChargebackCostChargebackCostNameArgs, options: DeleteApiPublicConsoleV2ChargebackCostChargebackCostNameOptions) => { const {baseUrl, fetch: fetchFn = fetch, httpAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (httpAuth !== undefined) headers.set('authorization', `Bearer ${httpAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/public/console/v2/chargeback-cost/${encodeURIComponent(String(args['chargeback-cost-name']))}${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 };