export type DeleteApiV1CarriersCarrierIdArgs = {carrierId: string}; export type DeleteApiV1CarriersCarrierIdOptions = {baseUrl?: string | undefined, httpBasic?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Archive carrier * * DELETE /v1/carriers/{carrierId} */ export const deleteApiV1CarriersCarrierId = async (args: DeleteApiV1CarriersCarrierIdArgs, options?: DeleteApiV1CarriersCarrierIdOptions) => { const {baseUrl = "https://api.prod.goaugment.com", fetch: fetchFn = fetch, httpBasic} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (httpBasic !== undefined) headers.set('authorization', `Basic ${btoa(`${httpBasic.username}:${httpBasic.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/carriers/${encodeURIComponent(String(args.carrierId))}${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 };