export type DeleteApiPublicApiBumpsIdArgs = {id: string}; export type DeleteApiPublicApiBumpsIdOptions = {baseUrl?: string | undefined, OAuthToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove um order bump existente. * * DELETE /public_api/bumps/{id}/ */ export const deleteApiPublicApiBumpsId = async (args: DeleteApiPublicApiBumpsIdArgs, options?: DeleteApiPublicApiBumpsIdOptions) => { const {baseUrl = "https://api.cakto.com.br", fetch: fetchFn = fetch, OAuthToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (OAuthToken !== undefined) headers.set('authorization', `Bearer ${OAuthToken}`) const url = `${baseUrl.replace(/\/+$/, '')}/public_api/bumps/${encodeURIComponent(String(args.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 };