"use strict";var _a,_b;Object.defineProperty(exports,"__esModule",{value:!0}),exports.QueryDefinition=exports.QueryString=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var _1=()=>{var tmp=require(".");return _1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp};class QueryString{constructor(props={}){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_logs_QueryStringProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,QueryString),error}this.fields=props.fields,this.stats=props.stats,this.sort=props.sort,this.limit=props.limit,this.display=props.display,props.parseStatements?this.parse=props.parseStatements:props.parse?this.parse=[props.parse]:this.parse=[],props.filterStatements?this.filter=props.filterStatements:props.filter?this.filter=[props.filter]:this.filter=[]}toString(){return[this.buildQueryLine("fields",this.fields?.join(", ")),...this.buildQueryLines("parse",this.parse),...this.buildQueryLines("filter",this.filter),this.buildQueryLine("stats",this.stats),this.buildQueryLine("sort",this.sort),this.buildQueryLine("limit",this.limit?.toString()),this.buildQueryLine("display",this.display)].filter(queryLine=>queryLine!==void 0&&queryLine.length>0).join(`
| `)}buildQueryLines(command,statements){return statements===void 0?[]:statements.map(statement=>this.buildQueryLine(command,statement))}buildQueryLine(command,statement){return statement?`${command} ${statement}`:""}}exports.QueryString=QueryString,_a=JSII_RTTI_SYMBOL_1,QueryString[_a]={fqn:"aws-cdk-lib.aws_logs.QueryString",version:"2.148.1"};class QueryDefinition extends core_1().Resource{constructor(scope,id,props){super(scope,id,{physicalName:props.queryDefinitionName});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_logs_QueryDefinitionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,QueryDefinition),error}const queryDefinition=new(_1()).CfnQueryDefinition(this,"Resource",{name:props.queryDefinitionName,queryString:props.queryString.toString(),logGroupNames:typeof props.logGroups>"u"?[]:props.logGroups.flatMap(logGroup=>logGroup.logGroupName)});this.queryDefinitionId=queryDefinition.attrQueryDefinitionId}}exports.QueryDefinition=QueryDefinition,_b=JSII_RTTI_SYMBOL_1,QueryDefinition[_b]={fqn:"aws-cdk-lib.aws_logs.QueryDefinition",version:"2.148.1"};
