mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-03 08:46:55 +00:00
Merge remote-tracking branch 'origin/master' into 2.3.0
This commit is contained in:
@@ -11,6 +11,7 @@ Method | HTTP request | Description
|
||||
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
[**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters
|
||||
[**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data
|
||||
|
||||
|
||||
<a name="fakeOuterBooleanSerialize"></a>
|
||||
@@ -23,16 +24,16 @@ Test serialization of outer boolean types
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.FakeApi();
|
||||
let apiInstance = new SwaggerPetstore.FakeApi();
|
||||
|
||||
var opts = {
|
||||
let opts = {
|
||||
'body': new SwaggerPetstore.OuterBoolean() // OuterBoolean | Input boolean as post body
|
||||
};
|
||||
apiInstance.fakeOuterBooleanSerialize(opts).then(function(data) {
|
||||
apiInstance.fakeOuterBooleanSerialize(opts).then((data) => {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, function(error) {
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
@@ -67,16 +68,16 @@ Test serialization of object with outer number type
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.FakeApi();
|
||||
let apiInstance = new SwaggerPetstore.FakeApi();
|
||||
|
||||
var opts = {
|
||||
let opts = {
|
||||
'body': new SwaggerPetstore.OuterComposite() // OuterComposite | Input composite as post body
|
||||
};
|
||||
apiInstance.fakeOuterCompositeSerialize(opts).then(function(data) {
|
||||
apiInstance.fakeOuterCompositeSerialize(opts).then((data) => {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, function(error) {
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
@@ -111,16 +112,16 @@ Test serialization of outer number types
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.FakeApi();
|
||||
let apiInstance = new SwaggerPetstore.FakeApi();
|
||||
|
||||
var opts = {
|
||||
let opts = {
|
||||
'body': new SwaggerPetstore.OuterNumber() // OuterNumber | Input number as post body
|
||||
};
|
||||
apiInstance.fakeOuterNumberSerialize(opts).then(function(data) {
|
||||
apiInstance.fakeOuterNumberSerialize(opts).then((data) => {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, function(error) {
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
@@ -155,16 +156,16 @@ Test serialization of outer string types
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.FakeApi();
|
||||
let apiInstance = new SwaggerPetstore.FakeApi();
|
||||
|
||||
var opts = {
|
||||
let opts = {
|
||||
'body': new SwaggerPetstore.OuterString() // OuterString | Input string as post body
|
||||
};
|
||||
apiInstance.fakeOuterStringSerialize(opts).then(function(data) {
|
||||
apiInstance.fakeOuterStringSerialize(opts).then((data) => {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, function(error) {
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
@@ -199,15 +200,15 @@ To test \"client\" model
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.FakeApi();
|
||||
let apiInstance = new SwaggerPetstore.FakeApi();
|
||||
|
||||
var body = new SwaggerPetstore.Client(); // Client | client model
|
||||
let body = new SwaggerPetstore.Client(); // Client | client model
|
||||
|
||||
apiInstance.testClientModel(body).then(function(data) {
|
||||
apiInstance.testClientModel(body).then((data) => {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, function(error) {
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
@@ -242,25 +243,25 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.instance;
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
let defaultClient = SwaggerPetstore.ApiClient.instance;
|
||||
|
||||
// Configure HTTP basic authorization: http_basic_test
|
||||
var http_basic_test = defaultClient.authentications['http_basic_test'];
|
||||
let http_basic_test = defaultClient.authentications['http_basic_test'];
|
||||
http_basic_test.username = 'YOUR USERNAME';
|
||||
http_basic_test.password = 'YOUR PASSWORD';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.FakeApi();
|
||||
let apiInstance = new SwaggerPetstore.FakeApi();
|
||||
|
||||
var _number = 3.4; // Number | None
|
||||
let _number = 3.4; // Number | None
|
||||
|
||||
var _double = 1.2; // Number | None
|
||||
let _double = 1.2; // Number | None
|
||||
|
||||
var patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
|
||||
let patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None
|
||||
|
||||
var _byte = B; // Blob | None
|
||||
let _byte = B; // Blob | None
|
||||
|
||||
var opts = {
|
||||
let opts = {
|
||||
'integer': 56, // Number | None
|
||||
'int32': 56, // Number | None
|
||||
'int64': 789, // Number | None
|
||||
@@ -272,9 +273,9 @@ var opts = {
|
||||
'password': "password_example", // String | None
|
||||
'callback': "callback_example" // String | None
|
||||
};
|
||||
apiInstance.testEndpointParameters(_number, _double, patternWithoutDelimiter, _byte, opts).then(function() {
|
||||
apiInstance.testEndpointParameters(_number, _double, patternWithoutDelimiter, _byte, opts).then(() => {
|
||||
console.log('API called successfully.');
|
||||
}, function(error) {
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
@@ -322,11 +323,11 @@ To test enum parameters
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.FakeApi();
|
||||
let apiInstance = new SwaggerPetstore.FakeApi();
|
||||
|
||||
var opts = {
|
||||
let opts = {
|
||||
'enumFormStringArray': ["enumFormStringArray_example"], // [String] | Form parameter enum test (string array)
|
||||
'enumFormString': "-efg", // String | Form parameter enum test (string)
|
||||
'enumHeaderStringArray': ["enumHeaderStringArray_example"], // [String] | Header parameter enum test (string array)
|
||||
@@ -336,9 +337,9 @@ var opts = {
|
||||
'enumQueryInteger': 56, // Number | Query parameter enum test (double)
|
||||
'enumQueryDouble': 1.2 // Number | Query parameter enum test (double)
|
||||
};
|
||||
apiInstance.testEnumParameters(opts).then(function() {
|
||||
apiInstance.testEnumParameters(opts).then(() => {
|
||||
console.log('API called successfully.');
|
||||
}, function(error) {
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
@@ -370,3 +371,49 @@ No authorization required
|
||||
- **Content-Type**: */*
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="testJsonFormData"></a>
|
||||
# **testJsonFormData**
|
||||
> testJsonFormData(param, param2)
|
||||
|
||||
test json serialization of form data
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
|
||||
let apiInstance = new SwaggerPetstore.FakeApi();
|
||||
|
||||
let param = "param_example"; // String | field1
|
||||
|
||||
let param2 = "param2_example"; // String | field2
|
||||
|
||||
apiInstance.testJsonFormData(param, param2).then(() => {
|
||||
console.log('API called successfully.');
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**param** | **String**| field1 |
|
||||
**param2** | **String**| field2 |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
@@ -15,15 +15,15 @@ To test class name in snake case
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.Fake_classname_tags123Api();
|
||||
let apiInstance = new SwaggerPetstore.Fake_classname_tags123Api();
|
||||
|
||||
var body = new SwaggerPetstore.Client(); // Client | client model
|
||||
let body = new SwaggerPetstore.Client(); // Client | client model
|
||||
|
||||
apiInstance.testClassname(body).then(function(data) {
|
||||
apiInstance.testClassname(body).then((data) => {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, function(error) {
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
|
||||
@@ -24,20 +24,20 @@ Add a new pet to the store
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.instance;
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
let defaultClient = SwaggerPetstore.ApiClient.instance;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
let petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.PetApi();
|
||||
let apiInstance = new SwaggerPetstore.PetApi();
|
||||
|
||||
var body = new SwaggerPetstore.Pet(); // Pet | Pet object that needs to be added to the store
|
||||
let body = new SwaggerPetstore.Pet(); // Pet | Pet object that needs to be added to the store
|
||||
|
||||
apiInstance.addPet(body).then(function() {
|
||||
apiInstance.addPet(body).then(() => {
|
||||
console.log('API called successfully.');
|
||||
}, function(error) {
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
@@ -72,23 +72,23 @@ Deletes a pet
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.instance;
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
let defaultClient = SwaggerPetstore.ApiClient.instance;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
let petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.PetApi();
|
||||
let apiInstance = new SwaggerPetstore.PetApi();
|
||||
|
||||
var petId = 789; // Number | Pet id to delete
|
||||
let petId = 789; // Number | Pet id to delete
|
||||
|
||||
var opts = {
|
||||
let opts = {
|
||||
'apiKey': "apiKey_example" // String |
|
||||
};
|
||||
apiInstance.deletePet(petId, opts).then(function() {
|
||||
apiInstance.deletePet(petId, opts).then(() => {
|
||||
console.log('API called successfully.');
|
||||
}, function(error) {
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
@@ -124,20 +124,20 @@ Multiple status values can be provided with comma separated strings
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.instance;
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
let defaultClient = SwaggerPetstore.ApiClient.instance;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
let petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.PetApi();
|
||||
let apiInstance = new SwaggerPetstore.PetApi();
|
||||
|
||||
var status = ["status_example"]; // [String] | Status values that need to be considered for filter
|
||||
let status = ["status_example"]; // [String] | Status values that need to be considered for filter
|
||||
|
||||
apiInstance.findPetsByStatus(status).then(function(data) {
|
||||
apiInstance.findPetsByStatus(status).then((data) => {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, function(error) {
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
@@ -172,20 +172,20 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.instance;
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
let defaultClient = SwaggerPetstore.ApiClient.instance;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
let petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.PetApi();
|
||||
let apiInstance = new SwaggerPetstore.PetApi();
|
||||
|
||||
var tags = ["tags_example"]; // [String] | Tags to filter by
|
||||
let tags = ["tags_example"]; // [String] | Tags to filter by
|
||||
|
||||
apiInstance.findPetsByTags(tags).then(function(data) {
|
||||
apiInstance.findPetsByTags(tags).then((data) => {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, function(error) {
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
@@ -220,22 +220,22 @@ Returns a single pet
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.instance;
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
let defaultClient = SwaggerPetstore.ApiClient.instance;
|
||||
|
||||
// Configure API key authorization: api_key
|
||||
var api_key = defaultClient.authentications['api_key'];
|
||||
let api_key = defaultClient.authentications['api_key'];
|
||||
api_key.apiKey = 'YOUR API KEY';
|
||||
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
||||
//api_key.apiKeyPrefix = 'Token';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.PetApi();
|
||||
let apiInstance = new SwaggerPetstore.PetApi();
|
||||
|
||||
var petId = 789; // Number | ID of pet to return
|
||||
let petId = 789; // Number | ID of pet to return
|
||||
|
||||
apiInstance.getPetById(petId).then(function(data) {
|
||||
apiInstance.getPetById(petId).then((data) => {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, function(error) {
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
@@ -270,20 +270,20 @@ Update an existing pet
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.instance;
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
let defaultClient = SwaggerPetstore.ApiClient.instance;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
let petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.PetApi();
|
||||
let apiInstance = new SwaggerPetstore.PetApi();
|
||||
|
||||
var body = new SwaggerPetstore.Pet(); // Pet | Pet object that needs to be added to the store
|
||||
let body = new SwaggerPetstore.Pet(); // Pet | Pet object that needs to be added to the store
|
||||
|
||||
apiInstance.updatePet(body).then(function() {
|
||||
apiInstance.updatePet(body).then(() => {
|
||||
console.log('API called successfully.');
|
||||
}, function(error) {
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
@@ -318,24 +318,24 @@ Updates a pet in the store with form data
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.instance;
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
let defaultClient = SwaggerPetstore.ApiClient.instance;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
let petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.PetApi();
|
||||
let apiInstance = new SwaggerPetstore.PetApi();
|
||||
|
||||
var petId = 789; // Number | ID of pet that needs to be updated
|
||||
let petId = 789; // Number | ID of pet that needs to be updated
|
||||
|
||||
var opts = {
|
||||
let opts = {
|
||||
'name': "name_example", // String | Updated name of the pet
|
||||
'status': "status_example" // String | Updated status of the pet
|
||||
};
|
||||
apiInstance.updatePetWithForm(petId, opts).then(function() {
|
||||
apiInstance.updatePetWithForm(petId, opts).then(() => {
|
||||
console.log('API called successfully.');
|
||||
}, function(error) {
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
@@ -372,24 +372,24 @@ uploads an image
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.instance;
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
let defaultClient = SwaggerPetstore.ApiClient.instance;
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
var petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
let petstore_auth = defaultClient.authentications['petstore_auth'];
|
||||
petstore_auth.accessToken = 'YOUR ACCESS TOKEN';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.PetApi();
|
||||
let apiInstance = new SwaggerPetstore.PetApi();
|
||||
|
||||
var petId = 789; // Number | ID of pet to update
|
||||
let petId = 789; // Number | ID of pet to update
|
||||
|
||||
var opts = {
|
||||
let opts = {
|
||||
'additionalMetadata': "additionalMetadata_example", // String | Additional data to pass to server
|
||||
'file': "/path/to/file.txt" // File | file to upload
|
||||
};
|
||||
apiInstance.uploadFile(petId, opts).then(function(data) {
|
||||
apiInstance.uploadFile(petId, opts).then((data) => {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, function(error) {
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
|
||||
@@ -20,15 +20,15 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.StoreApi();
|
||||
let apiInstance = new SwaggerPetstore.StoreApi();
|
||||
|
||||
var orderId = "orderId_example"; // String | ID of the order that needs to be deleted
|
||||
let orderId = "orderId_example"; // String | ID of the order that needs to be deleted
|
||||
|
||||
apiInstance.deleteOrder(orderId).then(function() {
|
||||
apiInstance.deleteOrder(orderId).then(() => {
|
||||
console.log('API called successfully.');
|
||||
}, function(error) {
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
@@ -63,19 +63,19 @@ Returns a map of status codes to quantities
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
var defaultClient = SwaggerPetstore.ApiClient.instance;
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
let defaultClient = SwaggerPetstore.ApiClient.instance;
|
||||
|
||||
// Configure API key authorization: api_key
|
||||
var api_key = defaultClient.authentications['api_key'];
|
||||
let api_key = defaultClient.authentications['api_key'];
|
||||
api_key.apiKey = 'YOUR API KEY';
|
||||
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
||||
//api_key.apiKeyPrefix = 'Token';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.StoreApi();
|
||||
apiInstance.getInventory().then(function(data) {
|
||||
let apiInstance = new SwaggerPetstore.StoreApi();
|
||||
apiInstance.getInventory().then((data) => {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, function(error) {
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
@@ -107,15 +107,15 @@ For valid response try integer IDs with value <= 5 or > 10. Other val
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.StoreApi();
|
||||
let apiInstance = new SwaggerPetstore.StoreApi();
|
||||
|
||||
var orderId = 789; // Number | ID of pet that needs to be fetched
|
||||
let orderId = 789; // Number | ID of pet that needs to be fetched
|
||||
|
||||
apiInstance.getOrderById(orderId).then(function(data) {
|
||||
apiInstance.getOrderById(orderId).then((data) => {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, function(error) {
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
@@ -150,15 +150,15 @@ Place an order for a pet
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.StoreApi();
|
||||
let apiInstance = new SwaggerPetstore.StoreApi();
|
||||
|
||||
var body = new SwaggerPetstore.Order(); // Order | order placed for purchasing the pet
|
||||
let body = new SwaggerPetstore.Order(); // Order | order placed for purchasing the pet
|
||||
|
||||
apiInstance.placeOrder(body).then(function(data) {
|
||||
apiInstance.placeOrder(body).then((data) => {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, function(error) {
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
|
||||
@@ -24,15 +24,15 @@ This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.UserApi();
|
||||
let apiInstance = new SwaggerPetstore.UserApi();
|
||||
|
||||
var body = new SwaggerPetstore.User(); // User | Created user object
|
||||
let body = new SwaggerPetstore.User(); // User | Created user object
|
||||
|
||||
apiInstance.createUser(body).then(function() {
|
||||
apiInstance.createUser(body).then(() => {
|
||||
console.log('API called successfully.');
|
||||
}, function(error) {
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
@@ -67,15 +67,15 @@ Creates list of users with given input array
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.UserApi();
|
||||
let apiInstance = new SwaggerPetstore.UserApi();
|
||||
|
||||
var body = [new SwaggerPetstore.User()]; // [User] | List of user object
|
||||
let body = [new SwaggerPetstore.User()]; // [User] | List of user object
|
||||
|
||||
apiInstance.createUsersWithArrayInput(body).then(function() {
|
||||
apiInstance.createUsersWithArrayInput(body).then(() => {
|
||||
console.log('API called successfully.');
|
||||
}, function(error) {
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
@@ -110,15 +110,15 @@ Creates list of users with given input array
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.UserApi();
|
||||
let apiInstance = new SwaggerPetstore.UserApi();
|
||||
|
||||
var body = [new SwaggerPetstore.User()]; // [User] | List of user object
|
||||
let body = [new SwaggerPetstore.User()]; // [User] | List of user object
|
||||
|
||||
apiInstance.createUsersWithListInput(body).then(function() {
|
||||
apiInstance.createUsersWithListInput(body).then(() => {
|
||||
console.log('API called successfully.');
|
||||
}, function(error) {
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
@@ -153,15 +153,15 @@ This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.UserApi();
|
||||
let apiInstance = new SwaggerPetstore.UserApi();
|
||||
|
||||
var username = "username_example"; // String | The name that needs to be deleted
|
||||
let username = "username_example"; // String | The name that needs to be deleted
|
||||
|
||||
apiInstance.deleteUser(username).then(function() {
|
||||
apiInstance.deleteUser(username).then(() => {
|
||||
console.log('API called successfully.');
|
||||
}, function(error) {
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
@@ -196,15 +196,15 @@ Get user by user name
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.UserApi();
|
||||
let apiInstance = new SwaggerPetstore.UserApi();
|
||||
|
||||
var username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing.
|
||||
let username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing.
|
||||
|
||||
apiInstance.getUserByName(username).then(function(data) {
|
||||
apiInstance.getUserByName(username).then((data) => {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, function(error) {
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
@@ -239,17 +239,17 @@ Logs user into the system
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.UserApi();
|
||||
let apiInstance = new SwaggerPetstore.UserApi();
|
||||
|
||||
var username = "username_example"; // String | The user name for login
|
||||
let username = "username_example"; // String | The user name for login
|
||||
|
||||
var password = "password_example"; // String | The password for login in clear text
|
||||
let password = "password_example"; // String | The password for login in clear text
|
||||
|
||||
apiInstance.loginUser(username, password).then(function(data) {
|
||||
apiInstance.loginUser(username, password).then((data) => {
|
||||
console.log('API called successfully. Returned data: ' + data);
|
||||
}, function(error) {
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
@@ -285,12 +285,12 @@ Logs out current logged in user session
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.UserApi();
|
||||
apiInstance.logoutUser().then(function() {
|
||||
let apiInstance = new SwaggerPetstore.UserApi();
|
||||
apiInstance.logoutUser().then(() => {
|
||||
console.log('API called successfully.');
|
||||
}, function(error) {
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
@@ -322,17 +322,17 @@ This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
```javascript
|
||||
var SwaggerPetstore = require('swagger_petstore');
|
||||
import SwaggerPetstore from 'swagger_petstore';
|
||||
|
||||
var apiInstance = new SwaggerPetstore.UserApi();
|
||||
let apiInstance = new SwaggerPetstore.UserApi();
|
||||
|
||||
var username = "username_example"; // String | name that need to be deleted
|
||||
let username = "username_example"; // String | name that need to be deleted
|
||||
|
||||
var body = new SwaggerPetstore.User(); // User | Updated user object
|
||||
let body = new SwaggerPetstore.User(); // User | Updated user object
|
||||
|
||||
apiInstance.updateUser(username, body).then(function() {
|
||||
apiInstance.updateUser(username, body).then(() => {
|
||||
console.log('API called successfully.');
|
||||
}, function(error) {
|
||||
}, (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user