@amaabca/aws-lex-custom-resources
Version:
AWS Lex infrastructure as code via the CDK
27 lines (26 loc) • 803 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const __1 = require("..");
class default_1 {
constructor(scope, id, serviceToken, props) {
this.scope = scope;
this.id = id;
this.serviceToken = serviceToken;
this.props = props;
this.locales = [];
}
addLocale(localeProps) {
const locale = new __1.LexBotLocale(localeProps);
this.locales.push(locale);
return locale;
}
definition() {
const configuration = { ...this.props };
configuration['CR.botLocales'] = this.locales.map((l) => l.definition());
return configuration;
}
build() {
return new __1.LexBot(this.scope, this.id, this.serviceToken, this.definition());
}
}
exports.default = default_1;