export type DeleteApiApiV0DeskProjectsProjectIdShareArgs = {project_id: string}; export type DeleteApiApiV0DeskProjectsProjectIdShareOptions = {baseUrl: string, HTTPBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Stop sharing a hosted project * * DELETE /api/v0/desk/projects/{project_id}/share */ export const deleteApiApiV0DeskProjectsProjectIdShare = async (args: DeleteApiApiV0DeskProjectsProjectIdShareArgs, options: DeleteApiApiV0DeskProjectsProjectIdShareOptions) => { const {baseUrl, 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(/\/+$/, '')}/api/v0/desk/projects/${encodeURIComponent(String(args.project_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 };