export type CreateApiV20IdentityproviderConfigureArgs = {Accept?: ('application/json' | 'application/hal+json' | 'application/xml' | 'text/xml' | 'text/csv') | undefined, body: {idpType?: 'saml' | undefined, idpIssuer?: string | undefined, idpLoginEndpoint?: string | undefined, idpLogoutEndpoint?: string | undefined, idpCertificate?: string | undefined, wantAuthnResponseSigned?: boolean | undefined, decryptionPrivateKey?: string | undefined, idpDisableRequestedAuthnContext?: boolean | undefined} | {idpType?: 'oidc' | undefined, idpIssuer?: string | undefined, idpClientId?: string | undefined, idpClientSecret?: string | undefined, idpAdditionalScope?: string | undefined, idpFrontChannelLogoutUrl?: string | undefined, idpIdTokenSignedResponseAlg?: ('RS256' | 'RS384' | 'RS512' | 'HS256' | 'HS384' | 'HS512') | undefined, idpTokenEndpointAuthMethod?: ('client_secret_basic' | 'client_secret_post' | 'client_secret_jwt' | 'private_key_jwt' | 'tls_client_auth' | 'self_signed_tls_client_auth' | 'none') | undefined}}; export type CreateApiV20IdentityproviderConfigureOptions = {baseUrl?: string | undefined, APIKeyHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Set Up an Identity Provider * * POST /v2.0/identityprovider/configure * * Also accepts auth: APIKeyQueryParam, CXoneTokenHeader, OAuth2 */ export const createApiV20IdentityproviderConfigure = async (args: CreateApiV20IdentityproviderConfigureArgs, options?: CreateApiV20IdentityproviderConfigureOptions) => { const {baseUrl = "https://api-trial.cognigy.ai/testing", fetch: fetchFn = fetch, APIKeyHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.Accept != null) headers.set("Accept", String(args.Accept)) if (APIKeyHeader !== undefined) headers.set("X-API-Key", APIKeyHeader) const url = `${baseUrl.replace(/\/+$/, '')}/v2.0/identityprovider/configure${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };