"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Backend=exports.LoggingFormat=exports.AccessLog=exports.Protocol=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var utils_1=()=>{var tmp=require("./private/utils");return utils_1=()=>tmp,tmp},cdk=()=>{var tmp=require("../../core");return cdk=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp},Protocol;(function(Protocol2){Protocol2.HTTP="http",Protocol2.TCP="tcp",Protocol2.HTTP2="http2",Protocol2.GRPC="grpc"})(Protocol||(exports.Protocol=Protocol={}));class AccessLog{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_appmesh.AccessLog",version:"2.256.1"};static fromFilePath(filePath,loggingFormat){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_appmesh_LoggingFormat(loggingFormat)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromFilePath),error}return new FileAccessLog(filePath,loggingFormat)}}exports.AccessLog=AccessLog;class FileAccessLog extends AccessLog{filePath;virtualNodeLoggingFormat;virtualGatewayLoggingFormat;constructor(filePath,loggingFormat){super(),this.filePath=filePath,this.virtualGatewayLoggingFormat=loggingFormat?.bind().formatConfig,this.virtualNodeLoggingFormat=loggingFormat?.bind().formatConfig}bind(_scope){return{virtualNodeAccessLog:{file:{path:this.filePath,format:this.virtualNodeLoggingFormat}},virtualGatewayAccessLog:{file:{path:this.filePath,format:this.virtualGatewayLoggingFormat}}}}}class LoggingFormat{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_appmesh.LoggingFormat",version:"2.256.1"};static fromText(text){return new TextLoggingFormat(text)}static fromJson(jsonLoggingFormat){if(Object.keys(jsonLoggingFormat).length==0)throw new(cdk()).UnscopedValidationError((0,literal_string_1().lit)`JsonKeyPairsEmpty`,"Json key pairs cannot be empty.");return new JsonLoggingFormat(jsonLoggingFormat)}}exports.LoggingFormat=LoggingFormat;class JsonLoggingFormat extends LoggingFormat{json;constructor(json){super(),this.json=Object.entries(json).map(([key,value])=>({key,value}))}bind(){return{formatConfig:{json:this.json}}}}class TextLoggingFormat extends LoggingFormat{text;constructor(text){super(),this.text=text}bind(){return{formatConfig:{text:this.text}}}}class Backend{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_appmesh.Backend",version:"2.256.1"};static virtualService(virtualService,props={}){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_appmesh_IVirtualService(virtualService),jsiiDeprecationWarnings().aws_cdk_lib_aws_appmesh_VirtualServiceBackendOptions(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.virtualService),error}return new VirtualServiceBackend(virtualService,props.tlsClientPolicy)}}exports.Backend=Backend;class VirtualServiceBackend extends Backend{virtualService;tlsClientPolicy;constructor(virtualService,tlsClientPolicy){super(),this.virtualService=virtualService,this.tlsClientPolicy=tlsClientPolicy}bind(scope){return{virtualServiceBackend:{virtualService:{virtualServiceName:cdk().Token.isUnresolved(this.virtualService.virtualServiceName)?this.virtualService.physicalName:this.virtualService.virtualServiceName,clientPolicy:this.tlsClientPolicy?{tls:(0,utils_1().renderTlsClientPolicy)(scope,this.tlsClientPolicy)}:void 0}}}}}
