export type DeleteApiV1OrgsOrgIdIntegrationsArgs = {org_id: string, names: string}; export type DeleteApiV1OrgsOrgIdIntegrationsOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete given integration endpoints in org-settings. * * DELETE /v1/orgs/{org_id}/integrations */ export const deleteApiV1OrgsOrgIdIntegrations = async (args: DeleteApiV1OrgsOrgIdIntegrationsArgs, options?: DeleteApiV1OrgsOrgIdIntegrationsOptions) => { const {baseUrl = "https://api.edgedelta.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.names != null) query.append("names", String(args.names)) if (ApiKeyAuth !== undefined) headers.set("X-ED-API-Token", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v1/orgs/${encodeURIComponent(String(args.org_id))}/integrations${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 };