export type CreateApiV3AccountsLoginSamlAccountAliasOrganizationAliasAcsArgs = {accountAlias: string, organizationAlias: string}; export type CreateApiV3AccountsLoginSamlAccountAliasOrganizationAliasAcsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * SAML assertion consumer service for an organization * * POST /v3/accounts/login/saml/{accountAlias}/{organizationAlias}/acs */ export const createApiV3AccountsLoginSamlAccountAliasOrganizationAliasAcs = async (args: CreateApiV3AccountsLoginSamlAccountAliasOrganizationAliasAcsArgs, options?: CreateApiV3AccountsLoginSamlAccountAliasOrganizationAliasAcsOptions) => { const {baseUrl = "https://api.cryptlex.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/v3/accounts/login/saml/${encodeURIComponent(String(args.accountAlias))}/${encodeURIComponent(String(args.organizationAlias))}/acs${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };