forked from loafle/openapi-generator-original
feat(typescript): improve docs generation (#19699)
This commit is contained in:
parent
911455d206
commit
1b247e75a9
@ -22,27 +22,31 @@ Method | HTTP request | Description
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { {{{moduleName}}} } from '{{{projectName}}}';
|
{{#hasParams}}
|
||||||
import * as fs from 'fs';
|
import { createConfiguration, {{classname}} } from '{{{projectName}}}';
|
||||||
|
import type { {{classname}}{{operationIdCamelCase}}Request } from '{{{projectName}}}';
|
||||||
|
{{/hasParams}}
|
||||||
|
{{^hasParams}}
|
||||||
|
import { createConfiguration, {{classname}} } from '{{{projectName}}}';
|
||||||
|
{{/hasParams}}
|
||||||
|
|
||||||
const configuration = {{{moduleName}}}.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new {{{moduleName}}}.{{classname}}(configuration);
|
const apiInstance = new {{classname}}(configuration);
|
||||||
|
|
||||||
{{#hasParams}}
|
{{#hasParams}}
|
||||||
let body:{{{moduleName}}}.{{classname}}{{operationIdCamelCase}}Request = {
|
const request: {{classname}}{{operationIdCamelCase}}Request = {
|
||||||
{{#allParams}}
|
{{#allParams}}
|
||||||
// {{{dataType}}}{{#description}} | {{{description}}}{{/description}}{{^required}} (optional){{/required}}
|
{{#description}} // {{{description}}}{{^required}} (optional){{/required}}{{/description}}
|
||||||
{{paramName}}: {{{example}}},
|
{{paramName}}: {{{example}}},
|
||||||
{{/allParams}}
|
{{/allParams}}
|
||||||
};
|
};
|
||||||
{{/hasParams}}
|
{{/hasParams}}
|
||||||
{{^hasParams}}
|
{{^hasParams}}
|
||||||
let body:any = {};
|
const request = {};
|
||||||
{{/hasParams}}
|
{{/hasParams}}
|
||||||
|
|
||||||
apiInstance.{{{operationId}}}(body).then((data:any) => {
|
const data = await apiInstance.{{{operationId}}}(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,17 +15,15 @@ Method | HTTP request | Description
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.list(body).then((data:any) => {
|
const data = await apiInstance.list(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,17 +15,15 @@ Method | HTTP request | Description
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.uniqueItems(body).then((data:any) => {
|
const data = await apiInstance.uniqueItems(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -46,17 +46,15 @@ Method | HTTP request | Description
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.testDecodeArrayOfArraysGet(body).then((data:any) => {
|
const data = await apiInstance.testDecodeArrayOfArraysGet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -93,17 +91,15 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.testDecodeArrayOfGet(body).then((data:any) => {
|
const data = await apiInstance.testDecodeArrayOfGet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -140,17 +136,15 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.testDecodeArrayOfMapsOfObjectsGet(body).then((data:any) => {
|
const data = await apiInstance.testDecodeArrayOfMapsOfObjectsGet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -187,17 +181,15 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.testDecodeArrayOfNullableGet(body).then((data:any) => {
|
const data = await apiInstance.testDecodeArrayOfNullableGet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -234,17 +226,15 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.testDecodeArrayOfNullableObjectsGet(body).then((data:any) => {
|
const data = await apiInstance.testDecodeArrayOfNullableObjectsGet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -281,17 +271,15 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.testDecodeCompositeObjectsGet(body).then((data:any) => {
|
const data = await apiInstance.testDecodeCompositeObjectsGet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -328,17 +316,15 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.testDecodeMapOfMapsOfObjectsGet(body).then((data:any) => {
|
const data = await apiInstance.testDecodeMapOfMapsOfObjectsGet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -375,17 +361,15 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.testDecodeMapOfObjectsGet(body).then((data:any) => {
|
const data = await apiInstance.testDecodeMapOfObjectsGet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -422,17 +406,15 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.testDecodeMapOfPrimitiveGet(body).then((data:any) => {
|
const data = await apiInstance.testDecodeMapOfPrimitiveGet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -469,17 +451,15 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.testDecodeNullableArrayGet(body).then((data:any) => {
|
const data = await apiInstance.testDecodeNullableArrayGet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -516,17 +496,15 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.testDecodeNullableGet(body).then((data:any) => {
|
const data = await apiInstance.testDecodeNullableGet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -563,17 +541,15 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.testDecodeObjectGet(body).then((data:any) => {
|
const data = await apiInstance.testDecodeObjectGet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -610,17 +586,15 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.testDecodePrimitiveBooleanGet(body).then((data:any) => {
|
const data = await apiInstance.testDecodePrimitiveBooleanGet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -657,17 +631,15 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.testDecodePrimitiveIntegerGet(body).then((data:any) => {
|
const data = await apiInstance.testDecodePrimitiveIntegerGet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -704,17 +676,15 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.testDecodePrimitiveNumberGet(body).then((data:any) => {
|
const data = await apiInstance.testDecodePrimitiveNumberGet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -751,17 +721,15 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.testDecodePrimitiveStringGet(body).then((data:any) => {
|
const data = await apiInstance.testDecodePrimitiveStringGet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -798,14 +766,14 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
import type { DefaultApiTestEncodeArrayOfArraysPostRequest } from '';
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:.DefaultApiTestEncodeArrayOfArraysPostRequest = {
|
const request: DefaultApiTestEncodeArrayOfArraysPostRequest = {
|
||||||
// Array<Array<string>>
|
|
||||||
requestBody: [
|
requestBody: [
|
||||||
[
|
[
|
||||||
"string_example",
|
"string_example",
|
||||||
@ -813,9 +781,8 @@ let body:.DefaultApiTestEncodeArrayOfArraysPostRequest = {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.testEncodeArrayOfArraysPost(body).then((data:any) => {
|
const data = await apiInstance.testEncodeArrayOfArraysPost(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -855,14 +822,14 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
import type { DefaultApiTestEncodeArrayOfMapsOfObjectsPostRequest } from '';
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:.DefaultApiTestEncodeArrayOfMapsOfObjectsPostRequest = {
|
const request: DefaultApiTestEncodeArrayOfMapsOfObjectsPostRequest = {
|
||||||
// Array<{ [key: string]: ComplexObject; }>
|
|
||||||
complexObject: [
|
complexObject: [
|
||||||
{
|
{
|
||||||
"key": {
|
"key": {
|
||||||
@ -875,9 +842,8 @@ let body:.DefaultApiTestEncodeArrayOfMapsOfObjectsPostRequest = {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.testEncodeArrayOfMapsOfObjectsPost(body).then((data:any) => {
|
const data = await apiInstance.testEncodeArrayOfMapsOfObjectsPost(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -917,14 +883,14 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
import type { DefaultApiTestEncodeArrayOfNullableObjectsPostRequest } from '';
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:.DefaultApiTestEncodeArrayOfNullableObjectsPostRequest = {
|
const request: DefaultApiTestEncodeArrayOfNullableObjectsPostRequest = {
|
||||||
// Array<ComplexObject>
|
|
||||||
complexObject: [
|
complexObject: [
|
||||||
{
|
{
|
||||||
requiredProperty: "requiredProperty_example",
|
requiredProperty: "requiredProperty_example",
|
||||||
@ -935,9 +901,8 @@ let body:.DefaultApiTestEncodeArrayOfNullableObjectsPostRequest = {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.testEncodeArrayOfNullableObjectsPost(body).then((data:any) => {
|
const data = await apiInstance.testEncodeArrayOfNullableObjectsPost(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -977,22 +942,21 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
import type { DefaultApiTestEncodeArrayOfNullablePostRequest } from '';
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:.DefaultApiTestEncodeArrayOfNullablePostRequest = {
|
const request: DefaultApiTestEncodeArrayOfNullablePostRequest = {
|
||||||
// Array<string | null>
|
|
||||||
requestBody: [
|
requestBody: [
|
||||||
"requestBody_example",
|
"requestBody_example",
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.testEncodeArrayOfNullablePost(body).then((data:any) => {
|
const data = await apiInstance.testEncodeArrayOfNullablePost(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -1032,22 +996,21 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
import type { DefaultApiTestEncodeArrayOfPostRequest } from '';
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:.DefaultApiTestEncodeArrayOfPostRequest = {
|
const request: DefaultApiTestEncodeArrayOfPostRequest = {
|
||||||
// Array<string>
|
|
||||||
requestBody: [
|
requestBody: [
|
||||||
"requestBody_example",
|
"requestBody_example",
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.testEncodeArrayOfPost(body).then((data:any) => {
|
const data = await apiInstance.testEncodeArrayOfPost(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -1087,14 +1050,14 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
import type { DefaultApiTestEncodeCompositeObjectsPostRequest } from '';
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:.DefaultApiTestEncodeCompositeObjectsPostRequest = {
|
const request: DefaultApiTestEncodeCompositeObjectsPostRequest = {
|
||||||
// CompositeObject
|
|
||||||
compositeObject: {
|
compositeObject: {
|
||||||
optionalNullableInnerObject: {
|
optionalNullableInnerObject: {
|
||||||
requiredProperty: "requiredProperty_example",
|
requiredProperty: "requiredProperty_example",
|
||||||
@ -1105,9 +1068,8 @@ let body:.DefaultApiTestEncodeCompositeObjectsPostRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.testEncodeCompositeObjectsPost(body).then((data:any) => {
|
const data = await apiInstance.testEncodeCompositeObjectsPost(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -1147,14 +1109,14 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
import type { DefaultApiTestEncodeMapOfMapsOfObjectsPostRequest } from '';
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:.DefaultApiTestEncodeMapOfMapsOfObjectsPostRequest = {
|
const request: DefaultApiTestEncodeMapOfMapsOfObjectsPostRequest = {
|
||||||
// { [key: string]: { [key: string]: ComplexObject; }; }
|
|
||||||
requestBody: {
|
requestBody: {
|
||||||
"key":
|
"key":
|
||||||
key: {
|
key: {
|
||||||
@ -1167,9 +1129,8 @@ let body:.DefaultApiTestEncodeMapOfMapsOfObjectsPostRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.testEncodeMapOfMapsOfObjectsPost(body).then((data:any) => {
|
const data = await apiInstance.testEncodeMapOfMapsOfObjectsPost(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -1209,14 +1170,14 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
import type { DefaultApiTestEncodeMapOfObjectsPostRequest } from '';
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:.DefaultApiTestEncodeMapOfObjectsPostRequest = {
|
const request: DefaultApiTestEncodeMapOfObjectsPostRequest = {
|
||||||
// { [key: string]: ComplexObject | null; }
|
|
||||||
requestBody: {
|
requestBody: {
|
||||||
"key": {
|
"key": {
|
||||||
requiredProperty: "requiredProperty_example",
|
requiredProperty: "requiredProperty_example",
|
||||||
@ -1227,9 +1188,8 @@ let body:.DefaultApiTestEncodeMapOfObjectsPostRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.testEncodeMapOfObjectsPost(body).then((data:any) => {
|
const data = await apiInstance.testEncodeMapOfObjectsPost(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -1269,22 +1229,21 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
import type { DefaultApiTestEncodeMapOfPrimitivePostRequest } from '';
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:.DefaultApiTestEncodeMapOfPrimitivePostRequest = {
|
const request: DefaultApiTestEncodeMapOfPrimitivePostRequest = {
|
||||||
// { [key: string]: string; }
|
|
||||||
requestBody: {
|
requestBody: {
|
||||||
"key": "key_example",
|
"key": "key_example",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.testEncodeMapOfPrimitivePost(body).then((data:any) => {
|
const data = await apiInstance.testEncodeMapOfPrimitivePost(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -1324,22 +1283,21 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
import type { DefaultApiTestEncodeNullableArrayPostRequest } from '';
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:.DefaultApiTestEncodeNullableArrayPostRequest = {
|
const request: DefaultApiTestEncodeNullableArrayPostRequest = {
|
||||||
// Array<string> (optional)
|
|
||||||
requestBody: [
|
requestBody: [
|
||||||
"requestBody_example",
|
"requestBody_example",
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.testEncodeNullableArrayPost(body).then((data:any) => {
|
const data = await apiInstance.testEncodeNullableArrayPost(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -1379,20 +1337,19 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
import type { DefaultApiTestEncodeNullablePostRequest } from '';
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:.DefaultApiTestEncodeNullablePostRequest = {
|
const request: DefaultApiTestEncodeNullablePostRequest = {
|
||||||
// string (optional)
|
|
||||||
body: "body_example",
|
body: "body_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.testEncodeNullablePost(body).then((data:any) => {
|
const data = await apiInstance.testEncodeNullablePost(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -1432,14 +1389,14 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
import type { DefaultApiTestEncodeObjectPostRequest } from '';
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:.DefaultApiTestEncodeObjectPostRequest = {
|
const request: DefaultApiTestEncodeObjectPostRequest = {
|
||||||
// ComplexObject
|
|
||||||
complexObject: {
|
complexObject: {
|
||||||
requiredProperty: "requiredProperty_example",
|
requiredProperty: "requiredProperty_example",
|
||||||
requiredNullableProperty: "requiredNullableProperty_example",
|
requiredNullableProperty: "requiredNullableProperty_example",
|
||||||
@ -1448,9 +1405,8 @@ let body:.DefaultApiTestEncodeObjectPostRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.testEncodeObjectPost(body).then((data:any) => {
|
const data = await apiInstance.testEncodeObjectPost(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -1490,20 +1446,19 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
import type { DefaultApiTestEncodePrimitiveBooleanPostRequest } from '';
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:.DefaultApiTestEncodePrimitiveBooleanPostRequest = {
|
const request: DefaultApiTestEncodePrimitiveBooleanPostRequest = {
|
||||||
// boolean
|
|
||||||
body: true,
|
body: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.testEncodePrimitiveBooleanPost(body).then((data:any) => {
|
const data = await apiInstance.testEncodePrimitiveBooleanPost(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -1543,20 +1498,19 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
import type { DefaultApiTestEncodePrimitiveIntegerPostRequest } from '';
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:.DefaultApiTestEncodePrimitiveIntegerPostRequest = {
|
const request: DefaultApiTestEncodePrimitiveIntegerPostRequest = {
|
||||||
// number
|
|
||||||
body: 1,
|
body: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.testEncodePrimitiveIntegerPost(body).then((data:any) => {
|
const data = await apiInstance.testEncodePrimitiveIntegerPost(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -1596,20 +1550,19 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
import type { DefaultApiTestEncodePrimitiveNumberPostRequest } from '';
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:.DefaultApiTestEncodePrimitiveNumberPostRequest = {
|
const request: DefaultApiTestEncodePrimitiveNumberPostRequest = {
|
||||||
// number
|
|
||||||
body: 3.14,
|
body: 3.14,
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.testEncodePrimitiveNumberPost(body).then((data:any) => {
|
const data = await apiInstance.testEncodePrimitiveNumberPost(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -1649,20 +1602,19 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
import type { DefaultApiTestEncodePrimitiveStringPostRequest } from '';
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:.DefaultApiTestEncodePrimitiveStringPostRequest = {
|
const request: DefaultApiTestEncodePrimitiveStringPostRequest = {
|
||||||
// string
|
|
||||||
body: "body_example",
|
body: "body_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.testEncodePrimitiveStringPost(body).then((data:any) => {
|
const data = await apiInstance.testEncodePrimitiveStringPost(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,14 +23,14 @@ Method | HTTP request | Description
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiAddPetRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiAddPetRequest = {
|
const request: PetApiAddPetRequest = {
|
||||||
// Pet | Pet object that needs to be added to the store
|
// Pet object that needs to be added to the store
|
||||||
pet: {
|
pet: {
|
||||||
id: 1,
|
id: 1,
|
||||||
category: {
|
category: {
|
||||||
@ -51,9 +51,8 @@ let body:petstore.PetApiAddPetRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.addPet(body).then((data:any) => {
|
const data = await apiInstance.addPet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -95,22 +94,21 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiDeletePetRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiDeletePetRequest = {
|
const request: PetApiDeletePetRequest = {
|
||||||
// number | Pet id to delete
|
// Pet id to delete
|
||||||
petId: 1,
|
petId: 1,
|
||||||
// string (optional)
|
|
||||||
apiKey: "api_key_example",
|
apiKey: "api_key_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.deletePet(body).then((data:any) => {
|
const data = await apiInstance.deletePet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -152,22 +150,21 @@ Multiple status values can be provided with comma separated strings
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiFindPetsByStatusRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiFindPetsByStatusRequest = {
|
const request: PetApiFindPetsByStatusRequest = {
|
||||||
// Array<'available' | 'pending' | 'sold'> | Status values that need to be considered for filter
|
// Status values that need to be considered for filter
|
||||||
status: [
|
status: [
|
||||||
"available",
|
"available",
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.findPetsByStatus(body).then((data:any) => {
|
const data = await apiInstance.findPetsByStatus(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -209,22 +206,21 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiFindPetsByTagsRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiFindPetsByTagsRequest = {
|
const request: PetApiFindPetsByTagsRequest = {
|
||||||
// Array<string> | Tags to filter by
|
// Tags to filter by
|
||||||
tags: [
|
tags: [
|
||||||
"tags_example",
|
"tags_example",
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.findPetsByTags(body).then((data:any) => {
|
const data = await apiInstance.findPetsByTags(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -266,20 +262,19 @@ Returns a single pet
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiGetPetByIdRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiGetPetByIdRequest = {
|
const request: PetApiGetPetByIdRequest = {
|
||||||
// number | ID of pet to return
|
// ID of pet to return
|
||||||
petId: 1,
|
petId: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.getPetById(body).then((data:any) => {
|
const data = await apiInstance.getPetById(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -322,14 +317,14 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiUpdatePetRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiUpdatePetRequest = {
|
const request: PetApiUpdatePetRequest = {
|
||||||
// Pet | Pet object that needs to be added to the store
|
// Pet object that needs to be added to the store
|
||||||
pet: {
|
pet: {
|
||||||
id: 1,
|
id: 1,
|
||||||
category: {
|
category: {
|
||||||
@ -350,9 +345,8 @@ let body:petstore.PetApiUpdatePetRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.updatePet(body).then((data:any) => {
|
const data = await apiInstance.updatePet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -396,24 +390,23 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiUpdatePetWithFormRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiUpdatePetWithFormRequest = {
|
const request: PetApiUpdatePetWithFormRequest = {
|
||||||
// number | ID of pet that needs to be updated
|
// ID of pet that needs to be updated
|
||||||
petId: 1,
|
petId: 1,
|
||||||
// string | Updated name of the pet (optional)
|
// Updated name of the pet (optional)
|
||||||
name: "name_example",
|
name: "name_example",
|
||||||
// string | Updated status of the pet (optional)
|
// Updated status of the pet (optional)
|
||||||
status: "status_example",
|
status: "status_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.updatePetWithForm(body).then((data:any) => {
|
const data = await apiInstance.updatePetWithForm(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -456,24 +449,23 @@ void (empty response body)
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiUploadFileRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiUploadFileRequest = {
|
const request: PetApiUploadFileRequest = {
|
||||||
// number | ID of pet to update
|
// ID of pet to update
|
||||||
petId: 1,
|
petId: 1,
|
||||||
// string | Additional data to pass to server (optional)
|
// Additional data to pass to server (optional)
|
||||||
additionalMetadata: "additionalMetadata_example",
|
additionalMetadata: "additionalMetadata_example",
|
||||||
// HttpFile | file to upload (optional)
|
// file to upload (optional)
|
||||||
file: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' },
|
file: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' },
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.uploadFile(body).then((data:any) => {
|
const data = await apiInstance.uploadFile(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,20 +19,19 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { StoreApiDeleteOrderRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:petstore.StoreApiDeleteOrderRequest = {
|
const request: StoreApiDeleteOrderRequest = {
|
||||||
// string | ID of the order that needs to be deleted
|
// ID of the order that needs to be deleted
|
||||||
orderId: "orderId_example",
|
orderId: "orderId_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.deleteOrder(body).then((data:any) => {
|
const data = await apiInstance.deleteOrder(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -74,17 +73,15 @@ Returns a map of status codes to quantities
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.getInventory(body).then((data:any) => {
|
const data = await apiInstance.getInventory(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -122,20 +119,19 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { StoreApiGetOrderByIdRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:petstore.StoreApiGetOrderByIdRequest = {
|
const request: StoreApiGetOrderByIdRequest = {
|
||||||
// number | ID of pet that needs to be fetched
|
// ID of pet that needs to be fetched
|
||||||
orderId: 1,
|
orderId: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.getOrderById(body).then((data:any) => {
|
const data = await apiInstance.getOrderById(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -178,14 +174,14 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { StoreApiPlaceOrderRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:petstore.StoreApiPlaceOrderRequest = {
|
const request: StoreApiPlaceOrderRequest = {
|
||||||
// Order | order placed for purchasing the pet
|
// order placed for purchasing the pet
|
||||||
order: {
|
order: {
|
||||||
id: 1,
|
id: 1,
|
||||||
petId: 1,
|
petId: 1,
|
||||||
@ -196,9 +192,8 @@ let body:petstore.StoreApiPlaceOrderRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.placeOrder(body).then((data:any) => {
|
const data = await apiInstance.placeOrder(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,14 +23,14 @@ This can only be done by the logged in user.
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiCreateUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiCreateUserRequest = {
|
const request: UserApiCreateUserRequest = {
|
||||||
// User | Created user object
|
// Created user object
|
||||||
user: {
|
user: {
|
||||||
id: 1,
|
id: 1,
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
@ -43,9 +43,8 @@ let body:petstore.UserApiCreateUserRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.createUser(body).then((data:any) => {
|
const data = await apiInstance.createUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -86,14 +85,14 @@ void (empty response body)
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiCreateUsersWithArrayInputRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiCreateUsersWithArrayInputRequest = {
|
const request: UserApiCreateUsersWithArrayInputRequest = {
|
||||||
// Array<User> | List of user object
|
// List of user object
|
||||||
user: [
|
user: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
@ -108,9 +107,8 @@ let body:petstore.UserApiCreateUsersWithArrayInputRequest = {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.createUsersWithArrayInput(body).then((data:any) => {
|
const data = await apiInstance.createUsersWithArrayInput(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -151,14 +149,14 @@ void (empty response body)
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiCreateUsersWithListInputRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiCreateUsersWithListInputRequest = {
|
const request: UserApiCreateUsersWithListInputRequest = {
|
||||||
// Array<User> | List of user object
|
// List of user object
|
||||||
user: [
|
user: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
@ -173,9 +171,8 @@ let body:petstore.UserApiCreateUsersWithListInputRequest = {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.createUsersWithListInput(body).then((data:any) => {
|
const data = await apiInstance.createUsersWithListInput(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -216,20 +213,19 @@ This can only be done by the logged in user.
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiDeleteUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiDeleteUserRequest = {
|
const request: UserApiDeleteUserRequest = {
|
||||||
// string | The name that needs to be deleted
|
// The name that needs to be deleted
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.deleteUser(body).then((data:any) => {
|
const data = await apiInstance.deleteUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -271,20 +267,19 @@ void (empty response body)
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiGetUserByNameRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiGetUserByNameRequest = {
|
const request: UserApiGetUserByNameRequest = {
|
||||||
// string | The name that needs to be fetched. Use user1 for testing.
|
// The name that needs to be fetched. Use user1 for testing.
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.getUserByName(body).then((data:any) => {
|
const data = await apiInstance.getUserByName(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -327,22 +322,21 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiLoginUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiLoginUserRequest = {
|
const request: UserApiLoginUserRequest = {
|
||||||
// string | The user name for login
|
// The user name for login
|
||||||
username: "CbUUGjjNSwg0_bs9ZayIMrKdgNvb6gvxmPb9GcsM61ate1RA89q3w1l4eH4XxEz.5awLMdeXylwK0lMGUSM4jsrh4dstlnQUN5vVdMLPA",
|
username: "CbUUGjjNSwg0_bs9ZayIMrKdgNvb6gvxmPb9GcsM61ate1RA89q3w1l4eH4XxEz.5awLMdeXylwK0lMGUSM4jsrh4dstlnQUN5vVdMLPA",
|
||||||
// string | The password for login in clear text
|
// The password for login in clear text
|
||||||
password: "password_example",
|
password: "password_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.loginUser(body).then((data:any) => {
|
const data = await apiInstance.loginUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -385,17 +379,15 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.logoutUser(body).then((data:any) => {
|
const data = await apiInstance.logoutUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -433,16 +425,16 @@ This can only be done by the logged in user.
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiUpdateUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiUpdateUserRequest = {
|
const request: UserApiUpdateUserRequest = {
|
||||||
// string | name that need to be deleted
|
// name that need to be deleted
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
// User | Updated user object
|
// Updated user object
|
||||||
user: {
|
user: {
|
||||||
id: 1,
|
id: 1,
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
@ -455,9 +447,8 @@ let body:petstore.UserApiUpdateUserRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.updateUser(body).then((data:any) => {
|
const data = await apiInstance.updateUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,22 +17,21 @@ Method | HTTP request | Description
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
import type { DefaultApiFilePostRequest } from '';
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:.DefaultApiFilePostRequest = {
|
const request: DefaultApiFilePostRequest = {
|
||||||
// FilePostRequest (optional)
|
|
||||||
filePostRequest: {
|
filePostRequest: {
|
||||||
file: null,
|
file: null,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.filePost(body).then((data:any) => {
|
const data = await apiInstance.filePost(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -72,20 +71,19 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
import type { DefaultApiPetsFilteredPatchRequest } from '';
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:.DefaultApiPetsFilteredPatchRequest = {
|
const request: DefaultApiPetsFilteredPatchRequest = {
|
||||||
// PetsFilteredPatchRequest (optional)
|
|
||||||
petsFilteredPatchRequest: null,
|
petsFilteredPatchRequest: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.petsFilteredPatch(body).then((data:any) => {
|
const data = await apiInstance.petsFilteredPatch(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -125,20 +123,19 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
import type { DefaultApiPetsPatchRequest } from '';
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:.DefaultApiPetsPatchRequest = {
|
const request: DefaultApiPetsPatchRequest = {
|
||||||
// PetsPatchRequest (optional)
|
|
||||||
petsPatchRequest: null,
|
petsPatchRequest: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.petsPatch(body).then((data:any) => {
|
const data = await apiInstance.petsPatch(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,14 +23,14 @@ Method | HTTP request | Description
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiAddPetRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiAddPetRequest = {
|
const request: PetApiAddPetRequest = {
|
||||||
// Pet | Pet object that needs to be added to the store
|
// Pet object that needs to be added to the store
|
||||||
pet: {
|
pet: {
|
||||||
id: 1,
|
id: 1,
|
||||||
category: {
|
category: {
|
||||||
@ -51,9 +51,8 @@ let body:petstore.PetApiAddPetRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.addPet(body).then((data:any) => {
|
const data = await apiInstance.addPet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -95,22 +94,21 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiDeletePetRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiDeletePetRequest = {
|
const request: PetApiDeletePetRequest = {
|
||||||
// number | Pet id to delete
|
// Pet id to delete
|
||||||
petId: 1,
|
petId: 1,
|
||||||
// string (optional)
|
|
||||||
apiKey: "api_key_example",
|
apiKey: "api_key_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.deletePet(body).then((data:any) => {
|
const data = await apiInstance.deletePet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -152,22 +150,21 @@ Multiple status values can be provided with comma separated strings
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiFindPetsByStatusRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiFindPetsByStatusRequest = {
|
const request: PetApiFindPetsByStatusRequest = {
|
||||||
// Array<'available' | 'pending' | 'sold'> | Status values that need to be considered for filter
|
// Status values that need to be considered for filter
|
||||||
status: [
|
status: [
|
||||||
"available",
|
"available",
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.findPetsByStatus(body).then((data:any) => {
|
const data = await apiInstance.findPetsByStatus(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -209,22 +206,21 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiFindPetsByTagsRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiFindPetsByTagsRequest = {
|
const request: PetApiFindPetsByTagsRequest = {
|
||||||
// Array<string> | Tags to filter by
|
// Tags to filter by
|
||||||
tags: [
|
tags: [
|
||||||
"tags_example",
|
"tags_example",
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.findPetsByTags(body).then((data:any) => {
|
const data = await apiInstance.findPetsByTags(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -266,20 +262,19 @@ Returns a single pet
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiGetPetByIdRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiGetPetByIdRequest = {
|
const request: PetApiGetPetByIdRequest = {
|
||||||
// number | ID of pet to return
|
// ID of pet to return
|
||||||
petId: 1,
|
petId: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.getPetById(body).then((data:any) => {
|
const data = await apiInstance.getPetById(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -322,14 +317,14 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiUpdatePetRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiUpdatePetRequest = {
|
const request: PetApiUpdatePetRequest = {
|
||||||
// Pet | Pet object that needs to be added to the store
|
// Pet object that needs to be added to the store
|
||||||
pet: {
|
pet: {
|
||||||
id: 1,
|
id: 1,
|
||||||
category: {
|
category: {
|
||||||
@ -350,9 +345,8 @@ let body:petstore.PetApiUpdatePetRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.updatePet(body).then((data:any) => {
|
const data = await apiInstance.updatePet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -396,24 +390,23 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiUpdatePetWithFormRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiUpdatePetWithFormRequest = {
|
const request: PetApiUpdatePetWithFormRequest = {
|
||||||
// number | ID of pet that needs to be updated
|
// ID of pet that needs to be updated
|
||||||
petId: 1,
|
petId: 1,
|
||||||
// string | Updated name of the pet (optional)
|
// Updated name of the pet (optional)
|
||||||
name: "name_example",
|
name: "name_example",
|
||||||
// string | Updated status of the pet (optional)
|
// Updated status of the pet (optional)
|
||||||
status: "status_example",
|
status: "status_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.updatePetWithForm(body).then((data:any) => {
|
const data = await apiInstance.updatePetWithForm(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -456,24 +449,23 @@ void (empty response body)
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiUploadFileRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiUploadFileRequest = {
|
const request: PetApiUploadFileRequest = {
|
||||||
// number | ID of pet to update
|
// ID of pet to update
|
||||||
petId: 1,
|
petId: 1,
|
||||||
// string | Additional data to pass to server (optional)
|
// Additional data to pass to server (optional)
|
||||||
additionalMetadata: "additionalMetadata_example",
|
additionalMetadata: "additionalMetadata_example",
|
||||||
// HttpFile | file to upload (optional)
|
// file to upload (optional)
|
||||||
file: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' },
|
file: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' },
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.uploadFile(body).then((data:any) => {
|
const data = await apiInstance.uploadFile(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,20 +19,19 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { StoreApiDeleteOrderRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:petstore.StoreApiDeleteOrderRequest = {
|
const request: StoreApiDeleteOrderRequest = {
|
||||||
// string | ID of the order that needs to be deleted
|
// ID of the order that needs to be deleted
|
||||||
orderId: "orderId_example",
|
orderId: "orderId_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.deleteOrder(body).then((data:any) => {
|
const data = await apiInstance.deleteOrder(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -74,17 +73,15 @@ Returns a map of status codes to quantities
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.getInventory(body).then((data:any) => {
|
const data = await apiInstance.getInventory(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -122,20 +119,19 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { StoreApiGetOrderByIdRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:petstore.StoreApiGetOrderByIdRequest = {
|
const request: StoreApiGetOrderByIdRequest = {
|
||||||
// number | ID of pet that needs to be fetched
|
// ID of pet that needs to be fetched
|
||||||
orderId: 1,
|
orderId: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.getOrderById(body).then((data:any) => {
|
const data = await apiInstance.getOrderById(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -178,14 +174,14 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { StoreApiPlaceOrderRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:petstore.StoreApiPlaceOrderRequest = {
|
const request: StoreApiPlaceOrderRequest = {
|
||||||
// Order | order placed for purchasing the pet
|
// order placed for purchasing the pet
|
||||||
order: {
|
order: {
|
||||||
id: 1,
|
id: 1,
|
||||||
petId: 1,
|
petId: 1,
|
||||||
@ -196,9 +192,8 @@ let body:petstore.StoreApiPlaceOrderRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.placeOrder(body).then((data:any) => {
|
const data = await apiInstance.placeOrder(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,14 +23,14 @@ This can only be done by the logged in user.
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiCreateUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiCreateUserRequest = {
|
const request: UserApiCreateUserRequest = {
|
||||||
// User | Created user object
|
// Created user object
|
||||||
user: {
|
user: {
|
||||||
id: 1,
|
id: 1,
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
@ -43,9 +43,8 @@ let body:petstore.UserApiCreateUserRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.createUser(body).then((data:any) => {
|
const data = await apiInstance.createUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -86,14 +85,14 @@ void (empty response body)
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiCreateUsersWithArrayInputRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiCreateUsersWithArrayInputRequest = {
|
const request: UserApiCreateUsersWithArrayInputRequest = {
|
||||||
// Array<User> | List of user object
|
// List of user object
|
||||||
user: [
|
user: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
@ -108,9 +107,8 @@ let body:petstore.UserApiCreateUsersWithArrayInputRequest = {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.createUsersWithArrayInput(body).then((data:any) => {
|
const data = await apiInstance.createUsersWithArrayInput(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -151,14 +149,14 @@ void (empty response body)
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiCreateUsersWithListInputRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiCreateUsersWithListInputRequest = {
|
const request: UserApiCreateUsersWithListInputRequest = {
|
||||||
// Array<User> | List of user object
|
// List of user object
|
||||||
user: [
|
user: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
@ -173,9 +171,8 @@ let body:petstore.UserApiCreateUsersWithListInputRequest = {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.createUsersWithListInput(body).then((data:any) => {
|
const data = await apiInstance.createUsersWithListInput(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -216,20 +213,19 @@ This can only be done by the logged in user.
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiDeleteUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiDeleteUserRequest = {
|
const request: UserApiDeleteUserRequest = {
|
||||||
// string | The name that needs to be deleted
|
// The name that needs to be deleted
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.deleteUser(body).then((data:any) => {
|
const data = await apiInstance.deleteUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -271,20 +267,19 @@ void (empty response body)
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiGetUserByNameRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiGetUserByNameRequest = {
|
const request: UserApiGetUserByNameRequest = {
|
||||||
// string | The name that needs to be fetched. Use user1 for testing.
|
// The name that needs to be fetched. Use user1 for testing.
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.getUserByName(body).then((data:any) => {
|
const data = await apiInstance.getUserByName(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -327,22 +322,21 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiLoginUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiLoginUserRequest = {
|
const request: UserApiLoginUserRequest = {
|
||||||
// string | The user name for login
|
// The user name for login
|
||||||
username: "CbUUGjjNSwg0_bs9ZayIMrKdgNvb6gvxmPb9GcsM61ate1RA89q3w1l4eH4XxEz.5awLMdeXylwK0lMGUSM4jsrh4dstlnQUN5vVdMLPA",
|
username: "CbUUGjjNSwg0_bs9ZayIMrKdgNvb6gvxmPb9GcsM61ate1RA89q3w1l4eH4XxEz.5awLMdeXylwK0lMGUSM4jsrh4dstlnQUN5vVdMLPA",
|
||||||
// string | The password for login in clear text
|
// The password for login in clear text
|
||||||
password: "password_example",
|
password: "password_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.loginUser(body).then((data:any) => {
|
const data = await apiInstance.loginUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -385,17 +379,15 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.logoutUser(body).then((data:any) => {
|
const data = await apiInstance.logoutUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -433,16 +425,16 @@ This can only be done by the logged in user.
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiUpdateUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiUpdateUserRequest = {
|
const request: UserApiUpdateUserRequest = {
|
||||||
// string | name that need to be deleted
|
// name that need to be deleted
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
// User | Updated user object
|
// Updated user object
|
||||||
user: {
|
user: {
|
||||||
id: 1,
|
id: 1,
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
@ -455,9 +447,8 @@ let body:petstore.UserApiUpdateUserRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.updateUser(body).then((data:any) => {
|
const data = await apiInstance.updateUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,14 +23,14 @@ Method | HTTP request | Description
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiAddPetRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiAddPetRequest = {
|
const request: PetApiAddPetRequest = {
|
||||||
// Pet | Pet object that needs to be added to the store
|
// Pet object that needs to be added to the store
|
||||||
pet: {
|
pet: {
|
||||||
id: 1,
|
id: 1,
|
||||||
category: {
|
category: {
|
||||||
@ -51,9 +51,8 @@ let body:petstore.PetApiAddPetRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.addPet(body).then((data:any) => {
|
const data = await apiInstance.addPet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -95,22 +94,21 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiDeletePetRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiDeletePetRequest = {
|
const request: PetApiDeletePetRequest = {
|
||||||
// number | Pet id to delete
|
// Pet id to delete
|
||||||
petId: 1,
|
petId: 1,
|
||||||
// string (optional)
|
|
||||||
apiKey: "api_key_example",
|
apiKey: "api_key_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.deletePet(body).then((data:any) => {
|
const data = await apiInstance.deletePet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -152,22 +150,21 @@ Multiple status values can be provided with comma separated strings
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiFindPetsByStatusRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiFindPetsByStatusRequest = {
|
const request: PetApiFindPetsByStatusRequest = {
|
||||||
// Array<'available' | 'pending' | 'sold'> | Status values that need to be considered for filter
|
// Status values that need to be considered for filter
|
||||||
status: [
|
status: [
|
||||||
"available",
|
"available",
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.findPetsByStatus(body).then((data:any) => {
|
const data = await apiInstance.findPetsByStatus(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -209,22 +206,21 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiFindPetsByTagsRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiFindPetsByTagsRequest = {
|
const request: PetApiFindPetsByTagsRequest = {
|
||||||
// Array<string> | Tags to filter by
|
// Tags to filter by
|
||||||
tags: [
|
tags: [
|
||||||
"tags_example",
|
"tags_example",
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.findPetsByTags(body).then((data:any) => {
|
const data = await apiInstance.findPetsByTags(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -266,20 +262,19 @@ Returns a single pet
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiGetPetByIdRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiGetPetByIdRequest = {
|
const request: PetApiGetPetByIdRequest = {
|
||||||
// number | ID of pet to return
|
// ID of pet to return
|
||||||
petId: 1,
|
petId: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.getPetById(body).then((data:any) => {
|
const data = await apiInstance.getPetById(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -322,14 +317,14 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiUpdatePetRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiUpdatePetRequest = {
|
const request: PetApiUpdatePetRequest = {
|
||||||
// Pet | Pet object that needs to be added to the store
|
// Pet object that needs to be added to the store
|
||||||
pet: {
|
pet: {
|
||||||
id: 1,
|
id: 1,
|
||||||
category: {
|
category: {
|
||||||
@ -350,9 +345,8 @@ let body:petstore.PetApiUpdatePetRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.updatePet(body).then((data:any) => {
|
const data = await apiInstance.updatePet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -396,24 +390,23 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiUpdatePetWithFormRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiUpdatePetWithFormRequest = {
|
const request: PetApiUpdatePetWithFormRequest = {
|
||||||
// number | ID of pet that needs to be updated
|
// ID of pet that needs to be updated
|
||||||
petId: 1,
|
petId: 1,
|
||||||
// string | Updated name of the pet (optional)
|
// Updated name of the pet (optional)
|
||||||
name: "name_example",
|
name: "name_example",
|
||||||
// string | Updated status of the pet (optional)
|
// Updated status of the pet (optional)
|
||||||
status: "status_example",
|
status: "status_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.updatePetWithForm(body).then((data:any) => {
|
const data = await apiInstance.updatePetWithForm(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -456,24 +449,23 @@ void (empty response body)
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiUploadFileRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiUploadFileRequest = {
|
const request: PetApiUploadFileRequest = {
|
||||||
// number | ID of pet to update
|
// ID of pet to update
|
||||||
petId: 1,
|
petId: 1,
|
||||||
// string | Additional data to pass to server (optional)
|
// Additional data to pass to server (optional)
|
||||||
additionalMetadata: "additionalMetadata_example",
|
additionalMetadata: "additionalMetadata_example",
|
||||||
// HttpFile | file to upload (optional)
|
// file to upload (optional)
|
||||||
file: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' },
|
file: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' },
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.uploadFile(body).then((data:any) => {
|
const data = await apiInstance.uploadFile(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,20 +19,19 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { StoreApiDeleteOrderRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:petstore.StoreApiDeleteOrderRequest = {
|
const request: StoreApiDeleteOrderRequest = {
|
||||||
// string | ID of the order that needs to be deleted
|
// ID of the order that needs to be deleted
|
||||||
orderId: "orderId_example",
|
orderId: "orderId_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.deleteOrder(body).then((data:any) => {
|
const data = await apiInstance.deleteOrder(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -74,17 +73,15 @@ Returns a map of status codes to quantities
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.getInventory(body).then((data:any) => {
|
const data = await apiInstance.getInventory(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -122,20 +119,19 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { StoreApiGetOrderByIdRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:petstore.StoreApiGetOrderByIdRequest = {
|
const request: StoreApiGetOrderByIdRequest = {
|
||||||
// number | ID of pet that needs to be fetched
|
// ID of pet that needs to be fetched
|
||||||
orderId: 1,
|
orderId: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.getOrderById(body).then((data:any) => {
|
const data = await apiInstance.getOrderById(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -178,14 +174,14 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { StoreApiPlaceOrderRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:petstore.StoreApiPlaceOrderRequest = {
|
const request: StoreApiPlaceOrderRequest = {
|
||||||
// Order | order placed for purchasing the pet
|
// order placed for purchasing the pet
|
||||||
order: {
|
order: {
|
||||||
id: 1,
|
id: 1,
|
||||||
petId: 1,
|
petId: 1,
|
||||||
@ -196,9 +192,8 @@ let body:petstore.StoreApiPlaceOrderRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.placeOrder(body).then((data:any) => {
|
const data = await apiInstance.placeOrder(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,14 +23,14 @@ This can only be done by the logged in user.
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiCreateUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiCreateUserRequest = {
|
const request: UserApiCreateUserRequest = {
|
||||||
// User | Created user object
|
// Created user object
|
||||||
user: {
|
user: {
|
||||||
id: 1,
|
id: 1,
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
@ -43,9 +43,8 @@ let body:petstore.UserApiCreateUserRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.createUser(body).then((data:any) => {
|
const data = await apiInstance.createUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -86,14 +85,14 @@ void (empty response body)
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiCreateUsersWithArrayInputRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiCreateUsersWithArrayInputRequest = {
|
const request: UserApiCreateUsersWithArrayInputRequest = {
|
||||||
// Array<User> | List of user object
|
// List of user object
|
||||||
user: [
|
user: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
@ -108,9 +107,8 @@ let body:petstore.UserApiCreateUsersWithArrayInputRequest = {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.createUsersWithArrayInput(body).then((data:any) => {
|
const data = await apiInstance.createUsersWithArrayInput(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -151,14 +149,14 @@ void (empty response body)
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiCreateUsersWithListInputRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiCreateUsersWithListInputRequest = {
|
const request: UserApiCreateUsersWithListInputRequest = {
|
||||||
// Array<User> | List of user object
|
// List of user object
|
||||||
user: [
|
user: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
@ -173,9 +171,8 @@ let body:petstore.UserApiCreateUsersWithListInputRequest = {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.createUsersWithListInput(body).then((data:any) => {
|
const data = await apiInstance.createUsersWithListInput(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -216,20 +213,19 @@ This can only be done by the logged in user.
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiDeleteUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiDeleteUserRequest = {
|
const request: UserApiDeleteUserRequest = {
|
||||||
// string | The name that needs to be deleted
|
// The name that needs to be deleted
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.deleteUser(body).then((data:any) => {
|
const data = await apiInstance.deleteUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -271,20 +267,19 @@ void (empty response body)
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiGetUserByNameRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiGetUserByNameRequest = {
|
const request: UserApiGetUserByNameRequest = {
|
||||||
// string | The name that needs to be fetched. Use user1 for testing.
|
// The name that needs to be fetched. Use user1 for testing.
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.getUserByName(body).then((data:any) => {
|
const data = await apiInstance.getUserByName(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -327,22 +322,21 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiLoginUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiLoginUserRequest = {
|
const request: UserApiLoginUserRequest = {
|
||||||
// string | The user name for login
|
// The user name for login
|
||||||
username: "CbUUGjjNSwg0_bs9ZayIMrKdgNvb6gvxmPb9GcsM61ate1RA89q3w1l4eH4XxEz.5awLMdeXylwK0lMGUSM4jsrh4dstlnQUN5vVdMLPA",
|
username: "CbUUGjjNSwg0_bs9ZayIMrKdgNvb6gvxmPb9GcsM61ate1RA89q3w1l4eH4XxEz.5awLMdeXylwK0lMGUSM4jsrh4dstlnQUN5vVdMLPA",
|
||||||
// string | The password for login in clear text
|
// The password for login in clear text
|
||||||
password: "password_example",
|
password: "password_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.loginUser(body).then((data:any) => {
|
const data = await apiInstance.loginUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -385,17 +379,15 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.logoutUser(body).then((data:any) => {
|
const data = await apiInstance.logoutUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -433,16 +425,16 @@ This can only be done by the logged in user.
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiUpdateUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiUpdateUserRequest = {
|
const request: UserApiUpdateUserRequest = {
|
||||||
// string | name that need to be deleted
|
// name that need to be deleted
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
// User | Updated user object
|
// Updated user object
|
||||||
user: {
|
user: {
|
||||||
id: 1,
|
id: 1,
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
@ -455,9 +447,8 @@ let body:petstore.UserApiUpdateUserRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.updateUser(body).then((data:any) => {
|
const data = await apiInstance.updateUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,14 +23,14 @@ Method | HTTP request | Description
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiAddPetRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiAddPetRequest = {
|
const request: PetApiAddPetRequest = {
|
||||||
// Pet | Pet object that needs to be added to the store
|
// Pet object that needs to be added to the store
|
||||||
pet: {
|
pet: {
|
||||||
id: 1,
|
id: 1,
|
||||||
category: {
|
category: {
|
||||||
@ -51,9 +51,8 @@ let body:petstore.PetApiAddPetRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.addPet(body).then((data:any) => {
|
const data = await apiInstance.addPet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -95,22 +94,21 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiDeletePetRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiDeletePetRequest = {
|
const request: PetApiDeletePetRequest = {
|
||||||
// number | Pet id to delete
|
// Pet id to delete
|
||||||
petId: 1,
|
petId: 1,
|
||||||
// string (optional)
|
|
||||||
apiKey: "api_key_example",
|
apiKey: "api_key_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.deletePet(body).then((data:any) => {
|
const data = await apiInstance.deletePet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -152,22 +150,21 @@ Multiple status values can be provided with comma separated strings
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiFindPetsByStatusRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiFindPetsByStatusRequest = {
|
const request: PetApiFindPetsByStatusRequest = {
|
||||||
// Array<'available' | 'pending' | 'sold'> | Status values that need to be considered for filter
|
// Status values that need to be considered for filter
|
||||||
status: [
|
status: [
|
||||||
"available",
|
"available",
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.findPetsByStatus(body).then((data:any) => {
|
const data = await apiInstance.findPetsByStatus(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -209,22 +206,21 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiFindPetsByTagsRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiFindPetsByTagsRequest = {
|
const request: PetApiFindPetsByTagsRequest = {
|
||||||
// Array<string> | Tags to filter by
|
// Tags to filter by
|
||||||
tags: [
|
tags: [
|
||||||
"tags_example",
|
"tags_example",
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.findPetsByTags(body).then((data:any) => {
|
const data = await apiInstance.findPetsByTags(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -266,20 +262,19 @@ Returns a single pet
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiGetPetByIdRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiGetPetByIdRequest = {
|
const request: PetApiGetPetByIdRequest = {
|
||||||
// number | ID of pet to return
|
// ID of pet to return
|
||||||
petId: 1,
|
petId: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.getPetById(body).then((data:any) => {
|
const data = await apiInstance.getPetById(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -322,14 +317,14 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiUpdatePetRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiUpdatePetRequest = {
|
const request: PetApiUpdatePetRequest = {
|
||||||
// Pet | Pet object that needs to be added to the store
|
// Pet object that needs to be added to the store
|
||||||
pet: {
|
pet: {
|
||||||
id: 1,
|
id: 1,
|
||||||
category: {
|
category: {
|
||||||
@ -350,9 +345,8 @@ let body:petstore.PetApiUpdatePetRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.updatePet(body).then((data:any) => {
|
const data = await apiInstance.updatePet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -396,24 +390,23 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiUpdatePetWithFormRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiUpdatePetWithFormRequest = {
|
const request: PetApiUpdatePetWithFormRequest = {
|
||||||
// number | ID of pet that needs to be updated
|
// ID of pet that needs to be updated
|
||||||
petId: 1,
|
petId: 1,
|
||||||
// string | Updated name of the pet (optional)
|
// Updated name of the pet (optional)
|
||||||
name: "name_example",
|
name: "name_example",
|
||||||
// string | Updated status of the pet (optional)
|
// Updated status of the pet (optional)
|
||||||
status: "status_example",
|
status: "status_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.updatePetWithForm(body).then((data:any) => {
|
const data = await apiInstance.updatePetWithForm(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -456,24 +449,23 @@ void (empty response body)
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiUploadFileRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiUploadFileRequest = {
|
const request: PetApiUploadFileRequest = {
|
||||||
// number | ID of pet to update
|
// ID of pet to update
|
||||||
petId: 1,
|
petId: 1,
|
||||||
// string | Additional data to pass to server (optional)
|
// Additional data to pass to server (optional)
|
||||||
additionalMetadata: "additionalMetadata_example",
|
additionalMetadata: "additionalMetadata_example",
|
||||||
// HttpFile | file to upload (optional)
|
// file to upload (optional)
|
||||||
file: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' },
|
file: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' },
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.uploadFile(body).then((data:any) => {
|
const data = await apiInstance.uploadFile(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,20 +19,19 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { StoreApiDeleteOrderRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:petstore.StoreApiDeleteOrderRequest = {
|
const request: StoreApiDeleteOrderRequest = {
|
||||||
// string | ID of the order that needs to be deleted
|
// ID of the order that needs to be deleted
|
||||||
orderId: "orderId_example",
|
orderId: "orderId_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.deleteOrder(body).then((data:any) => {
|
const data = await apiInstance.deleteOrder(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -74,17 +73,15 @@ Returns a map of status codes to quantities
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.getInventory(body).then((data:any) => {
|
const data = await apiInstance.getInventory(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -122,20 +119,19 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { StoreApiGetOrderByIdRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:petstore.StoreApiGetOrderByIdRequest = {
|
const request: StoreApiGetOrderByIdRequest = {
|
||||||
// number | ID of pet that needs to be fetched
|
// ID of pet that needs to be fetched
|
||||||
orderId: 1,
|
orderId: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.getOrderById(body).then((data:any) => {
|
const data = await apiInstance.getOrderById(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -178,14 +174,14 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { StoreApiPlaceOrderRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:petstore.StoreApiPlaceOrderRequest = {
|
const request: StoreApiPlaceOrderRequest = {
|
||||||
// Order | order placed for purchasing the pet
|
// order placed for purchasing the pet
|
||||||
order: {
|
order: {
|
||||||
id: 1,
|
id: 1,
|
||||||
petId: 1,
|
petId: 1,
|
||||||
@ -196,9 +192,8 @@ let body:petstore.StoreApiPlaceOrderRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.placeOrder(body).then((data:any) => {
|
const data = await apiInstance.placeOrder(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,14 +23,14 @@ This can only be done by the logged in user.
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiCreateUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiCreateUserRequest = {
|
const request: UserApiCreateUserRequest = {
|
||||||
// User | Created user object
|
// Created user object
|
||||||
user: {
|
user: {
|
||||||
id: 1,
|
id: 1,
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
@ -43,9 +43,8 @@ let body:petstore.UserApiCreateUserRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.createUser(body).then((data:any) => {
|
const data = await apiInstance.createUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -86,14 +85,14 @@ void (empty response body)
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiCreateUsersWithArrayInputRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiCreateUsersWithArrayInputRequest = {
|
const request: UserApiCreateUsersWithArrayInputRequest = {
|
||||||
// Array<User> | List of user object
|
// List of user object
|
||||||
user: [
|
user: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
@ -108,9 +107,8 @@ let body:petstore.UserApiCreateUsersWithArrayInputRequest = {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.createUsersWithArrayInput(body).then((data:any) => {
|
const data = await apiInstance.createUsersWithArrayInput(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -151,14 +149,14 @@ void (empty response body)
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiCreateUsersWithListInputRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiCreateUsersWithListInputRequest = {
|
const request: UserApiCreateUsersWithListInputRequest = {
|
||||||
// Array<User> | List of user object
|
// List of user object
|
||||||
user: [
|
user: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
@ -173,9 +171,8 @@ let body:petstore.UserApiCreateUsersWithListInputRequest = {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.createUsersWithListInput(body).then((data:any) => {
|
const data = await apiInstance.createUsersWithListInput(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -216,20 +213,19 @@ This can only be done by the logged in user.
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiDeleteUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiDeleteUserRequest = {
|
const request: UserApiDeleteUserRequest = {
|
||||||
// string | The name that needs to be deleted
|
// The name that needs to be deleted
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.deleteUser(body).then((data:any) => {
|
const data = await apiInstance.deleteUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -271,20 +267,19 @@ void (empty response body)
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiGetUserByNameRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiGetUserByNameRequest = {
|
const request: UserApiGetUserByNameRequest = {
|
||||||
// string | The name that needs to be fetched. Use user1 for testing.
|
// The name that needs to be fetched. Use user1 for testing.
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.getUserByName(body).then((data:any) => {
|
const data = await apiInstance.getUserByName(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -327,22 +322,21 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiLoginUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiLoginUserRequest = {
|
const request: UserApiLoginUserRequest = {
|
||||||
// string | The user name for login
|
// The user name for login
|
||||||
username: "CbUUGjjNSwg0_bs9ZayIMrKdgNvb6gvxmPb9GcsM61ate1RA89q3w1l4eH4XxEz.5awLMdeXylwK0lMGUSM4jsrh4dstlnQUN5vVdMLPA",
|
username: "CbUUGjjNSwg0_bs9ZayIMrKdgNvb6gvxmPb9GcsM61ate1RA89q3w1l4eH4XxEz.5awLMdeXylwK0lMGUSM4jsrh4dstlnQUN5vVdMLPA",
|
||||||
// string | The password for login in clear text
|
// The password for login in clear text
|
||||||
password: "password_example",
|
password: "password_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.loginUser(body).then((data:any) => {
|
const data = await apiInstance.loginUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -385,17 +379,15 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.logoutUser(body).then((data:any) => {
|
const data = await apiInstance.logoutUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -433,16 +425,16 @@ This can only be done by the logged in user.
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiUpdateUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiUpdateUserRequest = {
|
const request: UserApiUpdateUserRequest = {
|
||||||
// string | name that need to be deleted
|
// name that need to be deleted
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
// User | Updated user object
|
// Updated user object
|
||||||
user: {
|
user: {
|
||||||
id: 1,
|
id: 1,
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
@ -455,9 +447,8 @@ let body:petstore.UserApiUpdateUserRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.updateUser(body).then((data:any) => {
|
const data = await apiInstance.updateUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,22 +16,21 @@ To test special tags and operation ID starting with number
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, AnotherFakeApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { AnotherFakeApi123testSpecialTagsRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.AnotherFakeApi(configuration);
|
const apiInstance = new AnotherFakeApi(configuration);
|
||||||
|
|
||||||
let body:petstore.AnotherFakeApi123testSpecialTagsRequest = {
|
const request: AnotherFakeApi123testSpecialTagsRequest = {
|
||||||
// Client | client model
|
// client model
|
||||||
client: {
|
client: {
|
||||||
client: "client_example",
|
client: "client_example",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance._123testSpecialTags(body).then((data:any) => {
|
const data = await apiInstance._123testSpecialTags(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,17 +15,15 @@ Method | HTTP request | Description
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, DefaultApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.fooGet(body).then((data:any) => {
|
const data = await apiInstance.fooGet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -33,17 +33,15 @@ for Java apache and Java native, test toUrlQueryString for maps with BegDecimal
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, FakeApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.FakeApi(configuration);
|
const apiInstance = new FakeApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.fakeBigDecimalMap(body).then((data:any) => {
|
const data = await apiInstance.fakeBigDecimalMap(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -80,17 +78,15 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, FakeApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.FakeApi(configuration);
|
const apiInstance = new FakeApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.fakeHealthGet(body).then((data:any) => {
|
const data = await apiInstance.fakeHealthGet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -127,14 +123,14 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, FakeApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { FakeApiFakeHttpSignatureTestRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.FakeApi(configuration);
|
const apiInstance = new FakeApi(configuration);
|
||||||
|
|
||||||
let body:petstore.FakeApiFakeHttpSignatureTestRequest = {
|
const request: FakeApiFakeHttpSignatureTestRequest = {
|
||||||
// Pet | Pet object that needs to be added to the store
|
// Pet object that needs to be added to the store
|
||||||
pet: {
|
pet: {
|
||||||
id: 1,
|
id: 1,
|
||||||
category: {
|
category: {
|
||||||
@ -153,15 +149,14 @@ let body:petstore.FakeApiFakeHttpSignatureTestRequest = {
|
|||||||
],
|
],
|
||||||
status: "available",
|
status: "available",
|
||||||
},
|
},
|
||||||
// string | query parameter (optional)
|
// query parameter (optional)
|
||||||
query1: "query_1_example",
|
query1: "query_1_example",
|
||||||
// string | header parameter (optional)
|
// header parameter (optional)
|
||||||
header1: "header_1_example",
|
header1: "header_1_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.fakeHttpSignatureTest(body).then((data:any) => {
|
const data = await apiInstance.fakeHttpSignatureTest(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -204,20 +199,19 @@ Test serialization of outer boolean types
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, FakeApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { FakeApiFakeOuterBooleanSerializeRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.FakeApi(configuration);
|
const apiInstance = new FakeApi(configuration);
|
||||||
|
|
||||||
let body:petstore.FakeApiFakeOuterBooleanSerializeRequest = {
|
const request: FakeApiFakeOuterBooleanSerializeRequest = {
|
||||||
// boolean | Input boolean as post body (optional)
|
// Input boolean as post body (optional)
|
||||||
body: true,
|
body: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.fakeOuterBooleanSerialize(body).then((data:any) => {
|
const data = await apiInstance.fakeOuterBooleanSerialize(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -258,14 +252,14 @@ Test serialization of object with outer number type
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, FakeApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { FakeApiFakeOuterCompositeSerializeRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.FakeApi(configuration);
|
const apiInstance = new FakeApi(configuration);
|
||||||
|
|
||||||
let body:petstore.FakeApiFakeOuterCompositeSerializeRequest = {
|
const request: FakeApiFakeOuterCompositeSerializeRequest = {
|
||||||
// OuterComposite | Input composite as post body (optional)
|
// Input composite as post body (optional)
|
||||||
outerComposite: {
|
outerComposite: {
|
||||||
myNumber: 3.14,
|
myNumber: 3.14,
|
||||||
myString: "myString_example",
|
myString: "myString_example",
|
||||||
@ -273,9 +267,8 @@ let body:petstore.FakeApiFakeOuterCompositeSerializeRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.fakeOuterCompositeSerialize(body).then((data:any) => {
|
const data = await apiInstance.fakeOuterCompositeSerialize(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -316,20 +309,19 @@ Test serialization of outer number types
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, FakeApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { FakeApiFakeOuterNumberSerializeRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.FakeApi(configuration);
|
const apiInstance = new FakeApi(configuration);
|
||||||
|
|
||||||
let body:petstore.FakeApiFakeOuterNumberSerializeRequest = {
|
const request: FakeApiFakeOuterNumberSerializeRequest = {
|
||||||
// number | Input number as post body (optional)
|
// Input number as post body (optional)
|
||||||
body: 3.14,
|
body: 3.14,
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.fakeOuterNumberSerialize(body).then((data:any) => {
|
const data = await apiInstance.fakeOuterNumberSerialize(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -370,20 +362,19 @@ Test serialization of outer string types
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, FakeApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { FakeApiFakeOuterStringSerializeRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.FakeApi(configuration);
|
const apiInstance = new FakeApi(configuration);
|
||||||
|
|
||||||
let body:petstore.FakeApiFakeOuterStringSerializeRequest = {
|
const request: FakeApiFakeOuterStringSerializeRequest = {
|
||||||
// string | Input string as post body (optional)
|
// Input string as post body (optional)
|
||||||
body: "body_example",
|
body: "body_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.fakeOuterStringSerialize(body).then((data:any) => {
|
const data = await apiInstance.fakeOuterStringSerialize(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -424,22 +415,21 @@ Test serialization of enum (int) properties with examples
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, FakeApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { FakeApiFakePropertyEnumIntegerSerializeRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.FakeApi(configuration);
|
const apiInstance = new FakeApi(configuration);
|
||||||
|
|
||||||
let body:petstore.FakeApiFakePropertyEnumIntegerSerializeRequest = {
|
const request: FakeApiFakePropertyEnumIntegerSerializeRequest = {
|
||||||
// OuterObjectWithEnumProperty | Input enum (int) as post body
|
// Input enum (int) as post body
|
||||||
outerObjectWithEnumProperty: {
|
outerObjectWithEnumProperty: {
|
||||||
value: 2,
|
value: 2,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.fakePropertyEnumIntegerSerialize(body).then((data:any) => {
|
const data = await apiInstance.fakePropertyEnumIntegerSerialize(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -480,20 +470,19 @@ For this test, the body has to be a binary file.
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, FakeApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { FakeApiTestBodyWithBinaryRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.FakeApi(configuration);
|
const apiInstance = new FakeApi(configuration);
|
||||||
|
|
||||||
let body:petstore.FakeApiTestBodyWithBinaryRequest = {
|
const request: FakeApiTestBodyWithBinaryRequest = {
|
||||||
// HttpFile | image to upload
|
// image to upload
|
||||||
body: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' },
|
body: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' },
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.testBodyWithBinary(body).then((data:any) => {
|
const data = await apiInstance.testBodyWithBinary(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -534,14 +523,14 @@ For this test, the body for this request must reference a schema named `File`.
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, FakeApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { FakeApiTestBodyWithFileSchemaRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.FakeApi(configuration);
|
const apiInstance = new FakeApi(configuration);
|
||||||
|
|
||||||
let body:petstore.FakeApiTestBodyWithFileSchemaRequest = {
|
const request: FakeApiTestBodyWithFileSchemaRequest = {
|
||||||
// FileSchemaTestClass
|
|
||||||
fileSchemaTestClass: {
|
fileSchemaTestClass: {
|
||||||
file: {
|
file: {
|
||||||
sourceURI: "sourceURI_example",
|
sourceURI: "sourceURI_example",
|
||||||
@ -554,9 +543,8 @@ let body:petstore.FakeApiTestBodyWithFileSchemaRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.testBodyWithFileSchema(body).then((data:any) => {
|
const data = await apiInstance.testBodyWithFileSchema(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -596,16 +584,16 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, FakeApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { FakeApiTestBodyWithQueryParamsRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.FakeApi(configuration);
|
const apiInstance = new FakeApi(configuration);
|
||||||
|
|
||||||
let body:petstore.FakeApiTestBodyWithQueryParamsRequest = {
|
const request: FakeApiTestBodyWithQueryParamsRequest = {
|
||||||
// string
|
|
||||||
query: "query_example",
|
query: "query_example",
|
||||||
// User
|
|
||||||
user: {
|
user: {
|
||||||
id: 1,
|
id: 1,
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
@ -618,9 +606,8 @@ let body:petstore.FakeApiTestBodyWithQueryParamsRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.testBodyWithQueryParams(body).then((data:any) => {
|
const data = await apiInstance.testBodyWithQueryParams(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -662,22 +649,21 @@ To test \"client\" model
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, FakeApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { FakeApiTestClientModelRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.FakeApi(configuration);
|
const apiInstance = new FakeApi(configuration);
|
||||||
|
|
||||||
let body:petstore.FakeApiTestClientModelRequest = {
|
const request: FakeApiTestClientModelRequest = {
|
||||||
// Client | client model
|
// client model
|
||||||
client: {
|
client: {
|
||||||
client: "client_example",
|
client: "client_example",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.testClientModel(body).then((data:any) => {
|
const data = await apiInstance.testClientModel(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -718,46 +704,45 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, FakeApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { FakeApiTestEndpointParametersRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.FakeApi(configuration);
|
const apiInstance = new FakeApi(configuration);
|
||||||
|
|
||||||
let body:petstore.FakeApiTestEndpointParametersRequest = {
|
const request: FakeApiTestEndpointParametersRequest = {
|
||||||
// number | None
|
// None
|
||||||
number: 32.1,
|
number: 32.1,
|
||||||
// number | None
|
// None
|
||||||
_double: 67.8,
|
_double: 67.8,
|
||||||
// string | None
|
// None
|
||||||
patternWithoutDelimiter: "AUR,rZ#UM/?R,Fp^l6$ARjbhJk C>",
|
patternWithoutDelimiter: "AUR,rZ#UM/?R,Fp^l6$ARjbhJk C>",
|
||||||
// string | None
|
// None
|
||||||
_byte: 'YQ==',
|
_byte: 'YQ==',
|
||||||
// number | None (optional)
|
// None (optional)
|
||||||
integer: 10,
|
integer: 10,
|
||||||
// number | None (optional)
|
// None (optional)
|
||||||
int32: 20,
|
int32: 20,
|
||||||
// number | None (optional)
|
// None (optional)
|
||||||
int64: 1,
|
int64: 1,
|
||||||
// number | None (optional)
|
// None (optional)
|
||||||
_float: 3.14,
|
_float: 3.14,
|
||||||
// string | None (optional)
|
// None (optional)
|
||||||
string: "/a/i",
|
string: "/a/i",
|
||||||
// HttpFile | None (optional)
|
// None (optional)
|
||||||
binary: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' },
|
binary: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' },
|
||||||
// string | None (optional)
|
// None (optional)
|
||||||
date: new Date('1970-01-01').toISOString().split('T')[0];,
|
date: new Date('1970-01-01').toISOString().split('T')[0];,
|
||||||
// Date | None (optional)
|
// None (optional)
|
||||||
dateTime: new Date('1970-01-01T00:00:00.00Z'),
|
dateTime: new Date('1970-01-01T00:00:00.00Z'),
|
||||||
// string | None (optional)
|
// None (optional)
|
||||||
password: "password_example",
|
password: "password_example",
|
||||||
// string | None (optional)
|
// None (optional)
|
||||||
callback: "callback_example",
|
callback: "callback_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.testEndpointParameters(body).then((data:any) => {
|
const data = await apiInstance.testEndpointParameters(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -812,44 +797,43 @@ To test enum parameters
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, FakeApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { FakeApiTestEnumParametersRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.FakeApi(configuration);
|
const apiInstance = new FakeApi(configuration);
|
||||||
|
|
||||||
let body:petstore.FakeApiTestEnumParametersRequest = {
|
const request: FakeApiTestEnumParametersRequest = {
|
||||||
// Array<'>' | '$'> | Header parameter enum test (string array) (optional)
|
// Header parameter enum test (string array) (optional)
|
||||||
enumHeaderStringArray: [
|
enumHeaderStringArray: [
|
||||||
"$",
|
"$",
|
||||||
],
|
],
|
||||||
// '_abc' | '-efg' | '(xyz)' | Header parameter enum test (string) (optional)
|
// Header parameter enum test (string) (optional)
|
||||||
enumHeaderString: "-efg",
|
enumHeaderString: "-efg",
|
||||||
// Array<'>' | '$'> | Query parameter enum test (string array) (optional)
|
// Query parameter enum test (string array) (optional)
|
||||||
enumQueryStringArray: [
|
enumQueryStringArray: [
|
||||||
"$",
|
"$",
|
||||||
],
|
],
|
||||||
// '_abc' | '-efg' | '(xyz)' | Query parameter enum test (string) (optional)
|
// Query parameter enum test (string) (optional)
|
||||||
enumQueryString: "-efg",
|
enumQueryString: "-efg",
|
||||||
// 1 | -2 | Query parameter enum test (double) (optional)
|
// Query parameter enum test (double) (optional)
|
||||||
enumQueryInteger: 1,
|
enumQueryInteger: 1,
|
||||||
// 1.1 | -1.2 | Query parameter enum test (double) (optional)
|
// Query parameter enum test (double) (optional)
|
||||||
enumQueryDouble: 1.1,
|
enumQueryDouble: 1.1,
|
||||||
// Array<EnumClass> (optional)
|
|
||||||
enumQueryModelArray: [
|
enumQueryModelArray: [
|
||||||
"-efg",
|
"-efg",
|
||||||
],
|
],
|
||||||
// Array<string> | Form parameter enum test (string array) (optional)
|
// Form parameter enum test (string array) (optional)
|
||||||
enumFormStringArray: [
|
enumFormStringArray: [
|
||||||
"$",
|
"$",
|
||||||
],
|
],
|
||||||
// string | Form parameter enum test (string) (optional)
|
// Form parameter enum test (string) (optional)
|
||||||
enumFormString: "-efg",
|
enumFormString: "-efg",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.testEnumParameters(body).then((data:any) => {
|
const data = await apiInstance.testEnumParameters(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -899,30 +883,29 @@ Fake endpoint to test group parameters (optional)
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, FakeApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { FakeApiTestGroupParametersRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.FakeApi(configuration);
|
const apiInstance = new FakeApi(configuration);
|
||||||
|
|
||||||
let body:petstore.FakeApiTestGroupParametersRequest = {
|
const request: FakeApiTestGroupParametersRequest = {
|
||||||
// number | Required String in group parameters
|
// Required String in group parameters
|
||||||
requiredStringGroup: 1,
|
requiredStringGroup: 1,
|
||||||
// boolean | Required Boolean in group parameters
|
// Required Boolean in group parameters
|
||||||
requiredBooleanGroup: true,
|
requiredBooleanGroup: true,
|
||||||
// number | Required Integer in group parameters
|
// Required Integer in group parameters
|
||||||
requiredInt64Group: 1,
|
requiredInt64Group: 1,
|
||||||
// number | String in group parameters (optional)
|
// String in group parameters (optional)
|
||||||
stringGroup: 1,
|
stringGroup: 1,
|
||||||
// boolean | Boolean in group parameters (optional)
|
// Boolean in group parameters (optional)
|
||||||
booleanGroup: true,
|
booleanGroup: true,
|
||||||
// number | Integer in group parameters (optional)
|
// Integer in group parameters (optional)
|
||||||
int64Group: 1,
|
int64Group: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.testGroupParameters(body).then((data:any) => {
|
const data = await apiInstance.testGroupParameters(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -968,22 +951,21 @@ void (empty response body)
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, FakeApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { FakeApiTestInlineAdditionalPropertiesRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.FakeApi(configuration);
|
const apiInstance = new FakeApi(configuration);
|
||||||
|
|
||||||
let body:petstore.FakeApiTestInlineAdditionalPropertiesRequest = {
|
const request: FakeApiTestInlineAdditionalPropertiesRequest = {
|
||||||
// { [key: string]: string; } | request body
|
// request body
|
||||||
requestBody: {
|
requestBody: {
|
||||||
"key": "key_example",
|
"key": "key_example",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.testInlineAdditionalProperties(body).then((data:any) => {
|
const data = await apiInstance.testInlineAdditionalProperties(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -1024,22 +1006,21 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, FakeApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { FakeApiTestJsonFormDataRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.FakeApi(configuration);
|
const apiInstance = new FakeApi(configuration);
|
||||||
|
|
||||||
let body:petstore.FakeApiTestJsonFormDataRequest = {
|
const request: FakeApiTestJsonFormDataRequest = {
|
||||||
// string | field1
|
// field1
|
||||||
param: "param_example",
|
param: "param_example",
|
||||||
// string | field2
|
// field2
|
||||||
param2: "param2_example",
|
param2: "param2_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.testJsonFormData(body).then((data:any) => {
|
const data = await apiInstance.testJsonFormData(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -1081,44 +1062,43 @@ To test the collection format in query parameters
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, FakeApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { FakeApiTestQueryParameterCollectionFormatRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.FakeApi(configuration);
|
const apiInstance = new FakeApi(configuration);
|
||||||
|
|
||||||
let body:petstore.FakeApiTestQueryParameterCollectionFormatRequest = {
|
const request: FakeApiTestQueryParameterCollectionFormatRequest = {
|
||||||
// Array<string>
|
|
||||||
pipe: [
|
pipe: [
|
||||||
"pipe_example",
|
"pipe_example",
|
||||||
],
|
],
|
||||||
// Array<string>
|
|
||||||
ioutil: [
|
ioutil: [
|
||||||
"ioutil_example",
|
"ioutil_example",
|
||||||
],
|
],
|
||||||
// Array<string>
|
|
||||||
http: [
|
http: [
|
||||||
"http_example",
|
"http_example",
|
||||||
],
|
],
|
||||||
// Array<string>
|
|
||||||
url: [
|
url: [
|
||||||
"url_example",
|
"url_example",
|
||||||
],
|
],
|
||||||
// Array<string>
|
|
||||||
context: [
|
context: [
|
||||||
"context_example",
|
"context_example",
|
||||||
],
|
],
|
||||||
// string
|
|
||||||
allowEmpty: "allowEmpty_example",
|
allowEmpty: "allowEmpty_example",
|
||||||
// { [key: string]: string; } (optional)
|
|
||||||
language: {
|
language: {
|
||||||
"key": "key_example",
|
"key": "key_example",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.testQueryParameterCollectionFormat(body).then((data:any) => {
|
const data = await apiInstance.testQueryParameterCollectionFormat(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,22 +16,21 @@ To test class name in snake case
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, FakeClassnameTags123Api } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { FakeClassnameTags123ApiTestClassnameRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.FakeClassnameTags123Api(configuration);
|
const apiInstance = new FakeClassnameTags123Api(configuration);
|
||||||
|
|
||||||
let body:petstore.FakeClassnameTags123ApiTestClassnameRequest = {
|
const request: FakeClassnameTags123ApiTestClassnameRequest = {
|
||||||
// Client | client model
|
// client model
|
||||||
client: {
|
client: {
|
||||||
client: "client_example",
|
client: "client_example",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.testClassname(body).then((data:any) => {
|
const data = await apiInstance.testClassname(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,14 +24,14 @@ Method | HTTP request | Description
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiAddPetRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiAddPetRequest = {
|
const request: PetApiAddPetRequest = {
|
||||||
// Pet | Pet object that needs to be added to the store
|
// Pet object that needs to be added to the store
|
||||||
pet: {
|
pet: {
|
||||||
id: 1,
|
id: 1,
|
||||||
category: {
|
category: {
|
||||||
@ -52,9 +52,8 @@ let body:petstore.PetApiAddPetRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.addPet(body).then((data:any) => {
|
const data = await apiInstance.addPet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -96,22 +95,21 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiDeletePetRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiDeletePetRequest = {
|
const request: PetApiDeletePetRequest = {
|
||||||
// number | Pet id to delete
|
// Pet id to delete
|
||||||
petId: 1,
|
petId: 1,
|
||||||
// string (optional)
|
|
||||||
apiKey: "api_key_example",
|
apiKey: "api_key_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.deletePet(body).then((data:any) => {
|
const data = await apiInstance.deletePet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -154,22 +152,21 @@ Multiple status values can be provided with comma separated strings
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiFindPetsByStatusRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiFindPetsByStatusRequest = {
|
const request: PetApiFindPetsByStatusRequest = {
|
||||||
// Array<'available' | 'pending' | 'sold'> | Status values that need to be considered for filter
|
// Status values that need to be considered for filter
|
||||||
status: [
|
status: [
|
||||||
"available",
|
"available",
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.findPetsByStatus(body).then((data:any) => {
|
const data = await apiInstance.findPetsByStatus(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -211,22 +208,21 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiFindPetsByTagsRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiFindPetsByTagsRequest = {
|
const request: PetApiFindPetsByTagsRequest = {
|
||||||
// Set<string> | Tags to filter by
|
// Tags to filter by
|
||||||
tags: [
|
tags: [
|
||||||
"tags_example",
|
"tags_example",
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.findPetsByTags(body).then((data:any) => {
|
const data = await apiInstance.findPetsByTags(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -268,20 +264,19 @@ Returns a single pet
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiGetPetByIdRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiGetPetByIdRequest = {
|
const request: PetApiGetPetByIdRequest = {
|
||||||
// number | ID of pet to return
|
// ID of pet to return
|
||||||
petId: 1,
|
petId: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.getPetById(body).then((data:any) => {
|
const data = await apiInstance.getPetById(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -324,14 +319,14 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiUpdatePetRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiUpdatePetRequest = {
|
const request: PetApiUpdatePetRequest = {
|
||||||
// Pet | Pet object that needs to be added to the store
|
// Pet object that needs to be added to the store
|
||||||
pet: {
|
pet: {
|
||||||
id: 1,
|
id: 1,
|
||||||
category: {
|
category: {
|
||||||
@ -352,9 +347,8 @@ let body:petstore.PetApiUpdatePetRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.updatePet(body).then((data:any) => {
|
const data = await apiInstance.updatePet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -398,24 +392,23 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiUpdatePetWithFormRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiUpdatePetWithFormRequest = {
|
const request: PetApiUpdatePetWithFormRequest = {
|
||||||
// number | ID of pet that needs to be updated
|
// ID of pet that needs to be updated
|
||||||
petId: 1,
|
petId: 1,
|
||||||
// string | Updated name of the pet (optional)
|
// Updated name of the pet (optional)
|
||||||
name: "name_example",
|
name: "name_example",
|
||||||
// string | Updated status of the pet (optional)
|
// Updated status of the pet (optional)
|
||||||
status: "status_example",
|
status: "status_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.updatePetWithForm(body).then((data:any) => {
|
const data = await apiInstance.updatePetWithForm(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -459,24 +452,23 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiUploadFileRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiUploadFileRequest = {
|
const request: PetApiUploadFileRequest = {
|
||||||
// number | ID of pet to update
|
// ID of pet to update
|
||||||
petId: 1,
|
petId: 1,
|
||||||
// string | Additional data to pass to server (optional)
|
// Additional data to pass to server (optional)
|
||||||
additionalMetadata: "additionalMetadata_example",
|
additionalMetadata: "additionalMetadata_example",
|
||||||
// HttpFile | file to upload (optional)
|
// file to upload (optional)
|
||||||
file: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' },
|
file: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' },
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.uploadFile(body).then((data:any) => {
|
const data = await apiInstance.uploadFile(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -519,24 +511,23 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiUploadFileWithRequiredFileRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiUploadFileWithRequiredFileRequest = {
|
const request: PetApiUploadFileWithRequiredFileRequest = {
|
||||||
// number | ID of pet to update
|
// ID of pet to update
|
||||||
petId: 1,
|
petId: 1,
|
||||||
// HttpFile | file to upload
|
// file to upload
|
||||||
requiredFile: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' },
|
requiredFile: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' },
|
||||||
// string | Additional data to pass to server (optional)
|
// Additional data to pass to server (optional)
|
||||||
additionalMetadata: "additionalMetadata_example",
|
additionalMetadata: "additionalMetadata_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.uploadFileWithRequiredFile(body).then((data:any) => {
|
const data = await apiInstance.uploadFileWithRequiredFile(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,20 +19,19 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { StoreApiDeleteOrderRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:petstore.StoreApiDeleteOrderRequest = {
|
const request: StoreApiDeleteOrderRequest = {
|
||||||
// string | ID of the order that needs to be deleted
|
// ID of the order that needs to be deleted
|
||||||
orderId: "order_id_example",
|
orderId: "order_id_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.deleteOrder(body).then((data:any) => {
|
const data = await apiInstance.deleteOrder(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -74,17 +73,15 @@ Returns a map of status codes to quantities
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.getInventory(body).then((data:any) => {
|
const data = await apiInstance.getInventory(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -122,20 +119,19 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { StoreApiGetOrderByIdRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:petstore.StoreApiGetOrderByIdRequest = {
|
const request: StoreApiGetOrderByIdRequest = {
|
||||||
// number | ID of pet that needs to be fetched
|
// ID of pet that needs to be fetched
|
||||||
orderId: 1,
|
orderId: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.getOrderById(body).then((data:any) => {
|
const data = await apiInstance.getOrderById(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -178,14 +174,14 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { StoreApiPlaceOrderRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:petstore.StoreApiPlaceOrderRequest = {
|
const request: StoreApiPlaceOrderRequest = {
|
||||||
// Order | order placed for purchasing the pet
|
// order placed for purchasing the pet
|
||||||
order: {
|
order: {
|
||||||
id: 1,
|
id: 1,
|
||||||
petId: 1,
|
petId: 1,
|
||||||
@ -196,9 +192,8 @@ let body:petstore.StoreApiPlaceOrderRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.placeOrder(body).then((data:any) => {
|
const data = await apiInstance.placeOrder(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,14 +23,14 @@ This can only be done by the logged in user.
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiCreateUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiCreateUserRequest = {
|
const request: UserApiCreateUserRequest = {
|
||||||
// User | Created user object
|
// Created user object
|
||||||
user: {
|
user: {
|
||||||
id: 1,
|
id: 1,
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
@ -43,9 +43,8 @@ let body:petstore.UserApiCreateUserRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.createUser(body).then((data:any) => {
|
const data = await apiInstance.createUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -86,14 +85,14 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiCreateUsersWithArrayInputRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiCreateUsersWithArrayInputRequest = {
|
const request: UserApiCreateUsersWithArrayInputRequest = {
|
||||||
// Array<User> | List of user object
|
// List of user object
|
||||||
user: [
|
user: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
@ -108,9 +107,8 @@ let body:petstore.UserApiCreateUsersWithArrayInputRequest = {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.createUsersWithArrayInput(body).then((data:any) => {
|
const data = await apiInstance.createUsersWithArrayInput(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -151,14 +149,14 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiCreateUsersWithListInputRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiCreateUsersWithListInputRequest = {
|
const request: UserApiCreateUsersWithListInputRequest = {
|
||||||
// Array<User> | List of user object
|
// List of user object
|
||||||
user: [
|
user: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
@ -173,9 +171,8 @@ let body:petstore.UserApiCreateUsersWithListInputRequest = {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.createUsersWithListInput(body).then((data:any) => {
|
const data = await apiInstance.createUsersWithListInput(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -216,20 +213,19 @@ This can only be done by the logged in user.
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiDeleteUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiDeleteUserRequest = {
|
const request: UserApiDeleteUserRequest = {
|
||||||
// string | The name that needs to be deleted
|
// The name that needs to be deleted
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.deleteUser(body).then((data:any) => {
|
const data = await apiInstance.deleteUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -271,20 +267,19 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiGetUserByNameRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiGetUserByNameRequest = {
|
const request: UserApiGetUserByNameRequest = {
|
||||||
// string | The name that needs to be fetched. Use user1 for testing.
|
// The name that needs to be fetched. Use user1 for testing.
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.getUserByName(body).then((data:any) => {
|
const data = await apiInstance.getUserByName(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -327,22 +322,21 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiLoginUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiLoginUserRequest = {
|
const request: UserApiLoginUserRequest = {
|
||||||
// string | The user name for login
|
// The user name for login
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
// string | The password for login in clear text
|
// The password for login in clear text
|
||||||
password: "password_example",
|
password: "password_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.loginUser(body).then((data:any) => {
|
const data = await apiInstance.loginUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -385,17 +379,15 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.logoutUser(body).then((data:any) => {
|
const data = await apiInstance.logoutUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -433,16 +425,16 @@ This can only be done by the logged in user.
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiUpdateUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiUpdateUserRequest = {
|
const request: UserApiUpdateUserRequest = {
|
||||||
// string | name that need to be deleted
|
// name that need to be deleted
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
// User | Updated user object
|
// Updated user object
|
||||||
user: {
|
user: {
|
||||||
id: 1,
|
id: 1,
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
@ -455,9 +447,8 @@ let body:petstore.UserApiUpdateUserRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.updateUser(body).then((data:any) => {
|
const data = await apiInstance.updateUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,14 +23,14 @@ Method | HTTP request | Description
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiAddPetRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiAddPetRequest = {
|
const request: PetApiAddPetRequest = {
|
||||||
// Pet | Pet object that needs to be added to the store
|
// Pet object that needs to be added to the store
|
||||||
pet: {
|
pet: {
|
||||||
id: 1,
|
id: 1,
|
||||||
category: {
|
category: {
|
||||||
@ -51,9 +51,8 @@ let body:petstore.PetApiAddPetRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.addPet(body).then((data:any) => {
|
const data = await apiInstance.addPet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -95,22 +94,21 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiDeletePetRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiDeletePetRequest = {
|
const request: PetApiDeletePetRequest = {
|
||||||
// number | Pet id to delete
|
// Pet id to delete
|
||||||
petId: 1,
|
petId: 1,
|
||||||
// string (optional)
|
|
||||||
apiKey: "api_key_example",
|
apiKey: "api_key_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.deletePet(body).then((data:any) => {
|
const data = await apiInstance.deletePet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -152,22 +150,21 @@ Multiple status values can be provided with comma separated strings
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiFindPetsByStatusRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiFindPetsByStatusRequest = {
|
const request: PetApiFindPetsByStatusRequest = {
|
||||||
// Array<'available' | 'pending' | 'sold'> | Status values that need to be considered for filter
|
// Status values that need to be considered for filter
|
||||||
status: [
|
status: [
|
||||||
"available",
|
"available",
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.findPetsByStatus(body).then((data:any) => {
|
const data = await apiInstance.findPetsByStatus(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -209,22 +206,21 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiFindPetsByTagsRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiFindPetsByTagsRequest = {
|
const request: PetApiFindPetsByTagsRequest = {
|
||||||
// Array<string> | Tags to filter by
|
// Tags to filter by
|
||||||
tags: [
|
tags: [
|
||||||
"tags_example",
|
"tags_example",
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.findPetsByTags(body).then((data:any) => {
|
const data = await apiInstance.findPetsByTags(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -266,20 +262,19 @@ Returns a single pet
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiGetPetByIdRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiGetPetByIdRequest = {
|
const request: PetApiGetPetByIdRequest = {
|
||||||
// number | ID of pet to return
|
// ID of pet to return
|
||||||
petId: 1,
|
petId: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.getPetById(body).then((data:any) => {
|
const data = await apiInstance.getPetById(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -322,14 +317,14 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiUpdatePetRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiUpdatePetRequest = {
|
const request: PetApiUpdatePetRequest = {
|
||||||
// Pet | Pet object that needs to be added to the store
|
// Pet object that needs to be added to the store
|
||||||
pet: {
|
pet: {
|
||||||
id: 1,
|
id: 1,
|
||||||
category: {
|
category: {
|
||||||
@ -350,9 +345,8 @@ let body:petstore.PetApiUpdatePetRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.updatePet(body).then((data:any) => {
|
const data = await apiInstance.updatePet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -396,24 +390,23 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiUpdatePetWithFormRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiUpdatePetWithFormRequest = {
|
const request: PetApiUpdatePetWithFormRequest = {
|
||||||
// number | ID of pet that needs to be updated
|
// ID of pet that needs to be updated
|
||||||
petId: 1,
|
petId: 1,
|
||||||
// string | Updated name of the pet (optional)
|
// Updated name of the pet (optional)
|
||||||
name: "name_example",
|
name: "name_example",
|
||||||
// string | Updated status of the pet (optional)
|
// Updated status of the pet (optional)
|
||||||
status: "status_example",
|
status: "status_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.updatePetWithForm(body).then((data:any) => {
|
const data = await apiInstance.updatePetWithForm(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -456,24 +449,23 @@ void (empty response body)
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiUploadFileRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiUploadFileRequest = {
|
const request: PetApiUploadFileRequest = {
|
||||||
// number | ID of pet to update
|
// ID of pet to update
|
||||||
petId: 1,
|
petId: 1,
|
||||||
// string | Additional data to pass to server (optional)
|
// Additional data to pass to server (optional)
|
||||||
additionalMetadata: "additionalMetadata_example",
|
additionalMetadata: "additionalMetadata_example",
|
||||||
// HttpFile | file to upload (optional)
|
// file to upload (optional)
|
||||||
file: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' },
|
file: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' },
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.uploadFile(body).then((data:any) => {
|
const data = await apiInstance.uploadFile(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,20 +19,19 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { StoreApiDeleteOrderRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:petstore.StoreApiDeleteOrderRequest = {
|
const request: StoreApiDeleteOrderRequest = {
|
||||||
// string | ID of the order that needs to be deleted
|
// ID of the order that needs to be deleted
|
||||||
orderId: "orderId_example",
|
orderId: "orderId_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.deleteOrder(body).then((data:any) => {
|
const data = await apiInstance.deleteOrder(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -74,17 +73,15 @@ Returns a map of status codes to quantities
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.getInventory(body).then((data:any) => {
|
const data = await apiInstance.getInventory(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -122,20 +119,19 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { StoreApiGetOrderByIdRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:petstore.StoreApiGetOrderByIdRequest = {
|
const request: StoreApiGetOrderByIdRequest = {
|
||||||
// number | ID of pet that needs to be fetched
|
// ID of pet that needs to be fetched
|
||||||
orderId: 1,
|
orderId: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.getOrderById(body).then((data:any) => {
|
const data = await apiInstance.getOrderById(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -178,14 +174,14 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { StoreApiPlaceOrderRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:petstore.StoreApiPlaceOrderRequest = {
|
const request: StoreApiPlaceOrderRequest = {
|
||||||
// Order | order placed for purchasing the pet
|
// order placed for purchasing the pet
|
||||||
order: {
|
order: {
|
||||||
id: 1,
|
id: 1,
|
||||||
petId: 1,
|
petId: 1,
|
||||||
@ -196,9 +192,8 @@ let body:petstore.StoreApiPlaceOrderRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.placeOrder(body).then((data:any) => {
|
const data = await apiInstance.placeOrder(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,14 +23,14 @@ This can only be done by the logged in user.
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiCreateUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiCreateUserRequest = {
|
const request: UserApiCreateUserRequest = {
|
||||||
// User | Created user object
|
// Created user object
|
||||||
user: {
|
user: {
|
||||||
id: 1,
|
id: 1,
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
@ -43,9 +43,8 @@ let body:petstore.UserApiCreateUserRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.createUser(body).then((data:any) => {
|
const data = await apiInstance.createUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -86,14 +85,14 @@ void (empty response body)
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiCreateUsersWithArrayInputRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiCreateUsersWithArrayInputRequest = {
|
const request: UserApiCreateUsersWithArrayInputRequest = {
|
||||||
// Array<User> | List of user object
|
// List of user object
|
||||||
user: [
|
user: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
@ -108,9 +107,8 @@ let body:petstore.UserApiCreateUsersWithArrayInputRequest = {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.createUsersWithArrayInput(body).then((data:any) => {
|
const data = await apiInstance.createUsersWithArrayInput(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -151,14 +149,14 @@ void (empty response body)
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiCreateUsersWithListInputRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiCreateUsersWithListInputRequest = {
|
const request: UserApiCreateUsersWithListInputRequest = {
|
||||||
// Array<User> | List of user object
|
// List of user object
|
||||||
user: [
|
user: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
@ -173,9 +171,8 @@ let body:petstore.UserApiCreateUsersWithListInputRequest = {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.createUsersWithListInput(body).then((data:any) => {
|
const data = await apiInstance.createUsersWithListInput(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -216,20 +213,19 @@ This can only be done by the logged in user.
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiDeleteUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiDeleteUserRequest = {
|
const request: UserApiDeleteUserRequest = {
|
||||||
// string | The name that needs to be deleted
|
// The name that needs to be deleted
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.deleteUser(body).then((data:any) => {
|
const data = await apiInstance.deleteUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -271,20 +267,19 @@ void (empty response body)
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiGetUserByNameRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiGetUserByNameRequest = {
|
const request: UserApiGetUserByNameRequest = {
|
||||||
// string | The name that needs to be fetched. Use user1 for testing.
|
// The name that needs to be fetched. Use user1 for testing.
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.getUserByName(body).then((data:any) => {
|
const data = await apiInstance.getUserByName(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -327,22 +322,21 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiLoginUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiLoginUserRequest = {
|
const request: UserApiLoginUserRequest = {
|
||||||
// string | The user name for login
|
// The user name for login
|
||||||
username: "CbUUGjjNSwg0_bs9ZayIMrKdgNvb6gvxmPb9GcsM61ate1RA89q3w1l4eH4XxEz.5awLMdeXylwK0lMGUSM4jsrh4dstlnQUN5vVdMLPA",
|
username: "CbUUGjjNSwg0_bs9ZayIMrKdgNvb6gvxmPb9GcsM61ate1RA89q3w1l4eH4XxEz.5awLMdeXylwK0lMGUSM4jsrh4dstlnQUN5vVdMLPA",
|
||||||
// string | The password for login in clear text
|
// The password for login in clear text
|
||||||
password: "password_example",
|
password: "password_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.loginUser(body).then((data:any) => {
|
const data = await apiInstance.loginUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -385,17 +379,15 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.logoutUser(body).then((data:any) => {
|
const data = await apiInstance.logoutUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -433,16 +425,16 @@ This can only be done by the logged in user.
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiUpdateUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiUpdateUserRequest = {
|
const request: UserApiUpdateUserRequest = {
|
||||||
// string | name that need to be deleted
|
// name that need to be deleted
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
// User | Updated user object
|
// Updated user object
|
||||||
user: {
|
user: {
|
||||||
id: 1,
|
id: 1,
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
@ -455,9 +447,8 @@ let body:petstore.UserApiUpdateUserRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.updateUser(body).then((data:any) => {
|
const data = await apiInstance.updateUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,14 +23,14 @@ Method | HTTP request | Description
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiAddPetRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiAddPetRequest = {
|
const request: PetApiAddPetRequest = {
|
||||||
// Pet | Pet object that needs to be added to the store
|
// Pet object that needs to be added to the store
|
||||||
pet: {
|
pet: {
|
||||||
id: 1,
|
id: 1,
|
||||||
category: {
|
category: {
|
||||||
@ -51,9 +51,8 @@ let body:petstore.PetApiAddPetRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.addPet(body).then((data:any) => {
|
const data = await apiInstance.addPet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -95,22 +94,21 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiDeletePetRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiDeletePetRequest = {
|
const request: PetApiDeletePetRequest = {
|
||||||
// number | Pet id to delete
|
// Pet id to delete
|
||||||
petId: 1,
|
petId: 1,
|
||||||
// string (optional)
|
|
||||||
apiKey: "api_key_example",
|
apiKey: "api_key_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.deletePet(body).then((data:any) => {
|
const data = await apiInstance.deletePet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -152,22 +150,21 @@ Multiple status values can be provided with comma separated strings
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiFindPetsByStatusRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiFindPetsByStatusRequest = {
|
const request: PetApiFindPetsByStatusRequest = {
|
||||||
// Array<'available' | 'pending' | 'sold'> | Status values that need to be considered for filter
|
// Status values that need to be considered for filter
|
||||||
status: [
|
status: [
|
||||||
"available",
|
"available",
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.findPetsByStatus(body).then((data:any) => {
|
const data = await apiInstance.findPetsByStatus(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -209,22 +206,21 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiFindPetsByTagsRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiFindPetsByTagsRequest = {
|
const request: PetApiFindPetsByTagsRequest = {
|
||||||
// Array<string> | Tags to filter by
|
// Tags to filter by
|
||||||
tags: [
|
tags: [
|
||||||
"tags_example",
|
"tags_example",
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.findPetsByTags(body).then((data:any) => {
|
const data = await apiInstance.findPetsByTags(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -266,20 +262,19 @@ Returns a single pet
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiGetPetByIdRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiGetPetByIdRequest = {
|
const request: PetApiGetPetByIdRequest = {
|
||||||
// number | ID of pet to return
|
// ID of pet to return
|
||||||
petId: 1,
|
petId: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.getPetById(body).then((data:any) => {
|
const data = await apiInstance.getPetById(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -322,14 +317,14 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiUpdatePetRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiUpdatePetRequest = {
|
const request: PetApiUpdatePetRequest = {
|
||||||
// Pet | Pet object that needs to be added to the store
|
// Pet object that needs to be added to the store
|
||||||
pet: {
|
pet: {
|
||||||
id: 1,
|
id: 1,
|
||||||
category: {
|
category: {
|
||||||
@ -350,9 +345,8 @@ let body:petstore.PetApiUpdatePetRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.updatePet(body).then((data:any) => {
|
const data = await apiInstance.updatePet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -396,24 +390,23 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiUpdatePetWithFormRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiUpdatePetWithFormRequest = {
|
const request: PetApiUpdatePetWithFormRequest = {
|
||||||
// number | ID of pet that needs to be updated
|
// ID of pet that needs to be updated
|
||||||
petId: 1,
|
petId: 1,
|
||||||
// string | Updated name of the pet (optional)
|
// Updated name of the pet (optional)
|
||||||
name: "name_example",
|
name: "name_example",
|
||||||
// string | Updated status of the pet (optional)
|
// Updated status of the pet (optional)
|
||||||
status: "status_example",
|
status: "status_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.updatePetWithForm(body).then((data:any) => {
|
const data = await apiInstance.updatePetWithForm(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -456,24 +449,23 @@ void (empty response body)
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiUploadFileRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiUploadFileRequest = {
|
const request: PetApiUploadFileRequest = {
|
||||||
// number | ID of pet to update
|
// ID of pet to update
|
||||||
petId: 1,
|
petId: 1,
|
||||||
// string | Additional data to pass to server (optional)
|
// Additional data to pass to server (optional)
|
||||||
additionalMetadata: "additionalMetadata_example",
|
additionalMetadata: "additionalMetadata_example",
|
||||||
// HttpFile | file to upload (optional)
|
// file to upload (optional)
|
||||||
file: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' },
|
file: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' },
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.uploadFile(body).then((data:any) => {
|
const data = await apiInstance.uploadFile(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,20 +19,19 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { StoreApiDeleteOrderRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:petstore.StoreApiDeleteOrderRequest = {
|
const request: StoreApiDeleteOrderRequest = {
|
||||||
// string | ID of the order that needs to be deleted
|
// ID of the order that needs to be deleted
|
||||||
orderId: "orderId_example",
|
orderId: "orderId_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.deleteOrder(body).then((data:any) => {
|
const data = await apiInstance.deleteOrder(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -74,17 +73,15 @@ Returns a map of status codes to quantities
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.getInventory(body).then((data:any) => {
|
const data = await apiInstance.getInventory(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -122,20 +119,19 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { StoreApiGetOrderByIdRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:petstore.StoreApiGetOrderByIdRequest = {
|
const request: StoreApiGetOrderByIdRequest = {
|
||||||
// number | ID of pet that needs to be fetched
|
// ID of pet that needs to be fetched
|
||||||
orderId: 1,
|
orderId: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.getOrderById(body).then((data:any) => {
|
const data = await apiInstance.getOrderById(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -178,14 +174,14 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { StoreApiPlaceOrderRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:petstore.StoreApiPlaceOrderRequest = {
|
const request: StoreApiPlaceOrderRequest = {
|
||||||
// Order | order placed for purchasing the pet
|
// order placed for purchasing the pet
|
||||||
order: {
|
order: {
|
||||||
id: 1,
|
id: 1,
|
||||||
petId: 1,
|
petId: 1,
|
||||||
@ -196,9 +192,8 @@ let body:petstore.StoreApiPlaceOrderRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.placeOrder(body).then((data:any) => {
|
const data = await apiInstance.placeOrder(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,14 +23,14 @@ This can only be done by the logged in user.
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiCreateUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiCreateUserRequest = {
|
const request: UserApiCreateUserRequest = {
|
||||||
// User | Created user object
|
// Created user object
|
||||||
user: {
|
user: {
|
||||||
id: 1,
|
id: 1,
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
@ -43,9 +43,8 @@ let body:petstore.UserApiCreateUserRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.createUser(body).then((data:any) => {
|
const data = await apiInstance.createUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -86,14 +85,14 @@ void (empty response body)
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiCreateUsersWithArrayInputRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiCreateUsersWithArrayInputRequest = {
|
const request: UserApiCreateUsersWithArrayInputRequest = {
|
||||||
// Array<User> | List of user object
|
// List of user object
|
||||||
user: [
|
user: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
@ -108,9 +107,8 @@ let body:petstore.UserApiCreateUsersWithArrayInputRequest = {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.createUsersWithArrayInput(body).then((data:any) => {
|
const data = await apiInstance.createUsersWithArrayInput(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -151,14 +149,14 @@ void (empty response body)
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiCreateUsersWithListInputRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiCreateUsersWithListInputRequest = {
|
const request: UserApiCreateUsersWithListInputRequest = {
|
||||||
// Array<User> | List of user object
|
// List of user object
|
||||||
user: [
|
user: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
@ -173,9 +171,8 @@ let body:petstore.UserApiCreateUsersWithListInputRequest = {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.createUsersWithListInput(body).then((data:any) => {
|
const data = await apiInstance.createUsersWithListInput(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -216,20 +213,19 @@ This can only be done by the logged in user.
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiDeleteUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiDeleteUserRequest = {
|
const request: UserApiDeleteUserRequest = {
|
||||||
// string | The name that needs to be deleted
|
// The name that needs to be deleted
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.deleteUser(body).then((data:any) => {
|
const data = await apiInstance.deleteUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -271,20 +267,19 @@ void (empty response body)
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiGetUserByNameRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiGetUserByNameRequest = {
|
const request: UserApiGetUserByNameRequest = {
|
||||||
// string | The name that needs to be fetched. Use user1 for testing.
|
// The name that needs to be fetched. Use user1 for testing.
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.getUserByName(body).then((data:any) => {
|
const data = await apiInstance.getUserByName(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -327,22 +322,21 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiLoginUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiLoginUserRequest = {
|
const request: UserApiLoginUserRequest = {
|
||||||
// string | The user name for login
|
// The user name for login
|
||||||
username: "CbUUGjjNSwg0_bs9ZayIMrKdgNvb6gvxmPb9GcsM61ate1RA89q3w1l4eH4XxEz.5awLMdeXylwK0lMGUSM4jsrh4dstlnQUN5vVdMLPA",
|
username: "CbUUGjjNSwg0_bs9ZayIMrKdgNvb6gvxmPb9GcsM61ate1RA89q3w1l4eH4XxEz.5awLMdeXylwK0lMGUSM4jsrh4dstlnQUN5vVdMLPA",
|
||||||
// string | The password for login in clear text
|
// The password for login in clear text
|
||||||
password: "password_example",
|
password: "password_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.loginUser(body).then((data:any) => {
|
const data = await apiInstance.loginUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -385,17 +379,15 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.logoutUser(body).then((data:any) => {
|
const data = await apiInstance.logoutUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -433,16 +425,16 @@ This can only be done by the logged in user.
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiUpdateUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiUpdateUserRequest = {
|
const request: UserApiUpdateUserRequest = {
|
||||||
// string | name that need to be deleted
|
// name that need to be deleted
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
// User | Updated user object
|
// Updated user object
|
||||||
user: {
|
user: {
|
||||||
id: 1,
|
id: 1,
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
@ -455,9 +447,8 @@ let body:petstore.UserApiUpdateUserRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.updateUser(body).then((data:any) => {
|
const data = await apiInstance.updateUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,17 +15,15 @@ Method | HTTP request | Description
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { } from '';
|
import { createConfiguration, DefaultApi } from '';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = .createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new .DefaultApi(configuration);
|
const apiInstance = new DefaultApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.uniqueItems(body).then((data:any) => {
|
const data = await apiInstance.uniqueItems(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,14 +23,14 @@ Method | HTTP request | Description
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiAddPetRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiAddPetRequest = {
|
const request: PetApiAddPetRequest = {
|
||||||
// Pet | Pet object that needs to be added to the store
|
// Pet object that needs to be added to the store
|
||||||
pet: {
|
pet: {
|
||||||
id: 1,
|
id: 1,
|
||||||
category: {
|
category: {
|
||||||
@ -51,9 +51,8 @@ let body:petstore.PetApiAddPetRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.addPet(body).then((data:any) => {
|
const data = await apiInstance.addPet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -95,22 +94,21 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiDeletePetRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiDeletePetRequest = {
|
const request: PetApiDeletePetRequest = {
|
||||||
// number | Pet id to delete
|
// Pet id to delete
|
||||||
petId: 1,
|
petId: 1,
|
||||||
// string (optional)
|
|
||||||
apiKey: "api_key_example",
|
apiKey: "api_key_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.deletePet(body).then((data:any) => {
|
const data = await apiInstance.deletePet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -152,22 +150,21 @@ Multiple status values can be provided with comma separated strings
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiFindPetsByStatusRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiFindPetsByStatusRequest = {
|
const request: PetApiFindPetsByStatusRequest = {
|
||||||
// Array<'available' | 'pending' | 'sold'> | Status values that need to be considered for filter
|
// Status values that need to be considered for filter
|
||||||
status: [
|
status: [
|
||||||
"available",
|
"available",
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.findPetsByStatus(body).then((data:any) => {
|
const data = await apiInstance.findPetsByStatus(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -209,22 +206,21 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiFindPetsByTagsRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiFindPetsByTagsRequest = {
|
const request: PetApiFindPetsByTagsRequest = {
|
||||||
// Array<string> | Tags to filter by
|
// Tags to filter by
|
||||||
tags: [
|
tags: [
|
||||||
"tags_example",
|
"tags_example",
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.findPetsByTags(body).then((data:any) => {
|
const data = await apiInstance.findPetsByTags(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -266,20 +262,19 @@ Returns a single pet
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiGetPetByIdRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiGetPetByIdRequest = {
|
const request: PetApiGetPetByIdRequest = {
|
||||||
// number | ID of pet to return
|
// ID of pet to return
|
||||||
petId: 1,
|
petId: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.getPetById(body).then((data:any) => {
|
const data = await apiInstance.getPetById(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -322,14 +317,14 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiUpdatePetRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiUpdatePetRequest = {
|
const request: PetApiUpdatePetRequest = {
|
||||||
// Pet | Pet object that needs to be added to the store
|
// Pet object that needs to be added to the store
|
||||||
pet: {
|
pet: {
|
||||||
id: 1,
|
id: 1,
|
||||||
category: {
|
category: {
|
||||||
@ -350,9 +345,8 @@ let body:petstore.PetApiUpdatePetRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.updatePet(body).then((data:any) => {
|
const data = await apiInstance.updatePet(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -396,24 +390,23 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiUpdatePetWithFormRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiUpdatePetWithFormRequest = {
|
const request: PetApiUpdatePetWithFormRequest = {
|
||||||
// number | ID of pet that needs to be updated
|
// ID of pet that needs to be updated
|
||||||
petId: 1,
|
petId: 1,
|
||||||
// string | Updated name of the pet (optional)
|
// Updated name of the pet (optional)
|
||||||
name: "name_example",
|
name: "name_example",
|
||||||
// string | Updated status of the pet (optional)
|
// Updated status of the pet (optional)
|
||||||
status: "status_example",
|
status: "status_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.updatePetWithForm(body).then((data:any) => {
|
const data = await apiInstance.updatePetWithForm(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -456,24 +449,23 @@ void (empty response body)
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, PetApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { PetApiUploadFileRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.PetApi(configuration);
|
const apiInstance = new PetApi(configuration);
|
||||||
|
|
||||||
let body:petstore.PetApiUploadFileRequest = {
|
const request: PetApiUploadFileRequest = {
|
||||||
// number | ID of pet to update
|
// ID of pet to update
|
||||||
petId: 1,
|
petId: 1,
|
||||||
// string | Additional data to pass to server (optional)
|
// Additional data to pass to server (optional)
|
||||||
additionalMetadata: "additionalMetadata_example",
|
additionalMetadata: "additionalMetadata_example",
|
||||||
// HttpFile | file to upload (optional)
|
// file to upload (optional)
|
||||||
file: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' },
|
file: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' },
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.uploadFile(body).then((data:any) => {
|
const data = await apiInstance.uploadFile(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,20 +19,19 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { StoreApiDeleteOrderRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:petstore.StoreApiDeleteOrderRequest = {
|
const request: StoreApiDeleteOrderRequest = {
|
||||||
// string | ID of the order that needs to be deleted
|
// ID of the order that needs to be deleted
|
||||||
orderId: "orderId_example",
|
orderId: "orderId_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.deleteOrder(body).then((data:any) => {
|
const data = await apiInstance.deleteOrder(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -74,17 +73,15 @@ Returns a map of status codes to quantities
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.getInventory(body).then((data:any) => {
|
const data = await apiInstance.getInventory(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -122,20 +119,19 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { StoreApiGetOrderByIdRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:petstore.StoreApiGetOrderByIdRequest = {
|
const request: StoreApiGetOrderByIdRequest = {
|
||||||
// number | ID of pet that needs to be fetched
|
// ID of pet that needs to be fetched
|
||||||
orderId: 1,
|
orderId: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.getOrderById(body).then((data:any) => {
|
const data = await apiInstance.getOrderById(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -178,14 +174,14 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, StoreApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { StoreApiPlaceOrderRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.StoreApi(configuration);
|
const apiInstance = new StoreApi(configuration);
|
||||||
|
|
||||||
let body:petstore.StoreApiPlaceOrderRequest = {
|
const request: StoreApiPlaceOrderRequest = {
|
||||||
// Order | order placed for purchasing the pet
|
// order placed for purchasing the pet
|
||||||
order: {
|
order: {
|
||||||
id: 1,
|
id: 1,
|
||||||
petId: 1,
|
petId: 1,
|
||||||
@ -196,9 +192,8 @@ let body:petstore.StoreApiPlaceOrderRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.placeOrder(body).then((data:any) => {
|
const data = await apiInstance.placeOrder(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,14 +23,14 @@ This can only be done by the logged in user.
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiCreateUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiCreateUserRequest = {
|
const request: UserApiCreateUserRequest = {
|
||||||
// User | Created user object
|
// Created user object
|
||||||
user: {
|
user: {
|
||||||
id: 1,
|
id: 1,
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
@ -43,9 +43,8 @@ let body:petstore.UserApiCreateUserRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.createUser(body).then((data:any) => {
|
const data = await apiInstance.createUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -86,14 +85,14 @@ void (empty response body)
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiCreateUsersWithArrayInputRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiCreateUsersWithArrayInputRequest = {
|
const request: UserApiCreateUsersWithArrayInputRequest = {
|
||||||
// Array<User> | List of user object
|
// List of user object
|
||||||
user: [
|
user: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
@ -108,9 +107,8 @@ let body:petstore.UserApiCreateUsersWithArrayInputRequest = {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.createUsersWithArrayInput(body).then((data:any) => {
|
const data = await apiInstance.createUsersWithArrayInput(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -151,14 +149,14 @@ void (empty response body)
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiCreateUsersWithListInputRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiCreateUsersWithListInputRequest = {
|
const request: UserApiCreateUsersWithListInputRequest = {
|
||||||
// Array<User> | List of user object
|
// List of user object
|
||||||
user: [
|
user: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
@ -173,9 +171,8 @@ let body:petstore.UserApiCreateUsersWithListInputRequest = {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.createUsersWithListInput(body).then((data:any) => {
|
const data = await apiInstance.createUsersWithListInput(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -216,20 +213,19 @@ This can only be done by the logged in user.
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiDeleteUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiDeleteUserRequest = {
|
const request: UserApiDeleteUserRequest = {
|
||||||
// string | The name that needs to be deleted
|
// The name that needs to be deleted
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.deleteUser(body).then((data:any) => {
|
const data = await apiInstance.deleteUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -271,20 +267,19 @@ void (empty response body)
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiGetUserByNameRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiGetUserByNameRequest = {
|
const request: UserApiGetUserByNameRequest = {
|
||||||
// string | The name that needs to be fetched. Use user1 for testing.
|
// The name that needs to be fetched. Use user1 for testing.
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.getUserByName(body).then((data:any) => {
|
const data = await apiInstance.getUserByName(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -327,22 +322,21 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiLoginUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiLoginUserRequest = {
|
const request: UserApiLoginUserRequest = {
|
||||||
// string | The user name for login
|
// The user name for login
|
||||||
username: "CbUUGjjNSwg0_bs9ZayIMrKdgNvb6gvxmPb9GcsM61ate1RA89q3w1l4eH4XxEz.5awLMdeXylwK0lMGUSM4jsrh4dstlnQUN5vVdMLPA",
|
username: "CbUUGjjNSwg0_bs9ZayIMrKdgNvb6gvxmPb9GcsM61ate1RA89q3w1l4eH4XxEz.5awLMdeXylwK0lMGUSM4jsrh4dstlnQUN5vVdMLPA",
|
||||||
// string | The password for login in clear text
|
// The password for login in clear text
|
||||||
password: "password_example",
|
password: "password_example",
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.loginUser(body).then((data:any) => {
|
const data = await apiInstance.loginUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -385,17 +379,15 @@ No authorization required
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:any = {};
|
const request = {};
|
||||||
|
|
||||||
apiInstance.logoutUser(body).then((data:any) => {
|
const data = await apiInstance.logoutUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -433,16 +425,16 @@ This can only be done by the logged in user.
|
|||||||
|
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { petstore } from 'ts-petstore-client';
|
import { createConfiguration, UserApi } from 'ts-petstore-client';
|
||||||
import * as fs from 'fs';
|
import type { UserApiUpdateUserRequest } from 'ts-petstore-client';
|
||||||
|
|
||||||
const configuration = petstore.createConfiguration();
|
const configuration = createConfiguration();
|
||||||
const apiInstance = new petstore.UserApi(configuration);
|
const apiInstance = new UserApi(configuration);
|
||||||
|
|
||||||
let body:petstore.UserApiUpdateUserRequest = {
|
const request: UserApiUpdateUserRequest = {
|
||||||
// string | name that need to be deleted
|
// name that need to be deleted
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
// User | Updated user object
|
// Updated user object
|
||||||
user: {
|
user: {
|
||||||
id: 1,
|
id: 1,
|
||||||
username: "username_example",
|
username: "username_example",
|
||||||
@ -455,9 +447,8 @@ let body:petstore.UserApiUpdateUserRequest = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
apiInstance.updateUser(body).then((data:any) => {
|
const data = await apiInstance.updateUser(request);
|
||||||
console.log('API called successfully. Returned data: ' + data);
|
console.log('API called successfully. Returned data:', data);
|
||||||
}).catch((error:any) => console.error(error));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user