export type DeleteApiV1StorePromotionsStorePromotionIdArgs = {store_promotion_id: string}; export type DeleteApiV1StorePromotionsStorePromotionIdOptions = {baseUrl?: string | undefined, HTTPBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Store Promotion * * DELETE /v1/store_promotions/{store_promotion_id} */ export const deleteApiV1StorePromotionsStorePromotionId = async (args: DeleteApiV1StorePromotionsStorePromotionIdArgs, options?: DeleteApiV1StorePromotionsStorePromotionIdOptions) => { const {baseUrl = "https://api.aghanim.com/s2s", fetch: fetchFn = fetch, HTTPBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (HTTPBearer !== undefined) headers.set('authorization', `Bearer ${HTTPBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/store_promotions/${encodeURIComponent(String(args.store_promotion_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 };