"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.UserPoolIdentityProviderGoogle=void 0;const jsiiDeprecationWarnings=require("../../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),user_pool_idp_base_1=require("./private/user-pool-idp-base"),cognito_generated_1=require("../cognito.generated");class UserPoolIdentityProviderGoogle extends user_pool_idp_base_1.UserPoolIdentityProviderBase{constructor(scope,id,props){super(scope,id,props);try{jsiiDeprecationWarnings.aws_cdk_lib_aws_cognito_UserPoolIdentityProviderGoogleProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,UserPoolIdentityProviderGoogle),error}const scopes=props.scopes??["profile"];if(!props.clientSecret&&!props.clientSecretValue||props.clientSecret&&props.clientSecretValue)throw new Error('Exactly one of "clientSecret" or "clientSecretValue" must be configured.');const resource=new cognito_generated_1.CfnUserPoolIdentityProvider(this,"Resource",{userPoolId:props.userPool.userPoolId,providerName:"Google",providerType:"Google",providerDetails:{client_id:props.clientId,client_secret:props.clientSecretValue?props.clientSecretValue.unsafeUnwrap():props.clientSecret,authorize_scopes:scopes.join(" ")},attributeMapping:super.configureAttributeMapping()});this.providerName=super.getResourceNameAttribute(resource.ref)}}exports.UserPoolIdentityProviderGoogle=UserPoolIdentityProviderGoogle,_a=JSII_RTTI_SYMBOL_1,UserPoolIdentityProviderGoogle[_a]={fqn:"aws-cdk-lib.aws_cognito.UserPoolIdentityProviderGoogle",version:"2.96.1"};
