|
1 |
| -(function(root, factory) { |
| 1 | +{{=< >=}}(function(root, factory) { |
2 | 2 | if (typeof define === 'function' && define.amd) {
|
3 | 3 | // AMD. Register as an anonymous module.
|
4 |
| - define(['../ApiClient'{{#imports}}, '../model/{{import}}'{{/imports}}], factory); |
| 4 | + define(['../ApiClient'<#imports>, '../model/<import>'</imports>], factory); |
5 | 5 | } else if (typeof module === 'object' && module.exports) {
|
6 | 6 | // CommonJS-like environments that support module.exports, like Node.
|
7 |
| - module.exports = factory(require('../ApiClient'){{#imports}}, require('../model/{{import}}'){{/imports}}); |
| 7 | + module.exports = factory(require('../ApiClient')<#imports>, require('../model/<import>')</imports>); |
8 | 8 | } else {
|
9 | 9 | // Browser globals (root is window)
|
10 |
| - if (!root.{{moduleName}}) { |
11 |
| - root.{{moduleName}} = {}; |
| 10 | + if (!root.<moduleName>) { |
| 11 | + root.<moduleName> = {}; |
12 | 12 | }
|
13 |
| - root.{{moduleName}}.{{classname}} = factory(root.{{moduleName}}.ApiClient{{#imports}}, root.{{moduleName}}.{{import}}{{/imports}}); |
| 13 | + root.<moduleName>.<classname> = factory(root.<moduleName>.ApiClient<#imports>, root.<moduleName>.<import></imports>); |
14 | 14 | }
|
15 |
| -}(this, function(ApiClient{{#imports}}, {{import}}{{/imports}}) { |
| 15 | +}(this, function(ApiClient<#imports>, <import></imports>) { |
16 | 16 | 'use strict';
|
17 | 17 |
|
18 |
| - var {{classname}} = function {{classname}}(apiClient) { |
| 18 | + var <classname> = function <classname>(apiClient) { |
19 | 19 | this.apiClient = apiClient || ApiClient.default;
|
20 | 20 |
|
21 | 21 | var self = this;
|
22 |
| - {{#operations}} |
23 |
| - {{#operation}} |
| 22 | + <#operations> |
| 23 | + <#operation> |
24 | 24 | /**
|
25 |
| - * {{summary}} |
26 |
| - * {{notes}} |
27 |
| - {{#allParams}} * @param {{=<% %>=}}{<% dataType %>} <%={{ }}=%> {{paramName}} {{description}} |
28 |
| - {{/allParams}} {{^usePromises}}* @param {function} callback the callback function, accepting three arguments: error, data, response{{/usePromises}}{{#returnType}} |
29 |
| - * data is of type: {{{returnType}}}{{/returnType}} |
| 25 | + * <summary> |
| 26 | + * <notes><#allParams> |
| 27 | + * @param {<dataType>} <#required><paramName></required><^required>opts['<paramName>']</required> <description></allParams><^usePromises> |
| 28 | + * @param {function} callback the callback function, accepting three arguments: error, data, response</usePromises><#returnType> |
| 29 | + * data is of type: <&returnType></returnType> |
30 | 30 | */
|
31 |
| - self.{{nickname}} = function({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{^usePromises}}{{#hasParams}}, {{/hasParams}}callback{{/usePromises}}) { |
32 |
| - var postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; |
33 |
| - {{#allParams}}{{#required}} |
34 |
| - // verify the required parameter '{{paramName}}' is set |
35 |
| - if ({{paramName}} == null) { |
36 |
| - throw "Missing the required parameter '{{paramName}}' when calling {{nickname}}"; |
| 31 | + self.<nickname> = function(<vendorExtensions.x-codegen-argList>) {<#hasOptionalParams> |
| 32 | + opts = opts || {};</hasOptionalParams> |
| 33 | + var postBody = <#bodyParam><#required><paramName></required><^required>opts['<paramName>']</required></bodyParam><^bodyParam>null</bodyParam>; |
| 34 | + <#allParams><#required> |
| 35 | + // verify the required parameter '<paramName>' is set |
| 36 | + if (<paramName> == null) { |
| 37 | + throw "Missing the required parameter '<paramName>' when calling <nickname>"; |
37 | 38 | }
|
38 |
| - {{/required}}{{/allParams}} |
| 39 | + </required></allParams> |
39 | 40 |
|
40 |
| - {{=< >=}} |
41 | 41 | var pathParams = {<#pathParams>
|
42 |
| - '<baseName>': <paramName><#hasMore>,</hasMore></pathParams> |
| 42 | + '<baseName>': <#required><paramName></required><^required>opts['<paramName>']</required><#hasMore>,</hasMore></pathParams> |
43 | 43 | };
|
44 | 44 | var queryParams = {<#queryParams>
|
45 |
| - '<baseName>': <#collectionFormat>this.apiClient.buildCollectionParam(<paramName>, '<collectionFormat>')</collectionFormat><^collectionFormat><paramName></collectionFormat><#hasMore>,</hasMore></queryParams> |
| 45 | + '<baseName>': <#collectionFormat>this.apiClient.buildCollectionParam(<#required><paramName></required><^required>opts['<paramName>']</required>, '<collectionFormat>')</collectionFormat><^collectionFormat><#required><paramName></required><^required>opts['<paramName>']</required></collectionFormat><#hasMore>,</hasMore></queryParams> |
46 | 46 | };
|
47 | 47 | var headerParams = {<#headerParams>
|
48 |
| - '<baseName>': <paramName><#hasMore>,</hasMore></headerParams> |
| 48 | + '<baseName>': <#required><paramName></required><^required>opts['<paramName>']</required><#hasMore>,</hasMore></headerParams> |
49 | 49 | };
|
50 | 50 | var formParams = {<#formParams>
|
51 |
| - '<baseName>': <#collectionFormat>this.apiClient.buildCollectionParam(<paramName>, '<collectionFormat>')</collectionFormat><^collectionFormat><paramName></collectionFormat><#hasMore>,</hasMore></formParams> |
| 51 | + '<baseName>': <#collectionFormat>this.apiClient.buildCollectionParam(<#required><paramName></required><^required>opts['<paramName>']</required>, '<collectionFormat>')</collectionFormat><^collectionFormat><#required><paramName></required><^required>opts['<paramName>']</required></collectionFormat><#hasMore>,</hasMore></formParams> |
52 | 52 | };
|
53 | 53 |
|
54 | 54 | var authNames = [<#authMethods>'<name>'<#hasMore>, </hasMore></authMethods>];
|
|
61 | 61 | pathParams, queryParams, headerParams, formParams, postBody,
|
62 | 62 | authNames, contentTypes, accepts, returnType<^usePromises>, callback</usePromises>
|
63 | 63 | );
|
64 |
| - <={{ }}=> |
| 64 | + |
65 | 65 | }
|
66 |
| - {{/operation}} |
67 |
| - {{/operations}} |
| 66 | + </operation> |
| 67 | + </operations> |
68 | 68 | };
|
69 | 69 |
|
70 |
| - return {{classname}}; |
71 |
| -})); |
| 70 | + return <classname>; |
| 71 | +}));<={{ }}=> |
0 commit comments