"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ServiceDiscovery=exports.DnsResponseType=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var DnsResponseType;(function(DnsResponseType2){DnsResponseType2.LOAD_BALANCER="LOADBALANCER",DnsResponseType2.ENDPOINTS="ENDPOINTS"})(DnsResponseType=exports.DnsResponseType||(exports.DnsResponseType={}));class ServiceDiscovery{static dns(hostname,responseType){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_appmesh_DnsResponseType(responseType)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.dns),error}return new DnsServiceDiscovery(hostname,responseType)}static cloudMap(service,instanceAttributes){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_servicediscovery_IService(service)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.cloudMap),error}return new CloudMapServiceDiscovery(service,instanceAttributes)}}exports.ServiceDiscovery=ServiceDiscovery,_a=JSII_RTTI_SYMBOL_1,ServiceDiscovery[_a]={fqn:"aws-cdk-lib.aws_appmesh.ServiceDiscovery",version:"2.24.1"};class DnsServiceDiscovery extends ServiceDiscovery{constructor(hostname,responseType){super(),this.hostname=hostname,this.responseType=responseType}bind(_scope){return{dns:{hostname:this.hostname,responseType:this.responseType}}}}class CloudMapServiceDiscovery extends ServiceDiscovery{constructor(service,instanceAttributes){super(),this.service=service,this.instanceAttributes=instanceAttributes}bind(_scope){return{cloudmap:{namespaceName:this.service.namespace.namespaceName,serviceName:this.service.serviceName,attributes:renderAttributes(this.instanceAttributes)}}}}function renderAttributes(attrs){if(attrs!==void 0)return Object.entries(attrs).map(([key,value])=>({key,value}))}
//# sourceMappingURL=service-discovery.js.map
