aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 10.4 kB
JavaScript
"use strict";var _a,_b;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnWorkspace=exports.CfnRuleGroupsNamespace=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 CfnRuleGroupsNamespacePropsValidator(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("data",cdk.requiredValidator)(properties.data)),errors.collect(cdk.propertyValidator("data",cdk.validateString)(properties.data)),errors.collect(cdk.propertyValidator("name",cdk.requiredValidator)(properties.name)),errors.collect(cdk.propertyValidator("name",cdk.validateString)(properties.name)),errors.collect(cdk.propertyValidator("tags",cdk.listValidator(cdk.validateCfnTag))(properties.tags)),errors.collect(cdk.propertyValidator("workspace",cdk.requiredValidator)(properties.workspace)),errors.collect(cdk.propertyValidator("workspace",cdk.validateString)(properties.workspace)),errors.wrap('supplied properties not correct for "CfnRuleGroupsNamespaceProps"')}function cfnRuleGroupsNamespacePropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnRuleGroupsNamespacePropsValidator(properties).assertSuccess(),{Data:cdk.stringToCloudFormation(properties.data),Name:cdk.stringToCloudFormation(properties.name),Workspace:cdk.stringToCloudFormation(properties.workspace),Tags:cdk.listMapper(cdk.cfnTagToCloudFormation)(properties.tags)}):properties}function CfnRuleGroupsNamespacePropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("data","Data",cfn_parse.FromCloudFormation.getString(properties.Data)),ret.addPropertyResult("name","Name",cfn_parse.FromCloudFormation.getString(properties.Name)),ret.addPropertyResult("workspace","Workspace",cfn_parse.FromCloudFormation.getString(properties.Workspace)),ret.addPropertyResult("tags","Tags",properties.Tags!=null?cfn_parse.FromCloudFormation.getArray(cfn_parse.FromCloudFormation.getCfnTag)(properties.Tags):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}class CfnRuleGroupsNamespace extends cdk.CfnResource{constructor(scope,id,props){super(scope,id,{type:CfnRuleGroupsNamespace.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_aps_CfnRuleGroupsNamespaceProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnRuleGroupsNamespace),error}cdk.requireProperty(props,"data",this),cdk.requireProperty(props,"name",this),cdk.requireProperty(props,"workspace",this),this.attrArn=cdk.Token.asString(this.getAtt("Arn",cdk.ResolutionTypeHint.STRING)),this.data=props.data,this.name=props.name,this.workspace=props.workspace,this.tags=new cdk.TagManager(cdk.TagType.STANDARD,"AWS::APS::RuleGroupsNamespace",props.tags,{tagPropertyName:"tags"})}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnRuleGroupsNamespacePropsFromCloudFormation(resourceProperties),ret=new CfnRuleGroupsNamespace(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",CfnRuleGroupsNamespace.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{data:this.data,name:this.name,workspace:this.workspace,tags:this.tags.renderTags()}}renderProperties(props){return cfnRuleGroupsNamespacePropsToCloudFormation(props)}}exports.CfnRuleGroupsNamespace=CfnRuleGroupsNamespace,_a=JSII_RTTI_SYMBOL_1,CfnRuleGroupsNamespace[_a]={fqn:"aws-cdk-lib.aws_aps.CfnRuleGroupsNamespace",version:"2.70.0"},CfnRuleGroupsNamespace.CFN_RESOURCE_TYPE_NAME="AWS::APS::RuleGroupsNamespace";function CfnWorkspacePropsValidator(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("alertManagerDefinition",cdk.validateString)(properties.alertManagerDefinition)),errors.collect(cdk.propertyValidator("alias",cdk.validateString)(properties.alias)),errors.collect(cdk.propertyValidator("loggingConfiguration",CfnWorkspace_LoggingConfigurationPropertyValidator)(properties.loggingConfiguration)),errors.collect(cdk.propertyValidator("tags",cdk.listValidator(cdk.validateCfnTag))(properties.tags)),errors.wrap('supplied properties not correct for "CfnWorkspaceProps"')}function cfnWorkspacePropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnWorkspacePropsValidator(properties).assertSuccess(),{AlertManagerDefinition:cdk.stringToCloudFormation(properties.alertManagerDefinition),Alias:cdk.stringToCloudFormation(properties.alias),LoggingConfiguration:cfnWorkspaceLoggingConfigurationPropertyToCloudFormation(properties.loggingConfiguration),Tags:cdk.listMapper(cdk.cfnTagToCloudFormation)(properties.tags)}):properties}function CfnWorkspacePropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("alertManagerDefinition","AlertManagerDefinition",properties.AlertManagerDefinition!=null?cfn_parse.FromCloudFormation.getString(properties.AlertManagerDefinition):void 0),ret.addPropertyResult("alias","Alias",properties.Alias!=null?cfn_parse.FromCloudFormation.getString(properties.Alias):void 0),ret.addPropertyResult("loggingConfiguration","LoggingConfiguration",properties.LoggingConfiguration!=null?CfnWorkspaceLoggingConfigurationPropertyFromCloudFormation(properties.LoggingConfiguration):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 CfnWorkspace extends cdk.CfnResource{constructor(scope,id,props={}){super(scope,id,{type:CfnWorkspace.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_aws_aps_CfnWorkspaceProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnWorkspace),error}this.attrArn=cdk.Token.asString(this.getAtt("Arn",cdk.ResolutionTypeHint.STRING)),this.attrPrometheusEndpoint=cdk.Token.asString(this.getAtt("PrometheusEndpoint",cdk.ResolutionTypeHint.STRING)),this.attrWorkspaceId=cdk.Token.asString(this.getAtt("WorkspaceId",cdk.ResolutionTypeHint.STRING)),this.alertManagerDefinition=props.alertManagerDefinition,this.alias=props.alias,this.loggingConfiguration=props.loggingConfiguration,this.tags=new cdk.TagManager(cdk.TagType.STANDARD,"AWS::APS::Workspace",props.tags,{tagPropertyName:"tags"})}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnWorkspacePropsFromCloudFormation(resourceProperties),ret=new CfnWorkspace(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",CfnWorkspace.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{alertManagerDefinition:this.alertManagerDefinition,alias:this.alias,loggingConfiguration:this.loggingConfiguration,tags:this.tags.renderTags()}}renderProperties(props){return cfnWorkspacePropsToCloudFormation(props)}}exports.CfnWorkspace=CfnWorkspace,_b=JSII_RTTI_SYMBOL_1,CfnWorkspace[_b]={fqn:"aws-cdk-lib.aws_aps.CfnWorkspace",version:"2.70.0"},CfnWorkspace.CFN_RESOURCE_TYPE_NAME="AWS::APS::Workspace";function CfnWorkspace_LoggingConfigurationPropertyValidator(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("logGroupArn",cdk.validateString)(properties.logGroupArn)),errors.wrap('supplied properties not correct for "LoggingConfigurationProperty"')}function cfnWorkspaceLoggingConfigurationPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnWorkspace_LoggingConfigurationPropertyValidator(properties).assertSuccess(),{LogGroupArn:cdk.stringToCloudFormation(properties.logGroupArn)}):properties}function CfnWorkspaceLoggingConfigurationPropertyFromCloudFormation(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("logGroupArn","LogGroupArn",properties.LogGroupArn!=null?cfn_parse.FromCloudFormation.getString(properties.LogGroupArn):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}