"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.RuntimeCustomClaim=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var core_1=()=>{var tmp=require("../../../../core");return core_1=()=>tmp,tmp},errors_1=()=>{var tmp=require("../../../../core/lib/errors");return errors_1=()=>tmp,tmp},helpers_internal_1=()=>{var tmp=require("../../../../core/lib/helpers-internal");return helpers_internal_1=()=>tmp,tmp},custom_claim_helpers_1=()=>{var tmp=require("../../common/custom-claim-helpers");return custom_claim_helpers_1=()=>tmp,tmp},types_1=()=>{var tmp=require("../../common/types");return types_1=()=>tmp,tmp};class RuntimeCustomClaim{name;valueType;operator;value;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_bedrockagentcore.RuntimeCustomClaim",version:"2.256.1"};static withStringValue(name,value){return new RuntimeCustomClaim(name,types_1().CustomClaimValueType.STRING,types_1().CustomClaimOperator.EQUALS,value)}static withStringArrayValue(name,values,operator=types_1().CustomClaimOperator.CONTAINS){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_bedrockagentcore_CustomClaimOperator(operator)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.withStringArrayValue),error}if(operator!==types_1().CustomClaimOperator.CONTAINS&&operator!==types_1().CustomClaimOperator.CONTAINS_ANY)throw new(errors_1()).UnscopedValidationError((0,helpers_internal_1().lit)`InvalidOperatorForStringArray`,`Custom claim '${name}': STRING_ARRAY type only supports CONTAINS or CONTAINS_ANY operators, got ${operator}`);return new RuntimeCustomClaim(name,types_1().CustomClaimValueType.STRING_ARRAY,operator,values)}constructor(name,valueType,operator,value){if(this.name=name,this.valueType=valueType,this.operator=operator,this.value=value,!core_1().Token.isUnresolved(value)){if(valueType===types_1().CustomClaimValueType.STRING&&typeof value!="string")throw new(errors_1()).UnscopedValidationError((0,helpers_internal_1().lit)`InvalidValueTypeForString`,`Custom claim '${name}': STRING type requires a string value, got ${typeof value}`);if(valueType===types_1().CustomClaimValueType.STRING_ARRAY&&!Array.isArray(value))throw new(errors_1()).UnscopedValidationError((0,helpers_internal_1().lit)`InvalidValueTypeForStringArray`,`Custom claim '${name}': STRING_ARRAY type requires an array value, got ${typeof value}`)}}_render(){if(this.operator===types_1().CustomClaimOperator.CONTAINS){const values=this.value;if(!core_1().Token.isUnresolved(values[0])&&values.length!==1)throw new(errors_1()).UnscopedValidationError((0,helpers_internal_1().lit)`InvalidContainsOperatorValueCount`,`Custom claim '${this.name}': CONTAINS operator requires exactly one value, got ${values.length} values`)}return(0,custom_claim_helpers_1().renderCustomClaim)(this.name,this.valueType,this.operator,this.value)}}exports.RuntimeCustomClaim=RuntimeCustomClaim;
