Created
May 8, 2019 08:12
-
-
Save webislife/039b1199c2414cafd082bb163727e9c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%_ let pathNames = Object.keys(paths); -%> | |
/* eslint-disable */ | |
/** | |
* Class Swagger API | |
*/ | |
export class SwaggerApi { | |
<%_ for(let i = 0; i < pathNames.length; ++i) { | |
let path = paths[pathNames[i]]; -%> | |
<% for(let action in path) { | |
let endpoint = path[action]; | |
%> | |
/** | |
* <%=endpoint.summary%> | |
* @param {Object} payload query <%=(action === 'get') ? 'params' : 'data'%> | |
* @returns {Object} {<%=Object.keys(endpoint.responses["200"].content["application/json"].schema.properties).join(", ")%>} | |
*/ | |
<%=endpoint.operationId%>(payload) { | |
return this.Request.<%=action%>("/api/v4<%=pathNames[i]%>/", | |
{ | |
<%=(action === 'get') ? 'params' : 'data'%>: payload | |
} | |
); | |
} <% } } %> | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment