export type DeleteApiPurchaseOrdersPurchaseOrderIdLineItemsIdArgs = {'X-Wafeq-Idempotency-Key'?: string | undefined, purchase_order_id: string, id: string}; export type DeleteApiPurchaseOrdersPurchaseOrderIdLineItemsIdOptions = {baseUrl?: string | undefined, APIKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete purchase order line item * * DELETE /purchase-orders/{purchase_order_id}/line-items/{id}/ */ export const deleteApiPurchaseOrdersPurchaseOrderIdLineItemsId = async (args: DeleteApiPurchaseOrdersPurchaseOrderIdLineItemsIdArgs, options?: DeleteApiPurchaseOrdersPurchaseOrderIdLineItemsIdOptions) => { const {baseUrl = "https://api.wafeq.com/v1", fetch: fetchFn = fetch, APIKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-Wafeq-Idempotency-Key'] != null) headers.set("X-Wafeq-Idempotency-Key", String(args['X-Wafeq-Idempotency-Key'])) if (APIKeyAuth !== undefined) headers.set("Authorization", APIKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/purchase-orders/${encodeURIComponent(String(args.purchase_order_id))}/line-items/${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 };