export type DeleteApiPublicConsoleV2ChargebackLabelChargebackLabelNameArgs = {'chargeback-label-name': string}; export type DeleteApiPublicConsoleV2ChargebackLabelChargebackLabelNameOptions = {baseUrl: string, httpAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a ChargebackLabel * * DELETE /public/console/v2/chargeback-label/{chargeback-label-name} */ export const deleteApiPublicConsoleV2ChargebackLabelChargebackLabelName = async (args: DeleteApiPublicConsoleV2ChargebackLabelChargebackLabelNameArgs, options: DeleteApiPublicConsoleV2ChargebackLabelChargebackLabelNameOptions) => { 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-label/${encodeURIComponent(String(args['chargeback-label-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 };