"use strict";var _a,_b,_c;Object.defineProperty(exports,"__esModule",{value:!0}),exports.Backend=exports.LoggingFormat=exports.AccessLog=exports.Protocol=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),utils_1=require("./private/utils"),cdk=require("../../core");var Protocol;(function(Protocol2){Protocol2.HTTP="http",Protocol2.TCP="tcp",Protocol2.HTTP2="http2",Protocol2.GRPC="grpc"})(Protocol||(exports.Protocol=Protocol={}));class AccessLog{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,_a=JSII_RTTI_SYMBOL_1,AccessLog[_a]={fqn:"aws-cdk-lib.aws_appmesh.AccessLog",version:"2.96.1"};class FileAccessLog extends AccessLog{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 fromText(text){return new TextLoggingFormat(text)}static fromJson(jsonLoggingFormat){if(Object.keys(jsonLoggingFormat).length==0)throw new Error("Json key pairs cannot be empty.");return new JsonLoggingFormat(jsonLoggingFormat)}}exports.LoggingFormat=LoggingFormat,_b=JSII_RTTI_SYMBOL_1,LoggingFormat[_b]={fqn:"aws-cdk-lib.aws_appmesh.LoggingFormat",version:"2.96.1"};class JsonLoggingFormat extends LoggingFormat{constructor(json){super(),this.json=Object.entries(json).map(([key,value])=>({key,value}))}bind(){return{formatConfig:{json:this.json}}}}class TextLoggingFormat extends LoggingFormat{constructor(text){super(),this.text=text}bind(){return{formatConfig:{text:this.text}}}}class Backend{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,_c=JSII_RTTI_SYMBOL_1,Backend[_c]={fqn:"aws-cdk-lib.aws_appmesh.Backend",version:"2.96.1"};class VirtualServiceBackend extends Backend{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}}}}}
