aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 11.5 kB
JavaScript
;var __createBinding=exports&&exports.__createBinding||(Object.create?(function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}):(function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]})),__setModuleDefault=exports&&exports.__setModuleDefault||(Object.create?(function(o,v){Object.defineProperty(o,"default",{enumerable:!0,value:v})}):function(o,v){o.default=v}),__importStar=exports&&exports.__importStar||(function(){var ownKeys=function(o){return ownKeys=Object.getOwnPropertyNames||function(o2){var ar=[];for(var k in o2)Object.prototype.hasOwnProperty.call(o2,k)&&(ar[ar.length]=k);return ar},ownKeys(o)};return function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k=ownKeys(mod),i=0;i<k.length;i++)k[i]!=="default"&&__createBinding(result,mod,k[i]);return __setModuleDefault(result,mod),result}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnPreferences=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=__importStar(require("../../core/lib"));return cdk=()=>tmp,tmp},cfn_parse=()=>{var tmp=__importStar(require("../../core/lib/helpers-internal"));return cfn_parse=()=>tmp,tmp},cdk_errors=()=>{var tmp=__importStar(require("../../core/lib/errors"));return cdk_errors=()=>tmp,tmp};class CfnPreferences extends cdk().CfnResource{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_ssmguiconnect.CfnPreferences",version:"2.259.0"};static CFN_RESOURCE_TYPE_NAME="AWS::SSMGuiConnect::Preferences";static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnPreferencesPropsFromCloudFormation(resourceProperties);if(cdk().isResolvableObject(propsResult.value))throw new(cdk_errors()).ValidationError(cfn_parse().lit`UnexpectedIResolvable`,"Unexpected IResolvable",scope);const ret=new CfnPreferences(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}static isCfnPreferences(x){return cdk().CfnResource.isCfnResource(x)&&x.cfnResourceType===CfnPreferences.CFN_RESOURCE_TYPE_NAME}_connectionRecordingPreferences;cfnPropertyNames={connectionRecordingPreferences:"ConnectionRecordingPreferences"};constructor(scope,id,props={}){super(scope,id,{type:CfnPreferences.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ssmguiconnect_CfnPreferencesProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnPreferences),error}this._connectionRecordingPreferences=props.connectionRecordingPreferences}get preferencesRef(){return{accountId:this.ref}}get connectionRecordingPreferences(){return this._connectionRecordingPreferences}set connectionRecordingPreferences(value){cdk().traceProperty(this.node,"ConnectionRecordingPreferences"),this._connectionRecordingPreferences=value}get attrAccountId(){return cdk().Token.asString(this.getAtt("AccountId",cdk().ResolutionTypeHint.STRING))}get cfnProperties(){return{connectionRecordingPreferences:this._connectionRecordingPreferences}}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",CfnPreferences.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:logicalId",this._synthesizeLogicalId()),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}renderProperties(props){return convertCfnPreferencesPropsToCloudFormation(props)}}exports.CfnPreferences=CfnPreferences;function CfnPreferencesS3BucketPropertyValidator(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.collect(cdk().propertyValidator("bucketOwner",cdk().requiredValidator)(properties.bucketOwner)),errors.collect(cdk().propertyValidator("bucketOwner",cdk().validateString)(properties.bucketOwner)),errors.wrap('supplied properties not correct for "S3BucketProperty"')}function convertCfnPreferencesS3BucketPropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnPreferencesS3BucketPropertyValidator(properties).assertSuccess(),{BucketName:cdk().stringToCloudFormation(properties.bucketName),BucketOwner:cdk().stringToCloudFormation(properties.bucketOwner)}):properties}function CfnPreferencesS3BucketPropertyFromCloudFormation(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.addPropertyResult("bucketOwner","BucketOwner",properties.BucketOwner!=null?cfn_parse().FromCloudFormation.getString(properties.BucketOwner):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnPreferencesRecordingDestinationsPropertyValidator(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("s3Buckets",cdk().requiredValidator)(properties.s3Buckets)),errors.collect(cdk().propertyValidator("s3Buckets",cdk().listValidator(CfnPreferencesS3BucketPropertyValidator))(properties.s3Buckets)),errors.wrap('supplied properties not correct for "RecordingDestinationsProperty"')}function convertCfnPreferencesRecordingDestinationsPropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnPreferencesRecordingDestinationsPropertyValidator(properties).assertSuccess(),{S3Buckets:cdk().listMapper(convertCfnPreferencesS3BucketPropertyToCloudFormation)(properties.s3Buckets)}):properties}function CfnPreferencesRecordingDestinationsPropertyFromCloudFormation(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("s3Buckets","S3Buckets",properties.S3Buckets!=null?cfn_parse().FromCloudFormation.getArray(CfnPreferencesS3BucketPropertyFromCloudFormation)(properties.S3Buckets):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnPreferencesConnectionRecordingPreferencesPropertyValidator(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("kmsKeyArn",cdk().requiredValidator)(properties.kmsKeyArn)),errors.collect(cdk().propertyValidator("kmsKeyArn",cdk().validateString)(properties.kmsKeyArn)),errors.collect(cdk().propertyValidator("recordingDestinations",cdk().requiredValidator)(properties.recordingDestinations)),errors.collect(cdk().propertyValidator("recordingDestinations",CfnPreferencesRecordingDestinationsPropertyValidator)(properties.recordingDestinations)),errors.wrap('supplied properties not correct for "ConnectionRecordingPreferencesProperty"')}function convertCfnPreferencesConnectionRecordingPreferencesPropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnPreferencesConnectionRecordingPreferencesPropertyValidator(properties).assertSuccess(),{KMSKeyArn:cdk().stringToCloudFormation(properties.kmsKeyArn),RecordingDestinations:convertCfnPreferencesRecordingDestinationsPropertyToCloudFormation(properties.recordingDestinations)}):properties}function CfnPreferencesConnectionRecordingPreferencesPropertyFromCloudFormation(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("kmsKeyArn","KMSKeyArn",properties.KMSKeyArn!=null?cfn_parse().FromCloudFormation.getString(properties.KMSKeyArn):void 0),ret.addPropertyResult("recordingDestinations","RecordingDestinations",properties.RecordingDestinations!=null?CfnPreferencesRecordingDestinationsPropertyFromCloudFormation(properties.RecordingDestinations):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnPreferencesPropsValidator(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("connectionRecordingPreferences",CfnPreferencesConnectionRecordingPreferencesPropertyValidator)(properties.connectionRecordingPreferences)),errors.wrap('supplied properties not correct for "CfnPreferencesProps"')}function convertCfnPreferencesPropsToCloudFormation(properties){return cdk().canInspect(properties)?(CfnPreferencesPropsValidator(properties).assertSuccess(),{ConnectionRecordingPreferences:convertCfnPreferencesConnectionRecordingPreferencesPropertyToCloudFormation(properties.connectionRecordingPreferences)}):properties}function CfnPreferencesPropsFromCloudFormation(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("connectionRecordingPreferences","ConnectionRecordingPreferences",properties.ConnectionRecordingPreferences!=null?CfnPreferencesConnectionRecordingPreferencesPropertyFromCloudFormation(properties.ConnectionRecordingPreferences):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}