export type DeleteApiApiInvoicesInvoiceIdShareArgs = {invoice_id: string, 'X-Workspace-Id'?: (string | null) | undefined}; export type DeleteApiApiInvoicesInvoiceIdShareOptions = {baseUrl: string, OAuth2PasswordBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Revoke Share Link * * DELETE /api/invoices/{invoice_id}/share */ export const deleteApiApiInvoicesInvoiceIdShare = async (args: DeleteApiApiInvoicesInvoiceIdShareArgs, options: DeleteApiApiInvoicesInvoiceIdShareOptions) => { const {baseUrl, fetch: fetchFn = fetch, OAuth2PasswordBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-Workspace-Id'] != null) headers.set("X-Workspace-Id", String(args['X-Workspace-Id'])) if (OAuth2PasswordBearer !== undefined) headers.set('authorization', `Bearer ${OAuth2PasswordBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/invoices/${encodeURIComponent(String(args.invoice_id))}/share${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 };