export type DeleteApiProjectsProjectIdFigmaAttachmentsIdArgs = {'X-PhraseApp-OTP'?: string | undefined, project_id: string, id: string, branch?: string | undefined}; export type DeleteApiProjectsProjectIdFigmaAttachmentsIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a Figma attachment * * DELETE /projects/{project_id}/figma_attachments/{id} */ export const deleteApiProjectsProjectIdFigmaAttachmentsId = async (args: DeleteApiProjectsProjectIdFigmaAttachmentsIdArgs, options?: DeleteApiProjectsProjectIdFigmaAttachmentsIdOptions) => { const {baseUrl = "https://eu.phrase.com/control-hub", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-PhraseApp-OTP'] != null) headers.set("X-PhraseApp-OTP", String(args['X-PhraseApp-OTP'])) if (args.branch != null) query.append("branch", String(args.branch)) const url = `${baseUrl.replace(/\/+$/, '')}/projects/${encodeURIComponent(String(args.project_id))}/figma_attachments/${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 };