forked from loafle/openapi-generator-original
[typescript-fetch] fix snakecase discriminator (#15838)
* [typescript-fetch] fix snakecase discriminator (#7080) * [typescript-fetch] add snakecase discriminator test case
This commit is contained in:
parent
730b946537
commit
504744a390
@ -0,0 +1,4 @@
|
|||||||
|
generatorName: typescript-fetch
|
||||||
|
outputDir: samples/client/petstore/typescript-fetch/builds/snakecase-discriminator
|
||||||
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/snakecase-discriminator.yaml
|
||||||
|
templateDir: modules/openapi-generator/src/main/resources/typescript-fetch
|
@ -46,7 +46,7 @@ export function {{classname}}FromJSONTyped(json: any, ignoreDiscriminator: boole
|
|||||||
{{#discriminator}}
|
{{#discriminator}}
|
||||||
if (!ignoreDiscriminator) {
|
if (!ignoreDiscriminator) {
|
||||||
{{#discriminator.mappedModels}}
|
{{#discriminator.mappedModels}}
|
||||||
if (json['{{discriminator.propertyName}}'] === '{{mappingName}}') {
|
if (json['{{discriminator.propertyBaseName}}'] === '{{mappingName}}') {
|
||||||
return {{modelName}}FromJSONTyped(json, true);
|
return {{modelName}}FromJSONTyped(json, true);
|
||||||
}
|
}
|
||||||
{{/discriminator.mappedModels}}
|
{{/discriminator.mappedModels}}
|
||||||
|
@ -21,7 +21,7 @@ export function {{classname}}FromJSONTyped(json: any, ignoreDiscriminator: boole
|
|||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
{{#discriminator}}
|
{{#discriminator}}
|
||||||
switch (json['{{discriminator.propertyName}}']) {
|
switch (json['{{discriminator.propertyBaseName}}']) {
|
||||||
{{#discriminator.mappedModels}}
|
{{#discriminator.mappedModels}}
|
||||||
case '{{mappingName}}':
|
case '{{mappingName}}':
|
||||||
return {...{{modelName}}FromJSONTyped(json, true), {{discriminator.propertyName}}: '{{mappingName}}'};
|
return {...{{modelName}}FromJSONTyped(json, true), {{discriminator.propertyName}}: '{{mappingName}}'};
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,23 @@
|
|||||||
|
# OpenAPI Generator Ignore
|
||||||
|
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
||||||
|
|
||||||
|
# Use this file to prevent files from being overwritten by the generator.
|
||||||
|
# The patterns follow closely to .gitignore or .dockerignore.
|
||||||
|
|
||||||
|
# As an example, the C# client generator defines ApiClient.cs.
|
||||||
|
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
||||||
|
#ApiClient.cs
|
||||||
|
|
||||||
|
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||||
|
#foo/*/qux
|
||||||
|
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||||
|
|
||||||
|
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||||
|
#foo/**/qux
|
||||||
|
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||||
|
|
||||||
|
# You can also negate patterns with an exclamation (!).
|
||||||
|
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||||
|
#docs/*.md
|
||||||
|
# Then explicitly reverse the ignore rule for a single file:
|
||||||
|
#!docs/README.md
|
@ -0,0 +1,58 @@
|
|||||||
|
apis/AnotherFakeApi.ts
|
||||||
|
apis/DefaultApi.ts
|
||||||
|
apis/FakeApi.ts
|
||||||
|
apis/FakeClassnameTags123Api.ts
|
||||||
|
apis/PetApi.ts
|
||||||
|
apis/StoreApi.ts
|
||||||
|
apis/UserApi.ts
|
||||||
|
apis/index.ts
|
||||||
|
index.ts
|
||||||
|
models/AdditionalPropertiesClass.ts
|
||||||
|
models/AllOfWithSingleRef.ts
|
||||||
|
models/Animal.ts
|
||||||
|
models/ArrayOfArrayOfNumberOnly.ts
|
||||||
|
models/ArrayOfNumberOnly.ts
|
||||||
|
models/ArrayTest.ts
|
||||||
|
models/Capitalization.ts
|
||||||
|
models/Cat.ts
|
||||||
|
models/Category.ts
|
||||||
|
models/ClassModel.ts
|
||||||
|
models/Client.ts
|
||||||
|
models/DeprecatedObject.ts
|
||||||
|
models/Dog.ts
|
||||||
|
models/EnumArrays.ts
|
||||||
|
models/EnumClass.ts
|
||||||
|
models/EnumTest.ts
|
||||||
|
models/FakeBigDecimalMap200Response.ts
|
||||||
|
models/FileSchemaTestClass.ts
|
||||||
|
models/Foo.ts
|
||||||
|
models/FooGetDefaultResponse.ts
|
||||||
|
models/FormatTest.ts
|
||||||
|
models/HasOnlyReadOnly.ts
|
||||||
|
models/HealthCheckResult.ts
|
||||||
|
models/List.ts
|
||||||
|
models/MapTest.ts
|
||||||
|
models/MixedPropertiesAndAdditionalPropertiesClass.ts
|
||||||
|
models/Model200Response.ts
|
||||||
|
models/ModelApiResponse.ts
|
||||||
|
models/ModelFile.ts
|
||||||
|
models/Name.ts
|
||||||
|
models/NullableClass.ts
|
||||||
|
models/NumberOnly.ts
|
||||||
|
models/ObjectWithDeprecatedFields.ts
|
||||||
|
models/Order.ts
|
||||||
|
models/OuterComposite.ts
|
||||||
|
models/OuterEnum.ts
|
||||||
|
models/OuterEnumDefaultValue.ts
|
||||||
|
models/OuterEnumInteger.ts
|
||||||
|
models/OuterEnumIntegerDefaultValue.ts
|
||||||
|
models/OuterObjectWithEnumProperty.ts
|
||||||
|
models/Pet.ts
|
||||||
|
models/ReadOnlyFirst.ts
|
||||||
|
models/Return.ts
|
||||||
|
models/SingleRefType.ts
|
||||||
|
models/SpecialModelName.ts
|
||||||
|
models/Tag.ts
|
||||||
|
models/User.ts
|
||||||
|
models/index.ts
|
||||||
|
runtime.ts
|
@ -0,0 +1 @@
|
|||||||
|
7.0.0-SNAPSHOT
|
@ -0,0 +1,69 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
import * as runtime from '../runtime';
|
||||||
|
import type {
|
||||||
|
Client,
|
||||||
|
} from '../models/index';
|
||||||
|
import {
|
||||||
|
ClientFromJSON,
|
||||||
|
ClientToJSON,
|
||||||
|
} from '../models/index';
|
||||||
|
|
||||||
|
export interface 123testSpecialTagsRequest {
|
||||||
|
client: Client;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
export class AnotherFakeApi extends runtime.BaseAPI {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To test special tags and operation ID starting with number
|
||||||
|
* To test special tags
|
||||||
|
*/
|
||||||
|
async _123testSpecialTagsRaw(requestParameters: 123testSpecialTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Client>> {
|
||||||
|
if (requestParameters.client === null || requestParameters.client === undefined) {
|
||||||
|
throw new runtime.RequiredError('client','Required parameter requestParameters.client was null or undefined when calling _123testSpecialTags.');
|
||||||
|
}
|
||||||
|
|
||||||
|
const queryParameters: any = {};
|
||||||
|
|
||||||
|
const headerParameters: runtime.HTTPHeaders = {};
|
||||||
|
|
||||||
|
headerParameters['Content-Type'] = 'application/json';
|
||||||
|
|
||||||
|
const response = await this.request({
|
||||||
|
path: `/another-fake/dummy`,
|
||||||
|
method: 'PATCH',
|
||||||
|
headers: headerParameters,
|
||||||
|
query: queryParameters,
|
||||||
|
body: ClientToJSON(requestParameters.client),
|
||||||
|
}, initOverrides);
|
||||||
|
|
||||||
|
return new runtime.JSONApiResponse(response, (jsonValue) => ClientFromJSON(jsonValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To test special tags and operation ID starting with number
|
||||||
|
* To test special tags
|
||||||
|
*/
|
||||||
|
async _123testSpecialTags(requestParameters: 123testSpecialTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Client> {
|
||||||
|
const response = await this._123testSpecialTagsRaw(requestParameters, initOverrides);
|
||||||
|
return await response.value();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,54 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
import * as runtime from '../runtime';
|
||||||
|
import type {
|
||||||
|
FooGetDefaultResponse,
|
||||||
|
} from '../models/index';
|
||||||
|
import {
|
||||||
|
FooGetDefaultResponseFromJSON,
|
||||||
|
FooGetDefaultResponseToJSON,
|
||||||
|
} from '../models/index';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
export class DefaultApi extends runtime.BaseAPI {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
async fooGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FooGetDefaultResponse>> {
|
||||||
|
const queryParameters: any = {};
|
||||||
|
|
||||||
|
const headerParameters: runtime.HTTPHeaders = {};
|
||||||
|
|
||||||
|
const response = await this.request({
|
||||||
|
path: `/foo`,
|
||||||
|
method: 'GET',
|
||||||
|
headers: headerParameters,
|
||||||
|
query: queryParameters,
|
||||||
|
}, initOverrides);
|
||||||
|
|
||||||
|
return new runtime.JSONApiResponse(response, (jsonValue) => FooGetDefaultResponseFromJSON(jsonValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
async fooGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FooGetDefaultResponse> {
|
||||||
|
const response = await this.fooGetRaw(initOverrides);
|
||||||
|
return await response.value();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,73 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
import * as runtime from '../runtime';
|
||||||
|
import type {
|
||||||
|
Client,
|
||||||
|
} from '../models/index';
|
||||||
|
import {
|
||||||
|
ClientFromJSON,
|
||||||
|
ClientToJSON,
|
||||||
|
} from '../models/index';
|
||||||
|
|
||||||
|
export interface TestClassnameRequest {
|
||||||
|
client: Client;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
export class FakeClassnameTags123Api extends runtime.BaseAPI {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To test class name in snake case
|
||||||
|
* To test class name in snake case
|
||||||
|
*/
|
||||||
|
async testClassnameRaw(requestParameters: TestClassnameRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Client>> {
|
||||||
|
if (requestParameters.client === null || requestParameters.client === undefined) {
|
||||||
|
throw new runtime.RequiredError('client','Required parameter requestParameters.client was null or undefined when calling testClassname.');
|
||||||
|
}
|
||||||
|
|
||||||
|
const queryParameters: any = {};
|
||||||
|
|
||||||
|
const headerParameters: runtime.HTTPHeaders = {};
|
||||||
|
|
||||||
|
headerParameters['Content-Type'] = 'application/json';
|
||||||
|
|
||||||
|
if (this.configuration && this.configuration.apiKey) {
|
||||||
|
queryParameters["api_key_query"] = this.configuration.apiKey("api_key_query"); // api_key_query authentication
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await this.request({
|
||||||
|
path: `/fake_classname_test`,
|
||||||
|
method: 'PATCH',
|
||||||
|
headers: headerParameters,
|
||||||
|
query: queryParameters,
|
||||||
|
body: ClientToJSON(requestParameters.client),
|
||||||
|
}, initOverrides);
|
||||||
|
|
||||||
|
return new runtime.JSONApiResponse(response, (jsonValue) => ClientFromJSON(jsonValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To test class name in snake case
|
||||||
|
* To test class name in snake case
|
||||||
|
*/
|
||||||
|
async testClassname(requestParameters: TestClassnameRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Client> {
|
||||||
|
const response = await this.testClassnameRaw(requestParameters, initOverrides);
|
||||||
|
return await response.value();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,509 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
import * as runtime from '../runtime';
|
||||||
|
import type {
|
||||||
|
ModelApiResponse,
|
||||||
|
Pet,
|
||||||
|
} from '../models/index';
|
||||||
|
import {
|
||||||
|
ModelApiResponseFromJSON,
|
||||||
|
ModelApiResponseToJSON,
|
||||||
|
PetFromJSON,
|
||||||
|
PetToJSON,
|
||||||
|
} from '../models/index';
|
||||||
|
|
||||||
|
export interface AddPetRequest {
|
||||||
|
pet: Pet;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DeletePetRequest {
|
||||||
|
petId: number;
|
||||||
|
apiKey?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FindPetsByStatusRequest {
|
||||||
|
status: Array<FindPetsByStatusStatusEnum>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FindPetsByTagsRequest {
|
||||||
|
tags: Set<string>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface GetPetByIdRequest {
|
||||||
|
petId: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdatePetRequest {
|
||||||
|
pet: Pet;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdatePetWithFormRequest {
|
||||||
|
petId: number;
|
||||||
|
name?: string;
|
||||||
|
status?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UploadFileRequest {
|
||||||
|
petId: number;
|
||||||
|
additionalMetadata?: string;
|
||||||
|
file?: Blob;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UploadFileWithRequiredFileRequest {
|
||||||
|
petId: number;
|
||||||
|
requiredFile: Blob;
|
||||||
|
additionalMetadata?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
export class PetApi extends runtime.BaseAPI {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Add a new pet to the store
|
||||||
|
*/
|
||||||
|
async addPetRaw(requestParameters: AddPetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||||
|
if (requestParameters.pet === null || requestParameters.pet === undefined) {
|
||||||
|
throw new runtime.RequiredError('pet','Required parameter requestParameters.pet was null or undefined when calling addPet.');
|
||||||
|
}
|
||||||
|
|
||||||
|
const queryParameters: any = {};
|
||||||
|
|
||||||
|
const headerParameters: runtime.HTTPHeaders = {};
|
||||||
|
|
||||||
|
headerParameters['Content-Type'] = 'application/json';
|
||||||
|
|
||||||
|
if (this.configuration && this.configuration.accessToken) {
|
||||||
|
// oauth required
|
||||||
|
headerParameters["Authorization"] = await this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await this.request({
|
||||||
|
path: `/pet`,
|
||||||
|
method: 'POST',
|
||||||
|
headers: headerParameters,
|
||||||
|
query: queryParameters,
|
||||||
|
body: PetToJSON(requestParameters.pet),
|
||||||
|
}, initOverrides);
|
||||||
|
|
||||||
|
return new runtime.VoidApiResponse(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Add a new pet to the store
|
||||||
|
*/
|
||||||
|
async addPet(requestParameters: AddPetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||||
|
await this.addPetRaw(requestParameters, initOverrides);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Deletes a pet
|
||||||
|
*/
|
||||||
|
async deletePetRaw(requestParameters: DeletePetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||||
|
if (requestParameters.petId === null || requestParameters.petId === undefined) {
|
||||||
|
throw new runtime.RequiredError('petId','Required parameter requestParameters.petId was null or undefined when calling deletePet.');
|
||||||
|
}
|
||||||
|
|
||||||
|
const queryParameters: any = {};
|
||||||
|
|
||||||
|
const headerParameters: runtime.HTTPHeaders = {};
|
||||||
|
|
||||||
|
if (requestParameters.apiKey !== undefined && requestParameters.apiKey !== null) {
|
||||||
|
headerParameters['api_key'] = String(requestParameters.apiKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.configuration && this.configuration.accessToken) {
|
||||||
|
// oauth required
|
||||||
|
headerParameters["Authorization"] = await this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await this.request({
|
||||||
|
path: `/pet/{petId}`.replace(`{${"petId"}}`, encodeURIComponent(String(requestParameters.petId))),
|
||||||
|
method: 'DELETE',
|
||||||
|
headers: headerParameters,
|
||||||
|
query: queryParameters,
|
||||||
|
}, initOverrides);
|
||||||
|
|
||||||
|
return new runtime.VoidApiResponse(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Deletes a pet
|
||||||
|
*/
|
||||||
|
async deletePet(requestParameters: DeletePetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||||
|
await this.deletePetRaw(requestParameters, initOverrides);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Multiple status values can be provided with comma separated strings
|
||||||
|
* Finds Pets by status
|
||||||
|
*/
|
||||||
|
async findPetsByStatusRaw(requestParameters: FindPetsByStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<Pet>>> {
|
||||||
|
if (requestParameters.status === null || requestParameters.status === undefined) {
|
||||||
|
throw new runtime.RequiredError('status','Required parameter requestParameters.status was null or undefined when calling findPetsByStatus.');
|
||||||
|
}
|
||||||
|
|
||||||
|
const queryParameters: any = {};
|
||||||
|
|
||||||
|
if (requestParameters.status) {
|
||||||
|
queryParameters['status'] = requestParameters.status.join(runtime.COLLECTION_FORMATS["csv"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
const headerParameters: runtime.HTTPHeaders = {};
|
||||||
|
|
||||||
|
if (this.configuration && this.configuration.accessToken) {
|
||||||
|
// oauth required
|
||||||
|
headerParameters["Authorization"] = await this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await this.request({
|
||||||
|
path: `/pet/findByStatus`,
|
||||||
|
method: 'GET',
|
||||||
|
headers: headerParameters,
|
||||||
|
query: queryParameters,
|
||||||
|
}, initOverrides);
|
||||||
|
|
||||||
|
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PetFromJSON));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Multiple status values can be provided with comma separated strings
|
||||||
|
* Finds Pets by status
|
||||||
|
*/
|
||||||
|
async findPetsByStatus(requestParameters: FindPetsByStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Pet>> {
|
||||||
|
const response = await this.findPetsByStatusRaw(requestParameters, initOverrides);
|
||||||
|
return await response.value();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||||
|
* Finds Pets by tags
|
||||||
|
*/
|
||||||
|
async findPetsByTagsRaw(requestParameters: FindPetsByTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Set<Pet>>> {
|
||||||
|
if (requestParameters.tags === null || requestParameters.tags === undefined) {
|
||||||
|
throw new runtime.RequiredError('tags','Required parameter requestParameters.tags was null or undefined when calling findPetsByTags.');
|
||||||
|
}
|
||||||
|
|
||||||
|
const queryParameters: any = {};
|
||||||
|
|
||||||
|
if (requestParameters.tags) {
|
||||||
|
queryParameters['tags'] = Array.from(requestParameters.tags).join(runtime.COLLECTION_FORMATS["csv"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
const headerParameters: runtime.HTTPHeaders = {};
|
||||||
|
|
||||||
|
if (this.configuration && this.configuration.accessToken) {
|
||||||
|
// oauth required
|
||||||
|
headerParameters["Authorization"] = await this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await this.request({
|
||||||
|
path: `/pet/findByTags`,
|
||||||
|
method: 'GET',
|
||||||
|
headers: headerParameters,
|
||||||
|
query: queryParameters,
|
||||||
|
}, initOverrides);
|
||||||
|
|
||||||
|
return new runtime.JSONApiResponse(response, (jsonValue) => new Set(jsonValue.map(PetFromJSON)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||||
|
* Finds Pets by tags
|
||||||
|
*/
|
||||||
|
async findPetsByTags(requestParameters: FindPetsByTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Set<Pet>> {
|
||||||
|
const response = await this.findPetsByTagsRaw(requestParameters, initOverrides);
|
||||||
|
return await response.value();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a single pet
|
||||||
|
* Find pet by ID
|
||||||
|
*/
|
||||||
|
async getPetByIdRaw(requestParameters: GetPetByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Pet>> {
|
||||||
|
if (requestParameters.petId === null || requestParameters.petId === undefined) {
|
||||||
|
throw new runtime.RequiredError('petId','Required parameter requestParameters.petId was null or undefined when calling getPetById.');
|
||||||
|
}
|
||||||
|
|
||||||
|
const queryParameters: any = {};
|
||||||
|
|
||||||
|
const headerParameters: runtime.HTTPHeaders = {};
|
||||||
|
|
||||||
|
if (this.configuration && this.configuration.apiKey) {
|
||||||
|
headerParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await this.request({
|
||||||
|
path: `/pet/{petId}`.replace(`{${"petId"}}`, encodeURIComponent(String(requestParameters.petId))),
|
||||||
|
method: 'GET',
|
||||||
|
headers: headerParameters,
|
||||||
|
query: queryParameters,
|
||||||
|
}, initOverrides);
|
||||||
|
|
||||||
|
return new runtime.JSONApiResponse(response, (jsonValue) => PetFromJSON(jsonValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a single pet
|
||||||
|
* Find pet by ID
|
||||||
|
*/
|
||||||
|
async getPetById(requestParameters: GetPetByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Pet> {
|
||||||
|
const response = await this.getPetByIdRaw(requestParameters, initOverrides);
|
||||||
|
return await response.value();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Update an existing pet
|
||||||
|
*/
|
||||||
|
async updatePetRaw(requestParameters: UpdatePetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||||
|
if (requestParameters.pet === null || requestParameters.pet === undefined) {
|
||||||
|
throw new runtime.RequiredError('pet','Required parameter requestParameters.pet was null or undefined when calling updatePet.');
|
||||||
|
}
|
||||||
|
|
||||||
|
const queryParameters: any = {};
|
||||||
|
|
||||||
|
const headerParameters: runtime.HTTPHeaders = {};
|
||||||
|
|
||||||
|
headerParameters['Content-Type'] = 'application/json';
|
||||||
|
|
||||||
|
if (this.configuration && this.configuration.accessToken) {
|
||||||
|
// oauth required
|
||||||
|
headerParameters["Authorization"] = await this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await this.request({
|
||||||
|
path: `/pet`,
|
||||||
|
method: 'PUT',
|
||||||
|
headers: headerParameters,
|
||||||
|
query: queryParameters,
|
||||||
|
body: PetToJSON(requestParameters.pet),
|
||||||
|
}, initOverrides);
|
||||||
|
|
||||||
|
return new runtime.VoidApiResponse(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Update an existing pet
|
||||||
|
*/
|
||||||
|
async updatePet(requestParameters: UpdatePetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||||
|
await this.updatePetRaw(requestParameters, initOverrides);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Updates a pet in the store with form data
|
||||||
|
*/
|
||||||
|
async updatePetWithFormRaw(requestParameters: UpdatePetWithFormRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||||
|
if (requestParameters.petId === null || requestParameters.petId === undefined) {
|
||||||
|
throw new runtime.RequiredError('petId','Required parameter requestParameters.petId was null or undefined when calling updatePetWithForm.');
|
||||||
|
}
|
||||||
|
|
||||||
|
const queryParameters: any = {};
|
||||||
|
|
||||||
|
const headerParameters: runtime.HTTPHeaders = {};
|
||||||
|
|
||||||
|
if (this.configuration && this.configuration.accessToken) {
|
||||||
|
// oauth required
|
||||||
|
headerParameters["Authorization"] = await this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
const consumes: runtime.Consume[] = [
|
||||||
|
{ contentType: 'application/x-www-form-urlencoded' },
|
||||||
|
];
|
||||||
|
// @ts-ignore: canConsumeForm may be unused
|
||||||
|
const canConsumeForm = runtime.canConsumeForm(consumes);
|
||||||
|
|
||||||
|
let formParams: { append(param: string, value: any): any };
|
||||||
|
let useForm = false;
|
||||||
|
if (useForm) {
|
||||||
|
formParams = new FormData();
|
||||||
|
} else {
|
||||||
|
formParams = new URLSearchParams();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (requestParameters.name !== undefined) {
|
||||||
|
formParams.append('name', requestParameters.name as any);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (requestParameters.status !== undefined) {
|
||||||
|
formParams.append('status', requestParameters.status as any);
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await this.request({
|
||||||
|
path: `/pet/{petId}`.replace(`{${"petId"}}`, encodeURIComponent(String(requestParameters.petId))),
|
||||||
|
method: 'POST',
|
||||||
|
headers: headerParameters,
|
||||||
|
query: queryParameters,
|
||||||
|
body: formParams,
|
||||||
|
}, initOverrides);
|
||||||
|
|
||||||
|
return new runtime.VoidApiResponse(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Updates a pet in the store with form data
|
||||||
|
*/
|
||||||
|
async updatePetWithForm(requestParameters: UpdatePetWithFormRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||||
|
await this.updatePetWithFormRaw(requestParameters, initOverrides);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* uploads an image
|
||||||
|
*/
|
||||||
|
async uploadFileRaw(requestParameters: UploadFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ModelApiResponse>> {
|
||||||
|
if (requestParameters.petId === null || requestParameters.petId === undefined) {
|
||||||
|
throw new runtime.RequiredError('petId','Required parameter requestParameters.petId was null or undefined when calling uploadFile.');
|
||||||
|
}
|
||||||
|
|
||||||
|
const queryParameters: any = {};
|
||||||
|
|
||||||
|
const headerParameters: runtime.HTTPHeaders = {};
|
||||||
|
|
||||||
|
if (this.configuration && this.configuration.accessToken) {
|
||||||
|
// oauth required
|
||||||
|
headerParameters["Authorization"] = await this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
const consumes: runtime.Consume[] = [
|
||||||
|
{ contentType: 'multipart/form-data' },
|
||||||
|
];
|
||||||
|
// @ts-ignore: canConsumeForm may be unused
|
||||||
|
const canConsumeForm = runtime.canConsumeForm(consumes);
|
||||||
|
|
||||||
|
let formParams: { append(param: string, value: any): any };
|
||||||
|
let useForm = false;
|
||||||
|
// use FormData to transmit files using content-type "multipart/form-data"
|
||||||
|
useForm = canConsumeForm;
|
||||||
|
if (useForm) {
|
||||||
|
formParams = new FormData();
|
||||||
|
} else {
|
||||||
|
formParams = new URLSearchParams();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (requestParameters.additionalMetadata !== undefined) {
|
||||||
|
formParams.append('additionalMetadata', requestParameters.additionalMetadata as any);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (requestParameters.file !== undefined) {
|
||||||
|
formParams.append('file', requestParameters.file as any);
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await this.request({
|
||||||
|
path: `/pet/{petId}/uploadImage`.replace(`{${"petId"}}`, encodeURIComponent(String(requestParameters.petId))),
|
||||||
|
method: 'POST',
|
||||||
|
headers: headerParameters,
|
||||||
|
query: queryParameters,
|
||||||
|
body: formParams,
|
||||||
|
}, initOverrides);
|
||||||
|
|
||||||
|
return new runtime.JSONApiResponse(response, (jsonValue) => ModelApiResponseFromJSON(jsonValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* uploads an image
|
||||||
|
*/
|
||||||
|
async uploadFile(requestParameters: UploadFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelApiResponse> {
|
||||||
|
const response = await this.uploadFileRaw(requestParameters, initOverrides);
|
||||||
|
return await response.value();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* uploads an image (required)
|
||||||
|
*/
|
||||||
|
async uploadFileWithRequiredFileRaw(requestParameters: UploadFileWithRequiredFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ModelApiResponse>> {
|
||||||
|
if (requestParameters.petId === null || requestParameters.petId === undefined) {
|
||||||
|
throw new runtime.RequiredError('petId','Required parameter requestParameters.petId was null or undefined when calling uploadFileWithRequiredFile.');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (requestParameters.requiredFile === null || requestParameters.requiredFile === undefined) {
|
||||||
|
throw new runtime.RequiredError('requiredFile','Required parameter requestParameters.requiredFile was null or undefined when calling uploadFileWithRequiredFile.');
|
||||||
|
}
|
||||||
|
|
||||||
|
const queryParameters: any = {};
|
||||||
|
|
||||||
|
const headerParameters: runtime.HTTPHeaders = {};
|
||||||
|
|
||||||
|
if (this.configuration && this.configuration.accessToken) {
|
||||||
|
// oauth required
|
||||||
|
headerParameters["Authorization"] = await this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
const consumes: runtime.Consume[] = [
|
||||||
|
{ contentType: 'multipart/form-data' },
|
||||||
|
];
|
||||||
|
// @ts-ignore: canConsumeForm may be unused
|
||||||
|
const canConsumeForm = runtime.canConsumeForm(consumes);
|
||||||
|
|
||||||
|
let formParams: { append(param: string, value: any): any };
|
||||||
|
let useForm = false;
|
||||||
|
// use FormData to transmit files using content-type "multipart/form-data"
|
||||||
|
useForm = canConsumeForm;
|
||||||
|
if (useForm) {
|
||||||
|
formParams = new FormData();
|
||||||
|
} else {
|
||||||
|
formParams = new URLSearchParams();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (requestParameters.additionalMetadata !== undefined) {
|
||||||
|
formParams.append('additionalMetadata', requestParameters.additionalMetadata as any);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (requestParameters.requiredFile !== undefined) {
|
||||||
|
formParams.append('requiredFile', requestParameters.requiredFile as any);
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await this.request({
|
||||||
|
path: `/fake/{petId}/uploadImageWithRequiredFile`.replace(`{${"petId"}}`, encodeURIComponent(String(requestParameters.petId))),
|
||||||
|
method: 'POST',
|
||||||
|
headers: headerParameters,
|
||||||
|
query: queryParameters,
|
||||||
|
body: formParams,
|
||||||
|
}, initOverrides);
|
||||||
|
|
||||||
|
return new runtime.JSONApiResponse(response, (jsonValue) => ModelApiResponseFromJSON(jsonValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* uploads an image (required)
|
||||||
|
*/
|
||||||
|
async uploadFileWithRequiredFile(requestParameters: UploadFileWithRequiredFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelApiResponse> {
|
||||||
|
const response = await this.uploadFileWithRequiredFileRaw(requestParameters, initOverrides);
|
||||||
|
return await response.value();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const FindPetsByStatusStatusEnum = {
|
||||||
|
Available: 'available',
|
||||||
|
Pending: 'pending',
|
||||||
|
Sold: 'sold'
|
||||||
|
} as const;
|
||||||
|
export type FindPetsByStatusStatusEnum = typeof FindPetsByStatusStatusEnum[keyof typeof FindPetsByStatusStatusEnum];
|
@ -0,0 +1,172 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
import * as runtime from '../runtime';
|
||||||
|
import type {
|
||||||
|
Order,
|
||||||
|
} from '../models/index';
|
||||||
|
import {
|
||||||
|
OrderFromJSON,
|
||||||
|
OrderToJSON,
|
||||||
|
} from '../models/index';
|
||||||
|
|
||||||
|
export interface DeleteOrderRequest {
|
||||||
|
orderId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface GetOrderByIdRequest {
|
||||||
|
orderId: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PlaceOrderRequest {
|
||||||
|
order: Order;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
export class StoreApi extends runtime.BaseAPI {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||||
|
* Delete purchase order by ID
|
||||||
|
*/
|
||||||
|
async deleteOrderRaw(requestParameters: DeleteOrderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||||
|
if (requestParameters.orderId === null || requestParameters.orderId === undefined) {
|
||||||
|
throw new runtime.RequiredError('orderId','Required parameter requestParameters.orderId was null or undefined when calling deleteOrder.');
|
||||||
|
}
|
||||||
|
|
||||||
|
const queryParameters: any = {};
|
||||||
|
|
||||||
|
const headerParameters: runtime.HTTPHeaders = {};
|
||||||
|
|
||||||
|
const response = await this.request({
|
||||||
|
path: `/store/order/{order_id}`.replace(`{${"order_id"}}`, encodeURIComponent(String(requestParameters.orderId))),
|
||||||
|
method: 'DELETE',
|
||||||
|
headers: headerParameters,
|
||||||
|
query: queryParameters,
|
||||||
|
}, initOverrides);
|
||||||
|
|
||||||
|
return new runtime.VoidApiResponse(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||||
|
* Delete purchase order by ID
|
||||||
|
*/
|
||||||
|
async deleteOrder(requestParameters: DeleteOrderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||||
|
await this.deleteOrderRaw(requestParameters, initOverrides);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a map of status codes to quantities
|
||||||
|
* Returns pet inventories by status
|
||||||
|
*/
|
||||||
|
async getInventoryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{ [key: string]: number; }>> {
|
||||||
|
const queryParameters: any = {};
|
||||||
|
|
||||||
|
const headerParameters: runtime.HTTPHeaders = {};
|
||||||
|
|
||||||
|
if (this.configuration && this.configuration.apiKey) {
|
||||||
|
headerParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await this.request({
|
||||||
|
path: `/store/inventory`,
|
||||||
|
method: 'GET',
|
||||||
|
headers: headerParameters,
|
||||||
|
query: queryParameters,
|
||||||
|
}, initOverrides);
|
||||||
|
|
||||||
|
return new runtime.JSONApiResponse<any>(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a map of status codes to quantities
|
||||||
|
* Returns pet inventories by status
|
||||||
|
*/
|
||||||
|
async getInventory(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: number; }> {
|
||||||
|
const response = await this.getInventoryRaw(initOverrides);
|
||||||
|
return await response.value();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
|
||||||
|
* Find purchase order by ID
|
||||||
|
*/
|
||||||
|
async getOrderByIdRaw(requestParameters: GetOrderByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Order>> {
|
||||||
|
if (requestParameters.orderId === null || requestParameters.orderId === undefined) {
|
||||||
|
throw new runtime.RequiredError('orderId','Required parameter requestParameters.orderId was null or undefined when calling getOrderById.');
|
||||||
|
}
|
||||||
|
|
||||||
|
const queryParameters: any = {};
|
||||||
|
|
||||||
|
const headerParameters: runtime.HTTPHeaders = {};
|
||||||
|
|
||||||
|
const response = await this.request({
|
||||||
|
path: `/store/order/{order_id}`.replace(`{${"order_id"}}`, encodeURIComponent(String(requestParameters.orderId))),
|
||||||
|
method: 'GET',
|
||||||
|
headers: headerParameters,
|
||||||
|
query: queryParameters,
|
||||||
|
}, initOverrides);
|
||||||
|
|
||||||
|
return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
|
||||||
|
* Find purchase order by ID
|
||||||
|
*/
|
||||||
|
async getOrderById(requestParameters: GetOrderByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Order> {
|
||||||
|
const response = await this.getOrderByIdRaw(requestParameters, initOverrides);
|
||||||
|
return await response.value();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Place an order for a pet
|
||||||
|
*/
|
||||||
|
async placeOrderRaw(requestParameters: PlaceOrderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Order>> {
|
||||||
|
if (requestParameters.order === null || requestParameters.order === undefined) {
|
||||||
|
throw new runtime.RequiredError('order','Required parameter requestParameters.order was null or undefined when calling placeOrder.');
|
||||||
|
}
|
||||||
|
|
||||||
|
const queryParameters: any = {};
|
||||||
|
|
||||||
|
const headerParameters: runtime.HTTPHeaders = {};
|
||||||
|
|
||||||
|
headerParameters['Content-Type'] = 'application/json';
|
||||||
|
|
||||||
|
const response = await this.request({
|
||||||
|
path: `/store/order`,
|
||||||
|
method: 'POST',
|
||||||
|
headers: headerParameters,
|
||||||
|
query: queryParameters,
|
||||||
|
body: OrderToJSON(requestParameters.order),
|
||||||
|
}, initOverrides);
|
||||||
|
|
||||||
|
return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Place an order for a pet
|
||||||
|
*/
|
||||||
|
async placeOrder(requestParameters: PlaceOrderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Order> {
|
||||||
|
const response = await this.placeOrderRaw(requestParameters, initOverrides);
|
||||||
|
return await response.value();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,338 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
import * as runtime from '../runtime';
|
||||||
|
import type {
|
||||||
|
User,
|
||||||
|
} from '../models/index';
|
||||||
|
import {
|
||||||
|
UserFromJSON,
|
||||||
|
UserToJSON,
|
||||||
|
} from '../models/index';
|
||||||
|
|
||||||
|
export interface CreateUserRequest {
|
||||||
|
user: User;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateUsersWithArrayInputRequest {
|
||||||
|
user: Array<User>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateUsersWithListInputRequest {
|
||||||
|
user: Array<User>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DeleteUserRequest {
|
||||||
|
username: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface GetUserByNameRequest {
|
||||||
|
username: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface LoginUserRequest {
|
||||||
|
username: string;
|
||||||
|
password: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateUserRequest {
|
||||||
|
username: string;
|
||||||
|
user: User;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
export class UserApi extends runtime.BaseAPI {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This can only be done by the logged in user.
|
||||||
|
* Create user
|
||||||
|
*/
|
||||||
|
async createUserRaw(requestParameters: CreateUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||||
|
if (requestParameters.user === null || requestParameters.user === undefined) {
|
||||||
|
throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling createUser.');
|
||||||
|
}
|
||||||
|
|
||||||
|
const queryParameters: any = {};
|
||||||
|
|
||||||
|
const headerParameters: runtime.HTTPHeaders = {};
|
||||||
|
|
||||||
|
headerParameters['Content-Type'] = 'application/json';
|
||||||
|
|
||||||
|
const response = await this.request({
|
||||||
|
path: `/user`,
|
||||||
|
method: 'POST',
|
||||||
|
headers: headerParameters,
|
||||||
|
query: queryParameters,
|
||||||
|
body: UserToJSON(requestParameters.user),
|
||||||
|
}, initOverrides);
|
||||||
|
|
||||||
|
return new runtime.VoidApiResponse(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This can only be done by the logged in user.
|
||||||
|
* Create user
|
||||||
|
*/
|
||||||
|
async createUser(requestParameters: CreateUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||||
|
await this.createUserRaw(requestParameters, initOverrides);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Creates list of users with given input array
|
||||||
|
*/
|
||||||
|
async createUsersWithArrayInputRaw(requestParameters: CreateUsersWithArrayInputRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||||
|
if (requestParameters.user === null || requestParameters.user === undefined) {
|
||||||
|
throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling createUsersWithArrayInput.');
|
||||||
|
}
|
||||||
|
|
||||||
|
const queryParameters: any = {};
|
||||||
|
|
||||||
|
const headerParameters: runtime.HTTPHeaders = {};
|
||||||
|
|
||||||
|
headerParameters['Content-Type'] = 'application/json';
|
||||||
|
|
||||||
|
const response = await this.request({
|
||||||
|
path: `/user/createWithArray`,
|
||||||
|
method: 'POST',
|
||||||
|
headers: headerParameters,
|
||||||
|
query: queryParameters,
|
||||||
|
body: requestParameters.user.map(UserToJSON),
|
||||||
|
}, initOverrides);
|
||||||
|
|
||||||
|
return new runtime.VoidApiResponse(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Creates list of users with given input array
|
||||||
|
*/
|
||||||
|
async createUsersWithArrayInput(requestParameters: CreateUsersWithArrayInputRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||||
|
await this.createUsersWithArrayInputRaw(requestParameters, initOverrides);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Creates list of users with given input array
|
||||||
|
*/
|
||||||
|
async createUsersWithListInputRaw(requestParameters: CreateUsersWithListInputRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||||
|
if (requestParameters.user === null || requestParameters.user === undefined) {
|
||||||
|
throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling createUsersWithListInput.');
|
||||||
|
}
|
||||||
|
|
||||||
|
const queryParameters: any = {};
|
||||||
|
|
||||||
|
const headerParameters: runtime.HTTPHeaders = {};
|
||||||
|
|
||||||
|
headerParameters['Content-Type'] = 'application/json';
|
||||||
|
|
||||||
|
const response = await this.request({
|
||||||
|
path: `/user/createWithList`,
|
||||||
|
method: 'POST',
|
||||||
|
headers: headerParameters,
|
||||||
|
query: queryParameters,
|
||||||
|
body: requestParameters.user.map(UserToJSON),
|
||||||
|
}, initOverrides);
|
||||||
|
|
||||||
|
return new runtime.VoidApiResponse(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Creates list of users with given input array
|
||||||
|
*/
|
||||||
|
async createUsersWithListInput(requestParameters: CreateUsersWithListInputRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||||
|
await this.createUsersWithListInputRaw(requestParameters, initOverrides);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This can only be done by the logged in user.
|
||||||
|
* Delete user
|
||||||
|
*/
|
||||||
|
async deleteUserRaw(requestParameters: DeleteUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||||
|
if (requestParameters.username === null || requestParameters.username === undefined) {
|
||||||
|
throw new runtime.RequiredError('username','Required parameter requestParameters.username was null or undefined when calling deleteUser.');
|
||||||
|
}
|
||||||
|
|
||||||
|
const queryParameters: any = {};
|
||||||
|
|
||||||
|
const headerParameters: runtime.HTTPHeaders = {};
|
||||||
|
|
||||||
|
const response = await this.request({
|
||||||
|
path: `/user/{username}`.replace(`{${"username"}}`, encodeURIComponent(String(requestParameters.username))),
|
||||||
|
method: 'DELETE',
|
||||||
|
headers: headerParameters,
|
||||||
|
query: queryParameters,
|
||||||
|
}, initOverrides);
|
||||||
|
|
||||||
|
return new runtime.VoidApiResponse(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This can only be done by the logged in user.
|
||||||
|
* Delete user
|
||||||
|
*/
|
||||||
|
async deleteUser(requestParameters: DeleteUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||||
|
await this.deleteUserRaw(requestParameters, initOverrides);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Get user by user name
|
||||||
|
*/
|
||||||
|
async getUserByNameRaw(requestParameters: GetUserByNameRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<User>> {
|
||||||
|
if (requestParameters.username === null || requestParameters.username === undefined) {
|
||||||
|
throw new runtime.RequiredError('username','Required parameter requestParameters.username was null or undefined when calling getUserByName.');
|
||||||
|
}
|
||||||
|
|
||||||
|
const queryParameters: any = {};
|
||||||
|
|
||||||
|
const headerParameters: runtime.HTTPHeaders = {};
|
||||||
|
|
||||||
|
const response = await this.request({
|
||||||
|
path: `/user/{username}`.replace(`{${"username"}}`, encodeURIComponent(String(requestParameters.username))),
|
||||||
|
method: 'GET',
|
||||||
|
headers: headerParameters,
|
||||||
|
query: queryParameters,
|
||||||
|
}, initOverrides);
|
||||||
|
|
||||||
|
return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Get user by user name
|
||||||
|
*/
|
||||||
|
async getUserByName(requestParameters: GetUserByNameRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<User> {
|
||||||
|
const response = await this.getUserByNameRaw(requestParameters, initOverrides);
|
||||||
|
return await response.value();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Logs user into the system
|
||||||
|
*/
|
||||||
|
async loginUserRaw(requestParameters: LoginUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> {
|
||||||
|
if (requestParameters.username === null || requestParameters.username === undefined) {
|
||||||
|
throw new runtime.RequiredError('username','Required parameter requestParameters.username was null or undefined when calling loginUser.');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (requestParameters.password === null || requestParameters.password === undefined) {
|
||||||
|
throw new runtime.RequiredError('password','Required parameter requestParameters.password was null or undefined when calling loginUser.');
|
||||||
|
}
|
||||||
|
|
||||||
|
const queryParameters: any = {};
|
||||||
|
|
||||||
|
if (requestParameters.username !== undefined) {
|
||||||
|
queryParameters['username'] = requestParameters.username;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (requestParameters.password !== undefined) {
|
||||||
|
queryParameters['password'] = requestParameters.password;
|
||||||
|
}
|
||||||
|
|
||||||
|
const headerParameters: runtime.HTTPHeaders = {};
|
||||||
|
|
||||||
|
const response = await this.request({
|
||||||
|
path: `/user/login`,
|
||||||
|
method: 'GET',
|
||||||
|
headers: headerParameters,
|
||||||
|
query: queryParameters,
|
||||||
|
}, initOverrides);
|
||||||
|
|
||||||
|
if (this.isJsonMime(response.headers.get('content-type'))) {
|
||||||
|
return new runtime.JSONApiResponse<string>(response);
|
||||||
|
} else {
|
||||||
|
return new runtime.TextApiResponse(response) as any;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Logs user into the system
|
||||||
|
*/
|
||||||
|
async loginUser(requestParameters: LoginUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string> {
|
||||||
|
const response = await this.loginUserRaw(requestParameters, initOverrides);
|
||||||
|
return await response.value();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Logs out current logged in user session
|
||||||
|
*/
|
||||||
|
async logoutUserRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||||
|
const queryParameters: any = {};
|
||||||
|
|
||||||
|
const headerParameters: runtime.HTTPHeaders = {};
|
||||||
|
|
||||||
|
const response = await this.request({
|
||||||
|
path: `/user/logout`,
|
||||||
|
method: 'GET',
|
||||||
|
headers: headerParameters,
|
||||||
|
query: queryParameters,
|
||||||
|
}, initOverrides);
|
||||||
|
|
||||||
|
return new runtime.VoidApiResponse(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Logs out current logged in user session
|
||||||
|
*/
|
||||||
|
async logoutUser(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||||
|
await this.logoutUserRaw(initOverrides);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This can only be done by the logged in user.
|
||||||
|
* Updated user
|
||||||
|
*/
|
||||||
|
async updateUserRaw(requestParameters: UpdateUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||||
|
if (requestParameters.username === null || requestParameters.username === undefined) {
|
||||||
|
throw new runtime.RequiredError('username','Required parameter requestParameters.username was null or undefined when calling updateUser.');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (requestParameters.user === null || requestParameters.user === undefined) {
|
||||||
|
throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling updateUser.');
|
||||||
|
}
|
||||||
|
|
||||||
|
const queryParameters: any = {};
|
||||||
|
|
||||||
|
const headerParameters: runtime.HTTPHeaders = {};
|
||||||
|
|
||||||
|
headerParameters['Content-Type'] = 'application/json';
|
||||||
|
|
||||||
|
const response = await this.request({
|
||||||
|
path: `/user/{username}`.replace(`{${"username"}}`, encodeURIComponent(String(requestParameters.username))),
|
||||||
|
method: 'PUT',
|
||||||
|
headers: headerParameters,
|
||||||
|
query: queryParameters,
|
||||||
|
body: UserToJSON(requestParameters.user),
|
||||||
|
}, initOverrides);
|
||||||
|
|
||||||
|
return new runtime.VoidApiResponse(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This can only be done by the logged in user.
|
||||||
|
* Updated user
|
||||||
|
*/
|
||||||
|
async updateUser(requestParameters: UpdateUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||||
|
await this.updateUserRaw(requestParameters, initOverrides);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
export * from './AnotherFakeApi';
|
||||||
|
export * from './DefaultApi';
|
||||||
|
export * from './FakeApi';
|
||||||
|
export * from './FakeClassnameTags123Api';
|
||||||
|
export * from './PetApi';
|
||||||
|
export * from './StoreApi';
|
||||||
|
export * from './UserApi';
|
@ -0,0 +1,5 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
export * from './runtime';
|
||||||
|
export * from './apis/index';
|
||||||
|
export * from './models/index';
|
@ -0,0 +1,73 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface AdditionalPropertiesClass
|
||||||
|
*/
|
||||||
|
export interface AdditionalPropertiesClass {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {{ [key: string]: string; }}
|
||||||
|
* @memberof AdditionalPropertiesClass
|
||||||
|
*/
|
||||||
|
mapProperty?: { [key: string]: string; };
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {{ [key: string]: { [key: string]: string; }; }}
|
||||||
|
* @memberof AdditionalPropertiesClass
|
||||||
|
*/
|
||||||
|
mapOfMapProperty?: { [key: string]: { [key: string]: string; }; };
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the AdditionalPropertiesClass interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfAdditionalPropertiesClass(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function AdditionalPropertiesClassFromJSON(json: any): AdditionalPropertiesClass {
|
||||||
|
return AdditionalPropertiesClassFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function AdditionalPropertiesClassFromJSONTyped(json: any, ignoreDiscriminator: boolean): AdditionalPropertiesClass {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'mapProperty': !exists(json, 'map_property') ? undefined : json['map_property'],
|
||||||
|
'mapOfMapProperty': !exists(json, 'map_of_map_property') ? undefined : json['map_of_map_property'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function AdditionalPropertiesClassToJSON(value?: AdditionalPropertiesClass | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'map_property': value.mapProperty,
|
||||||
|
'map_of_map_property': value.mapOfMapProperty,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,80 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
import type { SingleRefType } from './SingleRefType';
|
||||||
|
import {
|
||||||
|
SingleRefTypeFromJSON,
|
||||||
|
SingleRefTypeFromJSONTyped,
|
||||||
|
SingleRefTypeToJSON,
|
||||||
|
} from './SingleRefType';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface AllOfWithSingleRef
|
||||||
|
*/
|
||||||
|
export interface AllOfWithSingleRef {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof AllOfWithSingleRef
|
||||||
|
*/
|
||||||
|
username?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {SingleRefType}
|
||||||
|
* @memberof AllOfWithSingleRef
|
||||||
|
*/
|
||||||
|
singleRefType?: SingleRefType;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the AllOfWithSingleRef interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfAllOfWithSingleRef(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function AllOfWithSingleRefFromJSON(json: any): AllOfWithSingleRef {
|
||||||
|
return AllOfWithSingleRefFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function AllOfWithSingleRefFromJSONTyped(json: any, ignoreDiscriminator: boolean): AllOfWithSingleRef {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'username': !exists(json, 'username') ? undefined : json['username'],
|
||||||
|
'singleRefType': !exists(json, 'SingleRefType') ? undefined : SingleRefTypeFromJSON(json['SingleRefType']),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function AllOfWithSingleRefToJSON(value?: AllOfWithSingleRef | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'username': value.username,
|
||||||
|
'SingleRefType': SingleRefTypeToJSON(value.singleRefType),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,87 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
import {
|
||||||
|
CatFromJSONTyped,
|
||||||
|
DogFromJSONTyped
|
||||||
|
} from './index';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface Animal
|
||||||
|
*/
|
||||||
|
export interface Animal {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Animal
|
||||||
|
*/
|
||||||
|
className: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Animal
|
||||||
|
*/
|
||||||
|
color?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the Animal interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfAnimal(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
isInstance = isInstance && "className" in value;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function AnimalFromJSON(json: any): Animal {
|
||||||
|
return AnimalFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function AnimalFromJSONTyped(json: any, ignoreDiscriminator: boolean): Animal {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
if (!ignoreDiscriminator) {
|
||||||
|
if (json['class_name'] === 'CAT') {
|
||||||
|
return CatFromJSONTyped(json, true);
|
||||||
|
}
|
||||||
|
if (json['class_name'] === 'DOG') {
|
||||||
|
return DogFromJSONTyped(json, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'className': json['class_name'],
|
||||||
|
'color': !exists(json, 'color') ? undefined : json['color'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function AnimalToJSON(value?: Animal | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'class_name': value.className,
|
||||||
|
'color': value.color,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,65 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface ArrayOfArrayOfNumberOnly
|
||||||
|
*/
|
||||||
|
export interface ArrayOfArrayOfNumberOnly {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Array<Array<number>>}
|
||||||
|
* @memberof ArrayOfArrayOfNumberOnly
|
||||||
|
*/
|
||||||
|
arrayArrayNumber?: Array<Array<number>>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the ArrayOfArrayOfNumberOnly interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfArrayOfArrayOfNumberOnly(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ArrayOfArrayOfNumberOnlyFromJSON(json: any): ArrayOfArrayOfNumberOnly {
|
||||||
|
return ArrayOfArrayOfNumberOnlyFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ArrayOfArrayOfNumberOnlyFromJSONTyped(json: any, ignoreDiscriminator: boolean): ArrayOfArrayOfNumberOnly {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'arrayArrayNumber': !exists(json, 'ArrayArrayNumber') ? undefined : json['ArrayArrayNumber'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ArrayOfArrayOfNumberOnlyToJSON(value?: ArrayOfArrayOfNumberOnly | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'ArrayArrayNumber': value.arrayArrayNumber,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,65 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface ArrayOfNumberOnly
|
||||||
|
*/
|
||||||
|
export interface ArrayOfNumberOnly {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Array<number>}
|
||||||
|
* @memberof ArrayOfNumberOnly
|
||||||
|
*/
|
||||||
|
arrayNumber?: Array<number>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the ArrayOfNumberOnly interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfArrayOfNumberOnly(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ArrayOfNumberOnlyFromJSON(json: any): ArrayOfNumberOnly {
|
||||||
|
return ArrayOfNumberOnlyFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ArrayOfNumberOnlyFromJSONTyped(json: any, ignoreDiscriminator: boolean): ArrayOfNumberOnly {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'arrayNumber': !exists(json, 'ArrayNumber') ? undefined : json['ArrayNumber'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ArrayOfNumberOnlyToJSON(value?: ArrayOfNumberOnly | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'ArrayNumber': value.arrayNumber,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,88 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
import type { ReadOnlyFirst } from './ReadOnlyFirst';
|
||||||
|
import {
|
||||||
|
ReadOnlyFirstFromJSON,
|
||||||
|
ReadOnlyFirstFromJSONTyped,
|
||||||
|
ReadOnlyFirstToJSON,
|
||||||
|
} from './ReadOnlyFirst';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface ArrayTest
|
||||||
|
*/
|
||||||
|
export interface ArrayTest {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Array<string>}
|
||||||
|
* @memberof ArrayTest
|
||||||
|
*/
|
||||||
|
arrayOfString?: Array<string>;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Array<Array<number>>}
|
||||||
|
* @memberof ArrayTest
|
||||||
|
*/
|
||||||
|
arrayArrayOfInteger?: Array<Array<number>>;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Array<Array<ReadOnlyFirst>>}
|
||||||
|
* @memberof ArrayTest
|
||||||
|
*/
|
||||||
|
arrayArrayOfModel?: Array<Array<ReadOnlyFirst>>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the ArrayTest interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfArrayTest(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ArrayTestFromJSON(json: any): ArrayTest {
|
||||||
|
return ArrayTestFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ArrayTestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ArrayTest {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'arrayOfString': !exists(json, 'array_of_string') ? undefined : json['array_of_string'],
|
||||||
|
'arrayArrayOfInteger': !exists(json, 'array_array_of_integer') ? undefined : json['array_array_of_integer'],
|
||||||
|
'arrayArrayOfModel': !exists(json, 'array_array_of_model') ? undefined : json['array_array_of_model'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ArrayTestToJSON(value?: ArrayTest | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'array_of_string': value.arrayOfString,
|
||||||
|
'array_array_of_integer': value.arrayArrayOfInteger,
|
||||||
|
'array_array_of_model': value.arrayArrayOfModel,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,105 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface Capitalization
|
||||||
|
*/
|
||||||
|
export interface Capitalization {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Capitalization
|
||||||
|
*/
|
||||||
|
smallCamel?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Capitalization
|
||||||
|
*/
|
||||||
|
capitalCamel?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Capitalization
|
||||||
|
*/
|
||||||
|
smallSnake?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Capitalization
|
||||||
|
*/
|
||||||
|
capitalSnake?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Capitalization
|
||||||
|
*/
|
||||||
|
sCAETHFlowPoints?: string;
|
||||||
|
/**
|
||||||
|
* Name of the pet
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Capitalization
|
||||||
|
*/
|
||||||
|
aTTNAME?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the Capitalization interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCapitalization(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CapitalizationFromJSON(json: any): Capitalization {
|
||||||
|
return CapitalizationFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CapitalizationFromJSONTyped(json: any, ignoreDiscriminator: boolean): Capitalization {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'smallCamel': !exists(json, 'smallCamel') ? undefined : json['smallCamel'],
|
||||||
|
'capitalCamel': !exists(json, 'CapitalCamel') ? undefined : json['CapitalCamel'],
|
||||||
|
'smallSnake': !exists(json, 'small_Snake') ? undefined : json['small_Snake'],
|
||||||
|
'capitalSnake': !exists(json, 'Capital_Snake') ? undefined : json['Capital_Snake'],
|
||||||
|
'sCAETHFlowPoints': !exists(json, 'SCA_ETH_Flow_Points') ? undefined : json['SCA_ETH_Flow_Points'],
|
||||||
|
'aTTNAME': !exists(json, 'ATT_NAME') ? undefined : json['ATT_NAME'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CapitalizationToJSON(value?: Capitalization | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'smallCamel': value.smallCamel,
|
||||||
|
'CapitalCamel': value.capitalCamel,
|
||||||
|
'small_Snake': value.smallSnake,
|
||||||
|
'Capital_Snake': value.capitalSnake,
|
||||||
|
'SCA_ETH_Flow_Points': value.sCAETHFlowPoints,
|
||||||
|
'ATT_NAME': value.aTTNAME,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,72 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
import type { Animal } from './Animal';
|
||||||
|
import {
|
||||||
|
AnimalFromJSON,
|
||||||
|
AnimalFromJSONTyped,
|
||||||
|
AnimalToJSON,
|
||||||
|
} from './Animal';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface Cat
|
||||||
|
*/
|
||||||
|
export interface Cat extends Animal {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof Cat
|
||||||
|
*/
|
||||||
|
declawed?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the Cat interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCat(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CatFromJSON(json: any): Cat {
|
||||||
|
return CatFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CatFromJSONTyped(json: any, ignoreDiscriminator: boolean): Cat {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
...AnimalFromJSONTyped(json, ignoreDiscriminator),
|
||||||
|
'declawed': !exists(json, 'declawed') ? undefined : json['declawed'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CatToJSON(value?: Cat | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
...AnimalToJSON(value),
|
||||||
|
'declawed': value.declawed,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,74 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface Category
|
||||||
|
*/
|
||||||
|
export interface Category {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof Category
|
||||||
|
*/
|
||||||
|
id?: number;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Category
|
||||||
|
*/
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the Category interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCategory(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
isInstance = isInstance && "name" in value;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CategoryFromJSON(json: any): Category {
|
||||||
|
return CategoryFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CategoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): Category {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
|
'name': json['name'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CategoryToJSON(value?: Category | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'id': value.id,
|
||||||
|
'name': value.name,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,65 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
/**
|
||||||
|
* Model for testing model with "_class" property
|
||||||
|
* @export
|
||||||
|
* @interface ClassModel
|
||||||
|
*/
|
||||||
|
export interface ClassModel {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof ClassModel
|
||||||
|
*/
|
||||||
|
_class?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the ClassModel interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfClassModel(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ClassModelFromJSON(json: any): ClassModel {
|
||||||
|
return ClassModelFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ClassModelFromJSONTyped(json: any, ignoreDiscriminator: boolean): ClassModel {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'_class': !exists(json, '_class') ? undefined : json['_class'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ClassModelToJSON(value?: ClassModel | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'_class': value._class,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,65 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface Client
|
||||||
|
*/
|
||||||
|
export interface Client {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Client
|
||||||
|
*/
|
||||||
|
client?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the Client interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfClient(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ClientFromJSON(json: any): Client {
|
||||||
|
return ClientFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ClientFromJSONTyped(json: any, ignoreDiscriminator: boolean): Client {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'client': !exists(json, 'client') ? undefined : json['client'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ClientToJSON(value?: Client | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'client': value.client,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,65 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface DeprecatedObject
|
||||||
|
*/
|
||||||
|
export interface DeprecatedObject {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof DeprecatedObject
|
||||||
|
*/
|
||||||
|
name?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the DeprecatedObject interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfDeprecatedObject(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function DeprecatedObjectFromJSON(json: any): DeprecatedObject {
|
||||||
|
return DeprecatedObjectFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function DeprecatedObjectFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeprecatedObject {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'name': !exists(json, 'name') ? undefined : json['name'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function DeprecatedObjectToJSON(value?: DeprecatedObject | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'name': value.name,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,72 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
import type { Animal } from './Animal';
|
||||||
|
import {
|
||||||
|
AnimalFromJSON,
|
||||||
|
AnimalFromJSONTyped,
|
||||||
|
AnimalToJSON,
|
||||||
|
} from './Animal';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface Dog
|
||||||
|
*/
|
||||||
|
export interface Dog extends Animal {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Dog
|
||||||
|
*/
|
||||||
|
breed?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the Dog interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfDog(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function DogFromJSON(json: any): Dog {
|
||||||
|
return DogFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function DogFromJSONTyped(json: any, ignoreDiscriminator: boolean): Dog {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
...AnimalFromJSONTyped(json, ignoreDiscriminator),
|
||||||
|
'breed': !exists(json, 'breed') ? undefined : json['breed'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function DogToJSON(value?: Dog | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
...AnimalToJSON(value),
|
||||||
|
'breed': value.breed,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,93 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface EnumArrays
|
||||||
|
*/
|
||||||
|
export interface EnumArrays {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof EnumArrays
|
||||||
|
*/
|
||||||
|
justSymbol?: EnumArraysJustSymbolEnum;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Array<string>}
|
||||||
|
* @memberof EnumArrays
|
||||||
|
*/
|
||||||
|
arrayEnum?: Array<EnumArraysArrayEnumEnum>;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const EnumArraysJustSymbolEnum = {
|
||||||
|
GreaterThanOrEqualTo: '>=',
|
||||||
|
Dollar: '$'
|
||||||
|
} as const;
|
||||||
|
export type EnumArraysJustSymbolEnum = typeof EnumArraysJustSymbolEnum[keyof typeof EnumArraysJustSymbolEnum];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const EnumArraysArrayEnumEnum = {
|
||||||
|
Fish: 'fish',
|
||||||
|
Crab: 'crab'
|
||||||
|
} as const;
|
||||||
|
export type EnumArraysArrayEnumEnum = typeof EnumArraysArrayEnumEnum[keyof typeof EnumArraysArrayEnumEnum];
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the EnumArrays interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfEnumArrays(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function EnumArraysFromJSON(json: any): EnumArrays {
|
||||||
|
return EnumArraysFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function EnumArraysFromJSONTyped(json: any, ignoreDiscriminator: boolean): EnumArrays {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'justSymbol': !exists(json, 'just_symbol') ? undefined : json['just_symbol'],
|
||||||
|
'arrayEnum': !exists(json, 'array_enum') ? undefined : json['array_enum'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function EnumArraysToJSON(value?: EnumArrays | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'just_symbol': value.justSymbol,
|
||||||
|
'array_enum': value.arrayEnum,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,39 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const EnumClass = {
|
||||||
|
Abc: '_abc',
|
||||||
|
Efg: '-efg',
|
||||||
|
Xyz: '(xyz)'
|
||||||
|
} as const;
|
||||||
|
export type EnumClass = typeof EnumClass[keyof typeof EnumClass];
|
||||||
|
|
||||||
|
|
||||||
|
export function EnumClassFromJSON(json: any): EnumClass {
|
||||||
|
return EnumClassFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function EnumClassFromJSONTyped(json: any, ignoreDiscriminator: boolean): EnumClass {
|
||||||
|
return json as EnumClass;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function EnumClassToJSON(value?: EnumClass | null): any {
|
||||||
|
return value as any;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,187 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
import type { OuterEnum } from './OuterEnum';
|
||||||
|
import {
|
||||||
|
OuterEnumFromJSON,
|
||||||
|
OuterEnumFromJSONTyped,
|
||||||
|
OuterEnumToJSON,
|
||||||
|
} from './OuterEnum';
|
||||||
|
import type { OuterEnumDefaultValue } from './OuterEnumDefaultValue';
|
||||||
|
import {
|
||||||
|
OuterEnumDefaultValueFromJSON,
|
||||||
|
OuterEnumDefaultValueFromJSONTyped,
|
||||||
|
OuterEnumDefaultValueToJSON,
|
||||||
|
} from './OuterEnumDefaultValue';
|
||||||
|
import type { OuterEnumInteger } from './OuterEnumInteger';
|
||||||
|
import {
|
||||||
|
OuterEnumIntegerFromJSON,
|
||||||
|
OuterEnumIntegerFromJSONTyped,
|
||||||
|
OuterEnumIntegerToJSON,
|
||||||
|
} from './OuterEnumInteger';
|
||||||
|
import type { OuterEnumIntegerDefaultValue } from './OuterEnumIntegerDefaultValue';
|
||||||
|
import {
|
||||||
|
OuterEnumIntegerDefaultValueFromJSON,
|
||||||
|
OuterEnumIntegerDefaultValueFromJSONTyped,
|
||||||
|
OuterEnumIntegerDefaultValueToJSON,
|
||||||
|
} from './OuterEnumIntegerDefaultValue';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface EnumTest
|
||||||
|
*/
|
||||||
|
export interface EnumTest {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof EnumTest
|
||||||
|
*/
|
||||||
|
enumString?: EnumTestEnumStringEnum;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof EnumTest
|
||||||
|
*/
|
||||||
|
enumStringRequired: EnumTestEnumStringRequiredEnum;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof EnumTest
|
||||||
|
*/
|
||||||
|
enumInteger?: EnumTestEnumIntegerEnum;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof EnumTest
|
||||||
|
*/
|
||||||
|
enumNumber?: EnumTestEnumNumberEnum;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {OuterEnum}
|
||||||
|
* @memberof EnumTest
|
||||||
|
*/
|
||||||
|
outerEnum?: OuterEnum | null;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {OuterEnumInteger}
|
||||||
|
* @memberof EnumTest
|
||||||
|
*/
|
||||||
|
outerEnumInteger?: OuterEnumInteger;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {OuterEnumDefaultValue}
|
||||||
|
* @memberof EnumTest
|
||||||
|
*/
|
||||||
|
outerEnumDefaultValue?: OuterEnumDefaultValue;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {OuterEnumIntegerDefaultValue}
|
||||||
|
* @memberof EnumTest
|
||||||
|
*/
|
||||||
|
outerEnumIntegerDefaultValue?: OuterEnumIntegerDefaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const EnumTestEnumStringEnum = {
|
||||||
|
Upper: 'UPPER',
|
||||||
|
Lower: 'lower',
|
||||||
|
Empty: ''
|
||||||
|
} as const;
|
||||||
|
export type EnumTestEnumStringEnum = typeof EnumTestEnumStringEnum[keyof typeof EnumTestEnumStringEnum];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const EnumTestEnumStringRequiredEnum = {
|
||||||
|
Upper: 'UPPER',
|
||||||
|
Lower: 'lower',
|
||||||
|
Empty: ''
|
||||||
|
} as const;
|
||||||
|
export type EnumTestEnumStringRequiredEnum = typeof EnumTestEnumStringRequiredEnum[keyof typeof EnumTestEnumStringRequiredEnum];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const EnumTestEnumIntegerEnum = {
|
||||||
|
NUMBER_1: 1,
|
||||||
|
NUMBER_MINUS_1: -1
|
||||||
|
} as const;
|
||||||
|
export type EnumTestEnumIntegerEnum = typeof EnumTestEnumIntegerEnum[keyof typeof EnumTestEnumIntegerEnum];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const EnumTestEnumNumberEnum = {
|
||||||
|
NUMBER_1_DOT_1: 1.1,
|
||||||
|
NUMBER_MINUS_1_DOT_2: -1.2
|
||||||
|
} as const;
|
||||||
|
export type EnumTestEnumNumberEnum = typeof EnumTestEnumNumberEnum[keyof typeof EnumTestEnumNumberEnum];
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the EnumTest interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfEnumTest(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
isInstance = isInstance && "enumStringRequired" in value;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function EnumTestFromJSON(json: any): EnumTest {
|
||||||
|
return EnumTestFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function EnumTestFromJSONTyped(json: any, ignoreDiscriminator: boolean): EnumTest {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'enumString': !exists(json, 'enum_string') ? undefined : json['enum_string'],
|
||||||
|
'enumStringRequired': json['enum_string_required'],
|
||||||
|
'enumInteger': !exists(json, 'enum_integer') ? undefined : json['enum_integer'],
|
||||||
|
'enumNumber': !exists(json, 'enum_number') ? undefined : json['enum_number'],
|
||||||
|
'outerEnum': !exists(json, 'outerEnum') ? undefined : OuterEnumFromJSON(json['outerEnum']),
|
||||||
|
'outerEnumInteger': !exists(json, 'outerEnumInteger') ? undefined : OuterEnumIntegerFromJSON(json['outerEnumInteger']),
|
||||||
|
'outerEnumDefaultValue': !exists(json, 'outerEnumDefaultValue') ? undefined : OuterEnumDefaultValueFromJSON(json['outerEnumDefaultValue']),
|
||||||
|
'outerEnumIntegerDefaultValue': !exists(json, 'outerEnumIntegerDefaultValue') ? undefined : OuterEnumIntegerDefaultValueFromJSON(json['outerEnumIntegerDefaultValue']),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function EnumTestToJSON(value?: EnumTest | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'enum_string': value.enumString,
|
||||||
|
'enum_string_required': value.enumStringRequired,
|
||||||
|
'enum_integer': value.enumInteger,
|
||||||
|
'enum_number': value.enumNumber,
|
||||||
|
'outerEnum': OuterEnumToJSON(value.outerEnum),
|
||||||
|
'outerEnumInteger': OuterEnumIntegerToJSON(value.outerEnumInteger),
|
||||||
|
'outerEnumDefaultValue': OuterEnumDefaultValueToJSON(value.outerEnumDefaultValue),
|
||||||
|
'outerEnumIntegerDefaultValue': OuterEnumIntegerDefaultValueToJSON(value.outerEnumIntegerDefaultValue),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,73 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface FakeBigDecimalMap200Response
|
||||||
|
*/
|
||||||
|
export interface FakeBigDecimalMap200Response {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof FakeBigDecimalMap200Response
|
||||||
|
*/
|
||||||
|
someId?: number;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {{ [key: string]: number; }}
|
||||||
|
* @memberof FakeBigDecimalMap200Response
|
||||||
|
*/
|
||||||
|
someMap?: { [key: string]: number; };
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the FakeBigDecimalMap200Response interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfFakeBigDecimalMap200Response(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function FakeBigDecimalMap200ResponseFromJSON(json: any): FakeBigDecimalMap200Response {
|
||||||
|
return FakeBigDecimalMap200ResponseFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function FakeBigDecimalMap200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): FakeBigDecimalMap200Response {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'someId': !exists(json, 'someId') ? undefined : json['someId'],
|
||||||
|
'someMap': !exists(json, 'someMap') ? undefined : json['someMap'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function FakeBigDecimalMap200ResponseToJSON(value?: FakeBigDecimalMap200Response | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'someId': value.someId,
|
||||||
|
'someMap': value.someMap,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,73 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface FileSchemaTestClass
|
||||||
|
*/
|
||||||
|
export interface FileSchemaTestClass {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {any}
|
||||||
|
* @memberof FileSchemaTestClass
|
||||||
|
*/
|
||||||
|
file?: any;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Array<any>}
|
||||||
|
* @memberof FileSchemaTestClass
|
||||||
|
*/
|
||||||
|
files?: Array<any>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the FileSchemaTestClass interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfFileSchemaTestClass(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function FileSchemaTestClassFromJSON(json: any): FileSchemaTestClass {
|
||||||
|
return FileSchemaTestClassFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function FileSchemaTestClassFromJSONTyped(json: any, ignoreDiscriminator: boolean): FileSchemaTestClass {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'file': !exists(json, 'file') ? undefined : json['file'],
|
||||||
|
'files': !exists(json, 'files') ? undefined : json['files'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function FileSchemaTestClassToJSON(value?: FileSchemaTestClass | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'file': value.file,
|
||||||
|
'files': value.files,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,65 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface Foo
|
||||||
|
*/
|
||||||
|
export interface Foo {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Foo
|
||||||
|
*/
|
||||||
|
bar?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the Foo interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfFoo(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function FooFromJSON(json: any): Foo {
|
||||||
|
return FooFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function FooFromJSONTyped(json: any, ignoreDiscriminator: boolean): Foo {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'bar': !exists(json, 'bar') ? undefined : json['bar'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function FooToJSON(value?: Foo | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'bar': value.bar,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,72 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
import type { Foo } from './Foo';
|
||||||
|
import {
|
||||||
|
FooFromJSON,
|
||||||
|
FooFromJSONTyped,
|
||||||
|
FooToJSON,
|
||||||
|
} from './Foo';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface FooGetDefaultResponse
|
||||||
|
*/
|
||||||
|
export interface FooGetDefaultResponse {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Foo}
|
||||||
|
* @memberof FooGetDefaultResponse
|
||||||
|
*/
|
||||||
|
string?: Foo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the FooGetDefaultResponse interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfFooGetDefaultResponse(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function FooGetDefaultResponseFromJSON(json: any): FooGetDefaultResponse {
|
||||||
|
return FooGetDefaultResponseFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function FooGetDefaultResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): FooGetDefaultResponse {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'string': !exists(json, 'string') ? undefined : FooFromJSON(json['string']),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function FooGetDefaultResponseToJSON(value?: FooGetDefaultResponse | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'string': FooToJSON(value.string),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,196 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
import type { Decimal } from './Decimal';
|
||||||
|
import {
|
||||||
|
DecimalFromJSON,
|
||||||
|
DecimalFromJSONTyped,
|
||||||
|
DecimalToJSON,
|
||||||
|
} from './Decimal';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface FormatTest
|
||||||
|
*/
|
||||||
|
export interface FormatTest {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof FormatTest
|
||||||
|
*/
|
||||||
|
integer?: number;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof FormatTest
|
||||||
|
*/
|
||||||
|
int32?: number;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof FormatTest
|
||||||
|
*/
|
||||||
|
int64?: number;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof FormatTest
|
||||||
|
*/
|
||||||
|
number: number;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof FormatTest
|
||||||
|
*/
|
||||||
|
_float?: number;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof FormatTest
|
||||||
|
*/
|
||||||
|
_double?: number;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Decimal}
|
||||||
|
* @memberof FormatTest
|
||||||
|
*/
|
||||||
|
decimal?: Decimal;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof FormatTest
|
||||||
|
*/
|
||||||
|
string?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof FormatTest
|
||||||
|
*/
|
||||||
|
_byte: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Blob}
|
||||||
|
* @memberof FormatTest
|
||||||
|
*/
|
||||||
|
binary?: Blob;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Date}
|
||||||
|
* @memberof FormatTest
|
||||||
|
*/
|
||||||
|
date: Date;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Date}
|
||||||
|
* @memberof FormatTest
|
||||||
|
*/
|
||||||
|
dateTime?: Date;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof FormatTest
|
||||||
|
*/
|
||||||
|
uuid?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof FormatTest
|
||||||
|
*/
|
||||||
|
password: string;
|
||||||
|
/**
|
||||||
|
* A string that is a 10 digit number. Can have leading zeros.
|
||||||
|
* @type {string}
|
||||||
|
* @memberof FormatTest
|
||||||
|
*/
|
||||||
|
patternWithDigits?: string;
|
||||||
|
/**
|
||||||
|
* A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.
|
||||||
|
* @type {string}
|
||||||
|
* @memberof FormatTest
|
||||||
|
*/
|
||||||
|
patternWithDigitsAndDelimiter?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the FormatTest interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfFormatTest(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
isInstance = isInstance && "number" in value;
|
||||||
|
isInstance = isInstance && "_byte" in value;
|
||||||
|
isInstance = isInstance && "date" in value;
|
||||||
|
isInstance = isInstance && "password" in value;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function FormatTestFromJSON(json: any): FormatTest {
|
||||||
|
return FormatTestFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function FormatTestFromJSONTyped(json: any, ignoreDiscriminator: boolean): FormatTest {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'integer': !exists(json, 'integer') ? undefined : json['integer'],
|
||||||
|
'int32': !exists(json, 'int32') ? undefined : json['int32'],
|
||||||
|
'int64': !exists(json, 'int64') ? undefined : json['int64'],
|
||||||
|
'number': json['number'],
|
||||||
|
'_float': !exists(json, 'float') ? undefined : json['float'],
|
||||||
|
'_double': !exists(json, 'double') ? undefined : json['double'],
|
||||||
|
'decimal': !exists(json, 'decimal') ? undefined : DecimalFromJSON(json['decimal']),
|
||||||
|
'string': !exists(json, 'string') ? undefined : json['string'],
|
||||||
|
'_byte': json['byte'],
|
||||||
|
'binary': !exists(json, 'binary') ? undefined : json['binary'],
|
||||||
|
'date': (new Date(json['date'])),
|
||||||
|
'dateTime': !exists(json, 'dateTime') ? undefined : (new Date(json['dateTime'])),
|
||||||
|
'uuid': !exists(json, 'uuid') ? undefined : json['uuid'],
|
||||||
|
'password': json['password'],
|
||||||
|
'patternWithDigits': !exists(json, 'pattern_with_digits') ? undefined : json['pattern_with_digits'],
|
||||||
|
'patternWithDigitsAndDelimiter': !exists(json, 'pattern_with_digits_and_delimiter') ? undefined : json['pattern_with_digits_and_delimiter'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function FormatTestToJSON(value?: FormatTest | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'integer': value.integer,
|
||||||
|
'int32': value.int32,
|
||||||
|
'int64': value.int64,
|
||||||
|
'number': value.number,
|
||||||
|
'float': value._float,
|
||||||
|
'double': value._double,
|
||||||
|
'decimal': DecimalToJSON(value.decimal),
|
||||||
|
'string': value.string,
|
||||||
|
'byte': value._byte,
|
||||||
|
'binary': value.binary,
|
||||||
|
'date': (value.date.toISOString().substr(0,10)),
|
||||||
|
'dateTime': value.dateTime === undefined ? undefined : (value.dateTime.toISOString()),
|
||||||
|
'uuid': value.uuid,
|
||||||
|
'password': value.password,
|
||||||
|
'pattern_with_digits': value.patternWithDigits,
|
||||||
|
'pattern_with_digits_and_delimiter': value.patternWithDigitsAndDelimiter,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,71 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface HasOnlyReadOnly
|
||||||
|
*/
|
||||||
|
export interface HasOnlyReadOnly {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof HasOnlyReadOnly
|
||||||
|
*/
|
||||||
|
readonly bar?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof HasOnlyReadOnly
|
||||||
|
*/
|
||||||
|
readonly foo?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the HasOnlyReadOnly interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfHasOnlyReadOnly(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function HasOnlyReadOnlyFromJSON(json: any): HasOnlyReadOnly {
|
||||||
|
return HasOnlyReadOnlyFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function HasOnlyReadOnlyFromJSONTyped(json: any, ignoreDiscriminator: boolean): HasOnlyReadOnly {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'bar': !exists(json, 'bar') ? undefined : json['bar'],
|
||||||
|
'foo': !exists(json, 'foo') ? undefined : json['foo'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function HasOnlyReadOnlyToJSON(value?: HasOnlyReadOnly | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,65 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
/**
|
||||||
|
* Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.
|
||||||
|
* @export
|
||||||
|
* @interface HealthCheckResult
|
||||||
|
*/
|
||||||
|
export interface HealthCheckResult {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof HealthCheckResult
|
||||||
|
*/
|
||||||
|
nullableMessage?: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the HealthCheckResult interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfHealthCheckResult(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function HealthCheckResultFromJSON(json: any): HealthCheckResult {
|
||||||
|
return HealthCheckResultFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function HealthCheckResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): HealthCheckResult {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'nullableMessage': !exists(json, 'NullableMessage') ? undefined : json['NullableMessage'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function HealthCheckResultToJSON(value?: HealthCheckResult | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'NullableMessage': value.nullableMessage,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,65 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface List
|
||||||
|
*/
|
||||||
|
export interface List {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof List
|
||||||
|
*/
|
||||||
|
_123list?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the List interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfList(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ListFromJSON(json: any): List {
|
||||||
|
return ListFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ListFromJSONTyped(json: any, ignoreDiscriminator: boolean): List {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'_123list': !exists(json, '123-list') ? undefined : json['123-list'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ListToJSON(value?: List | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'123-list': value._123list,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,100 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface MapTest
|
||||||
|
*/
|
||||||
|
export interface MapTest {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {{ [key: string]: { [key: string]: string; }; }}
|
||||||
|
* @memberof MapTest
|
||||||
|
*/
|
||||||
|
mapMapOfString?: { [key: string]: { [key: string]: string; }; };
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {{ [key: string]: string; }}
|
||||||
|
* @memberof MapTest
|
||||||
|
*/
|
||||||
|
mapOfEnumString?: { [key: string]: string; };
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {{ [key: string]: boolean; }}
|
||||||
|
* @memberof MapTest
|
||||||
|
*/
|
||||||
|
directMap?: { [key: string]: boolean; };
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {{ [key: string]: boolean; }}
|
||||||
|
* @memberof MapTest
|
||||||
|
*/
|
||||||
|
indirectMap?: { [key: string]: boolean; };
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const MapTestMapOfEnumStringEnum = {
|
||||||
|
Upper: 'UPPER',
|
||||||
|
Lower: 'lower'
|
||||||
|
} as const;
|
||||||
|
export type MapTestMapOfEnumStringEnum = typeof MapTestMapOfEnumStringEnum[keyof typeof MapTestMapOfEnumStringEnum];
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the MapTest interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfMapTest(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function MapTestFromJSON(json: any): MapTest {
|
||||||
|
return MapTestFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function MapTestFromJSONTyped(json: any, ignoreDiscriminator: boolean): MapTest {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'mapMapOfString': !exists(json, 'map_map_of_string') ? undefined : json['map_map_of_string'],
|
||||||
|
'mapOfEnumString': !exists(json, 'map_of_enum_string') ? undefined : json['map_of_enum_string'],
|
||||||
|
'directMap': !exists(json, 'direct_map') ? undefined : json['direct_map'],
|
||||||
|
'indirectMap': !exists(json, 'indirect_map') ? undefined : json['indirect_map'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function MapTestToJSON(value?: MapTest | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'map_map_of_string': value.mapMapOfString,
|
||||||
|
'map_of_enum_string': value.mapOfEnumString,
|
||||||
|
'direct_map': value.directMap,
|
||||||
|
'indirect_map': value.indirectMap,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,88 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
import type { Animal } from './Animal';
|
||||||
|
import {
|
||||||
|
AnimalFromJSON,
|
||||||
|
AnimalFromJSONTyped,
|
||||||
|
AnimalToJSON,
|
||||||
|
} from './Animal';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface MixedPropertiesAndAdditionalPropertiesClass
|
||||||
|
*/
|
||||||
|
export interface MixedPropertiesAndAdditionalPropertiesClass {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof MixedPropertiesAndAdditionalPropertiesClass
|
||||||
|
*/
|
||||||
|
uuid?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Date}
|
||||||
|
* @memberof MixedPropertiesAndAdditionalPropertiesClass
|
||||||
|
*/
|
||||||
|
dateTime?: Date;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {{ [key: string]: Animal; }}
|
||||||
|
* @memberof MixedPropertiesAndAdditionalPropertiesClass
|
||||||
|
*/
|
||||||
|
map?: { [key: string]: Animal; };
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the MixedPropertiesAndAdditionalPropertiesClass interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfMixedPropertiesAndAdditionalPropertiesClass(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function MixedPropertiesAndAdditionalPropertiesClassFromJSON(json: any): MixedPropertiesAndAdditionalPropertiesClass {
|
||||||
|
return MixedPropertiesAndAdditionalPropertiesClassFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function MixedPropertiesAndAdditionalPropertiesClassFromJSONTyped(json: any, ignoreDiscriminator: boolean): MixedPropertiesAndAdditionalPropertiesClass {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'uuid': !exists(json, 'uuid') ? undefined : json['uuid'],
|
||||||
|
'dateTime': !exists(json, 'dateTime') ? undefined : (new Date(json['dateTime'])),
|
||||||
|
'map': !exists(json, 'map') ? undefined : (mapValues(json['map'], AnimalFromJSON)),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function MixedPropertiesAndAdditionalPropertiesClassToJSON(value?: MixedPropertiesAndAdditionalPropertiesClass | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'uuid': value.uuid,
|
||||||
|
'dateTime': value.dateTime === undefined ? undefined : (value.dateTime.toISOString()),
|
||||||
|
'map': value.map === undefined ? undefined : (mapValues(value.map, AnimalToJSON)),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,73 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
/**
|
||||||
|
* Model for testing model name starting with number
|
||||||
|
* @export
|
||||||
|
* @interface Model200Response
|
||||||
|
*/
|
||||||
|
export interface Model200Response {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof Model200Response
|
||||||
|
*/
|
||||||
|
name?: number;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Model200Response
|
||||||
|
*/
|
||||||
|
_class?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the Model200Response interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfModel200Response(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function Model200ResponseFromJSON(json: any): Model200Response {
|
||||||
|
return Model200ResponseFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function Model200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): Model200Response {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'name': !exists(json, 'name') ? undefined : json['name'],
|
||||||
|
'_class': !exists(json, 'class') ? undefined : json['class'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function Model200ResponseToJSON(value?: Model200Response | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'name': value.name,
|
||||||
|
'class': value._class,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,81 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface ModelApiResponse
|
||||||
|
*/
|
||||||
|
export interface ModelApiResponse {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof ModelApiResponse
|
||||||
|
*/
|
||||||
|
code?: number;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof ModelApiResponse
|
||||||
|
*/
|
||||||
|
type?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof ModelApiResponse
|
||||||
|
*/
|
||||||
|
message?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the ModelApiResponse interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfModelApiResponse(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ModelApiResponseFromJSON(json: any): ModelApiResponse {
|
||||||
|
return ModelApiResponseFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ModelApiResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelApiResponse {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'code': !exists(json, 'code') ? undefined : json['code'],
|
||||||
|
'type': !exists(json, 'type') ? undefined : json['type'],
|
||||||
|
'message': !exists(json, 'message') ? undefined : json['message'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ModelApiResponseToJSON(value?: ModelApiResponse | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'code': value.code,
|
||||||
|
'type': value.type,
|
||||||
|
'message': value.message,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,65 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
/**
|
||||||
|
* Must be named `File` for test.
|
||||||
|
* @export
|
||||||
|
* @interface ModelFile
|
||||||
|
*/
|
||||||
|
export interface ModelFile {
|
||||||
|
/**
|
||||||
|
* Test capitalization
|
||||||
|
* @type {string}
|
||||||
|
* @memberof ModelFile
|
||||||
|
*/
|
||||||
|
sourceURI?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the ModelFile interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfModelFile(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ModelFileFromJSON(json: any): ModelFile {
|
||||||
|
return ModelFileFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ModelFileFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelFile {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'sourceURI': !exists(json, 'sourceURI') ? undefined : json['sourceURI'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ModelFileToJSON(value?: ModelFile | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'sourceURI': value.sourceURI,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,88 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
/**
|
||||||
|
* Model for testing model name same as property name
|
||||||
|
* @export
|
||||||
|
* @interface Name
|
||||||
|
*/
|
||||||
|
export interface Name {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof Name
|
||||||
|
*/
|
||||||
|
name: number;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof Name
|
||||||
|
*/
|
||||||
|
readonly snakeCase?: number;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Name
|
||||||
|
*/
|
||||||
|
property?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof Name
|
||||||
|
*/
|
||||||
|
readonly _123number?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the Name interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfName(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
isInstance = isInstance && "name" in value;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function NameFromJSON(json: any): Name {
|
||||||
|
return NameFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function NameFromJSONTyped(json: any, ignoreDiscriminator: boolean): Name {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'name': json['name'],
|
||||||
|
'snakeCase': !exists(json, 'snake_case') ? undefined : json['snake_case'],
|
||||||
|
'property': !exists(json, 'property') ? undefined : json['property'],
|
||||||
|
'_123number': !exists(json, '123Number') ? undefined : json['123Number'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function NameToJSON(value?: Name | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'name': value.name,
|
||||||
|
'property': value.property,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,156 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface NullableClass
|
||||||
|
*/
|
||||||
|
export interface NullableClass {
|
||||||
|
[key: string]: object | any;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof NullableClass
|
||||||
|
*/
|
||||||
|
integerProp?: number | null;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof NullableClass
|
||||||
|
*/
|
||||||
|
numberProp?: number | null;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof NullableClass
|
||||||
|
*/
|
||||||
|
booleanProp?: boolean | null;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof NullableClass
|
||||||
|
*/
|
||||||
|
stringProp?: string | null;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Date}
|
||||||
|
* @memberof NullableClass
|
||||||
|
*/
|
||||||
|
dateProp?: Date | null;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Date}
|
||||||
|
* @memberof NullableClass
|
||||||
|
*/
|
||||||
|
datetimeProp?: Date | null;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Array<object>}
|
||||||
|
* @memberof NullableClass
|
||||||
|
*/
|
||||||
|
arrayNullableProp?: Array<object> | null;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Array<object>}
|
||||||
|
* @memberof NullableClass
|
||||||
|
*/
|
||||||
|
arrayAndItemsNullableProp?: Array<object> | null;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Array<object>}
|
||||||
|
* @memberof NullableClass
|
||||||
|
*/
|
||||||
|
arrayItemsNullable?: Array<object>;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {{ [key: string]: object; }}
|
||||||
|
* @memberof NullableClass
|
||||||
|
*/
|
||||||
|
objectNullableProp?: { [key: string]: object; } | null;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {{ [key: string]: object; }}
|
||||||
|
* @memberof NullableClass
|
||||||
|
*/
|
||||||
|
objectAndItemsNullableProp?: { [key: string]: object; } | null;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {{ [key: string]: object; }}
|
||||||
|
* @memberof NullableClass
|
||||||
|
*/
|
||||||
|
objectItemsNullable?: { [key: string]: object; };
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the NullableClass interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfNullableClass(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function NullableClassFromJSON(json: any): NullableClass {
|
||||||
|
return NullableClassFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function NullableClassFromJSONTyped(json: any, ignoreDiscriminator: boolean): NullableClass {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
...json,
|
||||||
|
'integerProp': !exists(json, 'integer_prop') ? undefined : json['integer_prop'],
|
||||||
|
'numberProp': !exists(json, 'number_prop') ? undefined : json['number_prop'],
|
||||||
|
'booleanProp': !exists(json, 'boolean_prop') ? undefined : json['boolean_prop'],
|
||||||
|
'stringProp': !exists(json, 'string_prop') ? undefined : json['string_prop'],
|
||||||
|
'dateProp': !exists(json, 'date_prop') ? undefined : (json['date_prop'] === null ? null : new Date(json['date_prop'])),
|
||||||
|
'datetimeProp': !exists(json, 'datetime_prop') ? undefined : (json['datetime_prop'] === null ? null : new Date(json['datetime_prop'])),
|
||||||
|
'arrayNullableProp': !exists(json, 'array_nullable_prop') ? undefined : json['array_nullable_prop'],
|
||||||
|
'arrayAndItemsNullableProp': !exists(json, 'array_and_items_nullable_prop') ? undefined : json['array_and_items_nullable_prop'],
|
||||||
|
'arrayItemsNullable': !exists(json, 'array_items_nullable') ? undefined : json['array_items_nullable'],
|
||||||
|
'objectNullableProp': !exists(json, 'object_nullable_prop') ? undefined : json['object_nullable_prop'],
|
||||||
|
'objectAndItemsNullableProp': !exists(json, 'object_and_items_nullable_prop') ? undefined : json['object_and_items_nullable_prop'],
|
||||||
|
'objectItemsNullable': !exists(json, 'object_items_nullable') ? undefined : json['object_items_nullable'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function NullableClassToJSON(value?: NullableClass | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
...value,
|
||||||
|
'integer_prop': value.integerProp,
|
||||||
|
'number_prop': value.numberProp,
|
||||||
|
'boolean_prop': value.booleanProp,
|
||||||
|
'string_prop': value.stringProp,
|
||||||
|
'date_prop': value.dateProp === undefined ? undefined : (value.dateProp === null ? null : value.dateProp.toISOString().substr(0,10)),
|
||||||
|
'datetime_prop': value.datetimeProp === undefined ? undefined : (value.datetimeProp === null ? null : value.datetimeProp.toISOString()),
|
||||||
|
'array_nullable_prop': value.arrayNullableProp,
|
||||||
|
'array_and_items_nullable_prop': value.arrayAndItemsNullableProp,
|
||||||
|
'array_items_nullable': value.arrayItemsNullable,
|
||||||
|
'object_nullable_prop': value.objectNullableProp,
|
||||||
|
'object_and_items_nullable_prop': value.objectAndItemsNullableProp,
|
||||||
|
'object_items_nullable': value.objectItemsNullable,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,65 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface NumberOnly
|
||||||
|
*/
|
||||||
|
export interface NumberOnly {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof NumberOnly
|
||||||
|
*/
|
||||||
|
justNumber?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the NumberOnly interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfNumberOnly(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function NumberOnlyFromJSON(json: any): NumberOnly {
|
||||||
|
return NumberOnlyFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function NumberOnlyFromJSONTyped(json: any, ignoreDiscriminator: boolean): NumberOnly {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'justNumber': !exists(json, 'JustNumber') ? undefined : json['JustNumber'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function NumberOnlyToJSON(value?: NumberOnly | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'JustNumber': value.justNumber,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,99 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
import type { DeprecatedObject } from './DeprecatedObject';
|
||||||
|
import {
|
||||||
|
DeprecatedObjectFromJSON,
|
||||||
|
DeprecatedObjectFromJSONTyped,
|
||||||
|
DeprecatedObjectToJSON,
|
||||||
|
} from './DeprecatedObject';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface ObjectWithDeprecatedFields
|
||||||
|
*/
|
||||||
|
export interface ObjectWithDeprecatedFields {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof ObjectWithDeprecatedFields
|
||||||
|
*/
|
||||||
|
uuid?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof ObjectWithDeprecatedFields
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
|
id?: number;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {DeprecatedObject}
|
||||||
|
* @memberof ObjectWithDeprecatedFields
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
|
deprecatedRef?: DeprecatedObject;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Array<string>}
|
||||||
|
* @memberof ObjectWithDeprecatedFields
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
|
bars?: Array<string>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the ObjectWithDeprecatedFields interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfObjectWithDeprecatedFields(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ObjectWithDeprecatedFieldsFromJSON(json: any): ObjectWithDeprecatedFields {
|
||||||
|
return ObjectWithDeprecatedFieldsFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ObjectWithDeprecatedFieldsFromJSONTyped(json: any, ignoreDiscriminator: boolean): ObjectWithDeprecatedFields {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'uuid': !exists(json, 'uuid') ? undefined : json['uuid'],
|
||||||
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
|
'deprecatedRef': !exists(json, 'deprecatedRef') ? undefined : DeprecatedObjectFromJSON(json['deprecatedRef']),
|
||||||
|
'bars': !exists(json, 'bars') ? undefined : json['bars'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ObjectWithDeprecatedFieldsToJSON(value?: ObjectWithDeprecatedFields | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'uuid': value.uuid,
|
||||||
|
'id': value.id,
|
||||||
|
'deprecatedRef': DeprecatedObjectToJSON(value.deprecatedRef),
|
||||||
|
'bars': value.bars,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,117 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface Order
|
||||||
|
*/
|
||||||
|
export interface Order {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof Order
|
||||||
|
*/
|
||||||
|
id?: number;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof Order
|
||||||
|
*/
|
||||||
|
petId?: number;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof Order
|
||||||
|
*/
|
||||||
|
quantity?: number;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Date}
|
||||||
|
* @memberof Order
|
||||||
|
*/
|
||||||
|
shipDate?: Date;
|
||||||
|
/**
|
||||||
|
* Order Status
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Order
|
||||||
|
*/
|
||||||
|
status?: OrderStatusEnum;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof Order
|
||||||
|
*/
|
||||||
|
complete?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const OrderStatusEnum = {
|
||||||
|
Placed: 'placed',
|
||||||
|
Approved: 'approved',
|
||||||
|
Delivered: 'delivered'
|
||||||
|
} as const;
|
||||||
|
export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum];
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the Order interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfOrder(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function OrderFromJSON(json: any): Order {
|
||||||
|
return OrderFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Order {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
|
'petId': !exists(json, 'petId') ? undefined : json['petId'],
|
||||||
|
'quantity': !exists(json, 'quantity') ? undefined : json['quantity'],
|
||||||
|
'shipDate': !exists(json, 'shipDate') ? undefined : (new Date(json['shipDate'])),
|
||||||
|
'status': !exists(json, 'status') ? undefined : json['status'],
|
||||||
|
'complete': !exists(json, 'complete') ? undefined : json['complete'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function OrderToJSON(value?: Order | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'id': value.id,
|
||||||
|
'petId': value.petId,
|
||||||
|
'quantity': value.quantity,
|
||||||
|
'shipDate': value.shipDate === undefined ? undefined : (value.shipDate.toISOString()),
|
||||||
|
'status': value.status,
|
||||||
|
'complete': value.complete,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,81 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface OuterComposite
|
||||||
|
*/
|
||||||
|
export interface OuterComposite {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof OuterComposite
|
||||||
|
*/
|
||||||
|
myNumber?: number;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof OuterComposite
|
||||||
|
*/
|
||||||
|
myString?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof OuterComposite
|
||||||
|
*/
|
||||||
|
myBoolean?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the OuterComposite interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfOuterComposite(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function OuterCompositeFromJSON(json: any): OuterComposite {
|
||||||
|
return OuterCompositeFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function OuterCompositeFromJSONTyped(json: any, ignoreDiscriminator: boolean): OuterComposite {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'myNumber': !exists(json, 'my_number') ? undefined : json['my_number'],
|
||||||
|
'myString': !exists(json, 'my_string') ? undefined : json['my_string'],
|
||||||
|
'myBoolean': !exists(json, 'my_boolean') ? undefined : json['my_boolean'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function OuterCompositeToJSON(value?: OuterComposite | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'my_number': value.myNumber,
|
||||||
|
'my_string': value.myString,
|
||||||
|
'my_boolean': value.myBoolean,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,39 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const OuterEnum = {
|
||||||
|
Placed: 'placed',
|
||||||
|
Approved: 'approved',
|
||||||
|
Delivered: 'delivered'
|
||||||
|
} as const;
|
||||||
|
export type OuterEnum = typeof OuterEnum[keyof typeof OuterEnum];
|
||||||
|
|
||||||
|
|
||||||
|
export function OuterEnumFromJSON(json: any): OuterEnum {
|
||||||
|
return OuterEnumFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function OuterEnumFromJSONTyped(json: any, ignoreDiscriminator: boolean): OuterEnum {
|
||||||
|
return json as OuterEnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function OuterEnumToJSON(value?: OuterEnum | null): any {
|
||||||
|
return value as any;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,39 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const OuterEnumDefaultValue = {
|
||||||
|
Placed: 'placed',
|
||||||
|
Approved: 'approved',
|
||||||
|
Delivered: 'delivered'
|
||||||
|
} as const;
|
||||||
|
export type OuterEnumDefaultValue = typeof OuterEnumDefaultValue[keyof typeof OuterEnumDefaultValue];
|
||||||
|
|
||||||
|
|
||||||
|
export function OuterEnumDefaultValueFromJSON(json: any): OuterEnumDefaultValue {
|
||||||
|
return OuterEnumDefaultValueFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function OuterEnumDefaultValueFromJSONTyped(json: any, ignoreDiscriminator: boolean): OuterEnumDefaultValue {
|
||||||
|
return json as OuterEnumDefaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function OuterEnumDefaultValueToJSON(value?: OuterEnumDefaultValue | null): any {
|
||||||
|
return value as any;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,39 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const OuterEnumInteger = {
|
||||||
|
NUMBER_0: 0,
|
||||||
|
NUMBER_1: 1,
|
||||||
|
NUMBER_2: 2
|
||||||
|
} as const;
|
||||||
|
export type OuterEnumInteger = typeof OuterEnumInteger[keyof typeof OuterEnumInteger];
|
||||||
|
|
||||||
|
|
||||||
|
export function OuterEnumIntegerFromJSON(json: any): OuterEnumInteger {
|
||||||
|
return OuterEnumIntegerFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function OuterEnumIntegerFromJSONTyped(json: any, ignoreDiscriminator: boolean): OuterEnumInteger {
|
||||||
|
return json as OuterEnumInteger;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function OuterEnumIntegerToJSON(value?: OuterEnumInteger | null): any {
|
||||||
|
return value as any;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,39 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const OuterEnumIntegerDefaultValue = {
|
||||||
|
NUMBER_0: 0,
|
||||||
|
NUMBER_1: 1,
|
||||||
|
NUMBER_2: 2
|
||||||
|
} as const;
|
||||||
|
export type OuterEnumIntegerDefaultValue = typeof OuterEnumIntegerDefaultValue[keyof typeof OuterEnumIntegerDefaultValue];
|
||||||
|
|
||||||
|
|
||||||
|
export function OuterEnumIntegerDefaultValueFromJSON(json: any): OuterEnumIntegerDefaultValue {
|
||||||
|
return OuterEnumIntegerDefaultValueFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function OuterEnumIntegerDefaultValueFromJSONTyped(json: any, ignoreDiscriminator: boolean): OuterEnumIntegerDefaultValue {
|
||||||
|
return json as OuterEnumIntegerDefaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function OuterEnumIntegerDefaultValueToJSON(value?: OuterEnumIntegerDefaultValue | null): any {
|
||||||
|
return value as any;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,73 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
import type { OuterEnumInteger } from './OuterEnumInteger';
|
||||||
|
import {
|
||||||
|
OuterEnumIntegerFromJSON,
|
||||||
|
OuterEnumIntegerFromJSONTyped,
|
||||||
|
OuterEnumIntegerToJSON,
|
||||||
|
} from './OuterEnumInteger';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface OuterObjectWithEnumProperty
|
||||||
|
*/
|
||||||
|
export interface OuterObjectWithEnumProperty {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {OuterEnumInteger}
|
||||||
|
* @memberof OuterObjectWithEnumProperty
|
||||||
|
*/
|
||||||
|
value: OuterEnumInteger;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the OuterObjectWithEnumProperty interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfOuterObjectWithEnumProperty(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
isInstance = isInstance && "value" in value;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function OuterObjectWithEnumPropertyFromJSON(json: any): OuterObjectWithEnumProperty {
|
||||||
|
return OuterObjectWithEnumPropertyFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function OuterObjectWithEnumPropertyFromJSONTyped(json: any, ignoreDiscriminator: boolean): OuterObjectWithEnumProperty {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'value': OuterEnumIntegerFromJSON(json['value']),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function OuterObjectWithEnumPropertyToJSON(value?: OuterObjectWithEnumProperty | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'value': OuterEnumIntegerToJSON(value.value),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,132 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
import type { Category } from './Category';
|
||||||
|
import {
|
||||||
|
CategoryFromJSON,
|
||||||
|
CategoryFromJSONTyped,
|
||||||
|
CategoryToJSON,
|
||||||
|
} from './Category';
|
||||||
|
import type { Tag } from './Tag';
|
||||||
|
import {
|
||||||
|
TagFromJSON,
|
||||||
|
TagFromJSONTyped,
|
||||||
|
TagToJSON,
|
||||||
|
} from './Tag';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface Pet
|
||||||
|
*/
|
||||||
|
export interface Pet {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof Pet
|
||||||
|
*/
|
||||||
|
id?: number;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Category}
|
||||||
|
* @memberof Pet
|
||||||
|
*/
|
||||||
|
category?: Category;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Pet
|
||||||
|
*/
|
||||||
|
name: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Set<string>}
|
||||||
|
* @memberof Pet
|
||||||
|
*/
|
||||||
|
photoUrls: Set<string>;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Array<Tag>}
|
||||||
|
* @memberof Pet
|
||||||
|
*/
|
||||||
|
tags?: Array<Tag>;
|
||||||
|
/**
|
||||||
|
* pet status in the store
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Pet
|
||||||
|
*/
|
||||||
|
status?: PetStatusEnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const PetStatusEnum = {
|
||||||
|
Available: 'available',
|
||||||
|
Pending: 'pending',
|
||||||
|
Sold: 'sold'
|
||||||
|
} as const;
|
||||||
|
export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum];
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the Pet interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfPet(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
isInstance = isInstance && "name" in value;
|
||||||
|
isInstance = isInstance && "photoUrls" in value;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function PetFromJSON(json: any): Pet {
|
||||||
|
return PetFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
|
'category': !exists(json, 'category') ? undefined : CategoryFromJSON(json['category']),
|
||||||
|
'name': json['name'],
|
||||||
|
'photoUrls': json['photoUrls'],
|
||||||
|
'tags': !exists(json, 'tags') ? undefined : ((json['tags'] as Array<any>).map(TagFromJSON)),
|
||||||
|
'status': !exists(json, 'status') ? undefined : json['status'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function PetToJSON(value?: Pet | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'id': value.id,
|
||||||
|
'category': CategoryToJSON(value.category),
|
||||||
|
'name': value.name,
|
||||||
|
'photoUrls': Array.from(value.photoUrls as Set<any>),
|
||||||
|
'tags': value.tags === undefined ? undefined : ((value.tags as Array<any>).map(TagToJSON)),
|
||||||
|
'status': value.status,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,72 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface ReadOnlyFirst
|
||||||
|
*/
|
||||||
|
export interface ReadOnlyFirst {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof ReadOnlyFirst
|
||||||
|
*/
|
||||||
|
readonly bar?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof ReadOnlyFirst
|
||||||
|
*/
|
||||||
|
baz?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the ReadOnlyFirst interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfReadOnlyFirst(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ReadOnlyFirstFromJSON(json: any): ReadOnlyFirst {
|
||||||
|
return ReadOnlyFirstFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ReadOnlyFirstFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReadOnlyFirst {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'bar': !exists(json, 'bar') ? undefined : json['bar'],
|
||||||
|
'baz': !exists(json, 'baz') ? undefined : json['baz'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ReadOnlyFirstToJSON(value?: ReadOnlyFirst | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'baz': value.baz,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,65 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
/**
|
||||||
|
* Model for testing reserved words
|
||||||
|
* @export
|
||||||
|
* @interface Return
|
||||||
|
*/
|
||||||
|
export interface Return {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof Return
|
||||||
|
*/
|
||||||
|
_return?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the Return interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfReturn(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ReturnFromJSON(json: any): Return {
|
||||||
|
return ReturnFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ReturnFromJSONTyped(json: any, ignoreDiscriminator: boolean): Return {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'_return': !exists(json, 'return') ? undefined : json['return'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ReturnToJSON(value?: Return | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'return': value._return,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,38 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const SingleRefType = {
|
||||||
|
Admin: 'admin',
|
||||||
|
User: 'user'
|
||||||
|
} as const;
|
||||||
|
export type SingleRefType = typeof SingleRefType[keyof typeof SingleRefType];
|
||||||
|
|
||||||
|
|
||||||
|
export function SingleRefTypeFromJSON(json: any): SingleRefType {
|
||||||
|
return SingleRefTypeFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function SingleRefTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): SingleRefType {
|
||||||
|
return json as SingleRefType;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function SingleRefTypeToJSON(value?: SingleRefType | null): any {
|
||||||
|
return value as any;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,65 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface SpecialModelName
|
||||||
|
*/
|
||||||
|
export interface SpecialModelName {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof SpecialModelName
|
||||||
|
*/
|
||||||
|
$specialPropertyName?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the SpecialModelName interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfSpecialModelName(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function SpecialModelNameFromJSON(json: any): SpecialModelName {
|
||||||
|
return SpecialModelNameFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function SpecialModelNameFromJSONTyped(json: any, ignoreDiscriminator: boolean): SpecialModelName {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'$specialPropertyName': !exists(json, '$special[property.name]') ? undefined : json['$special[property.name]'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function SpecialModelNameToJSON(value?: SpecialModelName | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'$special[property.name]': value.$specialPropertyName,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,73 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface Tag
|
||||||
|
*/
|
||||||
|
export interface Tag {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof Tag
|
||||||
|
*/
|
||||||
|
id?: number;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Tag
|
||||||
|
*/
|
||||||
|
name?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the Tag interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfTag(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function TagFromJSON(json: any): Tag {
|
||||||
|
return TagFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function TagFromJSONTyped(json: any, ignoreDiscriminator: boolean): Tag {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
|
'name': !exists(json, 'name') ? undefined : json['name'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function TagToJSON(value?: Tag | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'id': value.id,
|
||||||
|
'name': value.name,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,121 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { exists, mapValues } from '../runtime';
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface User
|
||||||
|
*/
|
||||||
|
export interface User {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof User
|
||||||
|
*/
|
||||||
|
id?: number;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof User
|
||||||
|
*/
|
||||||
|
username?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof User
|
||||||
|
*/
|
||||||
|
firstName?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof User
|
||||||
|
*/
|
||||||
|
lastName?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof User
|
||||||
|
*/
|
||||||
|
email?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof User
|
||||||
|
*/
|
||||||
|
password?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof User
|
||||||
|
*/
|
||||||
|
phone?: string;
|
||||||
|
/**
|
||||||
|
* User Status
|
||||||
|
* @type {number}
|
||||||
|
* @memberof User
|
||||||
|
*/
|
||||||
|
userStatus?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the User interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfUser(value: object): boolean {
|
||||||
|
let isInstance = true;
|
||||||
|
|
||||||
|
return isInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function UserFromJSON(json: any): User {
|
||||||
|
return UserFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User {
|
||||||
|
if ((json === undefined) || (json === null)) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||||
|
'username': !exists(json, 'username') ? undefined : json['username'],
|
||||||
|
'firstName': !exists(json, 'firstName') ? undefined : json['firstName'],
|
||||||
|
'lastName': !exists(json, 'lastName') ? undefined : json['lastName'],
|
||||||
|
'email': !exists(json, 'email') ? undefined : json['email'],
|
||||||
|
'password': !exists(json, 'password') ? undefined : json['password'],
|
||||||
|
'phone': !exists(json, 'phone') ? undefined : json['phone'],
|
||||||
|
'userStatus': !exists(json, 'userStatus') ? undefined : json['userStatus'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function UserToJSON(value?: User | null): any {
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (value === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'id': value.id,
|
||||||
|
'username': value.username,
|
||||||
|
'firstName': value.firstName,
|
||||||
|
'lastName': value.lastName,
|
||||||
|
'email': value.email,
|
||||||
|
'password': value.password,
|
||||||
|
'phone': value.phone,
|
||||||
|
'userStatus': value.userStatus,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,49 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
export * from './AdditionalPropertiesClass';
|
||||||
|
export * from './AllOfWithSingleRef';
|
||||||
|
export * from './Animal';
|
||||||
|
export * from './ArrayOfArrayOfNumberOnly';
|
||||||
|
export * from './ArrayOfNumberOnly';
|
||||||
|
export * from './ArrayTest';
|
||||||
|
export * from './Capitalization';
|
||||||
|
export * from './Cat';
|
||||||
|
export * from './Category';
|
||||||
|
export * from './ClassModel';
|
||||||
|
export * from './Client';
|
||||||
|
export * from './DeprecatedObject';
|
||||||
|
export * from './Dog';
|
||||||
|
export * from './EnumArrays';
|
||||||
|
export * from './EnumClass';
|
||||||
|
export * from './EnumTest';
|
||||||
|
export * from './FakeBigDecimalMap200Response';
|
||||||
|
export * from './FileSchemaTestClass';
|
||||||
|
export * from './Foo';
|
||||||
|
export * from './FooGetDefaultResponse';
|
||||||
|
export * from './FormatTest';
|
||||||
|
export * from './HasOnlyReadOnly';
|
||||||
|
export * from './HealthCheckResult';
|
||||||
|
export * from './List';
|
||||||
|
export * from './MapTest';
|
||||||
|
export * from './MixedPropertiesAndAdditionalPropertiesClass';
|
||||||
|
export * from './Model200Response';
|
||||||
|
export * from './ModelApiResponse';
|
||||||
|
export * from './ModelFile';
|
||||||
|
export * from './Name';
|
||||||
|
export * from './NullableClass';
|
||||||
|
export * from './NumberOnly';
|
||||||
|
export * from './ObjectWithDeprecatedFields';
|
||||||
|
export * from './Order';
|
||||||
|
export * from './OuterComposite';
|
||||||
|
export * from './OuterEnum';
|
||||||
|
export * from './OuterEnumDefaultValue';
|
||||||
|
export * from './OuterEnumInteger';
|
||||||
|
export * from './OuterEnumIntegerDefaultValue';
|
||||||
|
export * from './OuterObjectWithEnumProperty';
|
||||||
|
export * from './Pet';
|
||||||
|
export * from './ReadOnlyFirst';
|
||||||
|
export * from './Return';
|
||||||
|
export * from './SingleRefType';
|
||||||
|
export * from './SpecialModelName';
|
||||||
|
export * from './Tag';
|
||||||
|
export * from './User';
|
@ -0,0 +1,431 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* OpenAPI Petstore
|
||||||
|
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||||
|
* https://openapi-generator.tech
|
||||||
|
* Do not edit the class manually.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
export const BASE_PATH = "http://petstore.swagger.io:80/v2".replace(/\/+$/, "");
|
||||||
|
|
||||||
|
export interface ConfigurationParameters {
|
||||||
|
basePath?: string; // override base path
|
||||||
|
fetchApi?: FetchAPI; // override for fetch implementation
|
||||||
|
middleware?: Middleware[]; // middleware to apply before/after fetch requests
|
||||||
|
queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings
|
||||||
|
username?: string; // parameter for basic security
|
||||||
|
password?: string; // parameter for basic security
|
||||||
|
apiKey?: string | ((name: string) => string); // parameter for apiKey security
|
||||||
|
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>); // parameter for oauth2 security
|
||||||
|
headers?: HTTPHeaders; //header params we want to use on every request
|
||||||
|
credentials?: RequestCredentials; //value for the credentials param we want to use on each request
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Configuration {
|
||||||
|
constructor(private configuration: ConfigurationParameters = {}) {}
|
||||||
|
|
||||||
|
set config(configuration: Configuration) {
|
||||||
|
this.configuration = configuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
get basePath(): string {
|
||||||
|
return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
|
||||||
|
}
|
||||||
|
|
||||||
|
get fetchApi(): FetchAPI | undefined {
|
||||||
|
return this.configuration.fetchApi;
|
||||||
|
}
|
||||||
|
|
||||||
|
get middleware(): Middleware[] {
|
||||||
|
return this.configuration.middleware || [];
|
||||||
|
}
|
||||||
|
|
||||||
|
get queryParamsStringify(): (params: HTTPQuery) => string {
|
||||||
|
return this.configuration.queryParamsStringify || querystring;
|
||||||
|
}
|
||||||
|
|
||||||
|
get username(): string | undefined {
|
||||||
|
return this.configuration.username;
|
||||||
|
}
|
||||||
|
|
||||||
|
get password(): string | undefined {
|
||||||
|
return this.configuration.password;
|
||||||
|
}
|
||||||
|
|
||||||
|
get apiKey(): ((name: string) => string) | undefined {
|
||||||
|
const apiKey = this.configuration.apiKey;
|
||||||
|
if (apiKey) {
|
||||||
|
return typeof apiKey === 'function' ? apiKey : () => apiKey;
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
get accessToken(): ((name?: string, scopes?: string[]) => string | Promise<string>) | undefined {
|
||||||
|
const accessToken = this.configuration.accessToken;
|
||||||
|
if (accessToken) {
|
||||||
|
return typeof accessToken === 'function' ? accessToken : async () => accessToken;
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
get headers(): HTTPHeaders | undefined {
|
||||||
|
return this.configuration.headers;
|
||||||
|
}
|
||||||
|
|
||||||
|
get credentials(): RequestCredentials | undefined {
|
||||||
|
return this.configuration.credentials;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const DefaultConfig = new Configuration();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is the base class for all generated API classes.
|
||||||
|
*/
|
||||||
|
export class BaseAPI {
|
||||||
|
|
||||||
|
private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i');
|
||||||
|
private middleware: Middleware[];
|
||||||
|
|
||||||
|
constructor(protected configuration = DefaultConfig) {
|
||||||
|
this.middleware = configuration.middleware;
|
||||||
|
}
|
||||||
|
|
||||||
|
withMiddleware<T extends BaseAPI>(this: T, ...middlewares: Middleware[]) {
|
||||||
|
const next = this.clone<T>();
|
||||||
|
next.middleware = next.middleware.concat(...middlewares);
|
||||||
|
return next;
|
||||||
|
}
|
||||||
|
|
||||||
|
withPreMiddleware<T extends BaseAPI>(this: T, ...preMiddlewares: Array<Middleware['pre']>) {
|
||||||
|
const middlewares = preMiddlewares.map((pre) => ({ pre }));
|
||||||
|
return this.withMiddleware<T>(...middlewares);
|
||||||
|
}
|
||||||
|
|
||||||
|
withPostMiddleware<T extends BaseAPI>(this: T, ...postMiddlewares: Array<Middleware['post']>) {
|
||||||
|
const middlewares = postMiddlewares.map((post) => ({ post }));
|
||||||
|
return this.withMiddleware<T>(...middlewares);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the given MIME is a JSON MIME.
|
||||||
|
* JSON MIME examples:
|
||||||
|
* application/json
|
||||||
|
* application/json; charset=UTF8
|
||||||
|
* APPLICATION/JSON
|
||||||
|
* application/vnd.company+json
|
||||||
|
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
||||||
|
* @return True if the given MIME is JSON, false otherwise.
|
||||||
|
*/
|
||||||
|
protected isJsonMime(mime: string | null | undefined): boolean {
|
||||||
|
if (!mime) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return BaseAPI.jsonRegex.test(mime);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise<Response> {
|
||||||
|
const { url, init } = await this.createFetchParams(context, initOverrides);
|
||||||
|
const response = await this.fetchApi(url, init);
|
||||||
|
if (response && (response.status >= 200 && response.status < 300)) {
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
throw new ResponseError(response, 'Response returned an error code');
|
||||||
|
}
|
||||||
|
|
||||||
|
private async createFetchParams(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction) {
|
||||||
|
let url = this.configuration.basePath + context.path;
|
||||||
|
if (context.query !== undefined && Object.keys(context.query).length !== 0) {
|
||||||
|
// only add the querystring to the URL if there are query parameters.
|
||||||
|
// this is done to avoid urls ending with a "?" character which buggy webservers
|
||||||
|
// do not handle correctly sometimes.
|
||||||
|
url += '?' + this.configuration.queryParamsStringify(context.query);
|
||||||
|
}
|
||||||
|
|
||||||
|
const headers = Object.assign({}, this.configuration.headers, context.headers);
|
||||||
|
Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {});
|
||||||
|
|
||||||
|
const initOverrideFn =
|
||||||
|
typeof initOverrides === "function"
|
||||||
|
? initOverrides
|
||||||
|
: async () => initOverrides;
|
||||||
|
|
||||||
|
const initParams = {
|
||||||
|
method: context.method,
|
||||||
|
headers,
|
||||||
|
body: context.body,
|
||||||
|
credentials: this.configuration.credentials,
|
||||||
|
};
|
||||||
|
|
||||||
|
const overriddenInit: RequestInit = {
|
||||||
|
...initParams,
|
||||||
|
...(await initOverrideFn({
|
||||||
|
init: initParams,
|
||||||
|
context,
|
||||||
|
}))
|
||||||
|
};
|
||||||
|
|
||||||
|
let body: any;
|
||||||
|
if (isFormData(overriddenInit.body)
|
||||||
|
|| (overriddenInit.body instanceof URLSearchParams)
|
||||||
|
|| isBlob(overriddenInit.body)) {
|
||||||
|
body = overriddenInit.body;
|
||||||
|
} else if (this.isJsonMime(headers['Content-Type'])) {
|
||||||
|
body = JSON.stringify(overriddenInit.body);
|
||||||
|
} else {
|
||||||
|
body = overriddenInit.body;
|
||||||
|
}
|
||||||
|
|
||||||
|
const init: RequestInit = {
|
||||||
|
...overriddenInit,
|
||||||
|
body
|
||||||
|
};
|
||||||
|
|
||||||
|
return { url, init };
|
||||||
|
}
|
||||||
|
|
||||||
|
private fetchApi = async (url: string, init: RequestInit) => {
|
||||||
|
let fetchParams = { url, init };
|
||||||
|
for (const middleware of this.middleware) {
|
||||||
|
if (middleware.pre) {
|
||||||
|
fetchParams = await middleware.pre({
|
||||||
|
fetch: this.fetchApi,
|
||||||
|
...fetchParams,
|
||||||
|
}) || fetchParams;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let response: Response | undefined = undefined;
|
||||||
|
try {
|
||||||
|
response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
|
||||||
|
} catch (e) {
|
||||||
|
for (const middleware of this.middleware) {
|
||||||
|
if (middleware.onError) {
|
||||||
|
response = await middleware.onError({
|
||||||
|
fetch: this.fetchApi,
|
||||||
|
url: fetchParams.url,
|
||||||
|
init: fetchParams.init,
|
||||||
|
error: e,
|
||||||
|
response: response ? response.clone() : undefined,
|
||||||
|
}) || response;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (response === undefined) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response');
|
||||||
|
} else {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (const middleware of this.middleware) {
|
||||||
|
if (middleware.post) {
|
||||||
|
response = await middleware.post({
|
||||||
|
fetch: this.fetchApi,
|
||||||
|
url: fetchParams.url,
|
||||||
|
init: fetchParams.init,
|
||||||
|
response: response.clone(),
|
||||||
|
}) || response;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a shallow clone of `this` by constructing a new instance
|
||||||
|
* and then shallow cloning data members.
|
||||||
|
*/
|
||||||
|
private clone<T extends BaseAPI>(this: T): T {
|
||||||
|
const constructor = this.constructor as any;
|
||||||
|
const next = new constructor(this.configuration);
|
||||||
|
next.middleware = this.middleware.slice();
|
||||||
|
return next;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
function isBlob(value: any): value is Blob {
|
||||||
|
return typeof Blob !== 'undefined' && value instanceof Blob;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isFormData(value: any): value is FormData {
|
||||||
|
return typeof FormData !== "undefined" && value instanceof FormData;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class ResponseError extends Error {
|
||||||
|
override name: "ResponseError" = "ResponseError";
|
||||||
|
constructor(public response: Response, msg?: string) {
|
||||||
|
super(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class FetchError extends Error {
|
||||||
|
override name: "FetchError" = "FetchError";
|
||||||
|
constructor(public cause: Error, msg?: string) {
|
||||||
|
super(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class RequiredError extends Error {
|
||||||
|
override name: "RequiredError" = "RequiredError";
|
||||||
|
constructor(public field: string, msg?: string) {
|
||||||
|
super(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const COLLECTION_FORMATS = {
|
||||||
|
csv: ",",
|
||||||
|
ssv: " ",
|
||||||
|
tsv: "\t",
|
||||||
|
pipes: "|",
|
||||||
|
};
|
||||||
|
|
||||||
|
export type FetchAPI = WindowOrWorkerGlobalScope['fetch'];
|
||||||
|
|
||||||
|
export type Json = any;
|
||||||
|
export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD';
|
||||||
|
export type HTTPHeaders = { [key: string]: string };
|
||||||
|
export type HTTPQuery = { [key: string]: string | number | null | boolean | Array<string | number | null | boolean> | Set<string | number | null | boolean> | HTTPQuery };
|
||||||
|
export type HTTPBody = Json | FormData | URLSearchParams;
|
||||||
|
export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody };
|
||||||
|
export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original';
|
||||||
|
|
||||||
|
export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise<RequestInit>
|
||||||
|
|
||||||
|
export interface FetchParams {
|
||||||
|
url: string;
|
||||||
|
init: RequestInit;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RequestOpts {
|
||||||
|
path: string;
|
||||||
|
method: HTTPMethod;
|
||||||
|
headers: HTTPHeaders;
|
||||||
|
query?: HTTPQuery;
|
||||||
|
body?: HTTPBody;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function exists(json: any, key: string) {
|
||||||
|
const value = json[key];
|
||||||
|
return value !== null && value !== undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function querystring(params: HTTPQuery, prefix: string = ''): string {
|
||||||
|
return Object.keys(params)
|
||||||
|
.map(key => querystringSingleKey(key, params[key], prefix))
|
||||||
|
.filter(part => part.length > 0)
|
||||||
|
.join('&');
|
||||||
|
}
|
||||||
|
|
||||||
|
function querystringSingleKey(key: string, value: string | number | null | undefined | boolean | Array<string | number | null | boolean> | Set<string | number | null | boolean> | HTTPQuery, keyPrefix: string = ''): string {
|
||||||
|
const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
|
||||||
|
if (value instanceof Array) {
|
||||||
|
const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue)))
|
||||||
|
.join(`&${encodeURIComponent(fullKey)}=`);
|
||||||
|
return `${encodeURIComponent(fullKey)}=${multiValue}`;
|
||||||
|
}
|
||||||
|
if (value instanceof Set) {
|
||||||
|
const valueAsArray = Array.from(value);
|
||||||
|
return querystringSingleKey(key, valueAsArray, keyPrefix);
|
||||||
|
}
|
||||||
|
if (value instanceof Date) {
|
||||||
|
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
|
||||||
|
}
|
||||||
|
if (value instanceof Object) {
|
||||||
|
return querystring(value as HTTPQuery, fullKey);
|
||||||
|
}
|
||||||
|
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function mapValues(data: any, fn: (item: any) => any) {
|
||||||
|
return Object.keys(data).reduce(
|
||||||
|
(acc, key) => ({ ...acc, [key]: fn(data[key]) }),
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function canConsumeForm(consumes: Consume[]): boolean {
|
||||||
|
for (const consume of consumes) {
|
||||||
|
if ('multipart/form-data' === consume.contentType) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Consume {
|
||||||
|
contentType: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RequestContext {
|
||||||
|
fetch: FetchAPI;
|
||||||
|
url: string;
|
||||||
|
init: RequestInit;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ResponseContext {
|
||||||
|
fetch: FetchAPI;
|
||||||
|
url: string;
|
||||||
|
init: RequestInit;
|
||||||
|
response: Response;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ErrorContext {
|
||||||
|
fetch: FetchAPI;
|
||||||
|
url: string;
|
||||||
|
init: RequestInit;
|
||||||
|
error: unknown;
|
||||||
|
response?: Response;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Middleware {
|
||||||
|
pre?(context: RequestContext): Promise<FetchParams | void>;
|
||||||
|
post?(context: ResponseContext): Promise<Response | void>;
|
||||||
|
onError?(context: ErrorContext): Promise<Response | void>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ApiResponse<T> {
|
||||||
|
raw: Response;
|
||||||
|
value(): Promise<T>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ResponseTransformer<T> {
|
||||||
|
(json: any): T;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class JSONApiResponse<T> {
|
||||||
|
constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}
|
||||||
|
|
||||||
|
async value(): Promise<T> {
|
||||||
|
return this.transformer(await this.raw.json());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class VoidApiResponse {
|
||||||
|
constructor(public raw: Response) {}
|
||||||
|
|
||||||
|
async value(): Promise<void> {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class BlobApiResponse {
|
||||||
|
constructor(public raw: Response) {}
|
||||||
|
|
||||||
|
async value(): Promise<Blob> {
|
||||||
|
return await this.raw.blob();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export class TextApiResponse {
|
||||||
|
constructor(public raw: Response) {}
|
||||||
|
|
||||||
|
async value(): Promise<string> {
|
||||||
|
return await this.raw.text();
|
||||||
|
};
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user