export type DeleteApiV2AuthnSsoSsoLinkageArgs = {partitionId: string, accountId: string, userId: string}; export type DeleteApiV2AuthnSsoSsoLinkageOptions = {baseUrl?: string | undefined, XAuthToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Unlink SSO for a user * * DELETE /v2/authn/sso/sso-linkage */ export const deleteApiV2AuthnSsoSsoLinkage = async (args: DeleteApiV2AuthnSsoSsoLinkageArgs, options?: DeleteApiV2AuthnSsoSsoLinkageOptions) => { const {baseUrl = "https://api.alianza.com", fetch: fetchFn = fetch, XAuthToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.partitionId != null) query.append("partitionId", String(args.partitionId)) if (args.accountId != null) query.append("accountId", String(args.accountId)) if (args.userId != null) query.append("userId", String(args.userId)) if (XAuthToken !== undefined) headers.set("X-AUTH-TOKEN", XAuthToken) const url = `${baseUrl.replace(/\/+$/, '')}/v2/authn/sso/sso-linkage${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 };