UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 18.5 kB
"use strict";var _a,_b;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnRoom=exports.CfnLoggingConfiguration=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 CfnLoggingConfigurationPropsValidator(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("destinationConfiguration",cdk.requiredValidator)(properties.destinationConfiguration)),errors.collect(cdk.propertyValidator("destinationConfiguration",CfnLoggingConfiguration_DestinationConfigurationPropertyValidator)(properties.destinationConfiguration)),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 "CfnLoggingConfigurationProps"')}function cfnLoggingConfigurationPropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnLoggingConfigurationPropsValidator(properties).assertSuccess(),{DestinationConfiguration:cfnLoggingConfigurationDestinationConfigurationPropertyToCloudFormation(properties.destinationConfiguration),Name:cdk.stringToCloudFormation(properties.name),Tags:cdk.listMapper(cdk.cfnTagToCloudFormation)(properties.tags)}):properties}function CfnLoggingConfigurationPropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("destinationConfiguration","DestinationConfiguration",CfnLoggingConfigurationDestinationConfigurationPropertyFromCloudFormation(properties.DestinationConfiguration)),ret.addPropertyResult("name","Name",properties.Name!=null?cfn_parse.FromCloudFormation.getString(properties.Name):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 CfnLoggingConfiguration extends cdk.CfnResource{constructor(scope,id,props){super(scope,id,{type:CfnLoggingConfiguration.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_ivschat_CfnLoggingConfigurationProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnLoggingConfiguration),error}cdk.requireProperty(props,"destinationConfiguration",this),this.attrArn=cdk.Token.asString(this.getAtt("Arn",cdk.ResolutionTypeHint.STRING)),this.attrId=cdk.Token.asString(this.getAtt("Id",cdk.ResolutionTypeHint.STRING)),this.attrState=cdk.Token.asString(this.getAtt("State",cdk.ResolutionTypeHint.STRING)),this.destinationConfiguration=props.destinationConfiguration,this.name=props.name,this.tags=new cdk.TagManager(cdk.TagType.STANDARD,"AWS::IVSChat::LoggingConfiguration",props.tags,{tagPropertyName:"tags"})}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnLoggingConfigurationPropsFromCloudFormation(resourceProperties),ret=new CfnLoggingConfiguration(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",CfnLoggingConfiguration.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{destinationConfiguration:this.destinationConfiguration,name:this.name,tags:this.tags.renderTags()}}renderProperties(props){return cfnLoggingConfigurationPropsToCloudFormation(props)}}exports.CfnLoggingConfiguration=CfnLoggingConfiguration,_a=JSII_RTTI_SYMBOL_1,CfnLoggingConfiguration[_a]={fqn:"aws-cdk-lib.aws_ivschat.CfnLoggingConfiguration",version:"2.70.0"},CfnLoggingConfiguration.CFN_RESOURCE_TYPE_NAME="AWS::IVSChat::LoggingConfiguration";function CfnLoggingConfiguration_CloudWatchLogsDestinationConfigurationPropertyValidator(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("logGroupName",cdk.requiredValidator)(properties.logGroupName)),errors.collect(cdk.propertyValidator("logGroupName",cdk.validateString)(properties.logGroupName)),errors.wrap('supplied properties not correct for "CloudWatchLogsDestinationConfigurationProperty"')}function cfnLoggingConfigurationCloudWatchLogsDestinationConfigurationPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnLoggingConfiguration_CloudWatchLogsDestinationConfigurationPropertyValidator(properties).assertSuccess(),{LogGroupName:cdk.stringToCloudFormation(properties.logGroupName)}):properties}function CfnLoggingConfigurationCloudWatchLogsDestinationConfigurationPropertyFromCloudFormation(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("logGroupName","LogGroupName",cfn_parse.FromCloudFormation.getString(properties.LogGroupName)),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnLoggingConfiguration_DestinationConfigurationPropertyValidator(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("cloudWatchLogs",CfnLoggingConfiguration_CloudWatchLogsDestinationConfigurationPropertyValidator)(properties.cloudWatchLogs)),errors.collect(cdk.propertyValidator("firehose",CfnLoggingConfiguration_FirehoseDestinationConfigurationPropertyValidator)(properties.firehose)),errors.collect(cdk.propertyValidator("s3",CfnLoggingConfiguration_S3DestinationConfigurationPropertyValidator)(properties.s3)),errors.wrap('supplied properties not correct for "DestinationConfigurationProperty"')}function cfnLoggingConfigurationDestinationConfigurationPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnLoggingConfiguration_DestinationConfigurationPropertyValidator(properties).assertSuccess(),{CloudWatchLogs:cfnLoggingConfigurationCloudWatchLogsDestinationConfigurationPropertyToCloudFormation(properties.cloudWatchLogs),Firehose:cfnLoggingConfigurationFirehoseDestinationConfigurationPropertyToCloudFormation(properties.firehose),S3:cfnLoggingConfigurationS3DestinationConfigurationPropertyToCloudFormation(properties.s3)}):properties}function CfnLoggingConfigurationDestinationConfigurationPropertyFromCloudFormation(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("cloudWatchLogs","CloudWatchLogs",properties.CloudWatchLogs!=null?CfnLoggingConfigurationCloudWatchLogsDestinationConfigurationPropertyFromCloudFormation(properties.CloudWatchLogs):void 0),ret.addPropertyResult("firehose","Firehose",properties.Firehose!=null?CfnLoggingConfigurationFirehoseDestinationConfigurationPropertyFromCloudFormation(properties.Firehose):void 0),ret.addPropertyResult("s3","S3",properties.S3!=null?CfnLoggingConfigurationS3DestinationConfigurationPropertyFromCloudFormation(properties.S3):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnLoggingConfiguration_FirehoseDestinationConfigurationPropertyValidator(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("deliveryStreamName",cdk.requiredValidator)(properties.deliveryStreamName)),errors.collect(cdk.propertyValidator("deliveryStreamName",cdk.validateString)(properties.deliveryStreamName)),errors.wrap('supplied properties not correct for "FirehoseDestinationConfigurationProperty"')}function cfnLoggingConfigurationFirehoseDestinationConfigurationPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnLoggingConfiguration_FirehoseDestinationConfigurationPropertyValidator(properties).assertSuccess(),{DeliveryStreamName:cdk.stringToCloudFormation(properties.deliveryStreamName)}):properties}function CfnLoggingConfigurationFirehoseDestinationConfigurationPropertyFromCloudFormation(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("deliveryStreamName","DeliveryStreamName",cfn_parse.FromCloudFormation.getString(properties.DeliveryStreamName)),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnLoggingConfiguration_S3DestinationConfigurationPropertyValidator(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("bucketName",cdk.requiredValidator)(properties.bucketName)),errors.collect(cdk.propertyValidator("bucketName",cdk.validateString)(properties.bucketName)),errors.wrap('supplied properties not correct for "S3DestinationConfigurationProperty"')}function cfnLoggingConfigurationS3DestinationConfigurationPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnLoggingConfiguration_S3DestinationConfigurationPropertyValidator(properties).assertSuccess(),{BucketName:cdk.stringToCloudFormation(properties.bucketName)}):properties}function CfnLoggingConfigurationS3DestinationConfigurationPropertyFromCloudFormation(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("bucketName","BucketName",cfn_parse.FromCloudFormation.getString(properties.BucketName)),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnRoomPropsValidator(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("loggingConfigurationIdentifiers",cdk.listValidator(cdk.validateString))(properties.loggingConfigurationIdentifiers)),errors.collect(cdk.propertyValidator("maximumMessageLength",cdk.validateNumber)(properties.maximumMessageLength)),errors.collect(cdk.propertyValidator("maximumMessageRatePerSecond",cdk.validateNumber)(properties.maximumMessageRatePerSecond)),errors.collect(cdk.propertyValidator("messageReviewHandler",CfnRoom_MessageReviewHandlerPropertyValidator)(properties.messageReviewHandler)),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 "CfnRoomProps"')}function cfnRoomPropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnRoomPropsValidator(properties).assertSuccess(),{LoggingConfigurationIdentifiers:cdk.listMapper(cdk.stringToCloudFormation)(properties.loggingConfigurationIdentifiers),MaximumMessageLength:cdk.numberToCloudFormation(properties.maximumMessageLength),MaximumMessageRatePerSecond:cdk.numberToCloudFormation(properties.maximumMessageRatePerSecond),MessageReviewHandler:cfnRoomMessageReviewHandlerPropertyToCloudFormation(properties.messageReviewHandler),Name:cdk.stringToCloudFormation(properties.name),Tags:cdk.listMapper(cdk.cfnTagToCloudFormation)(properties.tags)}):properties}function CfnRoomPropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("loggingConfigurationIdentifiers","LoggingConfigurationIdentifiers",properties.LoggingConfigurationIdentifiers!=null?cfn_parse.FromCloudFormation.getStringArray(properties.LoggingConfigurationIdentifiers):void 0),ret.addPropertyResult("maximumMessageLength","MaximumMessageLength",properties.MaximumMessageLength!=null?cfn_parse.FromCloudFormation.getNumber(properties.MaximumMessageLength):void 0),ret.addPropertyResult("maximumMessageRatePerSecond","MaximumMessageRatePerSecond",properties.MaximumMessageRatePerSecond!=null?cfn_parse.FromCloudFormation.getNumber(properties.MaximumMessageRatePerSecond):void 0),ret.addPropertyResult("messageReviewHandler","MessageReviewHandler",properties.MessageReviewHandler!=null?CfnRoomMessageReviewHandlerPropertyFromCloudFormation(properties.MessageReviewHandler):void 0),ret.addPropertyResult("name","Name",properties.Name!=null?cfn_parse.FromCloudFormation.getString(properties.Name):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 CfnRoom extends cdk.CfnResource{constructor(scope,id,props={}){super(scope,id,{type:CfnRoom.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_ivschat_CfnRoomProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnRoom),error}this.attrArn=cdk.Token.asString(this.getAtt("Arn",cdk.ResolutionTypeHint.STRING)),this.attrId=cdk.Token.asString(this.getAtt("Id",cdk.ResolutionTypeHint.STRING)),this.loggingConfigurationIdentifiers=props.loggingConfigurationIdentifiers,this.maximumMessageLength=props.maximumMessageLength,this.maximumMessageRatePerSecond=props.maximumMessageRatePerSecond,this.messageReviewHandler=props.messageReviewHandler,this.name=props.name,this.tags=new cdk.TagManager(cdk.TagType.STANDARD,"AWS::IVSChat::Room",props.tags,{tagPropertyName:"tags"})}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnRoomPropsFromCloudFormation(resourceProperties),ret=new CfnRoom(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",CfnRoom.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{loggingConfigurationIdentifiers:this.loggingConfigurationIdentifiers,maximumMessageLength:this.maximumMessageLength,maximumMessageRatePerSecond:this.maximumMessageRatePerSecond,messageReviewHandler:this.messageReviewHandler,name:this.name,tags:this.tags.renderTags()}}renderProperties(props){return cfnRoomPropsToCloudFormation(props)}}exports.CfnRoom=CfnRoom,_b=JSII_RTTI_SYMBOL_1,CfnRoom[_b]={fqn:"aws-cdk-lib.aws_ivschat.CfnRoom",version:"2.70.0"},CfnRoom.CFN_RESOURCE_TYPE_NAME="AWS::IVSChat::Room";function CfnRoom_MessageReviewHandlerPropertyValidator(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("fallbackResult",cdk.validateString)(properties.fallbackResult)),errors.collect(cdk.propertyValidator("uri",cdk.validateString)(properties.uri)),errors.wrap('supplied properties not correct for "MessageReviewHandlerProperty"')}function cfnRoomMessageReviewHandlerPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnRoom_MessageReviewHandlerPropertyValidator(properties).assertSuccess(),{FallbackResult:cdk.stringToCloudFormation(properties.fallbackResult),Uri:cdk.stringToCloudFormation(properties.uri)}):properties}function CfnRoomMessageReviewHandlerPropertyFromCloudFormation(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("fallbackResult","FallbackResult",properties.FallbackResult!=null?cfn_parse.FromCloudFormation.getString(properties.FallbackResult):void 0),ret.addPropertyResult("uri","Uri",properties.Uri!=null?cfn_parse.FromCloudFormation.getString(properties.Uri):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}