mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-21 23:57:10 +00:00
[JS] mark ES5 as deprecated (#6408)
* mark js es5 deprecated, remove samples, migrate samples to use oas3 * update test in pom.xml * update js samples * delete js es5 samples * update js petstore * remove openapi3 js petstore * fix tests * skip test/model/AdditionalPropertiesArray.spec.js * fix test * update doc
This commit is contained in:
@@ -38,14 +38,14 @@ export default class AnotherFakeApi {
|
||||
/**
|
||||
* To test special tags
|
||||
* To test special tags and operation ID starting with number
|
||||
* @param {module:model/Client} body client model
|
||||
* @param {module:model/Client} client client model
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Client} and HTTP response
|
||||
*/
|
||||
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");
|
||||
call123testSpecialTagsWithHttpInfo(client) {
|
||||
let postBody = client;
|
||||
// verify the required parameter 'client' is set
|
||||
if (client === undefined || client === null) {
|
||||
throw new Error("Missing the required parameter 'client' when calling call123testSpecialTags");
|
||||
}
|
||||
|
||||
let pathParams = {
|
||||
@@ -71,11 +71,11 @@ export default class AnotherFakeApi {
|
||||
/**
|
||||
* To test special tags
|
||||
* To test special tags and operation ID starting with number
|
||||
* @param {module:model/Client} body client model
|
||||
* @param {module:model/Client} client client model
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Client}
|
||||
*/
|
||||
call123testSpecialTags(body) {
|
||||
return this.call123testSpecialTagsWithHttpInfo(body)
|
||||
call123testSpecialTags(client) {
|
||||
return this.call123testSpecialTagsWithHttpInfo(client)
|
||||
.then(function(response_and_data) {
|
||||
return response_and_data.data;
|
||||
});
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
import ApiClient from "../ApiClient";
|
||||
import InlineResponseDefault from '../model/InlineResponseDefault';
|
||||
|
||||
/**
|
||||
* Default service.
|
||||
* @module api/DefaultApi
|
||||
* @version 1.0.0
|
||||
*/
|
||||
export default class DefaultApi {
|
||||
|
||||
/**
|
||||
* Constructs a new DefaultApi.
|
||||
* @alias module:api/DefaultApi
|
||||
* @class
|
||||
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
|
||||
* default to {@link module:ApiClient#instance} if unspecified.
|
||||
*/
|
||||
constructor(apiClient) {
|
||||
this.apiClient = apiClient || ApiClient.instance;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/InlineResponseDefault} and HTTP response
|
||||
*/
|
||||
fooGetWithHttpInfo() {
|
||||
let postBody = null;
|
||||
|
||||
let pathParams = {
|
||||
};
|
||||
let queryParams = {
|
||||
};
|
||||
let headerParams = {
|
||||
};
|
||||
let formParams = {
|
||||
};
|
||||
|
||||
let authNames = [];
|
||||
let contentTypes = [];
|
||||
let accepts = ['application/json'];
|
||||
let returnType = InlineResponseDefault;
|
||||
return this.apiClient.callApi(
|
||||
'/foo', 'GET',
|
||||
pathParams, queryParams, headerParams, formParams, postBody,
|
||||
authNames, contentTypes, accepts, returnType, null
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/InlineResponseDefault}
|
||||
*/
|
||||
fooGet() {
|
||||
return this.fooGetWithHttpInfo()
|
||||
.then(function(response_and_data) {
|
||||
return response_and_data.data;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -15,9 +15,10 @@
|
||||
import ApiClient from "../ApiClient";
|
||||
import Client from '../model/Client';
|
||||
import FileSchemaTestClass from '../model/FileSchemaTestClass';
|
||||
import HealthCheckResult from '../model/HealthCheckResult';
|
||||
import OuterComposite from '../model/OuterComposite';
|
||||
import Pet from '../model/Pet';
|
||||
import User from '../model/User';
|
||||
import XmlItem from '../model/XmlItem';
|
||||
|
||||
/**
|
||||
* Fake service.
|
||||
@@ -40,17 +41,11 @@ export default class FakeApi {
|
||||
|
||||
|
||||
/**
|
||||
* creates an XmlItem
|
||||
* this route creates an XmlItem
|
||||
* @param {module:model/XmlItem} xmlItem XmlItem Body
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
|
||||
* Health check endpoint
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/HealthCheckResult} and HTTP response
|
||||
*/
|
||||
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");
|
||||
}
|
||||
fakeHealthGetWithHttpInfo() {
|
||||
let postBody = null;
|
||||
|
||||
let pathParams = {
|
||||
};
|
||||
@@ -62,24 +57,76 @@ export default class FakeApi {
|
||||
};
|
||||
|
||||
let authNames = [];
|
||||
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;
|
||||
let contentTypes = [];
|
||||
let accepts = ['application/json'];
|
||||
let returnType = HealthCheckResult;
|
||||
return this.apiClient.callApi(
|
||||
'/fake/create_xml_item', 'POST',
|
||||
'/fake/health', 'GET',
|
||||
pathParams, queryParams, headerParams, formParams, postBody,
|
||||
authNames, contentTypes, accepts, returnType, null
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* creates an XmlItem
|
||||
* this route creates an XmlItem
|
||||
* @param {module:model/XmlItem} xmlItem XmlItem Body
|
||||
* Health check endpoint
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/HealthCheckResult}
|
||||
*/
|
||||
fakeHealthGet() {
|
||||
return this.fakeHealthGetWithHttpInfo()
|
||||
.then(function(response_and_data) {
|
||||
return response_and_data.data;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* test http signature authentication
|
||||
* @param {module:model/Pet} pet Pet object that needs to be added to the store
|
||||
* @param {Object} opts Optional parameters
|
||||
* @param {String} opts.query1 query parameter
|
||||
* @param {String} opts.header1 header parameter
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
|
||||
*/
|
||||
fakeHttpSignatureTestWithHttpInfo(pet, opts) {
|
||||
opts = opts || {};
|
||||
let postBody = pet;
|
||||
// verify the required parameter 'pet' is set
|
||||
if (pet === undefined || pet === null) {
|
||||
throw new Error("Missing the required parameter 'pet' when calling fakeHttpSignatureTest");
|
||||
}
|
||||
|
||||
let pathParams = {
|
||||
};
|
||||
let queryParams = {
|
||||
'query_1': opts['query1']
|
||||
};
|
||||
let headerParams = {
|
||||
'header_1': opts['header1']
|
||||
};
|
||||
let formParams = {
|
||||
};
|
||||
|
||||
let authNames = ['http_signature_test'];
|
||||
let contentTypes = ['application/json', 'application/xml'];
|
||||
let accepts = [];
|
||||
let returnType = null;
|
||||
return this.apiClient.callApi(
|
||||
'/fake/http-signature-test', 'GET',
|
||||
pathParams, queryParams, headerParams, formParams, postBody,
|
||||
authNames, contentTypes, accepts, returnType, null
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* test http signature authentication
|
||||
* @param {module:model/Pet} pet Pet object that needs to be added to the store
|
||||
* @param {Object} opts Optional parameters
|
||||
* @param {String} opts.query1 query parameter
|
||||
* @param {String} opts.header1 header parameter
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
||||
*/
|
||||
createXmlItem(xmlItem) {
|
||||
return this.createXmlItemWithHttpInfo(xmlItem)
|
||||
fakeHttpSignatureTest(pet, opts) {
|
||||
return this.fakeHttpSignatureTestWithHttpInfo(pet, opts)
|
||||
.then(function(response_and_data) {
|
||||
return response_and_data.data;
|
||||
});
|
||||
@@ -106,7 +153,7 @@ export default class FakeApi {
|
||||
};
|
||||
|
||||
let authNames = [];
|
||||
let contentTypes = [];
|
||||
let contentTypes = ['application/json'];
|
||||
let accepts = ['*/*'];
|
||||
let returnType = 'Boolean';
|
||||
return this.apiClient.callApi(
|
||||
@@ -133,12 +180,12 @@ export default class FakeApi {
|
||||
/**
|
||||
* Test serialization of object with outer number type
|
||||
* @param {Object} opts Optional parameters
|
||||
* @param {module:model/OuterComposite} opts.body Input composite as post body
|
||||
* @param {module:model/OuterComposite} opts.outerComposite Input composite as post body
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/OuterComposite} and HTTP response
|
||||
*/
|
||||
fakeOuterCompositeSerializeWithHttpInfo(opts) {
|
||||
opts = opts || {};
|
||||
let postBody = opts['body'];
|
||||
let postBody = opts['outerComposite'];
|
||||
|
||||
let pathParams = {
|
||||
};
|
||||
@@ -150,7 +197,7 @@ export default class FakeApi {
|
||||
};
|
||||
|
||||
let authNames = [];
|
||||
let contentTypes = [];
|
||||
let contentTypes = ['application/json'];
|
||||
let accepts = ['*/*'];
|
||||
let returnType = OuterComposite;
|
||||
return this.apiClient.callApi(
|
||||
@@ -163,7 +210,7 @@ export default class FakeApi {
|
||||
/**
|
||||
* Test serialization of object with outer number type
|
||||
* @param {Object} opts Optional parameters
|
||||
* @param {module:model/OuterComposite} opts.body Input composite as post body
|
||||
* @param {module:model/OuterComposite} opts.outerComposite Input composite as post body
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/OuterComposite}
|
||||
*/
|
||||
fakeOuterCompositeSerialize(opts) {
|
||||
@@ -194,7 +241,7 @@ export default class FakeApi {
|
||||
};
|
||||
|
||||
let authNames = [];
|
||||
let contentTypes = [];
|
||||
let contentTypes = ['application/json'];
|
||||
let accepts = ['*/*'];
|
||||
let returnType = 'Number';
|
||||
return this.apiClient.callApi(
|
||||
@@ -238,7 +285,7 @@ export default class FakeApi {
|
||||
};
|
||||
|
||||
let authNames = [];
|
||||
let contentTypes = [];
|
||||
let contentTypes = ['application/json'];
|
||||
let accepts = ['*/*'];
|
||||
let returnType = 'String';
|
||||
return this.apiClient.callApi(
|
||||
@@ -264,14 +311,14 @@ export default class FakeApi {
|
||||
|
||||
/**
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param {module:model/FileSchemaTestClass} body
|
||||
* @param {module:model/FileSchemaTestClass} fileSchemaTestClass
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
|
||||
*/
|
||||
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");
|
||||
testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass) {
|
||||
let postBody = fileSchemaTestClass;
|
||||
// verify the required parameter 'fileSchemaTestClass' is set
|
||||
if (fileSchemaTestClass === undefined || fileSchemaTestClass === null) {
|
||||
throw new Error("Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema");
|
||||
}
|
||||
|
||||
let pathParams = {
|
||||
@@ -296,11 +343,11 @@ export default class FakeApi {
|
||||
|
||||
/**
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param {module:model/FileSchemaTestClass} body
|
||||
* @param {module:model/FileSchemaTestClass} fileSchemaTestClass
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
||||
*/
|
||||
testBodyWithFileSchema(body) {
|
||||
return this.testBodyWithFileSchemaWithHttpInfo(body)
|
||||
testBodyWithFileSchema(fileSchemaTestClass) {
|
||||
return this.testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass)
|
||||
.then(function(response_and_data) {
|
||||
return response_and_data.data;
|
||||
});
|
||||
@@ -309,18 +356,18 @@ export default class FakeApi {
|
||||
|
||||
/**
|
||||
* @param {String} query
|
||||
* @param {module:model/User} body
|
||||
* @param {module:model/User} user
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
|
||||
*/
|
||||
testBodyWithQueryParamsWithHttpInfo(query, body) {
|
||||
let postBody = body;
|
||||
testBodyWithQueryParamsWithHttpInfo(query, user) {
|
||||
let postBody = user;
|
||||
// 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");
|
||||
// verify the required parameter 'user' is set
|
||||
if (user === undefined || user === null) {
|
||||
throw new Error("Missing the required parameter 'user' when calling testBodyWithQueryParams");
|
||||
}
|
||||
|
||||
let pathParams = {
|
||||
@@ -346,11 +393,11 @@ export default class FakeApi {
|
||||
|
||||
/**
|
||||
* @param {String} query
|
||||
* @param {module:model/User} body
|
||||
* @param {module:model/User} user
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
||||
*/
|
||||
testBodyWithQueryParams(query, body) {
|
||||
return this.testBodyWithQueryParamsWithHttpInfo(query, body)
|
||||
testBodyWithQueryParams(query, user) {
|
||||
return this.testBodyWithQueryParamsWithHttpInfo(query, user)
|
||||
.then(function(response_and_data) {
|
||||
return response_and_data.data;
|
||||
});
|
||||
@@ -360,14 +407,14 @@ export default class FakeApi {
|
||||
/**
|
||||
* To test \"client\" model
|
||||
* To test \"client\" model
|
||||
* @param {module:model/Client} body client model
|
||||
* @param {module:model/Client} client client model
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Client} and HTTP response
|
||||
*/
|
||||
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");
|
||||
testClientModelWithHttpInfo(client) {
|
||||
let postBody = client;
|
||||
// verify the required parameter 'client' is set
|
||||
if (client === undefined || client === null) {
|
||||
throw new Error("Missing the required parameter 'client' when calling testClientModel");
|
||||
}
|
||||
|
||||
let pathParams = {
|
||||
@@ -393,11 +440,11 @@ export default class FakeApi {
|
||||
/**
|
||||
* To test \"client\" model
|
||||
* To test \"client\" model
|
||||
* @param {module:model/Client} body client model
|
||||
* @param {module:model/Client} client client model
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Client}
|
||||
*/
|
||||
testClientModel(body) {
|
||||
return this.testClientModelWithHttpInfo(body)
|
||||
testClientModel(client) {
|
||||
return this.testClientModelWithHttpInfo(client)
|
||||
.then(function(response_and_data) {
|
||||
return response_and_data.data;
|
||||
});
|
||||
@@ -405,8 +452,8 @@ export default class FakeApi {
|
||||
|
||||
|
||||
/**
|
||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
* @param {Number} _number None
|
||||
* @param {Number} _double None
|
||||
* @param {String} patternWithoutDelimiter None
|
||||
@@ -479,8 +526,8 @@ export default class FakeApi {
|
||||
}
|
||||
|
||||
/**
|
||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
* @param {Number} _number None
|
||||
* @param {Number} _double None
|
||||
* @param {String} patternWithoutDelimiter None
|
||||
@@ -527,7 +574,7 @@ export default class FakeApi {
|
||||
let pathParams = {
|
||||
};
|
||||
let queryParams = {
|
||||
'enum_query_string_array': this.apiClient.buildCollectionParam(opts['enumQueryStringArray'], 'csv'),
|
||||
'enum_query_string_array': this.apiClient.buildCollectionParam(opts['enumQueryStringArray'], 'multi'),
|
||||
'enum_query_string': opts['enumQueryString'],
|
||||
'enum_query_integer': opts['enumQueryInteger'],
|
||||
'enum_query_double': opts['enumQueryDouble']
|
||||
@@ -617,7 +664,7 @@ export default class FakeApi {
|
||||
let formParams = {
|
||||
};
|
||||
|
||||
let authNames = [];
|
||||
let authNames = ['bearer_test'];
|
||||
let contentTypes = [];
|
||||
let accepts = [];
|
||||
let returnType = null;
|
||||
@@ -650,14 +697,14 @@ export default class FakeApi {
|
||||
|
||||
/**
|
||||
* test inline additionalProperties
|
||||
* @param {Object.<String, {String: String}>} param request body
|
||||
* @param {Object.<String, {String: String}>} requestBody request body
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
|
||||
*/
|
||||
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");
|
||||
testInlineAdditionalPropertiesWithHttpInfo(requestBody) {
|
||||
let postBody = requestBody;
|
||||
// verify the required parameter 'requestBody' is set
|
||||
if (requestBody === undefined || requestBody === null) {
|
||||
throw new Error("Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties");
|
||||
}
|
||||
|
||||
let pathParams = {
|
||||
@@ -682,11 +729,11 @@ export default class FakeApi {
|
||||
|
||||
/**
|
||||
* test inline additionalProperties
|
||||
* @param {Object.<String, {String: String}>} param request body
|
||||
* @param {Object.<String, {String: String}>} requestBody request body
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
||||
*/
|
||||
testInlineAdditionalProperties(param) {
|
||||
return this.testInlineAdditionalPropertiesWithHttpInfo(param)
|
||||
testInlineAdditionalProperties(requestBody) {
|
||||
return this.testInlineAdditionalPropertiesWithHttpInfo(requestBody)
|
||||
.then(function(response_and_data) {
|
||||
return response_and_data.data;
|
||||
});
|
||||
@@ -781,7 +828,7 @@ export default class FakeApi {
|
||||
let pathParams = {
|
||||
};
|
||||
let queryParams = {
|
||||
'pipe': this.apiClient.buildCollectionParam(pipe, 'csv'),
|
||||
'pipe': this.apiClient.buildCollectionParam(pipe, 'multi'),
|
||||
'ioutil': this.apiClient.buildCollectionParam(ioutil, 'csv'),
|
||||
'http': this.apiClient.buildCollectionParam(http, 'space'),
|
||||
'url': this.apiClient.buildCollectionParam(url, 'csv'),
|
||||
|
||||
@@ -38,14 +38,14 @@ export default class FakeClassnameTags123Api {
|
||||
/**
|
||||
* To test class name in snake case
|
||||
* To test class name in snake case
|
||||
* @param {module:model/Client} body client model
|
||||
* @param {module:model/Client} client client model
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Client} and HTTP response
|
||||
*/
|
||||
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");
|
||||
testClassnameWithHttpInfo(client) {
|
||||
let postBody = client;
|
||||
// verify the required parameter 'client' is set
|
||||
if (client === undefined || client === null) {
|
||||
throw new Error("Missing the required parameter 'client' when calling testClassname");
|
||||
}
|
||||
|
||||
let pathParams = {
|
||||
@@ -71,11 +71,11 @@ export default class FakeClassnameTags123Api {
|
||||
/**
|
||||
* To test class name in snake case
|
||||
* To test class name in snake case
|
||||
* @param {module:model/Client} body client model
|
||||
* @param {module:model/Client} client client model
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Client}
|
||||
*/
|
||||
testClassname(body) {
|
||||
return this.testClassnameWithHttpInfo(body)
|
||||
testClassname(client) {
|
||||
return this.testClassnameWithHttpInfo(client)
|
||||
.then(function(response_and_data) {
|
||||
return response_and_data.data;
|
||||
});
|
||||
|
||||
@@ -38,14 +38,15 @@ export default class PetApi {
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
* @param {module:model/Pet} body Pet object that needs to be added to the store
|
||||
* @param {module:model/Pet} pet Pet object that needs to be added to the store
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
|
||||
*/
|
||||
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");
|
||||
addPetWithHttpInfo(pet, opts) {
|
||||
opts = opts || {};
|
||||
let postBody = pet;
|
||||
// verify the required parameter 'pet' is set
|
||||
if (pet === undefined || pet === null) {
|
||||
throw new Error("Missing the required parameter 'pet' when calling addPet");
|
||||
}
|
||||
|
||||
let pathParams = {
|
||||
@@ -61,20 +62,29 @@ export default class PetApi {
|
||||
let contentTypes = ['application/json', 'application/xml'];
|
||||
let accepts = [];
|
||||
let returnType = null;
|
||||
let basePaths = ['http://petstore.swagger.io/v2', 'http://path-server-test.petstore.local/v2'];
|
||||
let basePath = basePaths[0]; // by default use the first one in "servers" defined in OpenAPI
|
||||
if (typeof opts['_base_path_index'] !== 'undefined') {
|
||||
if (opts['_base_path_index'] >= basePaths.length || opts['_base_path_index'] < 0) {
|
||||
throw new Error("Invalid index " + opts['_base_path_index'] + " when selecting the host settings. Must be less than " + basePaths.length);
|
||||
}
|
||||
basePath = basePaths[opts['_base_path_index']];
|
||||
}
|
||||
|
||||
return this.apiClient.callApi(
|
||||
'/pet', 'POST',
|
||||
pathParams, queryParams, headerParams, formParams, postBody,
|
||||
authNames, contentTypes, accepts, returnType, null
|
||||
authNames, contentTypes, accepts, returnType, basePath
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
* @param {module:model/Pet} body Pet object that needs to be added to the store
|
||||
* @param {module:model/Pet} pet Pet object that needs to be added to the store
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
||||
*/
|
||||
addPet(body) {
|
||||
return this.addPetWithHttpInfo(body)
|
||||
addPet(pet, opts) {
|
||||
return this.addPetWithHttpInfo(pet, opts)
|
||||
.then(function(response_and_data) {
|
||||
return response_and_data.data;
|
||||
});
|
||||
@@ -279,14 +289,15 @@ export default class PetApi {
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
* @param {module:model/Pet} body Pet object that needs to be added to the store
|
||||
* @param {module:model/Pet} pet Pet object that needs to be added to the store
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
|
||||
*/
|
||||
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");
|
||||
updatePetWithHttpInfo(pet, opts) {
|
||||
opts = opts || {};
|
||||
let postBody = pet;
|
||||
// verify the required parameter 'pet' is set
|
||||
if (pet === undefined || pet === null) {
|
||||
throw new Error("Missing the required parameter 'pet' when calling updatePet");
|
||||
}
|
||||
|
||||
let pathParams = {
|
||||
@@ -302,20 +313,29 @@ export default class PetApi {
|
||||
let contentTypes = ['application/json', 'application/xml'];
|
||||
let accepts = [];
|
||||
let returnType = null;
|
||||
let basePaths = ['http://petstore.swagger.io/v2', 'http://path-server-test.petstore.local/v2'];
|
||||
let basePath = basePaths[0]; // by default use the first one in "servers" defined in OpenAPI
|
||||
if (typeof opts['_base_path_index'] !== 'undefined') {
|
||||
if (opts['_base_path_index'] >= basePaths.length || opts['_base_path_index'] < 0) {
|
||||
throw new Error("Invalid index " + opts['_base_path_index'] + " when selecting the host settings. Must be less than " + basePaths.length);
|
||||
}
|
||||
basePath = basePaths[opts['_base_path_index']];
|
||||
}
|
||||
|
||||
return this.apiClient.callApi(
|
||||
'/pet', 'PUT',
|
||||
pathParams, queryParams, headerParams, formParams, postBody,
|
||||
authNames, contentTypes, accepts, returnType, null
|
||||
authNames, contentTypes, accepts, returnType, basePath
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
* @param {module:model/Pet} body Pet object that needs to be added to the store
|
||||
* @param {module:model/Pet} pet Pet object that needs to be added to the store
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
||||
*/
|
||||
updatePet(body) {
|
||||
return this.updatePetWithHttpInfo(body)
|
||||
updatePet(pet, opts) {
|
||||
return this.updatePetWithHttpInfo(pet, opts)
|
||||
.then(function(response_and_data) {
|
||||
return response_and_data.data;
|
||||
});
|
||||
|
||||
@@ -174,14 +174,14 @@ export default class StoreApi {
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
* @param {module:model/Order} body order placed for purchasing the pet
|
||||
* @param {module:model/Order} order order placed for purchasing the pet
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Order} and HTTP response
|
||||
*/
|
||||
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");
|
||||
placeOrderWithHttpInfo(order) {
|
||||
let postBody = order;
|
||||
// verify the required parameter 'order' is set
|
||||
if (order === undefined || order === null) {
|
||||
throw new Error("Missing the required parameter 'order' when calling placeOrder");
|
||||
}
|
||||
|
||||
let pathParams = {
|
||||
@@ -194,7 +194,7 @@ export default class StoreApi {
|
||||
};
|
||||
|
||||
let authNames = [];
|
||||
let contentTypes = [];
|
||||
let contentTypes = ['application/json'];
|
||||
let accepts = ['application/xml', 'application/json'];
|
||||
let returnType = Order;
|
||||
return this.apiClient.callApi(
|
||||
@@ -206,11 +206,11 @@ export default class StoreApi {
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
* @param {module:model/Order} body order placed for purchasing the pet
|
||||
* @param {module:model/Order} order order placed for purchasing the pet
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Order}
|
||||
*/
|
||||
placeOrder(body) {
|
||||
return this.placeOrderWithHttpInfo(body)
|
||||
placeOrder(order) {
|
||||
return this.placeOrderWithHttpInfo(order)
|
||||
.then(function(response_and_data) {
|
||||
return response_and_data.data;
|
||||
});
|
||||
|
||||
@@ -38,14 +38,14 @@ export default class UserApi {
|
||||
/**
|
||||
* Create user
|
||||
* This can only be done by the logged in user.
|
||||
* @param {module:model/User} body Created user object
|
||||
* @param {module:model/User} user Created user object
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
|
||||
*/
|
||||
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");
|
||||
createUserWithHttpInfo(user) {
|
||||
let postBody = user;
|
||||
// verify the required parameter 'user' is set
|
||||
if (user === undefined || user === null) {
|
||||
throw new Error("Missing the required parameter 'user' when calling createUser");
|
||||
}
|
||||
|
||||
let pathParams = {
|
||||
@@ -58,7 +58,7 @@ export default class UserApi {
|
||||
};
|
||||
|
||||
let authNames = [];
|
||||
let contentTypes = [];
|
||||
let contentTypes = ['application/json'];
|
||||
let accepts = [];
|
||||
let returnType = null;
|
||||
return this.apiClient.callApi(
|
||||
@@ -71,11 +71,11 @@ export default class UserApi {
|
||||
/**
|
||||
* Create user
|
||||
* This can only be done by the logged in user.
|
||||
* @param {module:model/User} body Created user object
|
||||
* @param {module:model/User} user Created user object
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
||||
*/
|
||||
createUser(body) {
|
||||
return this.createUserWithHttpInfo(body)
|
||||
createUser(user) {
|
||||
return this.createUserWithHttpInfo(user)
|
||||
.then(function(response_and_data) {
|
||||
return response_and_data.data;
|
||||
});
|
||||
@@ -84,14 +84,14 @@ export default class UserApi {
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param {Array.<module:model/User>} body List of user object
|
||||
* @param {Array.<module:model/User>} user List of user object
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
|
||||
*/
|
||||
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");
|
||||
createUsersWithArrayInputWithHttpInfo(user) {
|
||||
let postBody = user;
|
||||
// verify the required parameter 'user' is set
|
||||
if (user === undefined || user === null) {
|
||||
throw new Error("Missing the required parameter 'user' when calling createUsersWithArrayInput");
|
||||
}
|
||||
|
||||
let pathParams = {
|
||||
@@ -104,7 +104,7 @@ export default class UserApi {
|
||||
};
|
||||
|
||||
let authNames = [];
|
||||
let contentTypes = [];
|
||||
let contentTypes = ['application/json'];
|
||||
let accepts = [];
|
||||
let returnType = null;
|
||||
return this.apiClient.callApi(
|
||||
@@ -116,11 +116,11 @@ export default class UserApi {
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param {Array.<module:model/User>} body List of user object
|
||||
* @param {Array.<module:model/User>} user List of user object
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
||||
*/
|
||||
createUsersWithArrayInput(body) {
|
||||
return this.createUsersWithArrayInputWithHttpInfo(body)
|
||||
createUsersWithArrayInput(user) {
|
||||
return this.createUsersWithArrayInputWithHttpInfo(user)
|
||||
.then(function(response_and_data) {
|
||||
return response_and_data.data;
|
||||
});
|
||||
@@ -129,14 +129,14 @@ export default class UserApi {
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param {Array.<module:model/User>} body List of user object
|
||||
* @param {Array.<module:model/User>} user List of user object
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
|
||||
*/
|
||||
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");
|
||||
createUsersWithListInputWithHttpInfo(user) {
|
||||
let postBody = user;
|
||||
// verify the required parameter 'user' is set
|
||||
if (user === undefined || user === null) {
|
||||
throw new Error("Missing the required parameter 'user' when calling createUsersWithListInput");
|
||||
}
|
||||
|
||||
let pathParams = {
|
||||
@@ -149,7 +149,7 @@ export default class UserApi {
|
||||
};
|
||||
|
||||
let authNames = [];
|
||||
let contentTypes = [];
|
||||
let contentTypes = ['application/json'];
|
||||
let accepts = [];
|
||||
let returnType = null;
|
||||
return this.apiClient.callApi(
|
||||
@@ -161,11 +161,11 @@ export default class UserApi {
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
* @param {Array.<module:model/User>} body List of user object
|
||||
* @param {Array.<module:model/User>} user List of user object
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
||||
*/
|
||||
createUsersWithListInput(body) {
|
||||
return this.createUsersWithListInputWithHttpInfo(body)
|
||||
createUsersWithListInput(user) {
|
||||
return this.createUsersWithListInputWithHttpInfo(user)
|
||||
.then(function(response_and_data) {
|
||||
return response_and_data.data;
|
||||
});
|
||||
@@ -362,18 +362,18 @@ export default class UserApi {
|
||||
* Updated user
|
||||
* This can only be done by the logged in user.
|
||||
* @param {String} username name that need to be deleted
|
||||
* @param {module:model/User} body Updated user object
|
||||
* @param {module:model/User} user Updated user object
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
|
||||
*/
|
||||
updateUserWithHttpInfo(username, body) {
|
||||
let postBody = body;
|
||||
updateUserWithHttpInfo(username, user) {
|
||||
let postBody = user;
|
||||
// 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");
|
||||
// verify the required parameter 'user' is set
|
||||
if (user === undefined || user === null) {
|
||||
throw new Error("Missing the required parameter 'user' when calling updateUser");
|
||||
}
|
||||
|
||||
let pathParams = {
|
||||
@@ -387,7 +387,7 @@ export default class UserApi {
|
||||
};
|
||||
|
||||
let authNames = [];
|
||||
let contentTypes = [];
|
||||
let contentTypes = ['application/json'];
|
||||
let accepts = [];
|
||||
let returnType = null;
|
||||
return this.apiClient.callApi(
|
||||
@@ -401,11 +401,11 @@ export default class UserApi {
|
||||
* Updated user
|
||||
* This can only be done by the logged in user.
|
||||
* @param {String} username name that need to be deleted
|
||||
* @param {module:model/User} body Updated user object
|
||||
* @param {module:model/User} user Updated user object
|
||||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
||||
*/
|
||||
updateUser(username, body) {
|
||||
return this.updateUserWithHttpInfo(username, body)
|
||||
updateUser(username, user) {
|
||||
return this.updateUserWithHttpInfo(username, user)
|
||||
.then(function(response_and_data) {
|
||||
return response_and_data.data;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user