UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 14.1 kB
"use strict";var _a,_b;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnEventIntegration=exports.CfnDataIntegration=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),cdk=require("../../core"),cfn_parse=require("../../core/lib/helpers-internal");function CfnDataIntegrationPropsValidator(properties){if(!cdk.canInspect(properties))return cdk.VALIDATION_SUCCESS;const errors=new cdk.ValidationResults;return typeof properties!="object"&&errors.collect(new cdk.ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk.propertyValidator("description",cdk.validateString)(properties.description)),errors.collect(cdk.propertyValidator("kmsKey",cdk.requiredValidator)(properties.kmsKey)),errors.collect(cdk.propertyValidator("kmsKey",cdk.validateString)(properties.kmsKey)),errors.collect(cdk.propertyValidator("name",cdk.requiredValidator)(properties.name)),errors.collect(cdk.propertyValidator("name",cdk.validateString)(properties.name)),errors.collect(cdk.propertyValidator("scheduleConfig",cdk.requiredValidator)(properties.scheduleConfig)),errors.collect(cdk.propertyValidator("scheduleConfig",CfnDataIntegration_ScheduleConfigPropertyValidator)(properties.scheduleConfig)),errors.collect(cdk.propertyValidator("sourceUri",cdk.requiredValidator)(properties.sourceUri)),errors.collect(cdk.propertyValidator("sourceUri",cdk.validateString)(properties.sourceUri)),errors.collect(cdk.propertyValidator("tags",cdk.listValidator(cdk.validateCfnTag))(properties.tags)),errors.wrap('supplied properties not correct for "CfnDataIntegrationProps"')}function cfnDataIntegrationPropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnDataIntegrationPropsValidator(properties).assertSuccess(),{KmsKey:cdk.stringToCloudFormation(properties.kmsKey),Name:cdk.stringToCloudFormation(properties.name),ScheduleConfig:cfnDataIntegrationScheduleConfigPropertyToCloudFormation(properties.scheduleConfig),SourceURI:cdk.stringToCloudFormation(properties.sourceUri),Description:cdk.stringToCloudFormation(properties.description),Tags:cdk.listMapper(cdk.cfnTagToCloudFormation)(properties.tags)}):properties}function CfnDataIntegrationPropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("kmsKey","KmsKey",cfn_parse.FromCloudFormation.getString(properties.KmsKey)),ret.addPropertyResult("name","Name",cfn_parse.FromCloudFormation.getString(properties.Name)),ret.addPropertyResult("scheduleConfig","ScheduleConfig",CfnDataIntegrationScheduleConfigPropertyFromCloudFormation(properties.ScheduleConfig)),ret.addPropertyResult("sourceUri","SourceURI",cfn_parse.FromCloudFormation.getString(properties.SourceURI)),ret.addPropertyResult("description","Description",properties.Description!=null?cfn_parse.FromCloudFormation.getString(properties.Description):void 0),ret.addPropertyResult("tags","Tags",properties.Tags!=null?cfn_parse.FromCloudFormation.getArray(cfn_parse.FromCloudFormation.getCfnTag)(properties.Tags):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}class CfnDataIntegration extends cdk.CfnResource{constructor(scope,id,props){super(scope,id,{type:CfnDataIntegration.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_appintegrations_CfnDataIntegrationProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnDataIntegration),error}cdk.requireProperty(props,"kmsKey",this),cdk.requireProperty(props,"name",this),cdk.requireProperty(props,"scheduleConfig",this),cdk.requireProperty(props,"sourceUri",this),this.attrDataIntegrationArn=cdk.Token.asString(this.getAtt("DataIntegrationArn",cdk.ResolutionTypeHint.STRING)),this.attrId=cdk.Token.asString(this.getAtt("Id",cdk.ResolutionTypeHint.STRING)),this.kmsKey=props.kmsKey,this.name=props.name,this.scheduleConfig=props.scheduleConfig,this.sourceUri=props.sourceUri,this.description=props.description,this.tags=new cdk.TagManager(cdk.TagType.STANDARD,"AWS::AppIntegrations::DataIntegration",props.tags,{tagPropertyName:"tags"})}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnDataIntegrationPropsFromCloudFormation(resourceProperties),ret=new CfnDataIntegration(scope,id,propsResult.value);for(const[propKey,propVal]of Object.entries(propsResult.extraProperties))ret.addPropertyOverride(propKey,propVal);return options.parser.handleAttributes(ret,resourceAttributes,id),ret}inspect(inspector){try{jsiiDeprecationWarnings.aws_cdk_lib_TreeInspector(inspector)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.inspect),error}inspector.addAttribute("aws:cdk:cloudformation:type",CfnDataIntegration.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{kmsKey:this.kmsKey,name:this.name,scheduleConfig:this.scheduleConfig,sourceUri:this.sourceUri,description:this.description,tags:this.tags.renderTags()}}renderProperties(props){return cfnDataIntegrationPropsToCloudFormation(props)}}exports.CfnDataIntegration=CfnDataIntegration,_a=JSII_RTTI_SYMBOL_1,CfnDataIntegration[_a]={fqn:"aws-cdk-lib.aws_appintegrations.CfnDataIntegration",version:"2.70.0"},CfnDataIntegration.CFN_RESOURCE_TYPE_NAME="AWS::AppIntegrations::DataIntegration";function CfnDataIntegration_ScheduleConfigPropertyValidator(properties){if(!cdk.canInspect(properties))return cdk.VALIDATION_SUCCESS;const errors=new cdk.ValidationResults;return typeof properties!="object"&&errors.collect(new cdk.ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk.propertyValidator("firstExecutionFrom",cdk.requiredValidator)(properties.firstExecutionFrom)),errors.collect(cdk.propertyValidator("firstExecutionFrom",cdk.validateString)(properties.firstExecutionFrom)),errors.collect(cdk.propertyValidator("object",cdk.requiredValidator)(properties.object)),errors.collect(cdk.propertyValidator("object",cdk.validateString)(properties.object)),errors.collect(cdk.propertyValidator("scheduleExpression",cdk.requiredValidator)(properties.scheduleExpression)),errors.collect(cdk.propertyValidator("scheduleExpression",cdk.validateString)(properties.scheduleExpression)),errors.wrap('supplied properties not correct for "ScheduleConfigProperty"')}function cfnDataIntegrationScheduleConfigPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnDataIntegration_ScheduleConfigPropertyValidator(properties).assertSuccess(),{FirstExecutionFrom:cdk.stringToCloudFormation(properties.firstExecutionFrom),Object:cdk.stringToCloudFormation(properties.object),ScheduleExpression:cdk.stringToCloudFormation(properties.scheduleExpression)}):properties}function CfnDataIntegrationScheduleConfigPropertyFromCloudFormation(properties){if(cdk.isResolvableObject(properties))return new cfn_parse.FromCloudFormationResult(properties);if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("firstExecutionFrom","FirstExecutionFrom",cfn_parse.FromCloudFormation.getString(properties.FirstExecutionFrom)),ret.addPropertyResult("object","Object",cfn_parse.FromCloudFormation.getString(properties.Object)),ret.addPropertyResult("scheduleExpression","ScheduleExpression",cfn_parse.FromCloudFormation.getString(properties.ScheduleExpression)),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnEventIntegrationPropsValidator(properties){if(!cdk.canInspect(properties))return cdk.VALIDATION_SUCCESS;const errors=new cdk.ValidationResults;return typeof properties!="object"&&errors.collect(new cdk.ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk.propertyValidator("description",cdk.validateString)(properties.description)),errors.collect(cdk.propertyValidator("eventBridgeBus",cdk.requiredValidator)(properties.eventBridgeBus)),errors.collect(cdk.propertyValidator("eventBridgeBus",cdk.validateString)(properties.eventBridgeBus)),errors.collect(cdk.propertyValidator("eventFilter",cdk.requiredValidator)(properties.eventFilter)),errors.collect(cdk.propertyValidator("eventFilter",CfnEventIntegration_EventFilterPropertyValidator)(properties.eventFilter)),errors.collect(cdk.propertyValidator("name",cdk.requiredValidator)(properties.name)),errors.collect(cdk.propertyValidator("name",cdk.validateString)(properties.name)),errors.collect(cdk.propertyValidator("tags",cdk.listValidator(cdk.validateCfnTag))(properties.tags)),errors.wrap('supplied properties not correct for "CfnEventIntegrationProps"')}function cfnEventIntegrationPropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnEventIntegrationPropsValidator(properties).assertSuccess(),{EventBridgeBus:cdk.stringToCloudFormation(properties.eventBridgeBus),EventFilter:cfnEventIntegrationEventFilterPropertyToCloudFormation(properties.eventFilter),Name:cdk.stringToCloudFormation(properties.name),Description:cdk.stringToCloudFormation(properties.description),Tags:cdk.listMapper(cdk.cfnTagToCloudFormation)(properties.tags)}):properties}function CfnEventIntegrationPropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("eventBridgeBus","EventBridgeBus",cfn_parse.FromCloudFormation.getString(properties.EventBridgeBus)),ret.addPropertyResult("eventFilter","EventFilter",CfnEventIntegrationEventFilterPropertyFromCloudFormation(properties.EventFilter)),ret.addPropertyResult("name","Name",cfn_parse.FromCloudFormation.getString(properties.Name)),ret.addPropertyResult("description","Description",properties.Description!=null?cfn_parse.FromCloudFormation.getString(properties.Description):void 0),ret.addPropertyResult("tags","Tags",properties.Tags!=null?cfn_parse.FromCloudFormation.getArray(cfn_parse.FromCloudFormation.getCfnTag)(properties.Tags):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}class CfnEventIntegration extends cdk.CfnResource{constructor(scope,id,props){super(scope,id,{type:CfnEventIntegration.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_appintegrations_CfnEventIntegrationProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnEventIntegration),error}cdk.requireProperty(props,"eventBridgeBus",this),cdk.requireProperty(props,"eventFilter",this),cdk.requireProperty(props,"name",this),this.attrEventIntegrationArn=cdk.Token.asString(this.getAtt("EventIntegrationArn",cdk.ResolutionTypeHint.STRING)),this.eventBridgeBus=props.eventBridgeBus,this.eventFilter=props.eventFilter,this.name=props.name,this.description=props.description,this.tags=new cdk.TagManager(cdk.TagType.STANDARD,"AWS::AppIntegrations::EventIntegration",props.tags,{tagPropertyName:"tags"})}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnEventIntegrationPropsFromCloudFormation(resourceProperties),ret=new CfnEventIntegration(scope,id,propsResult.value);for(const[propKey,propVal]of Object.entries(propsResult.extraProperties))ret.addPropertyOverride(propKey,propVal);return options.parser.handleAttributes(ret,resourceAttributes,id),ret}inspect(inspector){try{jsiiDeprecationWarnings.aws_cdk_lib_TreeInspector(inspector)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.inspect),error}inspector.addAttribute("aws:cdk:cloudformation:type",CfnEventIntegration.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{eventBridgeBus:this.eventBridgeBus,eventFilter:this.eventFilter,name:this.name,description:this.description,tags:this.tags.renderTags()}}renderProperties(props){return cfnEventIntegrationPropsToCloudFormation(props)}}exports.CfnEventIntegration=CfnEventIntegration,_b=JSII_RTTI_SYMBOL_1,CfnEventIntegration[_b]={fqn:"aws-cdk-lib.aws_appintegrations.CfnEventIntegration",version:"2.70.0"},CfnEventIntegration.CFN_RESOURCE_TYPE_NAME="AWS::AppIntegrations::EventIntegration";function CfnEventIntegration_EventFilterPropertyValidator(properties){if(!cdk.canInspect(properties))return cdk.VALIDATION_SUCCESS;const errors=new cdk.ValidationResults;return typeof properties!="object"&&errors.collect(new cdk.ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk.propertyValidator("source",cdk.requiredValidator)(properties.source)),errors.collect(cdk.propertyValidator("source",cdk.validateString)(properties.source)),errors.wrap('supplied properties not correct for "EventFilterProperty"')}function cfnEventIntegrationEventFilterPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnEventIntegration_EventFilterPropertyValidator(properties).assertSuccess(),{Source:cdk.stringToCloudFormation(properties.source)}):properties}function CfnEventIntegrationEventFilterPropertyFromCloudFormation(properties){if(cdk.isResolvableObject(properties))return new cfn_parse.FromCloudFormationResult(properties);if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("source","Source",cfn_parse.FromCloudFormation.getString(properties.Source)),ret.addUnrecognizedPropertiesAsExtra(properties),ret}