aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 11.2 kB
JavaScript
;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnFeed=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/lib");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 CfnFeed extends cdk().CfnResource{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_elementalinference.CfnFeed",version:"2.246.0"};static CFN_RESOURCE_TYPE_NAME="AWS::ElementalInference::Feed";static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnFeedPropsFromCloudFormation(resourceProperties);if(cdk().isResolvableObject(propsResult.value))throw new(cdk_errors()).ValidationError("UnexpectedIResolvable","Unexpected IResolvable",scope);const ret=new CfnFeed(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 isCfnFeed(x){return cdk().CfnResource.isCfnResource(x)&&x.cfnResourceType===CfnFeed.CFN_RESOURCE_TYPE_NAME}static arnForFeed(resource){try{jsiiDeprecationWarnings().aws_cdk_lib_interfaces_aws_elementalinference_IFeedRef(resource)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.arnForFeed),error}return resource.feedRef.feedArn}cdkTagManager;name;outputs;tags;constructor(scope,id,props){super(scope,id,{type:CfnFeed.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_elementalinference_CfnFeedProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnFeed),error}cdk().requireProperty(props,"name",this),cdk().requireProperty(props,"outputs",this),this.cdkTagManager=new(cdk()).TagManager(cdk().TagType.MAP,"AWS::ElementalInference::Feed",void 0,{tagPropertyName:"tags"}),this.name=props.name,this.outputs=props.outputs,this.tags=props.tags}get feedRef(){return{feedId:this.ref,feedArn:this.attrArn}}get attrArn(){return cdk().Token.asString(this.getAtt("Arn",cdk().ResolutionTypeHint.STRING))}get attrDataEndpoints(){return cdk().Token.asList(this.getAtt("DataEndpoints",cdk().ResolutionTypeHint.STRING_LIST))}get attrId(){return cdk().Token.asString(this.getAtt("Id",cdk().ResolutionTypeHint.STRING))}get cfnProperties(){return{tags:this.cdkTagManager.renderTags(this.tags),name:this.name,outputs:this.outputs}}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",CfnFeed.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}renderProperties(props){return convertCfnFeedPropsToCloudFormation(props)}}exports.CfnFeed=CfnFeed;function CfnFeedClippingConfigPropertyValidator(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("callbackMetadata",cdk().validateString)(properties.callbackMetadata)),errors.wrap('supplied properties not correct for "ClippingConfigProperty"')}function convertCfnFeedClippingConfigPropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnFeedClippingConfigPropertyValidator(properties).assertSuccess(),{CallbackMetadata:cdk().stringToCloudFormation(properties.callbackMetadata)}):properties}function CfnFeedClippingConfigPropertyFromCloudFormation(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("callbackMetadata","CallbackMetadata",properties.CallbackMetadata!=null?cfn_parse().FromCloudFormation.getString(properties.CallbackMetadata):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnFeedOutputConfigPropertyValidator(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("clipping",CfnFeedClippingConfigPropertyValidator)(properties.clipping)),errors.collect(cdk().propertyValidator("cropping",cdk().validateObject)(properties.cropping)),errors.wrap('supplied properties not correct for "OutputConfigProperty"')}function convertCfnFeedOutputConfigPropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnFeedOutputConfigPropertyValidator(properties).assertSuccess(),{Clipping:convertCfnFeedClippingConfigPropertyToCloudFormation(properties.clipping),Cropping:cdk().objectToCloudFormation(properties.cropping)}):properties}function CfnFeedOutputConfigPropertyFromCloudFormation(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("clipping","Clipping",properties.Clipping!=null?CfnFeedClippingConfigPropertyFromCloudFormation(properties.Clipping):void 0),ret.addPropertyResult("cropping","Cropping",properties.Cropping!=null?cfn_parse().FromCloudFormation.getAny(properties.Cropping):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnFeedGetOutputPropertyValidator(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("description",cdk().validateString)(properties.description)),errors.collect(cdk().propertyValidator("name",cdk().requiredValidator)(properties.name)),errors.collect(cdk().propertyValidator("name",cdk().validateString)(properties.name)),errors.collect(cdk().propertyValidator("outputConfig",cdk().requiredValidator)(properties.outputConfig)),errors.collect(cdk().propertyValidator("outputConfig",CfnFeedOutputConfigPropertyValidator)(properties.outputConfig)),errors.collect(cdk().propertyValidator("status",cdk().requiredValidator)(properties.status)),errors.collect(cdk().propertyValidator("status",cdk().validateString)(properties.status)),errors.wrap('supplied properties not correct for "GetOutputProperty"')}function convertCfnFeedGetOutputPropertyToCloudFormation(properties){return cdk().canInspect(properties)?(CfnFeedGetOutputPropertyValidator(properties).assertSuccess(),{Description:cdk().stringToCloudFormation(properties.description),Name:cdk().stringToCloudFormation(properties.name),OutputConfig:convertCfnFeedOutputConfigPropertyToCloudFormation(properties.outputConfig),Status:cdk().stringToCloudFormation(properties.status)}):properties}function CfnFeedGetOutputPropertyFromCloudFormation(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("description","Description",properties.Description!=null?cfn_parse().FromCloudFormation.getString(properties.Description):void 0),ret.addPropertyResult("name","Name",properties.Name!=null?cfn_parse().FromCloudFormation.getString(properties.Name):void 0),ret.addPropertyResult("outputConfig","OutputConfig",properties.OutputConfig!=null?CfnFeedOutputConfigPropertyFromCloudFormation(properties.OutputConfig):void 0),ret.addPropertyResult("status","Status",properties.Status!=null?cfn_parse().FromCloudFormation.getString(properties.Status):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnFeedPropsValidator(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("name",cdk().requiredValidator)(properties.name)),errors.collect(cdk().propertyValidator("name",cdk().validateString)(properties.name)),errors.collect(cdk().propertyValidator("outputs",cdk().requiredValidator)(properties.outputs)),errors.collect(cdk().propertyValidator("outputs",cdk().listValidator(CfnFeedGetOutputPropertyValidator))(properties.outputs)),errors.collect(cdk().propertyValidator("tags",cdk().hashValidator(cdk().validateString))(properties.tags)),errors.wrap('supplied properties not correct for "CfnFeedProps"')}function convertCfnFeedPropsToCloudFormation(properties){return cdk().canInspect(properties)?(CfnFeedPropsValidator(properties).assertSuccess(),{Name:cdk().stringToCloudFormation(properties.name),Outputs:cdk().listMapper(convertCfnFeedGetOutputPropertyToCloudFormation)(properties.outputs),Tags:cdk().hashMapper(cdk().stringToCloudFormation)(properties.tags)}):properties}function CfnFeedPropsFromCloudFormation(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("name","Name",properties.Name!=null?cfn_parse().FromCloudFormation.getString(properties.Name):void 0),ret.addPropertyResult("outputs","Outputs",properties.Outputs!=null?cfn_parse().FromCloudFormation.getArray(CfnFeedGetOutputPropertyFromCloudFormation)(properties.Outputs):void 0),ret.addPropertyResult("tags","Tags",properties.Tags!=null?cfn_parse().FromCloudFormation.getMap(cfn_parse().FromCloudFormation.getString)(properties.Tags):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}