UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 14 kB
"use strict";var _a,_b;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnSlackChannelConfiguration=exports.CfnMicrosoftTeamsChannelConfiguration=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 CfnMicrosoftTeamsChannelConfigurationPropsValidator(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("configurationName",cdk.requiredValidator)(properties.configurationName)),errors.collect(cdk.propertyValidator("configurationName",cdk.validateString)(properties.configurationName)),errors.collect(cdk.propertyValidator("guardrailPolicies",cdk.listValidator(cdk.validateString))(properties.guardrailPolicies)),errors.collect(cdk.propertyValidator("iamRoleArn",cdk.requiredValidator)(properties.iamRoleArn)),errors.collect(cdk.propertyValidator("iamRoleArn",cdk.validateString)(properties.iamRoleArn)),errors.collect(cdk.propertyValidator("loggingLevel",cdk.validateString)(properties.loggingLevel)),errors.collect(cdk.propertyValidator("snsTopicArns",cdk.listValidator(cdk.validateString))(properties.snsTopicArns)),errors.collect(cdk.propertyValidator("teamId",cdk.requiredValidator)(properties.teamId)),errors.collect(cdk.propertyValidator("teamId",cdk.validateString)(properties.teamId)),errors.collect(cdk.propertyValidator("teamsChannelId",cdk.requiredValidator)(properties.teamsChannelId)),errors.collect(cdk.propertyValidator("teamsChannelId",cdk.validateString)(properties.teamsChannelId)),errors.collect(cdk.propertyValidator("teamsTenantId",cdk.requiredValidator)(properties.teamsTenantId)),errors.collect(cdk.propertyValidator("teamsTenantId",cdk.validateString)(properties.teamsTenantId)),errors.collect(cdk.propertyValidator("userRoleRequired",cdk.validateBoolean)(properties.userRoleRequired)),errors.wrap('supplied properties not correct for "CfnMicrosoftTeamsChannelConfigurationProps"')}function cfnMicrosoftTeamsChannelConfigurationPropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnMicrosoftTeamsChannelConfigurationPropsValidator(properties).assertSuccess(),{ConfigurationName:cdk.stringToCloudFormation(properties.configurationName),IamRoleArn:cdk.stringToCloudFormation(properties.iamRoleArn),TeamId:cdk.stringToCloudFormation(properties.teamId),TeamsChannelId:cdk.stringToCloudFormation(properties.teamsChannelId),TeamsTenantId:cdk.stringToCloudFormation(properties.teamsTenantId),GuardrailPolicies:cdk.listMapper(cdk.stringToCloudFormation)(properties.guardrailPolicies),LoggingLevel:cdk.stringToCloudFormation(properties.loggingLevel),SnsTopicArns:cdk.listMapper(cdk.stringToCloudFormation)(properties.snsTopicArns),UserRoleRequired:cdk.booleanToCloudFormation(properties.userRoleRequired)}):properties}function CfnMicrosoftTeamsChannelConfigurationPropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("configurationName","ConfigurationName",cfn_parse.FromCloudFormation.getString(properties.ConfigurationName)),ret.addPropertyResult("iamRoleArn","IamRoleArn",cfn_parse.FromCloudFormation.getString(properties.IamRoleArn)),ret.addPropertyResult("teamId","TeamId",cfn_parse.FromCloudFormation.getString(properties.TeamId)),ret.addPropertyResult("teamsChannelId","TeamsChannelId",cfn_parse.FromCloudFormation.getString(properties.TeamsChannelId)),ret.addPropertyResult("teamsTenantId","TeamsTenantId",cfn_parse.FromCloudFormation.getString(properties.TeamsTenantId)),ret.addPropertyResult("guardrailPolicies","GuardrailPolicies",properties.GuardrailPolicies!=null?cfn_parse.FromCloudFormation.getStringArray(properties.GuardrailPolicies):void 0),ret.addPropertyResult("loggingLevel","LoggingLevel",properties.LoggingLevel!=null?cfn_parse.FromCloudFormation.getString(properties.LoggingLevel):void 0),ret.addPropertyResult("snsTopicArns","SnsTopicArns",properties.SnsTopicArns!=null?cfn_parse.FromCloudFormation.getStringArray(properties.SnsTopicArns):void 0),ret.addPropertyResult("userRoleRequired","UserRoleRequired",properties.UserRoleRequired!=null?cfn_parse.FromCloudFormation.getBoolean(properties.UserRoleRequired):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}class CfnMicrosoftTeamsChannelConfiguration extends cdk.CfnResource{constructor(scope,id,props){super(scope,id,{type:CfnMicrosoftTeamsChannelConfiguration.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_chatbot_CfnMicrosoftTeamsChannelConfigurationProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnMicrosoftTeamsChannelConfiguration),error}cdk.requireProperty(props,"configurationName",this),cdk.requireProperty(props,"iamRoleArn",this),cdk.requireProperty(props,"teamId",this),cdk.requireProperty(props,"teamsChannelId",this),cdk.requireProperty(props,"teamsTenantId",this),this.attrArn=cdk.Token.asString(this.getAtt("Arn",cdk.ResolutionTypeHint.STRING)),this.configurationName=props.configurationName,this.iamRoleArn=props.iamRoleArn,this.teamId=props.teamId,this.teamsChannelId=props.teamsChannelId,this.teamsTenantId=props.teamsTenantId,this.guardrailPolicies=props.guardrailPolicies,this.loggingLevel=props.loggingLevel,this.snsTopicArns=props.snsTopicArns,this.userRoleRequired=props.userRoleRequired}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnMicrosoftTeamsChannelConfigurationPropsFromCloudFormation(resourceProperties),ret=new CfnMicrosoftTeamsChannelConfiguration(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",CfnMicrosoftTeamsChannelConfiguration.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{configurationName:this.configurationName,iamRoleArn:this.iamRoleArn,teamId:this.teamId,teamsChannelId:this.teamsChannelId,teamsTenantId:this.teamsTenantId,guardrailPolicies:this.guardrailPolicies,loggingLevel:this.loggingLevel,snsTopicArns:this.snsTopicArns,userRoleRequired:this.userRoleRequired}}renderProperties(props){return cfnMicrosoftTeamsChannelConfigurationPropsToCloudFormation(props)}}exports.CfnMicrosoftTeamsChannelConfiguration=CfnMicrosoftTeamsChannelConfiguration,_a=JSII_RTTI_SYMBOL_1,CfnMicrosoftTeamsChannelConfiguration[_a]={fqn:"aws-cdk-lib.aws_chatbot.CfnMicrosoftTeamsChannelConfiguration",version:"2.70.0"},CfnMicrosoftTeamsChannelConfiguration.CFN_RESOURCE_TYPE_NAME="AWS::Chatbot::MicrosoftTeamsChannelConfiguration";function CfnSlackChannelConfigurationPropsValidator(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("configurationName",cdk.requiredValidator)(properties.configurationName)),errors.collect(cdk.propertyValidator("configurationName",cdk.validateString)(properties.configurationName)),errors.collect(cdk.propertyValidator("guardrailPolicies",cdk.listValidator(cdk.validateString))(properties.guardrailPolicies)),errors.collect(cdk.propertyValidator("iamRoleArn",cdk.requiredValidator)(properties.iamRoleArn)),errors.collect(cdk.propertyValidator("iamRoleArn",cdk.validateString)(properties.iamRoleArn)),errors.collect(cdk.propertyValidator("loggingLevel",cdk.validateString)(properties.loggingLevel)),errors.collect(cdk.propertyValidator("slackChannelId",cdk.requiredValidator)(properties.slackChannelId)),errors.collect(cdk.propertyValidator("slackChannelId",cdk.validateString)(properties.slackChannelId)),errors.collect(cdk.propertyValidator("slackWorkspaceId",cdk.requiredValidator)(properties.slackWorkspaceId)),errors.collect(cdk.propertyValidator("slackWorkspaceId",cdk.validateString)(properties.slackWorkspaceId)),errors.collect(cdk.propertyValidator("snsTopicArns",cdk.listValidator(cdk.validateString))(properties.snsTopicArns)),errors.collect(cdk.propertyValidator("userRoleRequired",cdk.validateBoolean)(properties.userRoleRequired)),errors.wrap('supplied properties not correct for "CfnSlackChannelConfigurationProps"')}function cfnSlackChannelConfigurationPropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnSlackChannelConfigurationPropsValidator(properties).assertSuccess(),{ConfigurationName:cdk.stringToCloudFormation(properties.configurationName),IamRoleArn:cdk.stringToCloudFormation(properties.iamRoleArn),SlackChannelId:cdk.stringToCloudFormation(properties.slackChannelId),SlackWorkspaceId:cdk.stringToCloudFormation(properties.slackWorkspaceId),GuardrailPolicies:cdk.listMapper(cdk.stringToCloudFormation)(properties.guardrailPolicies),LoggingLevel:cdk.stringToCloudFormation(properties.loggingLevel),SnsTopicArns:cdk.listMapper(cdk.stringToCloudFormation)(properties.snsTopicArns),UserRoleRequired:cdk.booleanToCloudFormation(properties.userRoleRequired)}):properties}function CfnSlackChannelConfigurationPropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("configurationName","ConfigurationName",cfn_parse.FromCloudFormation.getString(properties.ConfigurationName)),ret.addPropertyResult("iamRoleArn","IamRoleArn",cfn_parse.FromCloudFormation.getString(properties.IamRoleArn)),ret.addPropertyResult("slackChannelId","SlackChannelId",cfn_parse.FromCloudFormation.getString(properties.SlackChannelId)),ret.addPropertyResult("slackWorkspaceId","SlackWorkspaceId",cfn_parse.FromCloudFormation.getString(properties.SlackWorkspaceId)),ret.addPropertyResult("guardrailPolicies","GuardrailPolicies",properties.GuardrailPolicies!=null?cfn_parse.FromCloudFormation.getStringArray(properties.GuardrailPolicies):void 0),ret.addPropertyResult("loggingLevel","LoggingLevel",properties.LoggingLevel!=null?cfn_parse.FromCloudFormation.getString(properties.LoggingLevel):void 0),ret.addPropertyResult("snsTopicArns","SnsTopicArns",properties.SnsTopicArns!=null?cfn_parse.FromCloudFormation.getStringArray(properties.SnsTopicArns):void 0),ret.addPropertyResult("userRoleRequired","UserRoleRequired",properties.UserRoleRequired!=null?cfn_parse.FromCloudFormation.getBoolean(properties.UserRoleRequired):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}class CfnSlackChannelConfiguration extends cdk.CfnResource{constructor(scope,id,props){super(scope,id,{type:CfnSlackChannelConfiguration.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_chatbot_CfnSlackChannelConfigurationProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnSlackChannelConfiguration),error}cdk.requireProperty(props,"configurationName",this),cdk.requireProperty(props,"iamRoleArn",this),cdk.requireProperty(props,"slackChannelId",this),cdk.requireProperty(props,"slackWorkspaceId",this),this.attrArn=cdk.Token.asString(this.getAtt("Arn",cdk.ResolutionTypeHint.STRING)),this.configurationName=props.configurationName,this.iamRoleArn=props.iamRoleArn,this.slackChannelId=props.slackChannelId,this.slackWorkspaceId=props.slackWorkspaceId,this.guardrailPolicies=props.guardrailPolicies,this.loggingLevel=props.loggingLevel,this.snsTopicArns=props.snsTopicArns,this.userRoleRequired=props.userRoleRequired}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnSlackChannelConfigurationPropsFromCloudFormation(resourceProperties),ret=new CfnSlackChannelConfiguration(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",CfnSlackChannelConfiguration.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{configurationName:this.configurationName,iamRoleArn:this.iamRoleArn,slackChannelId:this.slackChannelId,slackWorkspaceId:this.slackWorkspaceId,guardrailPolicies:this.guardrailPolicies,loggingLevel:this.loggingLevel,snsTopicArns:this.snsTopicArns,userRoleRequired:this.userRoleRequired}}renderProperties(props){return cfnSlackChannelConfigurationPropsToCloudFormation(props)}}exports.CfnSlackChannelConfiguration=CfnSlackChannelConfiguration,_b=JSII_RTTI_SYMBOL_1,CfnSlackChannelConfiguration[_b]={fqn:"aws-cdk-lib.aws_chatbot.CfnSlackChannelConfiguration",version:"2.70.0"},CfnSlackChannelConfiguration.CFN_RESOURCE_TYPE_NAME="AWS::Chatbot::SlackChannelConfiguration";