aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 8.64 kB
JavaScript
;var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnProfilingGroup=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 CfnProfilingGroupPropsValidator(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("agentPermissions",cdk.validateObject)(properties.agentPermissions)),errors.collect(cdk.propertyValidator("anomalyDetectionNotificationConfiguration",cdk.listValidator(CfnProfilingGroup_ChannelPropertyValidator))(properties.anomalyDetectionNotificationConfiguration)),errors.collect(cdk.propertyValidator("computePlatform",cdk.validateString)(properties.computePlatform)),errors.collect(cdk.propertyValidator("profilingGroupName",cdk.requiredValidator)(properties.profilingGroupName)),errors.collect(cdk.propertyValidator("profilingGroupName",cdk.validateString)(properties.profilingGroupName)),errors.collect(cdk.propertyValidator("tags",cdk.listValidator(cdk.validateCfnTag))(properties.tags)),errors.wrap('supplied properties not correct for "CfnProfilingGroupProps"')}function cfnProfilingGroupPropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnProfilingGroupPropsValidator(properties).assertSuccess(),{ProfilingGroupName:cdk.stringToCloudFormation(properties.profilingGroupName),AgentPermissions:cdk.objectToCloudFormation(properties.agentPermissions),AnomalyDetectionNotificationConfiguration:cdk.listMapper(cfnProfilingGroupChannelPropertyToCloudFormation)(properties.anomalyDetectionNotificationConfiguration),ComputePlatform:cdk.stringToCloudFormation(properties.computePlatform),Tags:cdk.listMapper(cdk.cfnTagToCloudFormation)(properties.tags)}):properties}function CfnProfilingGroupPropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("profilingGroupName","ProfilingGroupName",cfn_parse.FromCloudFormation.getString(properties.ProfilingGroupName)),ret.addPropertyResult("agentPermissions","AgentPermissions",properties.AgentPermissions!=null?cfn_parse.FromCloudFormation.getAny(properties.AgentPermissions):void 0),ret.addPropertyResult("anomalyDetectionNotificationConfiguration","AnomalyDetectionNotificationConfiguration",properties.AnomalyDetectionNotificationConfiguration!=null?cfn_parse.FromCloudFormation.getArray(CfnProfilingGroupChannelPropertyFromCloudFormation)(properties.AnomalyDetectionNotificationConfiguration):void 0),ret.addPropertyResult("computePlatform","ComputePlatform",properties.ComputePlatform!=null?cfn_parse.FromCloudFormation.getString(properties.ComputePlatform):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 CfnProfilingGroup extends cdk.CfnResource{constructor(scope,id,props){super(scope,id,{type:CfnProfilingGroup.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_codeguruprofiler_CfnProfilingGroupProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnProfilingGroup),error}cdk.requireProperty(props,"profilingGroupName",this),this.attrArn=cdk.Token.asString(this.getAtt("Arn",cdk.ResolutionTypeHint.STRING)),this.profilingGroupName=props.profilingGroupName,this.agentPermissions=props.agentPermissions,this.anomalyDetectionNotificationConfiguration=props.anomalyDetectionNotificationConfiguration,this.computePlatform=props.computePlatform,this.tags=new cdk.TagManager(cdk.TagType.STANDARD,"AWS::CodeGuruProfiler::ProfilingGroup",props.tags,{tagPropertyName:"tags"})}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnProfilingGroupPropsFromCloudFormation(resourceProperties),ret=new CfnProfilingGroup(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",CfnProfilingGroup.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{profilingGroupName:this.profilingGroupName,agentPermissions:this.agentPermissions,anomalyDetectionNotificationConfiguration:this.anomalyDetectionNotificationConfiguration,computePlatform:this.computePlatform,tags:this.tags.renderTags()}}renderProperties(props){return cfnProfilingGroupPropsToCloudFormation(props)}}exports.CfnProfilingGroup=CfnProfilingGroup,_a=JSII_RTTI_SYMBOL_1,CfnProfilingGroup[_a]={fqn:"aws-cdk-lib.aws_codeguruprofiler.CfnProfilingGroup",version:"2.70.0"},CfnProfilingGroup.CFN_RESOURCE_TYPE_NAME="AWS::CodeGuruProfiler::ProfilingGroup";function CfnProfilingGroup_AgentPermissionsPropertyValidator(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("principals",cdk.requiredValidator)(properties.principals)),errors.collect(cdk.propertyValidator("principals",cdk.listValidator(cdk.validateString))(properties.principals)),errors.wrap('supplied properties not correct for "AgentPermissionsProperty"')}function cfnProfilingGroupAgentPermissionsPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnProfilingGroup_AgentPermissionsPropertyValidator(properties).assertSuccess(),{Principals:cdk.listMapper(cdk.stringToCloudFormation)(properties.principals)}):properties}function CfnProfilingGroupAgentPermissionsPropertyFromCloudFormation(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("principals","Principals",cfn_parse.FromCloudFormation.getStringArray(properties.Principals)),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnProfilingGroup_ChannelPropertyValidator(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("channelId",cdk.validateString)(properties.channelId)),errors.collect(cdk.propertyValidator("channelUri",cdk.requiredValidator)(properties.channelUri)),errors.collect(cdk.propertyValidator("channelUri",cdk.validateString)(properties.channelUri)),errors.wrap('supplied properties not correct for "ChannelProperty"')}function cfnProfilingGroupChannelPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnProfilingGroup_ChannelPropertyValidator(properties).assertSuccess(),{channelId:cdk.stringToCloudFormation(properties.channelId),channelUri:cdk.stringToCloudFormation(properties.channelUri)}):properties}function CfnProfilingGroupChannelPropertyFromCloudFormation(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("channelId","channelId",properties.channelId!=null?cfn_parse.FromCloudFormation.getString(properties.channelId):void 0),ret.addPropertyResult("channelUri","channelUri",cfn_parse.FromCloudFormation.getString(properties.channelUri)),ret.addUnrecognizedPropertiesAsExtra(properties),ret}