export type DeleteApiApplicationsInstallationsIdentifierArgs = {identifier: string, force?: boolean | undefined}; export type DeleteApiApplicationsInstallationsIdentifierOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Application Installation * * DELETE /applications/installations/{identifier} */ export const deleteApiApplicationsInstallationsIdentifier = async (args: DeleteApiApplicationsInstallationsIdentifierArgs, options?: DeleteApiApplicationsInstallationsIdentifierOptions) => { const {baseUrl = "https://api.crowdin.com/api/v2", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.force != null) query.append("force", String(args.force)) const url = `${baseUrl.replace(/\/+$/, '')}/applications/installations/${encodeURIComponent(String(args.identifier))}${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 };