"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.GraphqlApiBase=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),data_source_1=require("./data-source"),resolver_1=require("./resolver"),core_1=require("../../core");class GraphqlApiBase extends core_1.Resource{addNoneDataSource(id,options){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_appsync_DataSourceOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addNoneDataSource),error}return new data_source_1.NoneDataSource(this,id,{api:this,name:options?.name,description:options?.description})}addDynamoDbDataSource(id,table,options){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_dynamodb_ITable(table),jsiiDeprecationWarnings.aws_cdk_lib_aws_appsync_DataSourceOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addDynamoDbDataSource),error}return new data_source_1.DynamoDbDataSource(this,id,{api:this,table,name:options?.name,description:options?.description})}addHttpDataSource(id,endpoint,options){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_appsync_HttpDataSourceOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addHttpDataSource),error}return new data_source_1.HttpDataSource(this,id,{api:this,endpoint,name:options?.name,description:options?.description,authorizationConfig:options?.authorizationConfig})}addLambdaDataSource(id,lambdaFunction,options){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_lambda_IFunction(lambdaFunction),jsiiDeprecationWarnings.aws_cdk_lib_aws_appsync_DataSourceOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addLambdaDataSource),error}return new data_source_1.LambdaDataSource(this,id,{api:this,lambdaFunction,name:options?.name,description:options?.description})}addRdsDataSource(id,serverlessCluster,secretStore,databaseName,options){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_rds_IServerlessCluster(serverlessCluster),jsiiDeprecationWarnings.aws_cdk_lib_aws_secretsmanager_ISecret(secretStore),jsiiDeprecationWarnings.aws_cdk_lib_aws_appsync_DataSourceOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addRdsDataSource),error}return new data_source_1.RdsDataSource(this,id,{api:this,name:options?.name,description:options?.description,serverlessCluster,secretStore,databaseName})}addElasticsearchDataSource(id,domain,options){try{jsiiDeprecationWarnings.print("aws-cdk-lib.aws_appsync.GraphqlApiBase#addElasticsearchDataSource","- use `addOpenSearchDataSource`"),jsiiDeprecationWarnings.aws_cdk_lib_aws_elasticsearch_IDomain(domain),jsiiDeprecationWarnings.aws_cdk_lib_aws_appsync_DataSourceOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addElasticsearchDataSource),error}return new data_source_1.ElasticsearchDataSource(this,id,{api:this,name:options?.name,description:options?.description,domain})}addEventBridgeDataSource(id,eventBus,options){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_events_IEventBus(eventBus),jsiiDeprecationWarnings.aws_cdk_lib_aws_appsync_DataSourceOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addEventBridgeDataSource),error}return new data_source_1.EventBridgeDataSource(this,id,{api:this,eventBus,name:options?.name,description:options?.description})}addOpenSearchDataSource(id,domain,options){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_opensearchservice_IDomain(domain),jsiiDeprecationWarnings.aws_cdk_lib_aws_appsync_DataSourceOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addOpenSearchDataSource),error}return new data_source_1.OpenSearchDataSource(this,id,{api:this,name:options?.name,description:options?.description,domain})}createResolver(id,props){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_appsync_ExtendedResolverProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.createResolver),error}return new resolver_1.Resolver(this,id,{api:this,...props})}addSchemaDependency(construct){try{jsiiDeprecationWarnings.aws_cdk_lib_CfnResource(construct)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addSchemaDependency),error}return!1}}exports.GraphqlApiBase=GraphqlApiBase,_a=JSII_RTTI_SYMBOL_1,GraphqlApiBase[_a]={fqn:"aws-cdk-lib.aws_appsync.GraphqlApiBase",version:"2.96.1"};
