export type DeleteApiApiV1CarrierAccountsCarrierAccountIDArgs = {carrierAccountID: string, 'X-PB-Developer-Partner-ID'?: string | undefined}; export type DeleteApiApiV1CarrierAccountsCarrierAccountIDOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Carrier * * DELETE /api/v1/carrierAccounts/{carrierAccountID} */ export const deleteApiApiV1CarrierAccountsCarrierAccountID = async (args: DeleteApiApiV1CarrierAccountsCarrierAccountIDArgs, options?: DeleteApiApiV1CarrierAccountsCarrierAccountIDOptions) => { const {baseUrl = "https://api-sandbox.sendpro360.pitneybowes.com/carrieraccountmgmt", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-PB-Developer-Partner-ID'] != null) headers.set("X-PB-Developer-Partner-ID", String(args['X-PB-Developer-Partner-ID'])) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/carrierAccounts/${encodeURIComponent(String(args.carrierAccountID))}${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 };