"use strict";var _a,_b;Object.defineProperty(exports,"__esModule",{value:!0}),exports.UserPoolIdentityProviderSaml=exports.UserPoolIdentityProviderSamlMetadata=exports.UserPoolIdentityProviderSamlMetadataType=exports.SigningAlgorithm=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var user_pool_idp_base_1=()=>{var tmp=require("./private/user-pool-idp-base");return user_pool_idp_base_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},cognito_generated_1=()=>{var tmp=require("../cognito.generated");return cognito_generated_1=()=>tmp,tmp},SigningAlgorithm;(function(SigningAlgorithm2){SigningAlgorithm2.RSA_SHA256="rsa-sha256"})(SigningAlgorithm||(exports.SigningAlgorithm=SigningAlgorithm={}));var UserPoolIdentityProviderSamlMetadataType;(function(UserPoolIdentityProviderSamlMetadataType2){UserPoolIdentityProviderSamlMetadataType2.URL="url",UserPoolIdentityProviderSamlMetadataType2.FILE="file"})(UserPoolIdentityProviderSamlMetadataType||(exports.UserPoolIdentityProviderSamlMetadataType=UserPoolIdentityProviderSamlMetadataType={}));class UserPoolIdentityProviderSamlMetadata{static url(url){return new UserPoolIdentityProviderSamlMetadata(url,UserPoolIdentityProviderSamlMetadataType.URL)}static file(fileContent){return new UserPoolIdentityProviderSamlMetadata(fileContent,UserPoolIdentityProviderSamlMetadataType.FILE)}constructor(metadataContent,metadataType){this.metadataContent=metadataContent,this.metadataType=metadataType}}exports.UserPoolIdentityProviderSamlMetadata=UserPoolIdentityProviderSamlMetadata,_a=JSII_RTTI_SYMBOL_1,UserPoolIdentityProviderSamlMetadata[_a]={fqn:"aws-cdk-lib.aws_cognito.UserPoolIdentityProviderSamlMetadata",version:"2.148.1"};class UserPoolIdentityProviderSaml extends user_pool_idp_base_1().UserPoolIdentityProviderBase{constructor(scope,id,props){super(scope,id,props);try{jsiiDeprecationWarnings().aws_cdk_lib_aws_cognito_UserPoolIdentityProviderSamlProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,UserPoolIdentityProviderSaml),error}this.validateName(props.name);const{metadataType,metadataContent}=props.metadata,resource=new(cognito_generated_1()).CfnUserPoolIdentityProvider(this,"Resource",{userPoolId:props.userPool.userPoolId,providerName:this.getProviderName(props.name),providerType:"SAML",providerDetails:{IDPSignout:props.idpSignout??!1,MetadataURL:metadataType===UserPoolIdentityProviderSamlMetadataType.URL?metadataContent:void 0,MetadataFile:metadataType===UserPoolIdentityProviderSamlMetadataType.FILE?metadataContent:void 0,EncryptedResponses:props.encryptedResponses??void 0,RequestSigningAlgorithm:props.requestSigningAlgorithm,IDPInit:props.idpInitiated??void 0},idpIdentifiers:props.identifiers,attributeMapping:super.configureAttributeMapping()});this.providerName=super.getResourceNameAttribute(resource.ref)}getProviderName(name){if(name)return this.validateName(name),name;const uniqueName=core_1().Names.uniqueResourceName(this,{maxLength:32});return uniqueName.length<3?`${uniqueName}saml`:uniqueName}validateName(name){if(name&&!core_1().Token.isUnresolved(name)&&(name.length<3||name.length>32))throw new Error(`Expected provider name to be between 3 and 32 characters, received ${name} (${name.length} characters)`)}}exports.UserPoolIdentityProviderSaml=UserPoolIdentityProviderSaml,_b=JSII_RTTI_SYMBOL_1,UserPoolIdentityProviderSaml[_b]={fqn:"aws-cdk-lib.aws_cognito.UserPoolIdentityProviderSaml",version:"2.148.1"};
