Add "servers" support to operation, path in the JS client (#2060)

* add operation, path servers to js es6 client

* add servers support to operation, path in js es5

* fix null check
This commit is contained in:
William Cheng
2019-02-09 22:25:01 +08:00
committed by GitHub
parent 8f5fa4df83
commit 348c22c883
40 changed files with 322 additions and 643 deletions

View File

@@ -112,19 +112,26 @@ class ApiClient {
return param.toString();
}
/**
/**
* Builds full URL by appending the given path to the base URL and replacing path parameter place-holders with parameter values.
* NOTE: query parameters are not handled here.
* @param {String} path The path to append to the base URL.
* @param {Object} pathParams The parameter values to append.
* @param {String} apiBasePath Base path defined in the path, operation level to override the default one
* @returns {String} The encoded path with parameter values substituted.
*/
buildUrl(path, pathParams) {
buildUrl(path, pathParams, apiBasePath) {
if (!path.match(/^\//)) {
path = '/' + path;
}
var url = this.basePath + path;
// use API (operation, path) base path if defined
if (apiBasePath !== null && apiBasePath !== undefined) {
url = apiBasePath + path;
}
url = url.replace(/\{([\w-]+)\}/g, (fullMatch, key) => {
var value;
if (pathParams.hasOwnProperty(key)) {
@@ -308,7 +315,7 @@ class ApiClient {
});
}
/**
/**
* Deserializes an HTTP response body into a value of the specified type.
* @param {Object} response A SuperAgent response object.
* @param {(String|Array.<String>|Object.<String, Object>|Function)} returnType The type to return. Pass a string for simple types
@@ -333,9 +340,8 @@ class ApiClient {
return ApiClient.convertToType(data, returnType);
}
/**
/**
* Invokes the REST service using the supplied settings and parameters.
* @param {String} path The base URL to invoke.
* @param {String} httpMethod The HTTP method to use.
@@ -349,13 +355,14 @@ class ApiClient {
* @param {Array.<String>} accepts An array of acceptable response MIME types.
* @param {(String|Array|ObjectFunction)} returnType The required type to return; can be a string for simple types or the
* constructor for a complex type.
* @param {String} apiBasePath base path defined in the operation/path level to override the default one
* @returns {Promise} A {@link https://www.promisejs.org/|Promise} object.
*/
callApi(path, httpMethod, pathParams,
queryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts,
returnType) {
returnType, apiBasePath) {
var url = this.buildUrl(path, pathParams);
var url = this.buildUrl(path, pathParams, apiBasePath);
var request = superagent(httpMethod, url);
if (this.plugins !== null) {
@@ -462,7 +469,6 @@ class ApiClient {
});
});
}
/**

View File

@@ -43,13 +43,11 @@ export default class AnotherFakeApi {
*/
call123testSpecialTagsWithHttpInfo(body) {
let postBody = body;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling call123testSpecialTags");
}
let pathParams = {
};
let queryParams = {
@@ -63,11 +61,10 @@ export default class AnotherFakeApi {
let contentTypes = ['application/json'];
let accepts = ['application/json'];
let returnType = Client;
return this.apiClient.callApi(
'/another-fake/dummy', 'PATCH',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}

View File

@@ -47,13 +47,11 @@ export default class FakeApi {
*/
createXmlItemWithHttpInfo(xmlItem) {
let postBody = xmlItem;
// verify the required parameter 'xmlItem' is set
if (xmlItem === undefined || xmlItem === null) {
throw new Error("Missing the required parameter 'xmlItem' when calling createXmlItem");
}
let pathParams = {
};
let queryParams = {
@@ -67,11 +65,10 @@ export default class FakeApi {
let contentTypes = ['application/xml', 'application/xml; charset=utf-8', 'application/xml; charset=utf-16', 'text/xml', 'text/xml; charset=utf-8', 'text/xml; charset=utf-16'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/fake/create_xml_item', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}
@@ -99,7 +96,6 @@ export default class FakeApi {
opts = opts || {};
let postBody = opts['body'];
let pathParams = {
};
let queryParams = {
@@ -113,11 +109,10 @@ export default class FakeApi {
let contentTypes = [];
let accepts = ['*/*'];
let returnType = 'Boolean';
return this.apiClient.callApi(
'/fake/outer/boolean', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}
@@ -145,7 +140,6 @@ export default class FakeApi {
opts = opts || {};
let postBody = opts['body'];
let pathParams = {
};
let queryParams = {
@@ -159,11 +153,10 @@ export default class FakeApi {
let contentTypes = [];
let accepts = ['*/*'];
let returnType = OuterComposite;
return this.apiClient.callApi(
'/fake/outer/composite', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}
@@ -191,7 +184,6 @@ export default class FakeApi {
opts = opts || {};
let postBody = opts['body'];
let pathParams = {
};
let queryParams = {
@@ -205,11 +197,10 @@ export default class FakeApi {
let contentTypes = [];
let accepts = ['*/*'];
let returnType = 'Number';
return this.apiClient.callApi(
'/fake/outer/number', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}
@@ -237,7 +228,6 @@ export default class FakeApi {
opts = opts || {};
let postBody = opts['body'];
let pathParams = {
};
let queryParams = {
@@ -251,11 +241,10 @@ export default class FakeApi {
let contentTypes = [];
let accepts = ['*/*'];
let returnType = 'String';
return this.apiClient.callApi(
'/fake/outer/string', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}
@@ -280,13 +269,11 @@ export default class FakeApi {
*/
testBodyWithFileSchemaWithHttpInfo(body) {
let postBody = body;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling testBodyWithFileSchema");
}
let pathParams = {
};
let queryParams = {
@@ -300,11 +287,10 @@ export default class FakeApi {
let contentTypes = ['application/json'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/fake/body-with-file-schema', 'PUT',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}
@@ -328,18 +314,15 @@ export default class FakeApi {
*/
testBodyWithQueryParamsWithHttpInfo(query, body) {
let postBody = body;
// verify the required parameter 'query' is set
if (query === undefined || query === null) {
throw new Error("Missing the required parameter 'query' when calling testBodyWithQueryParams");
}
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling testBodyWithQueryParams");
}
let pathParams = {
};
let queryParams = {
@@ -354,11 +337,10 @@ export default class FakeApi {
let contentTypes = ['application/json'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/fake/body-with-query-params', 'PUT',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}
@@ -383,13 +365,11 @@ export default class FakeApi {
*/
testClientModelWithHttpInfo(body) {
let postBody = body;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling testClientModel");
}
let pathParams = {
};
let queryParams = {
@@ -403,11 +383,10 @@ export default class FakeApi {
let contentTypes = ['application/json'];
let accepts = ['application/json'];
let returnType = Client;
return this.apiClient.callApi(
'/fake', 'PATCH',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}
@@ -448,28 +427,23 @@ export default class FakeApi {
testEndpointParametersWithHttpInfo(_number, _double, patternWithoutDelimiter, _byte, opts) {
opts = opts || {};
let postBody = null;
// verify the required parameter '_number' is set
if (_number === undefined || _number === null) {
throw new Error("Missing the required parameter '_number' when calling testEndpointParameters");
}
// verify the required parameter '_double' is set
if (_double === undefined || _double === null) {
throw new Error("Missing the required parameter '_double' when calling testEndpointParameters");
}
// verify the required parameter 'patternWithoutDelimiter' is set
if (patternWithoutDelimiter === undefined || patternWithoutDelimiter === null) {
throw new Error("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters");
}
// verify the required parameter '_byte' is set
if (_byte === undefined || _byte === null) {
throw new Error("Missing the required parameter '_byte' when calling testEndpointParameters");
}
let pathParams = {
};
let queryParams = {
@@ -497,11 +471,10 @@ export default class FakeApi {
let contentTypes = ['application/x-www-form-urlencoded'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/fake', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}
@@ -551,7 +524,6 @@ export default class FakeApi {
opts = opts || {};
let postBody = null;
let pathParams = {
};
let queryParams = {
@@ -573,11 +545,10 @@ export default class FakeApi {
let contentTypes = ['application/x-www-form-urlencoded'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/fake', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}
@@ -618,23 +589,19 @@ export default class FakeApi {
testGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, opts) {
opts = opts || {};
let postBody = null;
// verify the required parameter 'requiredStringGroup' is set
if (requiredStringGroup === undefined || requiredStringGroup === null) {
throw new Error("Missing the required parameter 'requiredStringGroup' when calling testGroupParameters");
}
// verify the required parameter 'requiredBooleanGroup' is set
if (requiredBooleanGroup === undefined || requiredBooleanGroup === null) {
throw new Error("Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters");
}
// verify the required parameter 'requiredInt64Group' is set
if (requiredInt64Group === undefined || requiredInt64Group === null) {
throw new Error("Missing the required parameter 'requiredInt64Group' when calling testGroupParameters");
}
let pathParams = {
};
let queryParams = {
@@ -654,11 +621,10 @@ export default class FakeApi {
let contentTypes = [];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/fake', 'DELETE',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}
@@ -689,13 +655,11 @@ export default class FakeApi {
*/
testInlineAdditionalPropertiesWithHttpInfo(param) {
let postBody = param;
// verify the required parameter 'param' is set
if (param === undefined || param === null) {
throw new Error("Missing the required parameter 'param' when calling testInlineAdditionalProperties");
}
let pathParams = {
};
let queryParams = {
@@ -709,11 +673,10 @@ export default class FakeApi {
let contentTypes = ['application/json'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/fake/inline-additionalProperties', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}
@@ -738,18 +701,15 @@ export default class FakeApi {
*/
testJsonFormDataWithHttpInfo(param, param2) {
let postBody = null;
// verify the required parameter 'param' is set
if (param === undefined || param === null) {
throw new Error("Missing the required parameter 'param' when calling testJsonFormData");
}
// verify the required parameter 'param2' is set
if (param2 === undefined || param2 === null) {
throw new Error("Missing the required parameter 'param2' when calling testJsonFormData");
}
let pathParams = {
};
let queryParams = {
@@ -765,11 +725,10 @@ export default class FakeApi {
let contentTypes = ['application/x-www-form-urlencoded'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/fake/jsonFormData', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}

View File

@@ -43,13 +43,11 @@ export default class FakeClassnameTags123Api {
*/
testClassnameWithHttpInfo(body) {
let postBody = body;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling testClassname");
}
let pathParams = {
};
let queryParams = {
@@ -63,11 +61,10 @@ export default class FakeClassnameTags123Api {
let contentTypes = ['application/json'];
let accepts = ['application/json'];
let returnType = Client;
return this.apiClient.callApi(
'/fake_classname_test', 'PATCH',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}

View File

@@ -43,13 +43,11 @@ export default class PetApi {
*/
addPetWithHttpInfo(body) {
let postBody = body;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling addPet");
}
let pathParams = {
};
let queryParams = {
@@ -63,11 +61,10 @@ export default class PetApi {
let contentTypes = ['application/json', 'application/xml'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/pet', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}
@@ -94,13 +91,11 @@ export default class PetApi {
deletePetWithHttpInfo(petId, opts) {
opts = opts || {};
let postBody = null;
// verify the required parameter 'petId' is set
if (petId === undefined || petId === null) {
throw new Error("Missing the required parameter 'petId' when calling deletePet");
}
let pathParams = {
'petId': petId
};
@@ -116,11 +111,10 @@ export default class PetApi {
let contentTypes = [];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/pet/{petId}', 'DELETE',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}
@@ -147,13 +141,11 @@ export default class PetApi {
*/
findPetsByStatusWithHttpInfo(status) {
let postBody = null;
// verify the required parameter 'status' is set
if (status === undefined || status === null) {
throw new Error("Missing the required parameter 'status' when calling findPetsByStatus");
}
let pathParams = {
};
let queryParams = {
@@ -168,11 +160,10 @@ export default class PetApi {
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let returnType = [Pet];
return this.apiClient.callApi(
'/pet/findByStatus', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}
@@ -198,13 +189,11 @@ export default class PetApi {
*/
findPetsByTagsWithHttpInfo(tags) {
let postBody = null;
// verify the required parameter 'tags' is set
if (tags === undefined || tags === null) {
throw new Error("Missing the required parameter 'tags' when calling findPetsByTags");
}
let pathParams = {
};
let queryParams = {
@@ -219,11 +208,10 @@ export default class PetApi {
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let returnType = [Pet];
return this.apiClient.callApi(
'/pet/findByTags', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}
@@ -249,13 +237,11 @@ export default class PetApi {
*/
getPetByIdWithHttpInfo(petId) {
let postBody = null;
// verify the required parameter 'petId' is set
if (petId === undefined || petId === null) {
throw new Error("Missing the required parameter 'petId' when calling getPetById");
}
let pathParams = {
'petId': petId
};
@@ -270,11 +256,10 @@ export default class PetApi {
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let returnType = Pet;
return this.apiClient.callApi(
'/pet/{petId}', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}
@@ -299,13 +284,11 @@ export default class PetApi {
*/
updatePetWithHttpInfo(body) {
let postBody = body;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling updatePet");
}
let pathParams = {
};
let queryParams = {
@@ -319,11 +302,10 @@ export default class PetApi {
let contentTypes = ['application/json', 'application/xml'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/pet', 'PUT',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}
@@ -351,13 +333,11 @@ export default class PetApi {
updatePetWithFormWithHttpInfo(petId, opts) {
opts = opts || {};
let postBody = null;
// verify the required parameter 'petId' is set
if (petId === undefined || petId === null) {
throw new Error("Missing the required parameter 'petId' when calling updatePetWithForm");
}
let pathParams = {
'petId': petId
};
@@ -374,11 +354,10 @@ export default class PetApi {
let contentTypes = ['application/x-www-form-urlencoded'];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/pet/{petId}', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}
@@ -409,13 +388,11 @@ export default class PetApi {
uploadFileWithHttpInfo(petId, opts) {
opts = opts || {};
let postBody = null;
// verify the required parameter 'petId' is set
if (petId === undefined || petId === null) {
throw new Error("Missing the required parameter 'petId' when calling uploadFile");
}
let pathParams = {
'petId': petId
};
@@ -432,11 +409,10 @@ export default class PetApi {
let contentTypes = ['multipart/form-data'];
let accepts = ['application/json'];
let returnType = ApiResponse;
return this.apiClient.callApi(
'/pet/{petId}/uploadImage', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}
@@ -467,18 +443,15 @@ export default class PetApi {
uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, opts) {
opts = opts || {};
let postBody = null;
// verify the required parameter 'petId' is set
if (petId === undefined || petId === null) {
throw new Error("Missing the required parameter 'petId' when calling uploadFileWithRequiredFile");
}
// verify the required parameter 'requiredFile' is set
if (requiredFile === undefined || requiredFile === null) {
throw new Error("Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile");
}
let pathParams = {
'petId': petId
};
@@ -495,11 +468,10 @@ export default class PetApi {
let contentTypes = ['multipart/form-data'];
let accepts = ['application/json'];
let returnType = ApiResponse;
return this.apiClient.callApi(
'/fake/{petId}/uploadImageWithRequiredFile', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}

View File

@@ -43,13 +43,11 @@ export default class StoreApi {
*/
deleteOrderWithHttpInfo(orderId) {
let postBody = null;
// verify the required parameter 'orderId' is set
if (orderId === undefined || orderId === null) {
throw new Error("Missing the required parameter 'orderId' when calling deleteOrder");
}
let pathParams = {
'order_id': orderId
};
@@ -64,11 +62,10 @@ export default class StoreApi {
let contentTypes = [];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/store/order/{order_id}', 'DELETE',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}
@@ -94,7 +91,6 @@ export default class StoreApi {
getInventoryWithHttpInfo() {
let postBody = null;
let pathParams = {
};
let queryParams = {
@@ -108,11 +104,10 @@ export default class StoreApi {
let contentTypes = [];
let accepts = ['application/json'];
let returnType = {'String': 'Number'};
return this.apiClient.callApi(
'/store/inventory', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}
@@ -137,13 +132,11 @@ export default class StoreApi {
*/
getOrderByIdWithHttpInfo(orderId) {
let postBody = null;
// verify the required parameter 'orderId' is set
if (orderId === undefined || orderId === null) {
throw new Error("Missing the required parameter 'orderId' when calling getOrderById");
}
let pathParams = {
'order_id': orderId
};
@@ -158,11 +151,10 @@ export default class StoreApi {
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let returnType = Order;
return this.apiClient.callApi(
'/store/order/{order_id}', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}
@@ -187,13 +179,11 @@ export default class StoreApi {
*/
placeOrderWithHttpInfo(body) {
let postBody = body;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling placeOrder");
}
let pathParams = {
};
let queryParams = {
@@ -207,11 +197,10 @@ export default class StoreApi {
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let returnType = Order;
return this.apiClient.callApi(
'/store/order', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}

View File

@@ -43,13 +43,11 @@ export default class UserApi {
*/
createUserWithHttpInfo(body) {
let postBody = body;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling createUser");
}
let pathParams = {
};
let queryParams = {
@@ -63,11 +61,10 @@ export default class UserApi {
let contentTypes = [];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/user', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}
@@ -92,13 +89,11 @@ export default class UserApi {
*/
createUsersWithArrayInputWithHttpInfo(body) {
let postBody = body;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling createUsersWithArrayInput");
}
let pathParams = {
};
let queryParams = {
@@ -112,11 +107,10 @@ export default class UserApi {
let contentTypes = [];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/user/createWithArray', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}
@@ -140,13 +134,11 @@ export default class UserApi {
*/
createUsersWithListInputWithHttpInfo(body) {
let postBody = body;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling createUsersWithListInput");
}
let pathParams = {
};
let queryParams = {
@@ -160,11 +152,10 @@ export default class UserApi {
let contentTypes = [];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/user/createWithList', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}
@@ -189,13 +180,11 @@ export default class UserApi {
*/
deleteUserWithHttpInfo(username) {
let postBody = null;
// verify the required parameter 'username' is set
if (username === undefined || username === null) {
throw new Error("Missing the required parameter 'username' when calling deleteUser");
}
let pathParams = {
'username': username
};
@@ -210,11 +199,10 @@ export default class UserApi {
let contentTypes = [];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/user/{username}', 'DELETE',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}
@@ -239,13 +227,11 @@ export default class UserApi {
*/
getUserByNameWithHttpInfo(username) {
let postBody = null;
// verify the required parameter 'username' is set
if (username === undefined || username === null) {
throw new Error("Missing the required parameter 'username' when calling getUserByName");
}
let pathParams = {
'username': username
};
@@ -260,11 +246,10 @@ export default class UserApi {
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let returnType = User;
return this.apiClient.callApi(
'/user/{username}', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}
@@ -289,18 +274,15 @@ export default class UserApi {
*/
loginUserWithHttpInfo(username, password) {
let postBody = null;
// verify the required parameter 'username' is set
if (username === undefined || username === null) {
throw new Error("Missing the required parameter 'username' when calling loginUser");
}
// verify the required parameter 'password' is set
if (password === undefined || password === null) {
throw new Error("Missing the required parameter 'password' when calling loginUser");
}
let pathParams = {
};
let queryParams = {
@@ -316,11 +298,10 @@ export default class UserApi {
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let returnType = 'String';
return this.apiClient.callApi(
'/user/login', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}
@@ -345,7 +326,6 @@ export default class UserApi {
logoutUserWithHttpInfo() {
let postBody = null;
let pathParams = {
};
let queryParams = {
@@ -359,11 +339,10 @@ export default class UserApi {
let contentTypes = [];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/user/logout', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}
@@ -388,18 +367,15 @@ export default class UserApi {
*/
updateUserWithHttpInfo(username, body) {
let postBody = body;
// verify the required parameter 'username' is set
if (username === undefined || username === null) {
throw new Error("Missing the required parameter 'username' when calling updateUser");
}
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling updateUser");
}
let pathParams = {
'username': username
};
@@ -414,11 +390,10 @@ export default class UserApi {
let contentTypes = [];
let accepts = [];
let returnType = null;
return this.apiClient.callApi(
'/user/{username}', 'PUT',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType
authNames, contentTypes, accepts, returnType, null
);
}