"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.VirtualGatewayListener=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},shared_interfaces_1=()=>{var tmp=require("./shared-interfaces");return shared_interfaces_1=()=>tmp,tmp};class VirtualGatewayListener{static http(options={}){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_appmesh_HttpGatewayListenerOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.http),error}return new VirtualGatewayListenerImpl(shared_interfaces_1().Protocol.HTTP,options.healthCheck,options.port,options.tls,options.connectionPool)}static http2(options={}){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_appmesh_Http2GatewayListenerOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.http2),error}return new VirtualGatewayListenerImpl(shared_interfaces_1().Protocol.HTTP2,options.healthCheck,options.port,options.tls,options.connectionPool)}static grpc(options={}){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_appmesh_GrpcGatewayListenerOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.grpc),error}return new VirtualGatewayListenerImpl(shared_interfaces_1().Protocol.GRPC,options.healthCheck,options.port,options.tls,options.connectionPool)}}exports.VirtualGatewayListener=VirtualGatewayListener,_a=JSII_RTTI_SYMBOL_1,VirtualGatewayListener[_a]={fqn:"aws-cdk-lib.aws_appmesh.VirtualGatewayListener",version:"2.159.0"};class VirtualGatewayListenerImpl extends VirtualGatewayListener{constructor(protocol,healthCheck,port=8080,listenerTls,connectionPool){super(),this.protocol=protocol,this.healthCheck=healthCheck,this.port=port,this.listenerTls=listenerTls,this.connectionPool=connectionPool}bind(scope){return{listener:{portMapping:{port:this.port,protocol:this.protocol},healthCheck:this.healthCheck?.bind(scope,{defaultPort:this.port}).virtualGatewayHealthCheck,tls:(0,utils_1().renderListenerTlsOptions)(scope,this.listenerTls),connectionPool:this.connectionPool?renderConnectionPool(this.connectionPool,this.protocol):void 0}}}}function renderConnectionPool(connectionPool,listenerProtocol){return{[listenerProtocol]:{maxRequests:connectionPool?.maxRequests!==void 0?connectionPool.maxRequests:void 0,maxConnections:connectionPool?.maxConnections!==void 0?connectionPool.maxConnections:void 0,maxPendingRequests:connectionPool?.maxPendingRequests!==void 0?connectionPool.maxPendingRequests:void 0}}}
