aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 20.1 kB
JavaScript
"use strict";var _a,_b;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnTable=exports.CfnKeyspace=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 CfnKeyspacePropsValidator(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("keyspaceName",cdk.validateString)(properties.keyspaceName)),errors.collect(cdk.propertyValidator("tags",cdk.listValidator(cdk.validateCfnTag))(properties.tags)),errors.wrap('supplied properties not correct for "CfnKeyspaceProps"')}function cfnKeyspacePropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnKeyspacePropsValidator(properties).assertSuccess(),{KeyspaceName:cdk.stringToCloudFormation(properties.keyspaceName),Tags:cdk.listMapper(cdk.cfnTagToCloudFormation)(properties.tags)}):properties}function CfnKeyspacePropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("keyspaceName","KeyspaceName",properties.KeyspaceName!=null?cfn_parse.FromCloudFormation.getString(properties.KeyspaceName):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 CfnKeyspace extends cdk.CfnResource{constructor(scope,id,props={}){super(scope,id,{type:CfnKeyspace.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_cassandra_CfnKeyspaceProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnKeyspace),error}this.keyspaceName=props.keyspaceName,this.tags=new cdk.TagManager(cdk.TagType.STANDARD,"AWS::Cassandra::Keyspace",props.tags,{tagPropertyName:"tags"})}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnKeyspacePropsFromCloudFormation(resourceProperties),ret=new CfnKeyspace(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",CfnKeyspace.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{keyspaceName:this.keyspaceName,tags:this.tags.renderTags()}}renderProperties(props){return cfnKeyspacePropsToCloudFormation(props)}}exports.CfnKeyspace=CfnKeyspace,_a=JSII_RTTI_SYMBOL_1,CfnKeyspace[_a]={fqn:"aws-cdk-lib.aws_cassandra.CfnKeyspace",version:"2.70.0"},CfnKeyspace.CFN_RESOURCE_TYPE_NAME="AWS::Cassandra::Keyspace";function CfnTablePropsValidator(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("billingMode",CfnTable_BillingModePropertyValidator)(properties.billingMode)),errors.collect(cdk.propertyValidator("clientSideTimestampsEnabled",cdk.validateBoolean)(properties.clientSideTimestampsEnabled)),errors.collect(cdk.propertyValidator("clusteringKeyColumns",cdk.listValidator(CfnTable_ClusteringKeyColumnPropertyValidator))(properties.clusteringKeyColumns)),errors.collect(cdk.propertyValidator("defaultTimeToLive",cdk.validateNumber)(properties.defaultTimeToLive)),errors.collect(cdk.propertyValidator("encryptionSpecification",CfnTable_EncryptionSpecificationPropertyValidator)(properties.encryptionSpecification)),errors.collect(cdk.propertyValidator("keyspaceName",cdk.requiredValidator)(properties.keyspaceName)),errors.collect(cdk.propertyValidator("keyspaceName",cdk.validateString)(properties.keyspaceName)),errors.collect(cdk.propertyValidator("partitionKeyColumns",cdk.requiredValidator)(properties.partitionKeyColumns)),errors.collect(cdk.propertyValidator("partitionKeyColumns",cdk.listValidator(CfnTable_ColumnPropertyValidator))(properties.partitionKeyColumns)),errors.collect(cdk.propertyValidator("pointInTimeRecoveryEnabled",cdk.validateBoolean)(properties.pointInTimeRecoveryEnabled)),errors.collect(cdk.propertyValidator("regularColumns",cdk.listValidator(CfnTable_ColumnPropertyValidator))(properties.regularColumns)),errors.collect(cdk.propertyValidator("tableName",cdk.validateString)(properties.tableName)),errors.collect(cdk.propertyValidator("tags",cdk.listValidator(cdk.validateCfnTag))(properties.tags)),errors.wrap('supplied properties not correct for "CfnTableProps"')}function cfnTablePropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnTablePropsValidator(properties).assertSuccess(),{KeyspaceName:cdk.stringToCloudFormation(properties.keyspaceName),PartitionKeyColumns:cdk.listMapper(cfnTableColumnPropertyToCloudFormation)(properties.partitionKeyColumns),BillingMode:cfnTableBillingModePropertyToCloudFormation(properties.billingMode),ClientSideTimestampsEnabled:cdk.booleanToCloudFormation(properties.clientSideTimestampsEnabled),ClusteringKeyColumns:cdk.listMapper(cfnTableClusteringKeyColumnPropertyToCloudFormation)(properties.clusteringKeyColumns),DefaultTimeToLive:cdk.numberToCloudFormation(properties.defaultTimeToLive),EncryptionSpecification:cfnTableEncryptionSpecificationPropertyToCloudFormation(properties.encryptionSpecification),PointInTimeRecoveryEnabled:cdk.booleanToCloudFormation(properties.pointInTimeRecoveryEnabled),RegularColumns:cdk.listMapper(cfnTableColumnPropertyToCloudFormation)(properties.regularColumns),TableName:cdk.stringToCloudFormation(properties.tableName),Tags:cdk.listMapper(cdk.cfnTagToCloudFormation)(properties.tags)}):properties}function CfnTablePropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("keyspaceName","KeyspaceName",cfn_parse.FromCloudFormation.getString(properties.KeyspaceName)),ret.addPropertyResult("partitionKeyColumns","PartitionKeyColumns",cfn_parse.FromCloudFormation.getArray(CfnTableColumnPropertyFromCloudFormation)(properties.PartitionKeyColumns)),ret.addPropertyResult("billingMode","BillingMode",properties.BillingMode!=null?CfnTableBillingModePropertyFromCloudFormation(properties.BillingMode):void 0),ret.addPropertyResult("clientSideTimestampsEnabled","ClientSideTimestampsEnabled",properties.ClientSideTimestampsEnabled!=null?cfn_parse.FromCloudFormation.getBoolean(properties.ClientSideTimestampsEnabled):void 0),ret.addPropertyResult("clusteringKeyColumns","ClusteringKeyColumns",properties.ClusteringKeyColumns!=null?cfn_parse.FromCloudFormation.getArray(CfnTableClusteringKeyColumnPropertyFromCloudFormation)(properties.ClusteringKeyColumns):void 0),ret.addPropertyResult("defaultTimeToLive","DefaultTimeToLive",properties.DefaultTimeToLive!=null?cfn_parse.FromCloudFormation.getNumber(properties.DefaultTimeToLive):void 0),ret.addPropertyResult("encryptionSpecification","EncryptionSpecification",properties.EncryptionSpecification!=null?CfnTableEncryptionSpecificationPropertyFromCloudFormation(properties.EncryptionSpecification):void 0),ret.addPropertyResult("pointInTimeRecoveryEnabled","PointInTimeRecoveryEnabled",properties.PointInTimeRecoveryEnabled!=null?cfn_parse.FromCloudFormation.getBoolean(properties.PointInTimeRecoveryEnabled):void 0),ret.addPropertyResult("regularColumns","RegularColumns",properties.RegularColumns!=null?cfn_parse.FromCloudFormation.getArray(CfnTableColumnPropertyFromCloudFormation)(properties.RegularColumns):void 0),ret.addPropertyResult("tableName","TableName",properties.TableName!=null?cfn_parse.FromCloudFormation.getString(properties.TableName):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 CfnTable extends cdk.CfnResource{constructor(scope,id,props){super(scope,id,{type:CfnTable.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_cassandra_CfnTableProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnTable),error}cdk.requireProperty(props,"keyspaceName",this),cdk.requireProperty(props,"partitionKeyColumns",this),this.keyspaceName=props.keyspaceName,this.partitionKeyColumns=props.partitionKeyColumns,this.billingMode=props.billingMode,this.clientSideTimestampsEnabled=props.clientSideTimestampsEnabled,this.clusteringKeyColumns=props.clusteringKeyColumns,this.defaultTimeToLive=props.defaultTimeToLive,this.encryptionSpecification=props.encryptionSpecification,this.pointInTimeRecoveryEnabled=props.pointInTimeRecoveryEnabled,this.regularColumns=props.regularColumns,this.tableName=props.tableName,this.tags=new cdk.TagManager(cdk.TagType.STANDARD,"AWS::Cassandra::Table",props.tags,{tagPropertyName:"tags"})}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnTablePropsFromCloudFormation(resourceProperties),ret=new CfnTable(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",CfnTable.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{keyspaceName:this.keyspaceName,partitionKeyColumns:this.partitionKeyColumns,billingMode:this.billingMode,clientSideTimestampsEnabled:this.clientSideTimestampsEnabled,clusteringKeyColumns:this.clusteringKeyColumns,defaultTimeToLive:this.defaultTimeToLive,encryptionSpecification:this.encryptionSpecification,pointInTimeRecoveryEnabled:this.pointInTimeRecoveryEnabled,regularColumns:this.regularColumns,tableName:this.tableName,tags:this.tags.renderTags()}}renderProperties(props){return cfnTablePropsToCloudFormation(props)}}exports.CfnTable=CfnTable,_b=JSII_RTTI_SYMBOL_1,CfnTable[_b]={fqn:"aws-cdk-lib.aws_cassandra.CfnTable",version:"2.70.0"},CfnTable.CFN_RESOURCE_TYPE_NAME="AWS::Cassandra::Table";function CfnTable_BillingModePropertyValidator(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("mode",cdk.requiredValidator)(properties.mode)),errors.collect(cdk.propertyValidator("mode",cdk.validateString)(properties.mode)),errors.collect(cdk.propertyValidator("provisionedThroughput",CfnTable_ProvisionedThroughputPropertyValidator)(properties.provisionedThroughput)),errors.wrap('supplied properties not correct for "BillingModeProperty"')}function cfnTableBillingModePropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnTable_BillingModePropertyValidator(properties).assertSuccess(),{Mode:cdk.stringToCloudFormation(properties.mode),ProvisionedThroughput:cfnTableProvisionedThroughputPropertyToCloudFormation(properties.provisionedThroughput)}):properties}function CfnTableBillingModePropertyFromCloudFormation(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("mode","Mode",cfn_parse.FromCloudFormation.getString(properties.Mode)),ret.addPropertyResult("provisionedThroughput","ProvisionedThroughput",properties.ProvisionedThroughput!=null?CfnTableProvisionedThroughputPropertyFromCloudFormation(properties.ProvisionedThroughput):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnTable_ClusteringKeyColumnPropertyValidator(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("column",cdk.requiredValidator)(properties.column)),errors.collect(cdk.propertyValidator("column",CfnTable_ColumnPropertyValidator)(properties.column)),errors.collect(cdk.propertyValidator("orderBy",cdk.validateString)(properties.orderBy)),errors.wrap('supplied properties not correct for "ClusteringKeyColumnProperty"')}function cfnTableClusteringKeyColumnPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnTable_ClusteringKeyColumnPropertyValidator(properties).assertSuccess(),{Column:cfnTableColumnPropertyToCloudFormation(properties.column),OrderBy:cdk.stringToCloudFormation(properties.orderBy)}):properties}function CfnTableClusteringKeyColumnPropertyFromCloudFormation(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("column","Column",CfnTableColumnPropertyFromCloudFormation(properties.Column)),ret.addPropertyResult("orderBy","OrderBy",properties.OrderBy!=null?cfn_parse.FromCloudFormation.getString(properties.OrderBy):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnTable_ColumnPropertyValidator(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("columnName",cdk.requiredValidator)(properties.columnName)),errors.collect(cdk.propertyValidator("columnName",cdk.validateString)(properties.columnName)),errors.collect(cdk.propertyValidator("columnType",cdk.requiredValidator)(properties.columnType)),errors.collect(cdk.propertyValidator("columnType",cdk.validateString)(properties.columnType)),errors.wrap('supplied properties not correct for "ColumnProperty"')}function cfnTableColumnPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnTable_ColumnPropertyValidator(properties).assertSuccess(),{ColumnName:cdk.stringToCloudFormation(properties.columnName),ColumnType:cdk.stringToCloudFormation(properties.columnType)}):properties}function CfnTableColumnPropertyFromCloudFormation(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("columnName","ColumnName",cfn_parse.FromCloudFormation.getString(properties.ColumnName)),ret.addPropertyResult("columnType","ColumnType",cfn_parse.FromCloudFormation.getString(properties.ColumnType)),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnTable_EncryptionSpecificationPropertyValidator(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("encryptionType",cdk.requiredValidator)(properties.encryptionType)),errors.collect(cdk.propertyValidator("encryptionType",cdk.validateString)(properties.encryptionType)),errors.collect(cdk.propertyValidator("kmsKeyIdentifier",cdk.validateString)(properties.kmsKeyIdentifier)),errors.wrap('supplied properties not correct for "EncryptionSpecificationProperty"')}function cfnTableEncryptionSpecificationPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnTable_EncryptionSpecificationPropertyValidator(properties).assertSuccess(),{EncryptionType:cdk.stringToCloudFormation(properties.encryptionType),KmsKeyIdentifier:cdk.stringToCloudFormation(properties.kmsKeyIdentifier)}):properties}function CfnTableEncryptionSpecificationPropertyFromCloudFormation(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("encryptionType","EncryptionType",cfn_parse.FromCloudFormation.getString(properties.EncryptionType)),ret.addPropertyResult("kmsKeyIdentifier","KmsKeyIdentifier",properties.KmsKeyIdentifier!=null?cfn_parse.FromCloudFormation.getString(properties.KmsKeyIdentifier):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnTable_ProvisionedThroughputPropertyValidator(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("readCapacityUnits",cdk.requiredValidator)(properties.readCapacityUnits)),errors.collect(cdk.propertyValidator("readCapacityUnits",cdk.validateNumber)(properties.readCapacityUnits)),errors.collect(cdk.propertyValidator("writeCapacityUnits",cdk.requiredValidator)(properties.writeCapacityUnits)),errors.collect(cdk.propertyValidator("writeCapacityUnits",cdk.validateNumber)(properties.writeCapacityUnits)),errors.wrap('supplied properties not correct for "ProvisionedThroughputProperty"')}function cfnTableProvisionedThroughputPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnTable_ProvisionedThroughputPropertyValidator(properties).assertSuccess(),{ReadCapacityUnits:cdk.numberToCloudFormation(properties.readCapacityUnits),WriteCapacityUnits:cdk.numberToCloudFormation(properties.writeCapacityUnits)}):properties}function CfnTableProvisionedThroughputPropertyFromCloudFormation(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("readCapacityUnits","ReadCapacityUnits",cfn_parse.FromCloudFormation.getNumber(properties.ReadCapacityUnits)),ret.addPropertyResult("writeCapacityUnits","WriteCapacityUnits",cfn_parse.FromCloudFormation.getNumber(properties.WriteCapacityUnits)),ret.addUnrecognizedPropertiesAsExtra(properties),ret}