forked from loafle/openapi-generator-original
91 lines
5.0 KiB
Plaintext
91 lines
5.0 KiB
Plaintext
{{=< >=}}(function(root, factory) {
|
|
if (typeof define === 'function' && define.amd) {
|
|
// AMD. Register as an anonymous module.
|
|
define(['../ApiClient'<#imports>, '../<#modelPackage><modelPackage>/</modelPackage><import>'</imports>], factory);
|
|
} else if (typeof module === 'object' && module.exports) {
|
|
// CommonJS-like environments that support module.exports, like Node.
|
|
module.exports = factory(require('../ApiClient')<#imports>, require('../<#modelPackage><modelPackage>/</modelPackage><import>')</imports>);
|
|
} else {
|
|
// Browser globals (root is window)
|
|
if (!root.<moduleName>) {
|
|
root.<moduleName> = {};
|
|
}
|
|
root.<moduleName>.<classname> = factory(root.<moduleName>.ApiClient<#imports>, root.<moduleName>.<import></imports>);
|
|
}
|
|
}(this, function(ApiClient<#imports>, <import></imports>) {
|
|
'use strict';
|
|
|
|
<#emitJSDoc> /**
|
|
* <baseName> service.
|
|
* @module <#apiPackage><apiPackage>/</apiPackage><classname>
|
|
* @version <projectVersion>
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new <classname>. <#description>
|
|
* <description></description>
|
|
* @alias module:<#apiPackage><apiPackage>/</apiPackage><classname>
|
|
* @class
|
|
* @param {module:ApiClient} apiClient Optional API client implementation to use, default to {@link module:ApiClient#instance}
|
|
* if unspecified.
|
|
*/
|
|
</emitJSDoc> var exports = function(apiClient) {
|
|
this.apiClient = apiClient || ApiClient.instance;
|
|
|
|
<#operations><#operation><#emitJSDoc><^usePromises>
|
|
/**
|
|
* Callback function to receive the result of the <nickname> operation.
|
|
* @callback module:<#apiPackage><apiPackage>/</apiPackage><classname>~<nickname>Callback
|
|
* @param {String} error Error message, if any.
|
|
* @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>
|
|
* @param {String} response The complete HTTP response.
|
|
*/</usePromises>
|
|
|
|
/**<#summary>
|
|
* <summary></summary><#notes>
|
|
* <notes></notes><#allParams><#required>
|
|
* @param <&vendorExtensions.x-jsdoc-type> <paramName> <description></required></allParams><#hasOptionalParams>
|
|
* @param {Object} opts Optional parameters<#allParams><^required>
|
|
* @param <&vendorExtensions.x-jsdoc-type> opts.<paramName> <description><#defaultValue> (default to <.>)</defaultValue></required></allParams></hasOptionalParams><^usePromises>
|
|
* @param {module:<#apiPackage><apiPackage>/</apiPackage><classname>~<nickname>Callback} callback The callback function, accepting three arguments: error, data, response</usePromises><#returnType>
|
|
* data is of type: <&vendorExtensions.x-jsdoc-type></returnType>
|
|
*/
|
|
</emitJSDoc> this.<nickname> = function(<vendorExtensions.x-codegen-argList>) {<#hasOptionalParams>
|
|
opts = opts || {};</hasOptionalParams>
|
|
var postBody = <#bodyParam><#required><paramName></required><^required>opts['<paramName>']</required></bodyParam><^bodyParam>null</bodyParam>;
|
|
<#allParams><#required>
|
|
// verify the required parameter '<paramName>' is set
|
|
if (<paramName> == undefined || <paramName> == null) {
|
|
throw "Missing the required parameter '<paramName>' when calling <nickname>";
|
|
}
|
|
</required></allParams>
|
|
|
|
var pathParams = {<#pathParams>
|
|
'<baseName>': <#required><paramName></required><^required>opts['<paramName>']</required><#hasMore>,</hasMore></pathParams>
|
|
};
|
|
var queryParams = {<#queryParams>
|
|
'<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>
|
|
};
|
|
var headerParams = {<#headerParams>
|
|
'<baseName>': <#required><paramName></required><^required>opts['<paramName>']</required><#hasMore>,</hasMore></headerParams>
|
|
};
|
|
var formParams = {<#formParams>
|
|
'<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>
|
|
};
|
|
|
|
var authNames = [<#authMethods>'<name>'<#hasMore>, </hasMore></authMethods>];
|
|
var contentTypes = [<#consumes>'<mediaType>'<#hasMore>, </hasMore></consumes>];
|
|
var accepts = [<#produces>'<mediaType>'<#hasMore>, </hasMore></produces>];
|
|
var returnType = <#returnType><&returnType></returnType><^returnType>null</returnType>;
|
|
|
|
return this.apiClient.callApi(
|
|
'<&path>', '<httpMethod>',
|
|
pathParams, queryParams, headerParams, formParams, postBody,
|
|
authNames, contentTypes, accepts, returnType<^usePromises>, callback</usePromises>
|
|
);
|
|
}
|
|
</operation></operations> };
|
|
|
|
return exports;
|
|
}));<={{ }}=>
|