handlebars.nodejs.service.mustache Maven / Gradle / Ivy
'use strict';
{{#operations}}
{{#operation}}
{{#contents}}
/**
{{#summary}}
* {{{summary}}}
{{/summary}}
{{#notes}}
* {{{notes}}}
{{/notes}}
*
{{#parameters}}
* {{paramName}} {{{dataType}}} {{{description}}}{{^required}} (optional){{/required}}
{{/parameters}}
{{^returnType}}
* no response value expected for this operation
{{/returnType}}
{{#returnType}}
* returns {{{returnType}}}
{{/returnType}}
**/
exports.{{{operationId}}} = function({{#parameters}}{{paramName}}{{#hasMore}},{{/hasMore}}{{/parameters}}) {
return new Promise(function(resolve, reject) {
{{#returnType}}
var examples = {};
{{#examples}}
examples['{{contentType}}'] = {{{example}}};
{{/examples}}
if (Object.keys(examples).length > 0) {
resolve(examples[Object.keys(examples)[0]]);
} else {
resolve();
}
{{/returnType}}
{{^returnType}}
resolve();
{{/returnType}}
});
}
{{/contents}}
{{/operation}}
{{/operations}}