export type DeleteApiOrganizationsOrganizationIdArgs = {organization_id: string}; export type DeleteApiOrganizationsOrganizationIdOptions = {baseUrl?: string | undefined, APIKeyHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Organization * * DELETE /organizations/{organization_id} */ export const deleteApiOrganizationsOrganizationId = async (args: DeleteApiOrganizationsOrganizationIdArgs, options?: DeleteApiOrganizationsOrganizationIdOptions) => { const {baseUrl = "https://api.baselayer.com", fetch: fetchFn = fetch, APIKeyHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (APIKeyHeader !== undefined) headers.set("X-API-Key", APIKeyHeader) const url = `${baseUrl.replace(/\/+$/, '')}/organizations/${encodeURIComponent(String(args.organization_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 };