"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ViaServicePrincipal=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),iam=require("../../aws-iam");class ViaServicePrincipal extends iam.PrincipalBase{constructor(serviceName,basePrincipal){super(),this.serviceName=serviceName;try{jsiiDeprecationWarnings.aws_cdk_lib_aws_iam_IPrincipal(basePrincipal)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.constructor),error}this.basePrincipal=basePrincipal||new iam.AnyPrincipal}get policyFragment(){const base=this.basePrincipal.policyFragment,conditions=Object.assign({},base.conditions);return conditions.StringEquals?conditions.StringEquals=Object.assign({"kms:ViaService":this.serviceName},conditions.StringEquals):conditions.StringEquals={"kms:ViaService":this.serviceName},{principalJson:base.principalJson,conditions}}}exports.ViaServicePrincipal=ViaServicePrincipal,_a=JSII_RTTI_SYMBOL_1,ViaServicePrincipal[_a]={fqn:"aws-cdk-lib.aws_kms.ViaServicePrincipal",version:"2.21.0"};
//# sourceMappingURL=via-service-principal.js.map
