aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 20.5 kB
JavaScript
"use strict";var _a,_b;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnRoom=exports.CfnLoggingConfiguration=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var cdk=()=>{var tmp=require("../../core");return cdk=()=>tmp,tmp},cfn_parse=()=>{var tmp=require("../../core/lib/helpers-internal");return cfn_parse=()=>tmp,tmp},cdk_errors=()=>{var tmp=require("../../core/lib/errors");return cdk_errors=()=>tmp,tmp};class CfnLoggingConfiguration extends cdk().CfnResource{static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnLoggingConfigurationPropsFromCloudFormation(resourceProperties);if(cdk().isResolvableObject(propsResult.value))throw new(cdk_errors()).ValidationError("Unexpected IResolvable",scope);const 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}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"}),this.tagsRaw=props.tags}get cfnProperties(){return{destinationConfiguration:this.destinationConfiguration,name:this.name,tags:this.tags.renderTags()}}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)}renderProperties(props){return convertCfnLoggingConfigurationPropsToCloudFormation(props)}}exports.CfnLoggingConfiguration=CfnLoggingConfiguration,_a=JSII_RTTI_SYMBOL_1,CfnLoggingConfiguration[_a]={fqn:"aws-cdk-lib.aws_ivschat.CfnLoggingConfiguration",version:"2.202.0"},CfnLoggingConfiguration.CFN_RESOURCE_TYPE_NAME="AWS::IVSChat::LoggingConfiguration";function CfnLoggingConfigurationS3DestinationConfigurationPropertyValidator(properties){if(!cdk().canInspect(properties))return cdk().VALIDATION_SUCCESS;const errors=new(cdk()).ValidationResults;return properties&&typeof properties=="object"&&!Array.isArray(properties)||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 convertCfnLoggingConfigurationS3DestinationConfigurationPropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnLoggingConfigurationS3DestinationConfigurationPropertyValidator(properties).assertSuccess(),{BucketName:cdk().stringToCloudFormation(properties.bucketName)}):properties}function CfnLoggingConfigurationS3DestinationConfigurationPropertyFromCloudFormation(properties){if(cdk().isResolvableObject(properties))return new(cfn_parse()).FromCloudFormationResult(properties);if(properties=properties??{},!(properties&&typeof properties=="object"&&!Array.isArray(properties)))return new(cfn_parse()).FromCloudFormationResult(properties);const ret=new(cfn_parse()).FromCloudFormationPropertyObject;return ret.addPropertyResult("bucketName","BucketName",properties.BucketName!=null?cfn_parse().FromCloudFormation.getString(properties.BucketName):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnLoggingConfigurationFirehoseDestinationConfigurationPropertyValidator(properties){if(!cdk().canInspect(properties))return cdk().VALIDATION_SUCCESS;const errors=new(cdk()).ValidationResults;return properties&&typeof properties=="object"&&!Array.isArray(properties)||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 convertCfnLoggingConfigurationFirehoseDestinationConfigurationPropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnLoggingConfigurationFirehoseDestinationConfigurationPropertyValidator(properties).assertSuccess(),{DeliveryStreamName:cdk().stringToCloudFormation(properties.deliveryStreamName)}):properties}function CfnLoggingConfigurationFirehoseDestinationConfigurationPropertyFromCloudFormation(properties){if(cdk().isResolvableObject(properties))return new(cfn_parse()).FromCloudFormationResult(properties);if(properties=properties??{},!(properties&&typeof properties=="object"&&!Array.isArray(properties)))return new(cfn_parse()).FromCloudFormationResult(properties);const ret=new(cfn_parse()).FromCloudFormationPropertyObject;return ret.addPropertyResult("deliveryStreamName","DeliveryStreamName",properties.DeliveryStreamName!=null?cfn_parse().FromCloudFormation.getString(properties.DeliveryStreamName):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnLoggingConfigurationCloudWatchLogsDestinationConfigurationPropertyValidator(properties){if(!cdk().canInspect(properties))return cdk().VALIDATION_SUCCESS;const errors=new(cdk()).ValidationResults;return properties&&typeof properties=="object"&&!Array.isArray(properties)||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 convertCfnLoggingConfigurationCloudWatchLogsDestinationConfigurationPropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnLoggingConfigurationCloudWatchLogsDestinationConfigurationPropertyValidator(properties).assertSuccess(),{LogGroupName:cdk().stringToCloudFormation(properties.logGroupName)}):properties}function CfnLoggingConfigurationCloudWatchLogsDestinationConfigurationPropertyFromCloudFormation(properties){if(cdk().isResolvableObject(properties))return new(cfn_parse()).FromCloudFormationResult(properties);if(properties=properties??{},!(properties&&typeof properties=="object"&&!Array.isArray(properties)))return new(cfn_parse()).FromCloudFormationResult(properties);const ret=new(cfn_parse()).FromCloudFormationPropertyObject;return ret.addPropertyResult("logGroupName","LogGroupName",properties.LogGroupName!=null?cfn_parse().FromCloudFormation.getString(properties.LogGroupName):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnLoggingConfigurationDestinationConfigurationPropertyValidator(properties){if(!cdk().canInspect(properties))return cdk().VALIDATION_SUCCESS;const errors=new(cdk()).ValidationResults;return properties&&typeof properties=="object"&&!Array.isArray(properties)||errors.collect(new(cdk()).ValidationResult("Expected an object, but received: "+JSON.stringify(properties))),errors.collect(cdk().propertyValidator("cloudWatchLogs",CfnLoggingConfigurationCloudWatchLogsDestinationConfigurationPropertyValidator)(properties.cloudWatchLogs)),errors.collect(cdk().propertyValidator("firehose",CfnLoggingConfigurationFirehoseDestinationConfigurationPropertyValidator)(properties.firehose)),errors.collect(cdk().propertyValidator("s3",CfnLoggingConfigurationS3DestinationConfigurationPropertyValidator)(properties.s3)),errors.wrap('supplied properties not correct for "DestinationConfigurationProperty"')}function convertCfnLoggingConfigurationDestinationConfigurationPropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnLoggingConfigurationDestinationConfigurationPropertyValidator(properties).assertSuccess(),{CloudWatchLogs:convertCfnLoggingConfigurationCloudWatchLogsDestinationConfigurationPropertyToCloudFormation(properties.cloudWatchLogs),Firehose:convertCfnLoggingConfigurationFirehoseDestinationConfigurationPropertyToCloudFormation(properties.firehose),S3:convertCfnLoggingConfigurationS3DestinationConfigurationPropertyToCloudFormation(properties.s3)}):properties}function CfnLoggingConfigurationDestinationConfigurationPropertyFromCloudFormation(properties){if(cdk().isResolvableObject(properties))return new(cfn_parse()).FromCloudFormationResult(properties);if(properties=properties??{},!(properties&&typeof properties=="object"&&!Array.isArray(properties)))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 CfnLoggingConfigurationPropsValidator(properties){if(!cdk().canInspect(properties))return cdk().VALIDATION_SUCCESS;const errors=new(cdk()).ValidationResults;return properties&&typeof properties=="object"&&!Array.isArray(properties)||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",CfnLoggingConfigurationDestinationConfigurationPropertyValidator)(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 convertCfnLoggingConfigurationPropsToCloudFormation(properties){return cdk().canInspect(properties)?(CfnLoggingConfigurationPropsValidator(properties).assertSuccess(),{DestinationConfiguration:convertCfnLoggingConfigurationDestinationConfigurationPropertyToCloudFormation(properties.destinationConfiguration),Name:cdk().stringToCloudFormation(properties.name),Tags:cdk().listMapper(cdk().cfnTagToCloudFormation)(properties.tags)}):properties}function CfnLoggingConfigurationPropsFromCloudFormation(properties){if(cdk().isResolvableObject(properties))return new(cfn_parse()).FromCloudFormationResult(properties);if(properties=properties??{},!(properties&&typeof properties=="object"&&!Array.isArray(properties)))return new(cfn_parse()).FromCloudFormationResult(properties);const ret=new(cfn_parse()).FromCloudFormationPropertyObject;return ret.addPropertyResult("destinationConfiguration","DestinationConfiguration",properties.DestinationConfiguration!=null?CfnLoggingConfigurationDestinationConfigurationPropertyFromCloudFormation(properties.DestinationConfiguration):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{static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnRoomPropsFromCloudFormation(resourceProperties);if(cdk().isResolvableObject(propsResult.value))throw new(cdk_errors()).ValidationError("Unexpected IResolvable",scope);const 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}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"}),this.tagsRaw=props.tags}get cfnProperties(){return{loggingConfigurationIdentifiers:this.loggingConfigurationIdentifiers,maximumMessageLength:this.maximumMessageLength,maximumMessageRatePerSecond:this.maximumMessageRatePerSecond,messageReviewHandler:this.messageReviewHandler,name:this.name,tags:this.tags.renderTags()}}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)}renderProperties(props){return convertCfnRoomPropsToCloudFormation(props)}}exports.CfnRoom=CfnRoom,_b=JSII_RTTI_SYMBOL_1,CfnRoom[_b]={fqn:"aws-cdk-lib.aws_ivschat.CfnRoom",version:"2.202.0"},CfnRoom.CFN_RESOURCE_TYPE_NAME="AWS::IVSChat::Room";function CfnRoomMessageReviewHandlerPropertyValidator(properties){if(!cdk().canInspect(properties))return cdk().VALIDATION_SUCCESS;const errors=new(cdk()).ValidationResults;return properties&&typeof properties=="object"&&!Array.isArray(properties)||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 convertCfnRoomMessageReviewHandlerPropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnRoomMessageReviewHandlerPropertyValidator(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??{},!(properties&&typeof properties=="object"&&!Array.isArray(properties)))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}function CfnRoomPropsValidator(properties){if(!cdk().canInspect(properties))return cdk().VALIDATION_SUCCESS;const errors=new(cdk()).ValidationResults;return properties&&typeof properties=="object"&&!Array.isArray(properties)||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",CfnRoomMessageReviewHandlerPropertyValidator)(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 convertCfnRoomPropsToCloudFormation(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:convertCfnRoomMessageReviewHandlerPropertyToCloudFormation(properties.messageReviewHandler),Name:cdk().stringToCloudFormation(properties.name),Tags:cdk().listMapper(cdk().cfnTagToCloudFormation)(properties.tags)}):properties}function CfnRoomPropsFromCloudFormation(properties){if(cdk().isResolvableObject(properties))return new(cfn_parse()).FromCloudFormationResult(properties);if(properties=properties??{},!(properties&&typeof properties=="object"&&!Array.isArray(properties)))return new(cfn_parse()).FromCloudFormationResult(properties);const ret=new(cfn_parse()).FromCloudFormationPropertyObject;return ret.addPropertyResult("loggingConfigurationIdentifiers","LoggingConfigurationIdentifiers",properties.LoggingConfigurationIdentifiers!=null?cfn_parse().FromCloudFormation.getArray(cfn_parse().FromCloudFormation.getString)(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}