|
1 | 1 | {{>licenseInfo}}
|
| 2 | +(function(root, factory) { |
| 3 | + if (typeof define === 'function' && define.amd) { |
| 4 | + // AMD. Register as an anonymous module. |
| 5 | +define(['{{#invokerPackage}}{{&invokerPackage}}/{{/invokerPackage}}ApiClient'{{#imports}}, '{{#invokerPackage}}{{&invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{&modelPackage}}/{{/modelPackage}}{{import}}'{{/imports}}], factory); |
| 6 | + } else if (typeof module === 'object' && module.exports) { |
| 7 | + // CommonJS-like environments that support module.exports, like Node. |
| 8 | + module.exports = factory(require('../ApiClient'){{#imports}}, require('../{{#modelPackage}}{{&modelPackage}}/{{/modelPackage}}{{import}}'){{/imports}}); |
| 9 | + } else { |
| 10 | + // Browser globals (root is window) |
| 11 | + if (!root.{{&moduleName}}) { |
| 12 | + root.{{&moduleName}} = {}; |
| 13 | + } |
| 14 | + root.{{&moduleName}}.{{&classname}} = factory(root.{{&moduleName}}.ApiClient{{#imports}}, root.{{&moduleName}}.{{import}}{{/imports}}); |
| 15 | + } |
| 16 | +}(this, function(ApiClient{{#imports}}, {{import}}{{/imports}}) { |
| 17 | + 'use strict'; |
2 | 18 |
|
3 |
| -{{=< >=}} |
4 |
| -import ApiClient from "../ApiClient"; |
5 |
| -<#imports>import <import> from '../<#modelPackage><&modelPackage>/</modelPackage><import>'; |
6 |
| -</imports> |
7 |
| - |
8 |
| -<#emitJSDoc>/** |
9 |
| -* <baseName> service. |
10 |
| -* @module <#invokerPackage><&invokerPackage>/</invokerPackage><#apiPackage><&apiPackage>/</apiPackage><classname> |
11 |
| -* @version <projectVersion> |
12 |
| -*/</emitJSDoc> |
13 |
| -export default class <classname> { |
| 19 | +{{#emitJSDoc}} /** |
| 20 | + * {{baseName}} service. |
| 21 | + * @module {{#invokerPackage}}{{&invokerPackage}}/{{/invokerPackage}}{{#apiPackage}}{{&apiPackage}}/{{/apiPackage}}{{classname}} |
| 22 | + * @version {{projectVersion}} |
| 23 | + */ |
14 | 24 |
|
15 |
| - <#emitJSDoc>/** |
16 |
| - * Constructs a new <&classname>. <#description> |
17 |
| - * <description></description> |
18 |
| - * @alias module:<#invokerPackage><&invokerPackage>/</invokerPackage><#apiPackage><apiPackage>/</apiPackage><classname> |
19 |
| - * @class |
20 |
| - * @param {module:<#invokerPackage><&invokerPackage>/</invokerPackage>ApiClient} [apiClient] Optional API client implementation to use, |
21 |
| - * default to {@link module:<#invokerPackage><&invokerPackage>/</invokerPackage>ApiClient#instance} if unspecified. |
22 |
| - */</emitJSDoc> |
23 |
| - constructor(apiClient) { |
24 |
| - this.apiClient = apiClient || ApiClient.instance; |
25 |
| - } |
| 25 | + /** |
| 26 | + * Constructs a new {{&classname}}. {{#description}} |
| 27 | + * {{description}}{{/description}} |
| 28 | + * @alias module:{{#invokerPackage}}{{&invokerPackage}}/{{/invokerPackage}}{{#apiPackage}}{{apiPackage}}/{{/apiPackage}}{{classname}} |
| 29 | + * @class |
| 30 | + * @param {module:{{#invokerPackage}}{{&invokerPackage}}/{{/invokerPackage}}ApiClient} [apiClient] Optional API client implementation to use, |
| 31 | + * default to {@link module:{{#invokerPackage}}{{&invokerPackage}}/{{/invokerPackage}}ApiClient#instance} if unspecified. |
| 32 | + */ |
| 33 | +{{/emitJSDoc}} var exports = function(apiClient) { |
| 34 | + this.apiClient = apiClient || ApiClient.instance; |
26 | 35 |
|
27 |
| -<#operations><#operation><#emitJSDoc><^usePromises> |
| 36 | +{{#operations}}{{#operation}}{{#emitJSDoc}}{{^usePromises}} |
28 | 37 | /**
|
29 |
| - * Callback function to receive the result of the <operationId> operation. |
30 |
| - * @callback module:<#invokerPackage><invokerPackage>/</invokerPackage><#apiPackage><apiPackage>/</apiPackage><classname>~<operationId>Callback |
| 38 | + * Callback function to receive the result of the {{operationId}} operation. |
| 39 | + * @callback module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#apiPackage}}{{apiPackage}}/{{/apiPackage}}{{classname}}~{{operationId}}Callback |
31 | 40 | * @param {String} error Error message, if any.
|
32 |
| - * @param <#vendorExtensions.x-jsdoc-type>{<&vendorExtensions.x-jsdoc-type>} data The data returned by the service call.</vendorExtensions.x-jsdoc-type><^vendorExtensions.x-jsdoc-type>data This operation does not return a value.</vendorExtensions.x-jsdoc-type> |
| 41 | + * @param {{#vendorExtensions.x-jsdoc-type}}{{braces "left"}}{{&vendorExtensions.x-jsdoc-type}}{{braces "right"}} data The data returned by the service call.{{/vendorExtensions.x-jsdoc-type}}{{^vendorExtensions.x-jsdoc-type}}data This operation does not return a value.{{/vendorExtensions.x-jsdoc-type}} |
33 | 42 | * @param {String} response The complete HTTP response.
|
34 |
| - */</usePromises> |
| 43 | + */{{/usePromises}} |
35 | 44 |
|
36 |
| - /**<#summary> |
37 |
| - * <summary></summary><#notes> |
38 |
| - * <notes></notes><#parameters><#required> |
39 |
| - * @param {<&vendorExtensions.x-jsdoc-type>} <paramName> <description></required></parameters><#hasOptionalParams> |
40 |
| - * @param {Object} opts Optional parameters<#parameters><^required> |
41 |
| - * @param {<&vendorExtensions.x-jsdoc-type>} opts.<paramName> <description><#defaultValue> (default to <.>)</defaultValue></required></parameters></hasOptionalParams><^usePromises> |
42 |
| - * @param {module:<#invokerPackage><&invokerPackage>/</invokerPackage><#apiPackage><&apiPackage>/</apiPackage><&classname>~<operationId>Callback} callback The callback function, accepting three arguments: error, data, response<#returnType> |
43 |
| - * data is of type: {@link <&vendorExtensions.x-jsdoc-type>}</returnType></usePromises><#usePromises> |
44 |
| - * @return {Promise} a {@link https://www.promisejs.org/|Promise}<#returnType>, with an object containing data of type {@link <&vendorExtensions.x-jsdoc-type>} and HTTP response</returnType><^returnType>, with an object containing HTTP response</returnType></usePromises> |
| 45 | + /**{{#summary}} |
| 46 | + * {{summary}}{{/summary}}{{#notes}} |
| 47 | + * {{notes}}{{/notes}}{{#allParams}}{{#required}} |
| 48 | + * @param {{braces "left"}}{{&vendorExtensions.x-jsdoc-type}}{{braces "right"}} {{paramName}} {{description}}{{/required}}{{/allParams}}{{#hasOptionalParams}} |
| 49 | + * @param {Object} opts Optional parameters{{#allParams}}{{^required}} |
| 50 | + * @param {{braces "left"}}{{&vendorExtensions.x-jsdoc-type}}{{braces "right"}} opts.{{paramName}} {{description}}{{#defaultValue}} (default to {{.}}){{/defaultValue}}{{/required}}{{/allParams}}{{/hasOptionalParams}}{{^usePromises}} |
| 51 | + * @param {module:{{#invokerPackage}}{{&invokerPackage}}/{{/invokerPackage}}{{#apiPackage}}{{&apiPackage}}/{{/apiPackage}}{{&classname}}~{{operationId}}Callback} callback The callback function, accepting three arguments: error, data, response{{#returnType}} |
| 52 | + * data is of type: {{braces "left"}}@link {{&vendorExtensions.x-jsdoc-type}}{{braces "right"}}{{/returnType}}{{/usePromises}}{{#usePromises}} |
| 53 | + * @return {Promise} a {@link https://www.promisejs.org/|Promise{{braces "right"}}{{#returnType}}, with an object containing data of type {@link {{&vendorExtensions.x-jsdoc-type}}{{braces "right"}} and HTTP response{{/returnType}}{{^returnType}}, with an object containing HTTP response{{/returnType}}{{/usePromises}} |
45 | 54 | */
|
46 |
| -</emitJSDoc> <operationId><#usePromises>WithHttpInfo</usePromises>(<vendorExtensions.x-codegen-argList>) {<#hasOptionalParams> |
47 |
| - opts = opts || {};</hasOptionalParams> |
48 |
| - let postBody = <#bodyParam><#required><paramName></required><^required>opts['<paramName>']</required></bodyParam><^bodyParam>null</bodyParam>; |
49 |
| -<#parameters><#required> |
50 |
| - // verify the required parameter '<paramName>' is set |
51 |
| - if (<paramName> === undefined || <paramName> === null) { |
52 |
| - throw new Error("Missing the required parameter '<paramName>' when calling <operationId>"); |
| 55 | +{{/emitJSDoc}} this.{{operationId}}{{#usePromises}}WithHttpInfo{{/usePromises}} = function({{vendorExtensions.x-codegen-arg-list}}{{^usePromises}}{{#hasParams}}, {{/hasParams}}callback{{/usePromises}}) {{braces "left"}}{{#hasOptionalParams}} |
| 56 | + opts = opts || {};{{/hasOptionalParams}} |
| 57 | + var postBody = {{#bodyParam}}{{#required}}{{paramName}}{{/required}}{{^required}}opts['{{paramName}}']{{/required}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; |
| 58 | +{{#allParams}}{{#required}} |
| 59 | + // verify the required parameter '{{paramName}}' is set |
| 60 | + if ({{paramName}} === undefined || {{paramName}} === null) { |
| 61 | + throw new Error("Missing the required parameter '{{paramName}}' when calling {{operationId}}"); |
53 | 62 | }
|
54 |
| -</required></parameters> |
| 63 | +{{/required}}{{/allParams}} |
55 | 64 |
|
56 |
| - let pathParams = {<#pathParams> |
57 |
| - '<baseName>': <#required><paramName></required><^required>opts['<paramName>']</required><#hasMore>,</hasMore></pathParams> |
| 65 | + var pathParams = {{braces "left"}}{{#pathParams}} |
| 66 | + '{{baseName}}': {{#required}}{{paramName}}{{/required}}{{^required}}opts['{{paramName}}']{{/required}}{{#hasMore}},{{/hasMore}}{{/pathParams}} |
| 67 | + }; |
| 68 | + let queryParams = {{braces "left"}}{{#queryParams}} |
| 69 | + '{{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}} |
58 | 70 | };
|
59 |
| - let queryParams = {<#queryParams> |
60 |
| - '<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> |
| 71 | + var collectionQueryParams = {{braces "left"}}{{#queryParams}}{{#collectionFormat}} |
| 72 | + '{{baseName}}': { |
| 73 | + value: {{#required}}{{paramName}}{{/required}}{{^required}}opts['{{paramName}}']{{/required}}, |
| 74 | + collectionFormat: '{{collectionFormat}}' |
| 75 | + },{{/collectionFormat}}{{/queryParams}} |
61 | 76 | };
|
62 |
| - let headerParams = {<#headerParams> |
63 |
| - '<baseName>': <#required><paramName></required><^required>opts['<paramName>']</required><#hasMore>,</hasMore></headerParams> |
| 77 | + var headerParams = {{braces "left"}}{{#headerParams}} |
| 78 | + '{{baseName}}': {{#required}}{{paramName}}{{/required}}{{^required}}opts['{{paramName}}']{{/required}}{{#hasMore}},{{/hasMore}}{{/headerParams}} |
64 | 79 | };
|
65 |
| - let formParams = {<#formParams> |
66 |
| - '<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> |
| 80 | + var formParams = {{braces "left"}}{{#formParams}} |
| 81 | + '{{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}} |
67 | 82 | };
|
68 | 83 |
|
69 |
| - let authNames = [<#authMethods>'<name>'<#hasMore>, </hasMore></authMethods>]; |
70 |
| - let contentTypes = [<#consumes>'<& mediaType>'<#hasMore>, </hasMore></consumes>]; |
71 |
| - let accepts = [<#produces>'<& mediaType>'<#hasMore>, </hasMore></produces>]; |
72 |
| - let returnType = <#returnType><&returnType></returnType><^returnType>null</returnType>; |
| 84 | + var authNames = [{{#authMethods}}'{{name}}'{{#hasMore}}, {{/hasMore}}{{/authMethods}}]; |
| 85 | + var contentTypes = [{{#consumes}}'{{& mediaType}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}]; |
| 86 | + var accepts = [{{#produces}}'{{& mediaType}}'{{#hasMore}}, {{/hasMore}}{{/produces}}]; |
| 87 | + var returnType = {{#returnType}}{{&returnType}}{{/returnType}}{{^returnType}}null{{/returnType}}; |
73 | 88 |
|
74 | 89 | return this.apiClient.callApi(
|
75 |
| - '<&path>', '<httpMethod>', |
76 |
| - pathParams, queryParams, headerParams, formParams, postBody, |
77 |
| - authNames, contentTypes, accepts, returnType<^usePromises>, callback</usePromises> |
| 90 | + '{{&path}}', '{{httpMethod}}', |
| 91 | + pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, |
| 92 | + authNames, contentTypes, accepts, returnType{{^usePromises}}, callback{{/usePromises}} |
78 | 93 | );
|
79 | 94 | }
|
80 |
| -<#usePromises> |
81 |
| - <#emitJSDoc> |
| 95 | +{{#usePromises}} |
| 96 | + {{#emitJSDoc}} |
82 | 97 |
|
83 |
| - /**<#summary> |
84 |
| - * <summary></summary><#notes> |
85 |
| - * <notes></notes><#parameters><#required> |
86 |
| - * @param {<&vendorExtensions.x-jsdoc-type>} <paramName> <description></required></parameters><#hasOptionalParams> |
87 |
| - * @param {Object} opts Optional parameters<#parameters><^required> |
88 |
| - * @param {<&vendorExtensions.x-jsdoc-type>} opts.<paramName> <description><#defaultValue> (default to <.>)</defaultValue></required></parameters></hasOptionalParams><^usePromises> |
89 |
| - * @param {module:<#invokerPackage><&invokerPackage>/</invokerPackage><#apiPackage><&apiPackage>/</apiPackage><&classname>~<operationId>Callback} callback The callback function, accepting three arguments: error, data, response<#returnType> |
90 |
| - * data is of type: {@link <&vendorExtensions.x-jsdoc-type>}</returnType></usePromises><#usePromises> |
91 |
| - * @return {Promise} a {@link https://www.promisejs.org/|Promise}<#returnType>, with data of type {@link <&vendorExtensions.x-jsdoc-type>}</returnType></usePromises> |
| 98 | + /**{{#summary}} |
| 99 | + * {{summary}}{{/summary}}{{#notes}} |
| 100 | + * {{notes}}{{/notes}}{{#allParams}}{{#required}} |
| 101 | + * @param {{braces "left"}}{{&vendorExtensions.x-jsdoc-type}}{{braces "right"}} {{paramName}} {{description}}{{/required}}{{/allParams}}{{#hasOptionalParams}} |
| 102 | + * @param {Object} opts Optional parameters{{#allParams}}{{^required}} |
| 103 | + * @param {{braces "left"}}{{&vendorExtensions.x-jsdoc-type}}{{braces "right"}} opts.{{paramName}} {{description}}{{#defaultValue}} (default to {{.}}){{/defaultValue}}{{/required}}{{/allParams}}{{/hasOptionalParams}}{{^usePromises}} |
| 104 | + * @param {module:{{#invokerPackage}}{{&invokerPackage}}/{{/invokerPackage}}{{#apiPackage}}{{&apiPackage}}/{{/apiPackage}}{{&classname}}~{{operationId}}Callback} callback The callback function, accepting three arguments: error, data, response{{#returnType}} |
| 105 | + * data is of type: {@link {{&vendorExtensions.x-jsdoc-type}}{{braces "right"}}{{/returnType}}{{/usePromises}}{{#usePromises}} |
| 106 | + * @return {Promise} a {@link https://www.promisejs.org/|Promise}{{#returnType}}, with data of type {@link {{&vendorExtensions.x-jsdoc-type}}{{braces "right"}}{{/returnType}}{{/usePromises}} |
92 | 107 | */
|
93 |
| -</emitJSDoc> <operationId>(<vendorExtensions.x-codegen-argList>) { |
94 |
| - return this.<operationId>WithHttpInfo(<vendorExtensions.x-codegen-argList>) |
| 108 | +{{/emitJSDoc}} this.{{operationId}} = function({{vendorExtensions.x-codegen-arg-list}}) { |
| 109 | + return this.{{operationId}}WithHttpInfo({{vendorExtensions.x-codegen-arg-list}}) |
95 | 110 | .then(function(response_and_data) {
|
96 | 111 | return response_and_data.data;
|
97 | 112 | });
|
98 | 113 | }
|
99 |
| -</usePromises> |
100 |
| -</operation></operations> |
| 114 | +{{/usePromises}} |
| 115 | +{{/operation}}{{/operations}} }; |
101 | 116 |
|
102 |
| -} |
103 |
| -<={{ }}=> |
| 117 | + return exports; |
| 118 | +})); |
0 commit comments