export type DeleteApiV1OrgsOrgIdByoProviderArgs = {orgId: string, Authorization?: string | undefined}; export type DeleteApiV1OrgsOrgIdByoProviderOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Removes the organization's own LLM provider and its stored credential. Idempotent. * * DELETE /v1/orgs/{orgId}/byo-provider */ export const deleteApiV1OrgsOrgIdByoProvider = async (args: DeleteApiV1OrgsOrgIdByoProviderArgs, options?: DeleteApiV1OrgsOrgIdByoProviderOptions) => { const {baseUrl = "https://api.tessl.io", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/orgs/${encodeURIComponent(String(args.orgId))}/byo-provider${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 };