UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 16.9 kB
"use strict";var _a,_b;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnResourceCollection=exports.CfnNotificationChannel=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 CfnNotificationChannelPropsValidator(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("config",cdk.requiredValidator)(properties.config)),errors.collect(cdk.propertyValidator("config",CfnNotificationChannel_NotificationChannelConfigPropertyValidator)(properties.config)),errors.wrap('supplied properties not correct for "CfnNotificationChannelProps"')}function cfnNotificationChannelPropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnNotificationChannelPropsValidator(properties).assertSuccess(),{Config:cfnNotificationChannelNotificationChannelConfigPropertyToCloudFormation(properties.config)}):properties}function CfnNotificationChannelPropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("config","Config",CfnNotificationChannelNotificationChannelConfigPropertyFromCloudFormation(properties.Config)),ret.addUnrecognizedPropertiesAsExtra(properties),ret}class CfnNotificationChannel extends cdk.CfnResource{constructor(scope,id,props){super(scope,id,{type:CfnNotificationChannel.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_devopsguru_CfnNotificationChannelProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnNotificationChannel),error}cdk.requireProperty(props,"config",this),this.attrId=cdk.Token.asString(this.getAtt("Id",cdk.ResolutionTypeHint.STRING)),this.config=props.config}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnNotificationChannelPropsFromCloudFormation(resourceProperties),ret=new CfnNotificationChannel(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",CfnNotificationChannel.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{config:this.config}}renderProperties(props){return cfnNotificationChannelPropsToCloudFormation(props)}}exports.CfnNotificationChannel=CfnNotificationChannel,_a=JSII_RTTI_SYMBOL_1,CfnNotificationChannel[_a]={fqn:"aws-cdk-lib.aws_devopsguru.CfnNotificationChannel",version:"2.70.0"},CfnNotificationChannel.CFN_RESOURCE_TYPE_NAME="AWS::DevOpsGuru::NotificationChannel";function CfnNotificationChannel_NotificationChannelConfigPropertyValidator(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("filters",CfnNotificationChannel_NotificationFilterConfigPropertyValidator)(properties.filters)),errors.collect(cdk.propertyValidator("sns",CfnNotificationChannel_SnsChannelConfigPropertyValidator)(properties.sns)),errors.wrap('supplied properties not correct for "NotificationChannelConfigProperty"')}function cfnNotificationChannelNotificationChannelConfigPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnNotificationChannel_NotificationChannelConfigPropertyValidator(properties).assertSuccess(),{Filters:cfnNotificationChannelNotificationFilterConfigPropertyToCloudFormation(properties.filters),Sns:cfnNotificationChannelSnsChannelConfigPropertyToCloudFormation(properties.sns)}):properties}function CfnNotificationChannelNotificationChannelConfigPropertyFromCloudFormation(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("filters","Filters",properties.Filters!=null?CfnNotificationChannelNotificationFilterConfigPropertyFromCloudFormation(properties.Filters):void 0),ret.addPropertyResult("sns","Sns",properties.Sns!=null?CfnNotificationChannelSnsChannelConfigPropertyFromCloudFormation(properties.Sns):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnNotificationChannel_NotificationFilterConfigPropertyValidator(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("messageTypes",cdk.listValidator(cdk.validateString))(properties.messageTypes)),errors.collect(cdk.propertyValidator("severities",cdk.listValidator(cdk.validateString))(properties.severities)),errors.wrap('supplied properties not correct for "NotificationFilterConfigProperty"')}function cfnNotificationChannelNotificationFilterConfigPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnNotificationChannel_NotificationFilterConfigPropertyValidator(properties).assertSuccess(),{MessageTypes:cdk.listMapper(cdk.stringToCloudFormation)(properties.messageTypes),Severities:cdk.listMapper(cdk.stringToCloudFormation)(properties.severities)}):properties}function CfnNotificationChannelNotificationFilterConfigPropertyFromCloudFormation(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("messageTypes","MessageTypes",properties.MessageTypes!=null?cfn_parse.FromCloudFormation.getStringArray(properties.MessageTypes):void 0),ret.addPropertyResult("severities","Severities",properties.Severities!=null?cfn_parse.FromCloudFormation.getStringArray(properties.Severities):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnNotificationChannel_SnsChannelConfigPropertyValidator(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("topicArn",cdk.validateString)(properties.topicArn)),errors.wrap('supplied properties not correct for "SnsChannelConfigProperty"')}function cfnNotificationChannelSnsChannelConfigPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnNotificationChannel_SnsChannelConfigPropertyValidator(properties).assertSuccess(),{TopicArn:cdk.stringToCloudFormation(properties.topicArn)}):properties}function CfnNotificationChannelSnsChannelConfigPropertyFromCloudFormation(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("topicArn","TopicArn",properties.TopicArn!=null?cfn_parse.FromCloudFormation.getString(properties.TopicArn):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnResourceCollectionPropsValidator(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("resourceCollectionFilter",cdk.requiredValidator)(properties.resourceCollectionFilter)),errors.collect(cdk.propertyValidator("resourceCollectionFilter",CfnResourceCollection_ResourceCollectionFilterPropertyValidator)(properties.resourceCollectionFilter)),errors.wrap('supplied properties not correct for "CfnResourceCollectionProps"')}function cfnResourceCollectionPropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnResourceCollectionPropsValidator(properties).assertSuccess(),{ResourceCollectionFilter:cfnResourceCollectionResourceCollectionFilterPropertyToCloudFormation(properties.resourceCollectionFilter)}):properties}function CfnResourceCollectionPropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("resourceCollectionFilter","ResourceCollectionFilter",CfnResourceCollectionResourceCollectionFilterPropertyFromCloudFormation(properties.ResourceCollectionFilter)),ret.addUnrecognizedPropertiesAsExtra(properties),ret}class CfnResourceCollection extends cdk.CfnResource{constructor(scope,id,props){super(scope,id,{type:CfnResourceCollection.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_devopsguru_CfnResourceCollectionProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnResourceCollection),error}cdk.requireProperty(props,"resourceCollectionFilter",this),this.attrResourceCollectionType=cdk.Token.asString(this.getAtt("ResourceCollectionType",cdk.ResolutionTypeHint.STRING)),this.resourceCollectionFilter=props.resourceCollectionFilter}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnResourceCollectionPropsFromCloudFormation(resourceProperties),ret=new CfnResourceCollection(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",CfnResourceCollection.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{resourceCollectionFilter:this.resourceCollectionFilter}}renderProperties(props){return cfnResourceCollectionPropsToCloudFormation(props)}}exports.CfnResourceCollection=CfnResourceCollection,_b=JSII_RTTI_SYMBOL_1,CfnResourceCollection[_b]={fqn:"aws-cdk-lib.aws_devopsguru.CfnResourceCollection",version:"2.70.0"},CfnResourceCollection.CFN_RESOURCE_TYPE_NAME="AWS::DevOpsGuru::ResourceCollection";function CfnResourceCollection_CloudFormationCollectionFilterPropertyValidator(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("stackNames",cdk.listValidator(cdk.validateString))(properties.stackNames)),errors.wrap('supplied properties not correct for "CloudFormationCollectionFilterProperty"')}function cfnResourceCollectionCloudFormationCollectionFilterPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnResourceCollection_CloudFormationCollectionFilterPropertyValidator(properties).assertSuccess(),{StackNames:cdk.listMapper(cdk.stringToCloudFormation)(properties.stackNames)}):properties}function CfnResourceCollectionCloudFormationCollectionFilterPropertyFromCloudFormation(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("stackNames","StackNames",properties.StackNames!=null?cfn_parse.FromCloudFormation.getStringArray(properties.StackNames):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnResourceCollection_ResourceCollectionFilterPropertyValidator(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("cloudFormation",CfnResourceCollection_CloudFormationCollectionFilterPropertyValidator)(properties.cloudFormation)),errors.collect(cdk.propertyValidator("tags",cdk.listValidator(CfnResourceCollection_TagCollectionPropertyValidator))(properties.tags)),errors.wrap('supplied properties not correct for "ResourceCollectionFilterProperty"')}function cfnResourceCollectionResourceCollectionFilterPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnResourceCollection_ResourceCollectionFilterPropertyValidator(properties).assertSuccess(),{CloudFormation:cfnResourceCollectionCloudFormationCollectionFilterPropertyToCloudFormation(properties.cloudFormation),Tags:cdk.listMapper(cfnResourceCollectionTagCollectionPropertyToCloudFormation)(properties.tags)}):properties}function CfnResourceCollectionResourceCollectionFilterPropertyFromCloudFormation(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("cloudFormation","CloudFormation",properties.CloudFormation!=null?CfnResourceCollectionCloudFormationCollectionFilterPropertyFromCloudFormation(properties.CloudFormation):void 0),ret.addPropertyResult("tags","Tags",properties.Tags!=null?cfn_parse.FromCloudFormation.getArray(CfnResourceCollectionTagCollectionPropertyFromCloudFormation)(properties.Tags):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnResourceCollection_TagCollectionPropertyValidator(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("appBoundaryKey",cdk.validateString)(properties.appBoundaryKey)),errors.collect(cdk.propertyValidator("tagValues",cdk.listValidator(cdk.validateString))(properties.tagValues)),errors.wrap('supplied properties not correct for "TagCollectionProperty"')}function cfnResourceCollectionTagCollectionPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnResourceCollection_TagCollectionPropertyValidator(properties).assertSuccess(),{AppBoundaryKey:cdk.stringToCloudFormation(properties.appBoundaryKey),TagValues:cdk.listMapper(cdk.stringToCloudFormation)(properties.tagValues)}):properties}function CfnResourceCollectionTagCollectionPropertyFromCloudFormation(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("appBoundaryKey","AppBoundaryKey",properties.AppBoundaryKey!=null?cfn_parse.FromCloudFormation.getString(properties.AppBoundaryKey):void 0),ret.addPropertyResult("tagValues","TagValues",properties.TagValues!=null?cfn_parse.FromCloudFormation.getStringArray(properties.TagValues):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}