aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 14.6 kB
JavaScript
"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnCampaign=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 CfnCampaignPropsValidator(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("connectInstanceArn",cdk.requiredValidator)(properties.connectInstanceArn)),errors.collect(cdk.propertyValidator("connectInstanceArn",cdk.validateString)(properties.connectInstanceArn)),errors.collect(cdk.propertyValidator("dialerConfig",cdk.requiredValidator)(properties.dialerConfig)),errors.collect(cdk.propertyValidator("dialerConfig",CfnCampaign_DialerConfigPropertyValidator)(properties.dialerConfig)),errors.collect(cdk.propertyValidator("name",cdk.requiredValidator)(properties.name)),errors.collect(cdk.propertyValidator("name",cdk.validateString)(properties.name)),errors.collect(cdk.propertyValidator("outboundCallConfig",cdk.requiredValidator)(properties.outboundCallConfig)),errors.collect(cdk.propertyValidator("outboundCallConfig",CfnCampaign_OutboundCallConfigPropertyValidator)(properties.outboundCallConfig)),errors.collect(cdk.propertyValidator("tags",cdk.listValidator(cdk.validateCfnTag))(properties.tags)),errors.wrap('supplied properties not correct for "CfnCampaignProps"')}function cfnCampaignPropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnCampaignPropsValidator(properties).assertSuccess(),{ConnectInstanceArn:cdk.stringToCloudFormation(properties.connectInstanceArn),DialerConfig:cfnCampaignDialerConfigPropertyToCloudFormation(properties.dialerConfig),Name:cdk.stringToCloudFormation(properties.name),OutboundCallConfig:cfnCampaignOutboundCallConfigPropertyToCloudFormation(properties.outboundCallConfig),Tags:cdk.listMapper(cdk.cfnTagToCloudFormation)(properties.tags)}):properties}function CfnCampaignPropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("connectInstanceArn","ConnectInstanceArn",cfn_parse.FromCloudFormation.getString(properties.ConnectInstanceArn)),ret.addPropertyResult("dialerConfig","DialerConfig",CfnCampaignDialerConfigPropertyFromCloudFormation(properties.DialerConfig)),ret.addPropertyResult("name","Name",cfn_parse.FromCloudFormation.getString(properties.Name)),ret.addPropertyResult("outboundCallConfig","OutboundCallConfig",CfnCampaignOutboundCallConfigPropertyFromCloudFormation(properties.OutboundCallConfig)),ret.addPropertyResult("tags","Tags",properties.Tags!=null?cfn_parse.FromCloudFormation.getArray(cfn_parse.FromCloudFormation.getCfnTag)(properties.Tags):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}class CfnCampaign extends cdk.CfnResource{constructor(scope,id,props){super(scope,id,{type:CfnCampaign.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_connectcampaigns_CfnCampaignProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnCampaign),error}cdk.requireProperty(props,"connectInstanceArn",this),cdk.requireProperty(props,"dialerConfig",this),cdk.requireProperty(props,"name",this),cdk.requireProperty(props,"outboundCallConfig",this),this.attrArn=cdk.Token.asString(this.getAtt("Arn",cdk.ResolutionTypeHint.STRING)),this.connectInstanceArn=props.connectInstanceArn,this.dialerConfig=props.dialerConfig,this.name=props.name,this.outboundCallConfig=props.outboundCallConfig,this.tags=new cdk.TagManager(cdk.TagType.STANDARD,"AWS::ConnectCampaigns::Campaign",props.tags,{tagPropertyName:"tags"})}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnCampaignPropsFromCloudFormation(resourceProperties),ret=new CfnCampaign(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",CfnCampaign.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{connectInstanceArn:this.connectInstanceArn,dialerConfig:this.dialerConfig,name:this.name,outboundCallConfig:this.outboundCallConfig,tags:this.tags.renderTags()}}renderProperties(props){return cfnCampaignPropsToCloudFormation(props)}}exports.CfnCampaign=CfnCampaign,_a=JSII_RTTI_SYMBOL_1,CfnCampaign[_a]={fqn:"aws-cdk-lib.aws_connectcampaigns.CfnCampaign",version:"2.70.0"},CfnCampaign.CFN_RESOURCE_TYPE_NAME="AWS::ConnectCampaigns::Campaign";function CfnCampaign_AnswerMachineDetectionConfigPropertyValidator(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("enableAnswerMachineDetection",cdk.requiredValidator)(properties.enableAnswerMachineDetection)),errors.collect(cdk.propertyValidator("enableAnswerMachineDetection",cdk.validateBoolean)(properties.enableAnswerMachineDetection)),errors.wrap('supplied properties not correct for "AnswerMachineDetectionConfigProperty"')}function cfnCampaignAnswerMachineDetectionConfigPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnCampaign_AnswerMachineDetectionConfigPropertyValidator(properties).assertSuccess(),{EnableAnswerMachineDetection:cdk.booleanToCloudFormation(properties.enableAnswerMachineDetection)}):properties}function CfnCampaignAnswerMachineDetectionConfigPropertyFromCloudFormation(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("enableAnswerMachineDetection","EnableAnswerMachineDetection",cfn_parse.FromCloudFormation.getBoolean(properties.EnableAnswerMachineDetection)),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnCampaign_DialerConfigPropertyValidator(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("predictiveDialerConfig",CfnCampaign_PredictiveDialerConfigPropertyValidator)(properties.predictiveDialerConfig)),errors.collect(cdk.propertyValidator("progressiveDialerConfig",CfnCampaign_ProgressiveDialerConfigPropertyValidator)(properties.progressiveDialerConfig)),errors.wrap('supplied properties not correct for "DialerConfigProperty"')}function cfnCampaignDialerConfigPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnCampaign_DialerConfigPropertyValidator(properties).assertSuccess(),{PredictiveDialerConfig:cfnCampaignPredictiveDialerConfigPropertyToCloudFormation(properties.predictiveDialerConfig),ProgressiveDialerConfig:cfnCampaignProgressiveDialerConfigPropertyToCloudFormation(properties.progressiveDialerConfig)}):properties}function CfnCampaignDialerConfigPropertyFromCloudFormation(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("predictiveDialerConfig","PredictiveDialerConfig",properties.PredictiveDialerConfig!=null?CfnCampaignPredictiveDialerConfigPropertyFromCloudFormation(properties.PredictiveDialerConfig):void 0),ret.addPropertyResult("progressiveDialerConfig","ProgressiveDialerConfig",properties.ProgressiveDialerConfig!=null?CfnCampaignProgressiveDialerConfigPropertyFromCloudFormation(properties.ProgressiveDialerConfig):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnCampaign_OutboundCallConfigPropertyValidator(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("answerMachineDetectionConfig",CfnCampaign_AnswerMachineDetectionConfigPropertyValidator)(properties.answerMachineDetectionConfig)),errors.collect(cdk.propertyValidator("connectContactFlowArn",cdk.requiredValidator)(properties.connectContactFlowArn)),errors.collect(cdk.propertyValidator("connectContactFlowArn",cdk.validateString)(properties.connectContactFlowArn)),errors.collect(cdk.propertyValidator("connectQueueArn",cdk.requiredValidator)(properties.connectQueueArn)),errors.collect(cdk.propertyValidator("connectQueueArn",cdk.validateString)(properties.connectQueueArn)),errors.collect(cdk.propertyValidator("connectSourcePhoneNumber",cdk.validateString)(properties.connectSourcePhoneNumber)),errors.wrap('supplied properties not correct for "OutboundCallConfigProperty"')}function cfnCampaignOutboundCallConfigPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnCampaign_OutboundCallConfigPropertyValidator(properties).assertSuccess(),{AnswerMachineDetectionConfig:cfnCampaignAnswerMachineDetectionConfigPropertyToCloudFormation(properties.answerMachineDetectionConfig),ConnectContactFlowArn:cdk.stringToCloudFormation(properties.connectContactFlowArn),ConnectQueueArn:cdk.stringToCloudFormation(properties.connectQueueArn),ConnectSourcePhoneNumber:cdk.stringToCloudFormation(properties.connectSourcePhoneNumber)}):properties}function CfnCampaignOutboundCallConfigPropertyFromCloudFormation(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("answerMachineDetectionConfig","AnswerMachineDetectionConfig",properties.AnswerMachineDetectionConfig!=null?CfnCampaignAnswerMachineDetectionConfigPropertyFromCloudFormation(properties.AnswerMachineDetectionConfig):void 0),ret.addPropertyResult("connectContactFlowArn","ConnectContactFlowArn",cfn_parse.FromCloudFormation.getString(properties.ConnectContactFlowArn)),ret.addPropertyResult("connectQueueArn","ConnectQueueArn",cfn_parse.FromCloudFormation.getString(properties.ConnectQueueArn)),ret.addPropertyResult("connectSourcePhoneNumber","ConnectSourcePhoneNumber",properties.ConnectSourcePhoneNumber!=null?cfn_parse.FromCloudFormation.getString(properties.ConnectSourcePhoneNumber):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnCampaign_PredictiveDialerConfigPropertyValidator(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("bandwidthAllocation",cdk.requiredValidator)(properties.bandwidthAllocation)),errors.collect(cdk.propertyValidator("bandwidthAllocation",cdk.validateNumber)(properties.bandwidthAllocation)),errors.wrap('supplied properties not correct for "PredictiveDialerConfigProperty"')}function cfnCampaignPredictiveDialerConfigPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnCampaign_PredictiveDialerConfigPropertyValidator(properties).assertSuccess(),{BandwidthAllocation:cdk.numberToCloudFormation(properties.bandwidthAllocation)}):properties}function CfnCampaignPredictiveDialerConfigPropertyFromCloudFormation(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("bandwidthAllocation","BandwidthAllocation",cfn_parse.FromCloudFormation.getNumber(properties.BandwidthAllocation)),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnCampaign_ProgressiveDialerConfigPropertyValidator(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("bandwidthAllocation",cdk.requiredValidator)(properties.bandwidthAllocation)),errors.collect(cdk.propertyValidator("bandwidthAllocation",cdk.validateNumber)(properties.bandwidthAllocation)),errors.wrap('supplied properties not correct for "ProgressiveDialerConfigProperty"')}function cfnCampaignProgressiveDialerConfigPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnCampaign_ProgressiveDialerConfigPropertyValidator(properties).assertSuccess(),{BandwidthAllocation:cdk.numberToCloudFormation(properties.bandwidthAllocation)}):properties}function CfnCampaignProgressiveDialerConfigPropertyFromCloudFormation(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("bandwidthAllocation","BandwidthAllocation",cfn_parse.FromCloudFormation.getNumber(properties.BandwidthAllocation)),ret.addUnrecognizedPropertiesAsExtra(properties),ret}