"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.VirtualGatewayListener=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),utils_1=require("./private/utils"),shared_interfaces_1=require("./shared-interfaces");class VirtualGatewayListener{static http(options={}){return jsiiDeprecationWarnings.aws_cdk_lib_aws_appmesh_HttpGatewayListenerOptions(options),new VirtualGatewayListenerImpl(shared_interfaces_1.Protocol.HTTP,options.healthCheck,options.port,options.tls,options.connectionPool)}static http2(options={}){return jsiiDeprecationWarnings.aws_cdk_lib_aws_appmesh_Http2GatewayListenerOptions(options),new VirtualGatewayListenerImpl(shared_interfaces_1.Protocol.HTTP2,options.healthCheck,options.port,options.tls,options.connectionPool)}static grpc(options={}){return jsiiDeprecationWarnings.aws_cdk_lib_aws_appmesh_GrpcGatewayListenerOptions(options),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.13.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){var _b;return{listener:{portMapping:{port:this.port,protocol:this.protocol},healthCheck:(_b=this.healthCheck)===null||_b===void 0?void 0:_b.bind(scope,{defaultPort:this.port}).virtualGatewayHealthCheck,tls:utils_1.renderListenerTlsOptions(scope,this.listenerTls),connectionPool:this.connectionPool?renderConnectionPool(this.connectionPool,this.protocol):void 0}}}}function renderConnectionPool(connectionPool,listenerProtocol){return{[listenerProtocol]:{maxRequests:(connectionPool==null?void 0:connectionPool.maxRequests)!==void 0?connectionPool.maxRequests:void 0,maxConnections:(connectionPool==null?void 0:connectionPool.maxConnections)!==void 0?connectionPool.maxConnections:void 0,maxPendingRequests:(connectionPool==null?void 0:connectionPool.maxPendingRequests)!==void 0?connectionPool.maxPendingRequests:void 0}}}
//# sourceMappingURL=virtual-gateway-listener.js.map
