"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.Route=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var appmesh_generated_1=()=>{var tmp=require("./appmesh.generated");return appmesh_generated_1=()=>tmp,tmp},utils_1=()=>{var tmp=require("./private/utils");return utils_1=()=>tmp,tmp},virtual_router_1=()=>{var tmp=require("./virtual-router");return virtual_router_1=()=>tmp,tmp},cdk=()=>{var tmp=require("../../core");return cdk=()=>tmp,tmp};class Route extends cdk().Resource{static fromRouteArn(scope,id,routeArn){return new class extends cdk().Resource{constructor(){super(...arguments),this.routeArn=routeArn,this.virtualRouter=virtual_router_1().VirtualRouter.fromVirtualRouterArn(this,"VirtualRouter",routeArn),this.routeName=cdk().Fn.select(4,cdk().Fn.split("/",cdk().Stack.of(scope).splitArn(routeArn,cdk().ArnFormat.SLASH_RESOURCE_NAME).resourceName))}}(scope,id)}static fromRouteAttributes(scope,id,attrs){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_appmesh_RouteAttributes(attrs)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromRouteAttributes),error}return new class extends cdk().Resource{constructor(){super(...arguments),this.routeName=attrs.routeName,this.virtualRouter=attrs.virtualRouter,this.routeArn=cdk().Stack.of(this).formatArn({service:"appmesh",resource:`mesh/${attrs.virtualRouter.mesh.meshName}/virtualRouter/${attrs.virtualRouter.virtualRouterName}/route`,resourceName:this.routeName})}}(scope,id)}constructor(scope,id,props){super(scope,id,{physicalName:props.routeName||cdk().Lazy.string({produce:()=>cdk().Names.uniqueId(this)})});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_appmesh_RouteProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,Route),error}this.virtualRouter=props.virtualRouter;const spec=props.routeSpec.bind(this),route=new(appmesh_generated_1()).CfnRoute(this,"Resource",{routeName:this.physicalName,meshName:this.virtualRouter.mesh.meshName,meshOwner:(0,utils_1().renderMeshOwner)(this.env.account,this.virtualRouter.mesh.env.account),virtualRouterName:this.virtualRouter.virtualRouterName,spec:{tcpRoute:spec.tcpRouteSpec,httpRoute:spec.httpRouteSpec,http2Route:spec.http2RouteSpec,grpcRoute:spec.grpcRouteSpec,priority:spec.priority}});this.routeName=this.getResourceNameAttribute(route.attrRouteName),this.routeArn=this.getResourceArnAttribute(route.ref,{service:"appmesh",resource:`mesh/${props.mesh.meshName}/virtualRouter/${props.virtualRouter.virtualRouterName}/route`,resourceName:this.physicalName})}}exports.Route=Route,_a=JSII_RTTI_SYMBOL_1,Route[_a]={fqn:"aws-cdk-lib.aws_appmesh.Route",version:"2.159.0"};
