UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 10.3 kB
"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnSkill=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 CfnSkillPropsValidator(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("authenticationConfiguration",cdk.requiredValidator)(properties.authenticationConfiguration)),errors.collect(cdk.propertyValidator("authenticationConfiguration",CfnSkill_AuthenticationConfigurationPropertyValidator)(properties.authenticationConfiguration)),errors.collect(cdk.propertyValidator("skillPackage",cdk.requiredValidator)(properties.skillPackage)),errors.collect(cdk.propertyValidator("skillPackage",CfnSkill_SkillPackagePropertyValidator)(properties.skillPackage)),errors.collect(cdk.propertyValidator("vendorId",cdk.requiredValidator)(properties.vendorId)),errors.collect(cdk.propertyValidator("vendorId",cdk.validateString)(properties.vendorId)),errors.wrap('supplied properties not correct for "CfnSkillProps"')}function cfnSkillPropsToCloudFormation(properties){return cdk.canInspect(properties)?(CfnSkillPropsValidator(properties).assertSuccess(),{AuthenticationConfiguration:cfnSkillAuthenticationConfigurationPropertyToCloudFormation(properties.authenticationConfiguration),SkillPackage:cfnSkillSkillPackagePropertyToCloudFormation(properties.skillPackage),VendorId:cdk.stringToCloudFormation(properties.vendorId)}):properties}function CfnSkillPropsFromCloudFormation(properties){if(properties=properties??{},typeof properties!="object")return new cfn_parse.FromCloudFormationResult(properties);const ret=new cfn_parse.FromCloudFormationPropertyObject;return ret.addPropertyResult("authenticationConfiguration","AuthenticationConfiguration",CfnSkillAuthenticationConfigurationPropertyFromCloudFormation(properties.AuthenticationConfiguration)),ret.addPropertyResult("skillPackage","SkillPackage",CfnSkillSkillPackagePropertyFromCloudFormation(properties.SkillPackage)),ret.addPropertyResult("vendorId","VendorId",cfn_parse.FromCloudFormation.getString(properties.VendorId)),ret.addUnrecognizedPropertiesAsExtra(properties),ret}class CfnSkill extends cdk.CfnResource{constructor(scope,id,props){super(scope,id,{type:CfnSkill.CFN_RESOURCE_TYPE_NAME,properties:props});try{jsiiDeprecationWarnings.aws_cdk_lib_alexa_ask_CfnSkillProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CfnSkill),error}cdk.requireProperty(props,"authenticationConfiguration",this),cdk.requireProperty(props,"skillPackage",this),cdk.requireProperty(props,"vendorId",this),this.authenticationConfiguration=props.authenticationConfiguration,this.skillPackage=props.skillPackage,this.vendorId=props.vendorId}static _fromCloudFormation(scope,id,resourceAttributes,options){resourceAttributes=resourceAttributes||{};const resourceProperties=options.parser.parseValue(resourceAttributes.Properties),propsResult=CfnSkillPropsFromCloudFormation(resourceProperties),ret=new CfnSkill(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",CfnSkill.CFN_RESOURCE_TYPE_NAME),inspector.addAttribute("aws:cdk:cloudformation:props",this.cfnProperties)}get cfnProperties(){return{authenticationConfiguration:this.authenticationConfiguration,skillPackage:this.skillPackage,vendorId:this.vendorId}}renderProperties(props){return cfnSkillPropsToCloudFormation(props)}}exports.CfnSkill=CfnSkill,_a=JSII_RTTI_SYMBOL_1,CfnSkill[_a]={fqn:"aws-cdk-lib.alexa_ask.CfnSkill",version:"2.70.0"},CfnSkill.CFN_RESOURCE_TYPE_NAME="Alexa::ASK::Skill";function CfnSkill_AuthenticationConfigurationPropertyValidator(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("clientId",cdk.requiredValidator)(properties.clientId)),errors.collect(cdk.propertyValidator("clientId",cdk.validateString)(properties.clientId)),errors.collect(cdk.propertyValidator("clientSecret",cdk.requiredValidator)(properties.clientSecret)),errors.collect(cdk.propertyValidator("clientSecret",cdk.validateString)(properties.clientSecret)),errors.collect(cdk.propertyValidator("refreshToken",cdk.requiredValidator)(properties.refreshToken)),errors.collect(cdk.propertyValidator("refreshToken",cdk.validateString)(properties.refreshToken)),errors.wrap('supplied properties not correct for "AuthenticationConfigurationProperty"')}function cfnSkillAuthenticationConfigurationPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnSkill_AuthenticationConfigurationPropertyValidator(properties).assertSuccess(),{ClientId:cdk.stringToCloudFormation(properties.clientId),ClientSecret:cdk.stringToCloudFormation(properties.clientSecret),RefreshToken:cdk.stringToCloudFormation(properties.refreshToken)}):properties}function CfnSkillAuthenticationConfigurationPropertyFromCloudFormation(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("clientId","ClientId",cfn_parse.FromCloudFormation.getString(properties.ClientId)),ret.addPropertyResult("clientSecret","ClientSecret",cfn_parse.FromCloudFormation.getString(properties.ClientSecret)),ret.addPropertyResult("refreshToken","RefreshToken",cfn_parse.FromCloudFormation.getString(properties.RefreshToken)),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnSkill_OverridesPropertyValidator(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("manifest",cdk.validateObject)(properties.manifest)),errors.wrap('supplied properties not correct for "OverridesProperty"')}function cfnSkillOverridesPropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnSkill_OverridesPropertyValidator(properties).assertSuccess(),{Manifest:cdk.objectToCloudFormation(properties.manifest)}):properties}function CfnSkillOverridesPropertyFromCloudFormation(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("manifest","Manifest",properties.Manifest!=null?cfn_parse.FromCloudFormation.getAny(properties.Manifest):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}function CfnSkill_SkillPackagePropertyValidator(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("overrides",CfnSkill_OverridesPropertyValidator)(properties.overrides)),errors.collect(cdk.propertyValidator("s3Bucket",cdk.requiredValidator)(properties.s3Bucket)),errors.collect(cdk.propertyValidator("s3Bucket",cdk.validateString)(properties.s3Bucket)),errors.collect(cdk.propertyValidator("s3BucketRole",cdk.validateString)(properties.s3BucketRole)),errors.collect(cdk.propertyValidator("s3Key",cdk.requiredValidator)(properties.s3Key)),errors.collect(cdk.propertyValidator("s3Key",cdk.validateString)(properties.s3Key)),errors.collect(cdk.propertyValidator("s3ObjectVersion",cdk.validateString)(properties.s3ObjectVersion)),errors.wrap('supplied properties not correct for "SkillPackageProperty"')}function cfnSkillSkillPackagePropertyToCloudFormation(properties){return cdk.canInspect(properties)?(CfnSkill_SkillPackagePropertyValidator(properties).assertSuccess(),{Overrides:cfnSkillOverridesPropertyToCloudFormation(properties.overrides),S3Bucket:cdk.stringToCloudFormation(properties.s3Bucket),S3BucketRole:cdk.stringToCloudFormation(properties.s3BucketRole),S3Key:cdk.stringToCloudFormation(properties.s3Key),S3ObjectVersion:cdk.stringToCloudFormation(properties.s3ObjectVersion)}):properties}function CfnSkillSkillPackagePropertyFromCloudFormation(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("overrides","Overrides",properties.Overrides!=null?CfnSkillOverridesPropertyFromCloudFormation(properties.Overrides):void 0),ret.addPropertyResult("s3Bucket","S3Bucket",cfn_parse.FromCloudFormation.getString(properties.S3Bucket)),ret.addPropertyResult("s3BucketRole","S3BucketRole",properties.S3BucketRole!=null?cfn_parse.FromCloudFormation.getString(properties.S3BucketRole):void 0),ret.addPropertyResult("s3Key","S3Key",cfn_parse.FromCloudFormation.getString(properties.S3Key)),ret.addPropertyResult("s3ObjectVersion","S3ObjectVersion",properties.S3ObjectVersion!=null?cfn_parse.FromCloudFormation.getString(properties.S3ObjectVersion):void 0),ret.addUnrecognizedPropertiesAsExtra(properties),ret}