UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 9.85 kB
"use strict";var _a;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=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 CfnPreferences extends cdk().CfnResource{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("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}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.attrAccountId=cdk().Token.asString(this.getAtt("AccountId",cdk().ResolutionTypeHint.STRING)),this.connectionRecordingPreferences=props.connectionRecordingPreferences}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:props",this.cfnProperties)}renderProperties(props){return convertCfnPreferencesPropsToCloudFormation(props)}}exports.CfnPreferences=CfnPreferences,_a=JSII_RTTI_SYMBOL_1,CfnPreferences[_a]={fqn:"aws-cdk-lib.aws_ssmguiconnect.CfnPreferences",version:"2.202.0"},CfnPreferences.CFN_RESOURCE_TYPE_NAME="AWS::SSMGuiConnect::Preferences";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}