forked from loafle/openapi-generator-original
[typescript-fetch] Add stringEnums option (#11976)
* [typescript-fetch] add stringEnums option * [typescript-fetch] add docs & samples * [typescript-fetch] update samples * [typescript-fetch] support 3.4 or lower version * [typescript-fetch] update samples
This commit is contained in:
parent
115e363064
commit
21c399f2b8
6
bin/configs/typescript-fetch-with-string-enums.yaml
Normal file
6
bin/configs/typescript-fetch-with-string-enums.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
generatorName: typescript-fetch
|
||||
outputDir: samples/client/petstore/typescript-fetch/builds/with-string-enums
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/typescript-fetch/enum.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/typescript-fetch
|
||||
additionalProperties:
|
||||
stringEnums: true
|
@ -37,6 +37,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false|
|
||||
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|
||||
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|
||||
|stringEnums|Generate string enums instead of objects for enum values.| |false|
|
||||
|supportsES6|Generate code that conforms to ES6.| |false|
|
||||
|typescriptThreePlus|Setting this property to true will generate TypeScript 3.6+ compatible code.| |true|
|
||||
|useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.| |true|
|
||||
|
@ -43,6 +43,8 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege
|
||||
public static final String PREFIX_PARAMETER_INTERFACES = "prefixParameterInterfaces";
|
||||
public static final String TYPESCRIPT_THREE_PLUS = "typescriptThreePlus";
|
||||
public static final String WITHOUT_RUNTIME_CHECKS = "withoutRuntimeChecks";
|
||||
public static final String STRING_ENUMS = "stringEnums";
|
||||
public static final String STRING_ENUMS_DESC = "Generate string enums instead of objects for enum values.";
|
||||
|
||||
protected String npmRepository = null;
|
||||
private boolean useSingleRequestParameter = true;
|
||||
@ -51,6 +53,7 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege
|
||||
protected boolean addedModelIndex = false;
|
||||
protected boolean typescriptThreePlus = true;
|
||||
protected boolean withoutRuntimeChecks = false;
|
||||
protected boolean stringEnums = false;
|
||||
|
||||
// "Saga and Record" mode.
|
||||
public static final String SAGAS_AND_RECORDS = "sagasAndRecords";
|
||||
@ -95,6 +98,7 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege
|
||||
this.cliOptions.add(new CliOption(TYPESCRIPT_THREE_PLUS, "Setting this property to true will generate TypeScript 3.6+ compatible code.", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.TRUE.toString()));
|
||||
this.cliOptions.add(new CliOption(WITHOUT_RUNTIME_CHECKS, "Setting this property to true will remove any runtime checks on the request and response payloads. Payloads will be casted to their expected types.", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString()));
|
||||
this.cliOptions.add(new CliOption(SAGAS_AND_RECORDS, "Setting this property to true will generate additional files for use with redux-saga and immutablejs.", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString()));
|
||||
this.cliOptions.add(new CliOption(STRING_ENUMS, STRING_ENUMS_DESC, SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -131,6 +135,13 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege
|
||||
this.withoutRuntimeChecks = withoutRuntimeChecks;
|
||||
}
|
||||
|
||||
public Boolean getStringEnums() {
|
||||
return this.stringEnums;
|
||||
}
|
||||
public void setStringEnums(Boolean stringEnums) {
|
||||
this.stringEnums = stringEnums;
|
||||
}
|
||||
|
||||
public Boolean getSagasAndRecords() {
|
||||
return sagasAndRecords;
|
||||
}
|
||||
@ -228,6 +239,10 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege
|
||||
this.setWithoutRuntimeChecks(convertPropertyToBoolean(WITHOUT_RUNTIME_CHECKS));
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(STRING_ENUMS)) {
|
||||
this.setStringEnums(convertPropertyToBoolean(STRING_ENUMS));
|
||||
}
|
||||
|
||||
if (!withoutRuntimeChecks) {
|
||||
this.modelTemplateFiles.put("models.mustache", ".ts");
|
||||
typeMapping.put("date", "Date");
|
||||
|
@ -365,6 +365,7 @@ export class {{classname}} extends runtime.BaseAPI {
|
||||
{{#operation}}
|
||||
{{#allParams}}
|
||||
{{#isEnum}}
|
||||
{{#stringEnums}}
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
@ -376,6 +377,33 @@ export enum {{operationIdCamelCase}}{{enumName}} {
|
||||
{{/enumVars}}
|
||||
{{/allowableValues}}
|
||||
}
|
||||
{{/stringEnums}}
|
||||
{{^stringEnums}}
|
||||
{{#typescriptThreePlus}}
|
||||
/**
|
||||
* @export
|
||||
*/
|
||||
export const {{operationIdCamelCase}}{{enumName}} = {
|
||||
{{#allowableValues}}
|
||||
{{#enumVars}}
|
||||
{{{name}}}: {{{value}}}{{^-last}},{{/-last}}
|
||||
{{/enumVars}}
|
||||
{{/allowableValues}}
|
||||
} as const;
|
||||
{{/typescriptThreePlus}}
|
||||
{{^typescriptThreePlus}}
|
||||
/**
|
||||
* @export
|
||||
*/
|
||||
export const {{operationIdCamelCase}}{{enumName}} = {
|
||||
{{#allowableValues}}
|
||||
{{#enumVars}}
|
||||
{{{name}}}: {{{value}}} as {{{value}}}{{^-last}},{{/-last}}
|
||||
{{/enumVars}}
|
||||
{{/allowableValues}}
|
||||
};{{/typescriptThreePlus}}
|
||||
export type {{operationIdCamelCase}}{{enumName}} = typeof {{operationIdCamelCase}}{{enumName}}[keyof typeof {{operationIdCamelCase}}{{enumName}}];
|
||||
{{/stringEnums}}
|
||||
{{/isEnum}}
|
||||
{{/allParams}}
|
||||
{{/operation}}
|
||||
|
@ -1,3 +1,4 @@
|
||||
{{#stringEnums}}
|
||||
/**
|
||||
* {{#lambda.indented_star_1}}{{{unescapedDescription}}}{{/lambda.indented_star_1}}
|
||||
* @export
|
||||
@ -9,4 +10,32 @@ export enum {{classname}} {
|
||||
{{{name}}} = {{{value}}}{{^-last}},{{/-last}}
|
||||
{{/enumVars}}
|
||||
{{/allowableValues}}
|
||||
}
|
||||
}
|
||||
{{/stringEnums}}{{^stringEnums}}
|
||||
{{#typescriptThreePlus}}
|
||||
/**
|
||||
* {{#lambda.indented_star_1}}{{{unescapedDescription}}}{{/lambda.indented_star_1}}
|
||||
* @export
|
||||
*/
|
||||
export const {{classname}} = {
|
||||
{{#allowableValues}}
|
||||
{{#enumVars}}
|
||||
{{{name}}}: {{{value}}}{{^-last}},{{/-last}}
|
||||
{{/enumVars}}
|
||||
{{/allowableValues}}
|
||||
} as const;
|
||||
{{/typescriptThreePlus}}
|
||||
{{^typescriptThreePlus}}
|
||||
/**
|
||||
* {{#lambda.indented_star_1}}{{{unescapedDescription}}}{{/lambda.indented_star_1}}
|
||||
* @export
|
||||
*/
|
||||
export const {{classname}} = {
|
||||
{{#allowableValues}}
|
||||
{{#enumVars}}
|
||||
{{{name}}}: {{{value}}} as {{{value}}}{{^-last}},{{/-last}}
|
||||
{{/enumVars}}
|
||||
{{/allowableValues}}
|
||||
};{{/typescriptThreePlus}}
|
||||
export type {{classname}} = typeof {{classname}}[keyof typeof {{classname}}];
|
||||
{{/stringEnums}}
|
@ -22,6 +22,7 @@ export interface {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{
|
||||
|
||||
{{#vars}}
|
||||
{{#isEnum}}
|
||||
{{#stringEnums}}
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
@ -32,4 +33,31 @@ export enum {{classname}}{{enumName}} {
|
||||
{{{name}}} = {{{value}}}{{^-last}},{{/-last}}
|
||||
{{/enumVars}}
|
||||
{{/allowableValues}}
|
||||
}{{/isEnum}}{{/vars}}{{/hasEnums}}
|
||||
}
|
||||
{{/stringEnums}}{{^stringEnums}}
|
||||
{{#typescriptThreePlus}}
|
||||
/**
|
||||
* @export
|
||||
*/
|
||||
export const {{classname}}{{enumName}} = {
|
||||
{{#allowableValues}}
|
||||
{{#enumVars}}
|
||||
{{{name}}}: {{{value}}}{{^-last}},{{/-last}}
|
||||
{{/enumVars}}
|
||||
{{/allowableValues}}
|
||||
} as const;
|
||||
{{/typescriptThreePlus}}
|
||||
{{^typescriptThreePlus}}
|
||||
/**
|
||||
* @export
|
||||
*/
|
||||
export const {{classname}}{{enumName}} = {
|
||||
{{#allowableValues}}
|
||||
{{#enumVars}}
|
||||
{{{name}}}: {{{value}}} as {{{value}}}{{^-last}},{{/-last}}
|
||||
{{/enumVars}}
|
||||
{{/allowableValues}}
|
||||
};{{/typescriptThreePlus}}
|
||||
export type {{classname}}{{enumName}} = typeof {{classname}}{{enumName}}[keyof typeof {{classname}}{{enumName}}];
|
||||
{{/stringEnums}}
|
||||
{{/isEnum}}{{/vars}}{{/hasEnums}}
|
@ -43,6 +43,7 @@ public class TypeScriptFetchClientOptionsProvider implements OptionsProvider {
|
||||
public static final String WITHOUT_RUNTIME_CHECKS = "true";
|
||||
public static final String SAGAS_AND_RECORDS = "false";
|
||||
public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false";
|
||||
public static final String STRING_ENUMS = "false";
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
@ -76,6 +77,7 @@ public class TypeScriptFetchClientOptionsProvider implements OptionsProvider {
|
||||
.put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true")
|
||||
.put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true")
|
||||
.put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE)
|
||||
.put(TypeScriptFetchClientCodegen.STRING_ENUMS, STRING_ENUMS)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -49,5 +49,6 @@ public class TypeScriptFetchClientOptionsTest extends AbstractOptionsTest {
|
||||
verify(clientCodegen).setWithoutRuntimeChecks(Boolean.valueOf(TypeScriptFetchClientOptionsProvider.WITHOUT_RUNTIME_CHECKS));
|
||||
verify(clientCodegen).setSagasAndRecords(Boolean.valueOf(TypeScriptFetchClientOptionsProvider.SAGAS_AND_RECORDS));
|
||||
verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(TypeScriptFetchClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE));
|
||||
verify(clientCodegen).setStringEnums(Boolean.parseBoolean(TypeScriptFetchClientOptionsProvider.STRING_ENUMS));
|
||||
}
|
||||
}
|
||||
|
@ -930,69 +930,69 @@ export class FakeApi extends runtime.BaseAPI {
|
||||
}
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum TestEnumParametersEnumHeaderStringArrayEnum {
|
||||
GreaterThan = '>',
|
||||
Dollar = '$'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const TestEnumParametersEnumHeaderStringArrayEnum = {
|
||||
GreaterThan: '>' as '>',
|
||||
Dollar: '$' as '$'
|
||||
};
|
||||
export type TestEnumParametersEnumHeaderStringArrayEnum = typeof TestEnumParametersEnumHeaderStringArrayEnum[keyof typeof TestEnumParametersEnumHeaderStringArrayEnum];
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum TestEnumParametersEnumHeaderStringEnum {
|
||||
Abc = '_abc',
|
||||
Efg = '-efg',
|
||||
Xyz = '(xyz)'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const TestEnumParametersEnumHeaderStringEnum = {
|
||||
Abc: '_abc' as '_abc',
|
||||
Efg: '-efg' as '-efg',
|
||||
Xyz: '(xyz)' as '(xyz)'
|
||||
};
|
||||
export type TestEnumParametersEnumHeaderStringEnum = typeof TestEnumParametersEnumHeaderStringEnum[keyof typeof TestEnumParametersEnumHeaderStringEnum];
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum TestEnumParametersEnumQueryStringArrayEnum {
|
||||
GreaterThan = '>',
|
||||
Dollar = '$'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const TestEnumParametersEnumQueryStringArrayEnum = {
|
||||
GreaterThan: '>' as '>',
|
||||
Dollar: '$' as '$'
|
||||
};
|
||||
export type TestEnumParametersEnumQueryStringArrayEnum = typeof TestEnumParametersEnumQueryStringArrayEnum[keyof typeof TestEnumParametersEnumQueryStringArrayEnum];
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum TestEnumParametersEnumQueryStringEnum {
|
||||
Abc = '_abc',
|
||||
Efg = '-efg',
|
||||
Xyz = '(xyz)'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const TestEnumParametersEnumQueryStringEnum = {
|
||||
Abc: '_abc' as '_abc',
|
||||
Efg: '-efg' as '-efg',
|
||||
Xyz: '(xyz)' as '(xyz)'
|
||||
};
|
||||
export type TestEnumParametersEnumQueryStringEnum = typeof TestEnumParametersEnumQueryStringEnum[keyof typeof TestEnumParametersEnumQueryStringEnum];
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum TestEnumParametersEnumQueryIntegerEnum {
|
||||
NUMBER_1 = 1,
|
||||
NUMBER_MINUS_2 = -2
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const TestEnumParametersEnumQueryIntegerEnum = {
|
||||
NUMBER_1: 1 as 1,
|
||||
NUMBER_MINUS_2: -2 as -2
|
||||
};
|
||||
export type TestEnumParametersEnumQueryIntegerEnum = typeof TestEnumParametersEnumQueryIntegerEnum[keyof typeof TestEnumParametersEnumQueryIntegerEnum];
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum TestEnumParametersEnumQueryDoubleEnum {
|
||||
NUMBER_1_DOT_1 = 1.1,
|
||||
NUMBER_MINUS_1_DOT_2 = -1.2
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const TestEnumParametersEnumQueryDoubleEnum = {
|
||||
NUMBER_1_DOT_1: 1.1 as 1.1,
|
||||
NUMBER_MINUS_1_DOT_2: -1.2 as -1.2
|
||||
};
|
||||
export type TestEnumParametersEnumQueryDoubleEnum = typeof TestEnumParametersEnumQueryDoubleEnum[keyof typeof TestEnumParametersEnumQueryDoubleEnum];
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum TestEnumParametersEnumFormStringArrayEnum {
|
||||
GreaterThan = '>',
|
||||
Dollar = '$'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const TestEnumParametersEnumFormStringArrayEnum = {
|
||||
GreaterThan: '>' as '>',
|
||||
Dollar: '$' as '$'
|
||||
};
|
||||
export type TestEnumParametersEnumFormStringArrayEnum = typeof TestEnumParametersEnumFormStringArrayEnum[keyof typeof TestEnumParametersEnumFormStringArrayEnum];
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum TestEnumParametersEnumFormStringEnum {
|
||||
Abc = '_abc',
|
||||
Efg = '-efg',
|
||||
Xyz = '(xyz)'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const TestEnumParametersEnumFormStringEnum = {
|
||||
Abc: '_abc' as '_abc',
|
||||
Efg: '-efg' as '-efg',
|
||||
Xyz: '(xyz)' as '(xyz)'
|
||||
};
|
||||
export type TestEnumParametersEnumFormStringEnum = typeof TestEnumParametersEnumFormStringEnum[keyof typeof TestEnumParametersEnumFormStringEnum];
|
||||
|
@ -497,11 +497,11 @@ export class PetApi extends runtime.BaseAPI {
|
||||
}
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum FindPetsByStatusStatusEnum {
|
||||
Available = 'available',
|
||||
Pending = 'pending',
|
||||
Sold = 'sold'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const FindPetsByStatusStatusEnum = {
|
||||
Available: 'available' as 'available',
|
||||
Pending: 'pending' as 'pending',
|
||||
Sold: 'sold' as 'sold'
|
||||
};
|
||||
export type FindPetsByStatusStatusEnum = typeof FindPetsByStatusStatusEnum[keyof typeof FindPetsByStatusStatusEnum];
|
||||
|
@ -33,21 +33,25 @@ export interface EnumArrays {
|
||||
arrayEnum?: Array<EnumArraysArrayEnumEnum>;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum EnumArraysJustSymbolEnum {
|
||||
GreaterThanOrEqualTo = '>=',
|
||||
Dollar = '$'
|
||||
}/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum EnumArraysArrayEnumEnum {
|
||||
Fish = 'fish',
|
||||
Crab = 'crab'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const EnumArraysJustSymbolEnum = {
|
||||
GreaterThanOrEqualTo: '>=' as '>=',
|
||||
Dollar: '$' as '$'
|
||||
};
|
||||
export type EnumArraysJustSymbolEnum = typeof EnumArraysJustSymbolEnum[keyof typeof EnumArraysJustSymbolEnum];
|
||||
|
||||
/**
|
||||
* @export
|
||||
*/
|
||||
export const EnumArraysArrayEnumEnum = {
|
||||
Fish: 'fish' as 'fish',
|
||||
Crab: 'crab' as 'crab'
|
||||
};
|
||||
export type EnumArraysArrayEnumEnum = typeof EnumArraysArrayEnumEnum[keyof typeof EnumArraysArrayEnumEnum];
|
||||
|
||||
|
||||
export function EnumArraysFromJSON(json: any): EnumArrays {
|
||||
return EnumArraysFromJSONTyped(json, false);
|
||||
|
@ -12,16 +12,18 @@
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum EnumClass {
|
||||
Abc = '_abc',
|
||||
Efg = '-efg',
|
||||
Xyz = '(xyz)'
|
||||
}
|
||||
export const EnumClass = {
|
||||
Abc: '_abc' as '_abc',
|
||||
Efg: '-efg' as '-efg',
|
||||
Xyz: '(xyz)' as '(xyz)'
|
||||
};
|
||||
export type EnumClass = typeof EnumClass[keyof typeof EnumClass];
|
||||
|
||||
|
||||
export function EnumClassFromJSON(json: any): EnumClass {
|
||||
return EnumClassFromJSONTyped(json, false);
|
||||
|
@ -94,37 +94,45 @@ export interface EnumTest {
|
||||
outerEnumIntegerDefaultValue?: OuterEnumIntegerDefaultValue;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum EnumTestEnumStringEnum {
|
||||
Upper = 'UPPER',
|
||||
Lower = 'lower',
|
||||
Empty = ''
|
||||
}/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum EnumTestEnumStringRequiredEnum {
|
||||
Upper = 'UPPER',
|
||||
Lower = 'lower',
|
||||
Empty = ''
|
||||
}/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum EnumTestEnumIntegerEnum {
|
||||
NUMBER_1 = 1,
|
||||
NUMBER_MINUS_1 = -1
|
||||
}/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum EnumTestEnumNumberEnum {
|
||||
NUMBER_1_DOT_1 = 1.1,
|
||||
NUMBER_MINUS_1_DOT_2 = -1.2
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const EnumTestEnumStringEnum = {
|
||||
Upper: 'UPPER' as 'UPPER',
|
||||
Lower: 'lower' as 'lower',
|
||||
Empty: '' as ''
|
||||
};
|
||||
export type EnumTestEnumStringEnum = typeof EnumTestEnumStringEnum[keyof typeof EnumTestEnumStringEnum];
|
||||
|
||||
/**
|
||||
* @export
|
||||
*/
|
||||
export const EnumTestEnumStringRequiredEnum = {
|
||||
Upper: 'UPPER' as 'UPPER',
|
||||
Lower: 'lower' as 'lower',
|
||||
Empty: '' as ''
|
||||
};
|
||||
export type EnumTestEnumStringRequiredEnum = typeof EnumTestEnumStringRequiredEnum[keyof typeof EnumTestEnumStringRequiredEnum];
|
||||
|
||||
/**
|
||||
* @export
|
||||
*/
|
||||
export const EnumTestEnumIntegerEnum = {
|
||||
NUMBER_1: 1 as 1,
|
||||
NUMBER_MINUS_1: -1 as -1
|
||||
};
|
||||
export type EnumTestEnumIntegerEnum = typeof EnumTestEnumIntegerEnum[keyof typeof EnumTestEnumIntegerEnum];
|
||||
|
||||
/**
|
||||
* @export
|
||||
*/
|
||||
export const EnumTestEnumNumberEnum = {
|
||||
NUMBER_1_DOT_1: 1.1 as 1.1,
|
||||
NUMBER_MINUS_1_DOT_2: -1.2 as -1.2
|
||||
};
|
||||
export type EnumTestEnumNumberEnum = typeof EnumTestEnumNumberEnum[keyof typeof EnumTestEnumNumberEnum];
|
||||
|
||||
|
||||
export function EnumTestFromJSON(json: any): EnumTest {
|
||||
return EnumTestFromJSONTyped(json, false);
|
||||
|
@ -45,14 +45,16 @@ export interface MapTest {
|
||||
indirectMap?: { [key: string]: boolean; };
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum MapTestMapOfEnumStringEnum {
|
||||
Upper = 'UPPER',
|
||||
Lower = 'lower'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const MapTestMapOfEnumStringEnum = {
|
||||
Upper: 'UPPER' as 'UPPER',
|
||||
Lower: 'lower' as 'lower'
|
||||
};
|
||||
export type MapTestMapOfEnumStringEnum = typeof MapTestMapOfEnumStringEnum[keyof typeof MapTestMapOfEnumStringEnum];
|
||||
|
||||
|
||||
export function MapTestFromJSON(json: any): MapTest {
|
||||
return MapTestFromJSONTyped(json, false);
|
||||
|
@ -57,15 +57,17 @@ export interface Order {
|
||||
complete?: boolean;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum OrderStatusEnum {
|
||||
Placed = 'placed',
|
||||
Approved = 'approved',
|
||||
Delivered = 'delivered'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const OrderStatusEnum = {
|
||||
Placed: 'placed' as 'placed',
|
||||
Approved: 'approved' as 'approved',
|
||||
Delivered: 'delivered' as 'delivered'
|
||||
};
|
||||
export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum];
|
||||
|
||||
|
||||
export function OrderFromJSON(json: any): Order {
|
||||
return OrderFromJSONTyped(json, false);
|
||||
|
@ -12,16 +12,18 @@
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum OuterEnum {
|
||||
Placed = 'placed',
|
||||
Approved = 'approved',
|
||||
Delivered = 'delivered'
|
||||
}
|
||||
export const OuterEnum = {
|
||||
Placed: 'placed' as 'placed',
|
||||
Approved: 'approved' as 'approved',
|
||||
Delivered: 'delivered' as 'delivered'
|
||||
};
|
||||
export type OuterEnum = typeof OuterEnum[keyof typeof OuterEnum];
|
||||
|
||||
|
||||
export function OuterEnumFromJSON(json: any): OuterEnum {
|
||||
return OuterEnumFromJSONTyped(json, false);
|
||||
|
@ -12,16 +12,18 @@
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum OuterEnumDefaultValue {
|
||||
Placed = 'placed',
|
||||
Approved = 'approved',
|
||||
Delivered = 'delivered'
|
||||
}
|
||||
export const OuterEnumDefaultValue = {
|
||||
Placed: 'placed' as 'placed',
|
||||
Approved: 'approved' as 'approved',
|
||||
Delivered: 'delivered' as 'delivered'
|
||||
};
|
||||
export type OuterEnumDefaultValue = typeof OuterEnumDefaultValue[keyof typeof OuterEnumDefaultValue];
|
||||
|
||||
|
||||
export function OuterEnumDefaultValueFromJSON(json: any): OuterEnumDefaultValue {
|
||||
return OuterEnumDefaultValueFromJSONTyped(json, false);
|
||||
|
@ -12,16 +12,18 @@
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum OuterEnumInteger {
|
||||
NUMBER_0 = 0,
|
||||
NUMBER_1 = 1,
|
||||
NUMBER_2 = 2
|
||||
}
|
||||
export const OuterEnumInteger = {
|
||||
NUMBER_0: 0 as 0,
|
||||
NUMBER_1: 1 as 1,
|
||||
NUMBER_2: 2 as 2
|
||||
};
|
||||
export type OuterEnumInteger = typeof OuterEnumInteger[keyof typeof OuterEnumInteger];
|
||||
|
||||
|
||||
export function OuterEnumIntegerFromJSON(json: any): OuterEnumInteger {
|
||||
return OuterEnumIntegerFromJSONTyped(json, false);
|
||||
|
@ -12,16 +12,18 @@
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum OuterEnumIntegerDefaultValue {
|
||||
NUMBER_0 = 0,
|
||||
NUMBER_1 = 1,
|
||||
NUMBER_2 = 2
|
||||
}
|
||||
export const OuterEnumIntegerDefaultValue = {
|
||||
NUMBER_0: 0 as 0,
|
||||
NUMBER_1: 1 as 1,
|
||||
NUMBER_2: 2 as 2
|
||||
};
|
||||
export type OuterEnumIntegerDefaultValue = typeof OuterEnumIntegerDefaultValue[keyof typeof OuterEnumIntegerDefaultValue];
|
||||
|
||||
|
||||
export function OuterEnumIntegerDefaultValueFromJSON(json: any): OuterEnumIntegerDefaultValue {
|
||||
return OuterEnumIntegerDefaultValueFromJSONTyped(json, false);
|
||||
|
@ -70,15 +70,17 @@ export interface Pet {
|
||||
status?: PetStatusEnum;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum PetStatusEnum {
|
||||
Available = 'available',
|
||||
Pending = 'pending',
|
||||
Sold = 'sold'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const PetStatusEnum = {
|
||||
Available: 'available' as 'available',
|
||||
Pending: 'pending' as 'pending',
|
||||
Sold: 'sold' as 'sold'
|
||||
};
|
||||
export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum];
|
||||
|
||||
|
||||
export function PetFromJSON(json: any): Pet {
|
||||
return PetFromJSONTyped(json, false);
|
||||
|
@ -415,11 +415,11 @@ export class PetApi extends runtime.BaseAPI {
|
||||
}
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum FindPetsByStatusStatusEnum {
|
||||
Available = 'available',
|
||||
Pending = 'pending',
|
||||
Sold = 'sold'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const FindPetsByStatusStatusEnum = {
|
||||
Available: 'available' as 'available',
|
||||
Pending: 'pending' as 'pending',
|
||||
Sold: 'sold' as 'sold'
|
||||
};
|
||||
export type FindPetsByStatusStatusEnum = typeof FindPetsByStatusStatusEnum[keyof typeof FindPetsByStatusStatusEnum];
|
||||
|
@ -57,15 +57,17 @@ export interface Order {
|
||||
complete?: boolean;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum OrderStatusEnum {
|
||||
Placed = 'placed',
|
||||
Approved = 'approved',
|
||||
Delivered = 'delivered'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const OrderStatusEnum = {
|
||||
Placed: 'placed' as 'placed',
|
||||
Approved: 'approved' as 'approved',
|
||||
Delivered: 'delivered' as 'delivered'
|
||||
};
|
||||
export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum];
|
||||
|
||||
|
||||
export function OrderFromJSON(json: any): Order {
|
||||
return OrderFromJSONTyped(json, false);
|
||||
|
@ -70,15 +70,17 @@ export interface Pet {
|
||||
status?: PetStatusEnum;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum PetStatusEnum {
|
||||
Available = 'available',
|
||||
Pending = 'pending',
|
||||
Sold = 'sold'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const PetStatusEnum = {
|
||||
Available: 'available' as 'available',
|
||||
Pending: 'pending' as 'pending',
|
||||
Sold: 'sold' as 'sold'
|
||||
};
|
||||
export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum];
|
||||
|
||||
|
||||
export function PetFromJSON(json: any): Pet {
|
||||
return PetFromJSONTyped(json, false);
|
||||
|
@ -196,20 +196,20 @@ export class DefaultApi extends runtime.BaseAPI {
|
||||
}
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum FakeEnumRequestGetInlineStringEnumEnum {
|
||||
One = 'one',
|
||||
Two = 'two',
|
||||
Three = 'three'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const FakeEnumRequestGetInlineStringEnumEnum = {
|
||||
One: 'one' as 'one',
|
||||
Two: 'two' as 'two',
|
||||
Three: 'three' as 'three'
|
||||
};
|
||||
export type FakeEnumRequestGetInlineStringEnumEnum = typeof FakeEnumRequestGetInlineStringEnumEnum[keyof typeof FakeEnumRequestGetInlineStringEnumEnum];
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum FakeEnumRequestGetInlineNumberEnumEnum {
|
||||
NUMBER_1 = 1,
|
||||
NUMBER_2 = 2,
|
||||
NUMBER_3 = 3
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const FakeEnumRequestGetInlineNumberEnumEnum = {
|
||||
NUMBER_1: 1 as 1,
|
||||
NUMBER_2: 2 as 2,
|
||||
NUMBER_3: 3 as 3
|
||||
};
|
||||
export type FakeEnumRequestGetInlineNumberEnumEnum = typeof FakeEnumRequestGetInlineNumberEnumEnum[keyof typeof FakeEnumRequestGetInlineNumberEnumEnum];
|
||||
|
@ -45,23 +45,27 @@ export interface InlineObject {
|
||||
nullableNumberEnum?: number | null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum InlineObjectStringEnumEnum {
|
||||
One = 'one',
|
||||
Two = 'two',
|
||||
Three = 'three'
|
||||
}/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum InlineObjectNumberEnumEnum {
|
||||
NUMBER_1 = 1,
|
||||
NUMBER_2 = 2,
|
||||
NUMBER_3 = 3
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const InlineObjectStringEnumEnum = {
|
||||
One: 'one' as 'one',
|
||||
Two: 'two' as 'two',
|
||||
Three: 'three' as 'three'
|
||||
};
|
||||
export type InlineObjectStringEnumEnum = typeof InlineObjectStringEnumEnum[keyof typeof InlineObjectStringEnumEnum];
|
||||
|
||||
/**
|
||||
* @export
|
||||
*/
|
||||
export const InlineObjectNumberEnumEnum = {
|
||||
NUMBER_1: 1 as 1,
|
||||
NUMBER_2: 2 as 2,
|
||||
NUMBER_3: 3 as 3
|
||||
};
|
||||
export type InlineObjectNumberEnumEnum = typeof InlineObjectNumberEnumEnum[keyof typeof InlineObjectNumberEnumEnum];
|
||||
|
||||
|
||||
export function InlineObjectFromJSON(json: any): InlineObject {
|
||||
return InlineObjectFromJSONTyped(json, false);
|
||||
|
@ -45,23 +45,27 @@ export interface InlineResponse200 {
|
||||
nullableNumberEnum?: number | null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum InlineResponse200StringEnumEnum {
|
||||
One = 'one',
|
||||
Two = 'two',
|
||||
Three = 'three'
|
||||
}/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum InlineResponse200NumberEnumEnum {
|
||||
NUMBER_1 = 1,
|
||||
NUMBER_2 = 2,
|
||||
NUMBER_3 = 3
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const InlineResponse200StringEnumEnum = {
|
||||
One: 'one' as 'one',
|
||||
Two: 'two' as 'two',
|
||||
Three: 'three' as 'three'
|
||||
};
|
||||
export type InlineResponse200StringEnumEnum = typeof InlineResponse200StringEnumEnum[keyof typeof InlineResponse200StringEnumEnum];
|
||||
|
||||
/**
|
||||
* @export
|
||||
*/
|
||||
export const InlineResponse200NumberEnumEnum = {
|
||||
NUMBER_1: 1 as 1,
|
||||
NUMBER_2: 2 as 2,
|
||||
NUMBER_3: 3 as 3
|
||||
};
|
||||
export type InlineResponse200NumberEnumEnum = typeof InlineResponse200NumberEnumEnum[keyof typeof InlineResponse200NumberEnumEnum];
|
||||
|
||||
|
||||
export function InlineResponse200FromJSON(json: any): InlineResponse200 {
|
||||
return InlineResponse200FromJSONTyped(json, false);
|
||||
|
@ -12,16 +12,18 @@
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum NumberEnum {
|
||||
NUMBER_1 = 1,
|
||||
NUMBER_2 = 2,
|
||||
NUMBER_3 = 3
|
||||
}
|
||||
export const NumberEnum = {
|
||||
NUMBER_1: 1 as 1,
|
||||
NUMBER_2: 2 as 2,
|
||||
NUMBER_3: 3 as 3
|
||||
};
|
||||
export type NumberEnum = typeof NumberEnum[keyof typeof NumberEnum];
|
||||
|
||||
|
||||
export function NumberEnumFromJSON(json: any): NumberEnum {
|
||||
return NumberEnumFromJSONTyped(json, false);
|
||||
|
@ -12,16 +12,18 @@
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum StringEnum {
|
||||
One = 'one',
|
||||
Two = 'two',
|
||||
Three = 'three'
|
||||
}
|
||||
export const StringEnum = {
|
||||
One: 'one' as 'one',
|
||||
Two: 'two' as 'two',
|
||||
Three: 'three' as 'three'
|
||||
};
|
||||
export type StringEnum = typeof StringEnum[keyof typeof StringEnum];
|
||||
|
||||
|
||||
export function StringEnumFromJSON(json: any): StringEnum {
|
||||
return StringEnumFromJSONTyped(json, false);
|
||||
|
@ -415,11 +415,11 @@ export class PetApi extends runtime.BaseAPI {
|
||||
}
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum FindPetsByStatusStatusEnum {
|
||||
Available = 'available',
|
||||
Pending = 'pending',
|
||||
Sold = 'sold'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const FindPetsByStatusStatusEnum = {
|
||||
Available: 'available' as 'available',
|
||||
Pending: 'pending' as 'pending',
|
||||
Sold: 'sold' as 'sold'
|
||||
};
|
||||
export type FindPetsByStatusStatusEnum = typeof FindPetsByStatusStatusEnum[keyof typeof FindPetsByStatusStatusEnum];
|
||||
|
@ -57,15 +57,17 @@ export interface Order {
|
||||
complete?: boolean;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum OrderStatusEnum {
|
||||
Placed = 'placed',
|
||||
Approved = 'approved',
|
||||
Delivered = 'delivered'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const OrderStatusEnum = {
|
||||
Placed: 'placed' as 'placed',
|
||||
Approved: 'approved' as 'approved',
|
||||
Delivered: 'delivered' as 'delivered'
|
||||
};
|
||||
export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum];
|
||||
|
||||
|
||||
export function OrderFromJSON(json: any): Order {
|
||||
return OrderFromJSONTyped(json, false);
|
||||
|
@ -70,15 +70,17 @@ export interface Pet {
|
||||
status?: PetStatusEnum;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum PetStatusEnum {
|
||||
Available = 'available',
|
||||
Pending = 'pending',
|
||||
Sold = 'sold'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const PetStatusEnum = {
|
||||
Available: 'available' as 'available',
|
||||
Pending: 'pending' as 'pending',
|
||||
Sold: 'sold' as 'sold'
|
||||
};
|
||||
export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum];
|
||||
|
||||
|
||||
export function PetFromJSON(json: any): Pet {
|
||||
return PetFromJSONTyped(json, false);
|
||||
|
@ -415,11 +415,11 @@ export class PetApi extends runtime.BaseAPI {
|
||||
}
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum FindPetsByStatusStatusEnum {
|
||||
Available = 'available',
|
||||
Pending = 'pending',
|
||||
Sold = 'sold'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const FindPetsByStatusStatusEnum = {
|
||||
Available: 'available' as 'available',
|
||||
Pending: 'pending' as 'pending',
|
||||
Sold: 'sold' as 'sold'
|
||||
};
|
||||
export type FindPetsByStatusStatusEnum = typeof FindPetsByStatusStatusEnum[keyof typeof FindPetsByStatusStatusEnum];
|
||||
|
@ -57,15 +57,17 @@ export interface Order {
|
||||
complete?: boolean;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum OrderStatusEnum {
|
||||
Placed = 'placed',
|
||||
Approved = 'approved',
|
||||
Delivered = 'delivered'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const OrderStatusEnum = {
|
||||
Placed: 'placed' as 'placed',
|
||||
Approved: 'approved' as 'approved',
|
||||
Delivered: 'delivered' as 'delivered'
|
||||
};
|
||||
export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum];
|
||||
|
||||
|
||||
export function OrderFromJSON(json: any): Order {
|
||||
return OrderFromJSONTyped(json, false);
|
||||
|
@ -70,15 +70,17 @@ export interface Pet {
|
||||
status?: PetStatusEnum;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum PetStatusEnum {
|
||||
Available = 'available',
|
||||
Pending = 'pending',
|
||||
Sold = 'sold'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const PetStatusEnum = {
|
||||
Available: 'available' as 'available',
|
||||
Pending: 'pending' as 'pending',
|
||||
Sold: 'sold' as 'sold'
|
||||
};
|
||||
export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum];
|
||||
|
||||
|
||||
export function PetFromJSON(json: any): Pet {
|
||||
return PetFromJSONTyped(json, false);
|
||||
|
@ -415,11 +415,11 @@ export class PetApi extends runtime.BaseAPI {
|
||||
}
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum FindPetsByStatusStatusEnum {
|
||||
Available = 'available',
|
||||
Pending = 'pending',
|
||||
Sold = 'sold'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const FindPetsByStatusStatusEnum = {
|
||||
Available: 'available' as 'available',
|
||||
Pending: 'pending' as 'pending',
|
||||
Sold: 'sold' as 'sold'
|
||||
};
|
||||
export type FindPetsByStatusStatusEnum = typeof FindPetsByStatusStatusEnum[keyof typeof FindPetsByStatusStatusEnum];
|
||||
|
@ -57,15 +57,17 @@ export interface Order {
|
||||
complete?: boolean;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum OrderStatusEnum {
|
||||
Placed = 'placed',
|
||||
Approved = 'approved',
|
||||
Delivered = 'delivered'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const OrderStatusEnum = {
|
||||
Placed: 'placed' as 'placed',
|
||||
Approved: 'approved' as 'approved',
|
||||
Delivered: 'delivered' as 'delivered'
|
||||
};
|
||||
export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum];
|
||||
|
||||
|
||||
export function OrderFromJSON(json: any): Order {
|
||||
return OrderFromJSONTyped(json, false);
|
||||
|
@ -70,15 +70,17 @@ export interface Pet {
|
||||
status?: PetStatusEnum;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum PetStatusEnum {
|
||||
Available = 'available',
|
||||
Pending = 'pending',
|
||||
Sold = 'sold'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const PetStatusEnum = {
|
||||
Available: 'available' as 'available',
|
||||
Pending: 'pending' as 'pending',
|
||||
Sold: 'sold' as 'sold'
|
||||
};
|
||||
export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum];
|
||||
|
||||
|
||||
export function PetFromJSON(json: any): Pet {
|
||||
return PetFromJSONTyped(json, false);
|
||||
|
@ -593,11 +593,12 @@ export class PetApi extends runtime.BaseAPI {
|
||||
}
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum FindPetsByStatusStatusEnum {
|
||||
Available = 'available',
|
||||
Pending = 'pending',
|
||||
Sold = 'sold'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const FindPetsByStatusStatusEnum = {
|
||||
Available: 'available',
|
||||
Pending: 'pending',
|
||||
Sold: 'sold'
|
||||
} as const;
|
||||
|
||||
export type FindPetsByStatusStatusEnum = typeof FindPetsByStatusStatusEnum[keyof typeof FindPetsByStatusStatusEnum];
|
||||
|
@ -12,16 +12,19 @@
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Behavior type of a pet
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum BehaviorType {
|
||||
Voluntary = 'Voluntary',
|
||||
Involuntary = 'Involuntary',
|
||||
Overt = 'Overt'
|
||||
}
|
||||
export const BehaviorType = {
|
||||
Voluntary: 'Voluntary',
|
||||
Involuntary: 'Involuntary',
|
||||
Overt: 'Overt'
|
||||
} as const;
|
||||
|
||||
export type BehaviorType = typeof BehaviorType[keyof typeof BehaviorType];
|
||||
|
||||
|
||||
export function BehaviorTypeFromJSON(json: any): BehaviorType {
|
||||
return BehaviorTypeFromJSONTyped(json, false);
|
||||
|
@ -12,25 +12,28 @@
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Status of the deployment request
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum DeploymentRequestStatus {
|
||||
New = 'New',
|
||||
Prepared = 'Prepared',
|
||||
Printed = 'Printed',
|
||||
Tested = 'Tested',
|
||||
Completed = 'Completed',
|
||||
Cancelled = 'Cancelled',
|
||||
Promoted = 'Promoted',
|
||||
Assigned = 'Assigned',
|
||||
Ready = 'Ready',
|
||||
Packaged = 'Packaged',
|
||||
Pairing = 'Pairing',
|
||||
Paired = 'Paired'
|
||||
}
|
||||
export const DeploymentRequestStatus = {
|
||||
New: 'New',
|
||||
Prepared: 'Prepared',
|
||||
Printed: 'Printed',
|
||||
Tested: 'Tested',
|
||||
Completed: 'Completed',
|
||||
Cancelled: 'Cancelled',
|
||||
Promoted: 'Promoted',
|
||||
Assigned: 'Assigned',
|
||||
Ready: 'Ready',
|
||||
Packaged: 'Packaged',
|
||||
Pairing: 'Pairing',
|
||||
Paired: 'Paired'
|
||||
} as const;
|
||||
|
||||
export type DeploymentRequestStatus = typeof DeploymentRequestStatus[keyof typeof DeploymentRequestStatus];
|
||||
|
||||
|
||||
export function DeploymentRequestStatusFromJSON(json: any): DeploymentRequestStatus {
|
||||
return DeploymentRequestStatusFromJSONTyped(json, false);
|
||||
|
@ -12,31 +12,34 @@
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Error code returned when an error occurs
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum ErrorCode {
|
||||
VolumeRangeAtLowestValue = 'Volume_Range_At_Lowest_Value',
|
||||
MusicVolumeBlocksVolumeRangeDecrease = 'Music_Volume_Blocks_Volume_Range_Decrease',
|
||||
VolumeRangeAtHighestValue = 'Volume_Range_At_Highest_Value',
|
||||
MaximumVolumeBlocksVolumeRangeIncrease = 'Maximum_Volume_Blocks_Volume_Range_Increase',
|
||||
MusicVolumeBlocksMaximumVolumeDecrease = 'Music_Volume_Blocks_Maximum_Volume_Decrease',
|
||||
MaximumVolumeAtLowestValue = 'Maximum_Volume_At_Lowest_Value',
|
||||
VolumeRangeBlocksMaximumVolumeDecrease = 'Volume_Range_Blocks_Maximum_Volume_Decrease',
|
||||
MaximumVolumeAtHighestValue = 'Maximum_Volume_At_Highest_Value',
|
||||
MessageGainBlocksMaximumVolumeIncrease = 'Message_Gain_Blocks_Maximum_Volume_Increase',
|
||||
MusicVolumeBlocksMaximumVolumeIncrease = 'Music_Volume_Blocks_Maximum_Volume_Increase',
|
||||
MaximumVolumeBlocksMessageGainDecrease = 'Maximum_Volume_Blocks_Message_Gain_Decrease',
|
||||
MessageGainAtHighestValue = 'Message_Gain_At_Highest_Value',
|
||||
MusicVolumeBlocksMessageGain = 'Music_Volume_Blocks_Message_Gain',
|
||||
MaximumMessageGainLowerThanMinimum = 'Maximum_Message_Gain_Lower_Than_Minimum',
|
||||
MaximumMessageGainHigherThanMaximum = 'Maximum_Message_Gain_Higher_Than_Maximum',
|
||||
MaximumMessageGainLowerThanMessageGain = 'Maximum_Message_Gain_Lower_Than_Message_Gain',
|
||||
MinimumVolumeBlocksMusicVolumeDecrease = 'Minimum_Volume_Blocks_Music_Volume_Decrease',
|
||||
MaximumVolumeBlocksMusicVolumeIncrease = 'Maximum_Volume_Blocks_Music_Volume_Increase'
|
||||
}
|
||||
export const ErrorCode = {
|
||||
VolumeRangeAtLowestValue: 'Volume_Range_At_Lowest_Value',
|
||||
MusicVolumeBlocksVolumeRangeDecrease: 'Music_Volume_Blocks_Volume_Range_Decrease',
|
||||
VolumeRangeAtHighestValue: 'Volume_Range_At_Highest_Value',
|
||||
MaximumVolumeBlocksVolumeRangeIncrease: 'Maximum_Volume_Blocks_Volume_Range_Increase',
|
||||
MusicVolumeBlocksMaximumVolumeDecrease: 'Music_Volume_Blocks_Maximum_Volume_Decrease',
|
||||
MaximumVolumeAtLowestValue: 'Maximum_Volume_At_Lowest_Value',
|
||||
VolumeRangeBlocksMaximumVolumeDecrease: 'Volume_Range_Blocks_Maximum_Volume_Decrease',
|
||||
MaximumVolumeAtHighestValue: 'Maximum_Volume_At_Highest_Value',
|
||||
MessageGainBlocksMaximumVolumeIncrease: 'Message_Gain_Blocks_Maximum_Volume_Increase',
|
||||
MusicVolumeBlocksMaximumVolumeIncrease: 'Music_Volume_Blocks_Maximum_Volume_Increase',
|
||||
MaximumVolumeBlocksMessageGainDecrease: 'Maximum_Volume_Blocks_Message_Gain_Decrease',
|
||||
MessageGainAtHighestValue: 'Message_Gain_At_Highest_Value',
|
||||
MusicVolumeBlocksMessageGain: 'Music_Volume_Blocks_Message_Gain',
|
||||
MaximumMessageGainLowerThanMinimum: 'Maximum_Message_Gain_Lower_Than_Minimum',
|
||||
MaximumMessageGainHigherThanMaximum: 'Maximum_Message_Gain_Higher_Than_Maximum',
|
||||
MaximumMessageGainLowerThanMessageGain: 'Maximum_Message_Gain_Lower_Than_Message_Gain',
|
||||
MinimumVolumeBlocksMusicVolumeDecrease: 'Minimum_Volume_Blocks_Music_Volume_Decrease',
|
||||
MaximumVolumeBlocksMusicVolumeIncrease: 'Maximum_Volume_Blocks_Music_Volume_Increase'
|
||||
} as const;
|
||||
|
||||
export type ErrorCode = typeof ErrorCode[keyof typeof ErrorCode];
|
||||
|
||||
|
||||
export function ErrorCodeFromJSON(json: any): ErrorCode {
|
||||
return ErrorCodeFromJSONTyped(json, false);
|
||||
|
@ -57,15 +57,18 @@ export interface Order {
|
||||
complete?: boolean;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum OrderStatusEnum {
|
||||
Placed = 'placed',
|
||||
Approved = 'approved',
|
||||
Delivered = 'delivered'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const OrderStatusEnum = {
|
||||
Placed: 'placed',
|
||||
Approved: 'approved',
|
||||
Delivered: 'delivered'
|
||||
} as const;
|
||||
|
||||
export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum];
|
||||
|
||||
|
||||
export function OrderFromJSON(json: any): Order {
|
||||
return OrderFromJSONTyped(json, false);
|
||||
|
@ -172,15 +172,18 @@ export interface Pet {
|
||||
regions?: Array<Array<number>>;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum PetStatusEnum {
|
||||
Available = 'available',
|
||||
Pending = 'pending',
|
||||
Sold = 'sold'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const PetStatusEnum = {
|
||||
Available: 'available',
|
||||
Pending: 'pending',
|
||||
Sold: 'sold'
|
||||
} as const;
|
||||
|
||||
export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum];
|
||||
|
||||
|
||||
export function PetFromJSON(json: any): Pet {
|
||||
return PetFromJSONTyped(json, false);
|
||||
|
@ -12,16 +12,19 @@
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Type of pet part
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum PetPartType {
|
||||
Curved = 'Curved',
|
||||
Smooth = 'Smooth',
|
||||
Long = 'Long'
|
||||
}
|
||||
export const PetPartType = {
|
||||
Curved: 'Curved',
|
||||
Smooth: 'Smooth',
|
||||
Long: 'Long'
|
||||
} as const;
|
||||
|
||||
export type PetPartType = typeof PetPartType[keyof typeof PetPartType];
|
||||
|
||||
|
||||
export function PetPartTypeFromJSON(json: any): PetPartType {
|
||||
return PetPartTypeFromJSONTyped(json, false);
|
||||
|
@ -64,35 +64,38 @@ export interface ResponseMeta {
|
||||
errors?: Array<Error>;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum ResponseMetaCodeEnum {
|
||||
Ok = 'Ok',
|
||||
GenericException = 'Generic_Exception',
|
||||
FieldErrorException = 'Field_Error_Exception',
|
||||
ImageValidationException = 'Image_Validation_Exception',
|
||||
InvalidContainerCreationWithNoDefaultAssetException = 'Invalid_Container_Creation_With_No_Default_Asset_Exception',
|
||||
InvalidOverrideModeException = 'Invalid_Override_Mode_Exception',
|
||||
InvalidTagException = 'Invalid_Tag_Exception',
|
||||
ItemUseException = 'Item_Use_Exception',
|
||||
MissingPlatformForSoftwareException = 'Missing_Platform_For_Software_Exception',
|
||||
MissingSoftwareForPlatformException = 'Missing_Software_For_Platform_Exception',
|
||||
PlatformNotSupportedException = 'Platform_Not_Supported_Exception',
|
||||
RefreshDataException = 'Refresh_Data_Exception',
|
||||
RoleAssignmentException = 'Role_Assignment_Exception',
|
||||
TaskAlreadyRunningException = 'Task_Already_Running_Exception',
|
||||
LoggedOutException = 'Logged_Out_Exception',
|
||||
AuthorizationException = 'Authorization_Exception',
|
||||
UnauthorizedActionForCurrentUserException = 'Unauthorized_Action_For_Current_User_Exception',
|
||||
UserAlreadyExistsButIsNotAuthenticatedException = 'User_Already_Exists_But_Is_Not_Authenticated_Exception',
|
||||
UserAlreadyHasActiveOrClosedGalaxieApiProductException = 'User_Already_Has_Active_Or_Closed_Galaxie_Api_Product_Exception',
|
||||
UserAlreadyHasMultipleGalaxieApiProductsException = 'User_Already_Has_Multiple_Galaxie_Api_Products_Exception',
|
||||
RecurlyApiException = 'Recurly_Api_Exception',
|
||||
RecurlyTransactionErrorException = 'Recurly_Transaction_Error_Exception',
|
||||
GalaxieApiException = 'Galaxie_Api_Exception'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const ResponseMetaCodeEnum = {
|
||||
Ok: 'Ok',
|
||||
GenericException: 'Generic_Exception',
|
||||
FieldErrorException: 'Field_Error_Exception',
|
||||
ImageValidationException: 'Image_Validation_Exception',
|
||||
InvalidContainerCreationWithNoDefaultAssetException: 'Invalid_Container_Creation_With_No_Default_Asset_Exception',
|
||||
InvalidOverrideModeException: 'Invalid_Override_Mode_Exception',
|
||||
InvalidTagException: 'Invalid_Tag_Exception',
|
||||
ItemUseException: 'Item_Use_Exception',
|
||||
MissingPlatformForSoftwareException: 'Missing_Platform_For_Software_Exception',
|
||||
MissingSoftwareForPlatformException: 'Missing_Software_For_Platform_Exception',
|
||||
PlatformNotSupportedException: 'Platform_Not_Supported_Exception',
|
||||
RefreshDataException: 'Refresh_Data_Exception',
|
||||
RoleAssignmentException: 'Role_Assignment_Exception',
|
||||
TaskAlreadyRunningException: 'Task_Already_Running_Exception',
|
||||
LoggedOutException: 'Logged_Out_Exception',
|
||||
AuthorizationException: 'Authorization_Exception',
|
||||
UnauthorizedActionForCurrentUserException: 'Unauthorized_Action_For_Current_User_Exception',
|
||||
UserAlreadyExistsButIsNotAuthenticatedException: 'User_Already_Exists_But_Is_Not_Authenticated_Exception',
|
||||
UserAlreadyHasActiveOrClosedGalaxieApiProductException: 'User_Already_Has_Active_Or_Closed_Galaxie_Api_Product_Exception',
|
||||
UserAlreadyHasMultipleGalaxieApiProductsException: 'User_Already_Has_Multiple_Galaxie_Api_Products_Exception',
|
||||
RecurlyApiException: 'Recurly_Api_Exception',
|
||||
RecurlyTransactionErrorException: 'Recurly_Transaction_Error_Exception',
|
||||
GalaxieApiException: 'Galaxie_Api_Exception'
|
||||
} as const;
|
||||
|
||||
export type ResponseMetaCodeEnum = typeof ResponseMetaCodeEnum[keyof typeof ResponseMetaCodeEnum];
|
||||
|
||||
|
||||
export function ResponseMetaFromJSON(json: any): ResponseMeta {
|
||||
return ResponseMetaFromJSONTyped(json, false);
|
||||
|
@ -12,16 +12,19 @@
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Warning code returned when a potential problem is detected
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum WarningCode {
|
||||
ReduceVolumeRangeToAvoidLargeSteps = 'Reduce_Volume_Range_To_Avoid_Large_Steps',
|
||||
RaiseAmplifierVolume = 'Raise_Amplifier_Volume',
|
||||
NoVolumeRangeSpecified = 'No_Volume_Range_Specified'
|
||||
}
|
||||
export const WarningCode = {
|
||||
ReduceVolumeRangeToAvoidLargeSteps: 'Reduce_Volume_Range_To_Avoid_Large_Steps',
|
||||
RaiseAmplifierVolume: 'Raise_Amplifier_Volume',
|
||||
NoVolumeRangeSpecified: 'No_Volume_Range_Specified'
|
||||
} as const;
|
||||
|
||||
export type WarningCode = typeof WarningCode[keyof typeof WarningCode];
|
||||
|
||||
|
||||
export function WarningCodeFromJSON(json: any): WarningCode {
|
||||
return WarningCodeFromJSONTyped(json, false);
|
||||
|
@ -415,11 +415,12 @@ export class PetApi extends runtime.BaseAPI {
|
||||
}
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum FindPetsByStatusStatusEnum {
|
||||
Available = 'available',
|
||||
Pending = 'pending',
|
||||
Sold = 'sold'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const FindPetsByStatusStatusEnum = {
|
||||
Available: 'available',
|
||||
Pending: 'pending',
|
||||
Sold: 'sold'
|
||||
} as const;
|
||||
|
||||
export type FindPetsByStatusStatusEnum = typeof FindPetsByStatusStatusEnum[keyof typeof FindPetsByStatusStatusEnum];
|
||||
|
@ -57,15 +57,18 @@ export interface Order {
|
||||
complete?: boolean;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum OrderStatusEnum {
|
||||
Placed = 'placed',
|
||||
Approved = 'approved',
|
||||
Delivered = 'delivered'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const OrderStatusEnum = {
|
||||
Placed: 'placed',
|
||||
Approved: 'approved',
|
||||
Delivered: 'delivered'
|
||||
} as const;
|
||||
|
||||
export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum];
|
||||
|
||||
|
||||
export function OrderFromJSON(json: any): Order {
|
||||
return OrderFromJSONTyped(json, false);
|
||||
|
@ -70,15 +70,18 @@ export interface Pet {
|
||||
status?: PetStatusEnum;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum PetStatusEnum {
|
||||
Available = 'available',
|
||||
Pending = 'pending',
|
||||
Sold = 'sold'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const PetStatusEnum = {
|
||||
Available: 'available',
|
||||
Pending: 'pending',
|
||||
Sold: 'sold'
|
||||
} as const;
|
||||
|
||||
export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum];
|
||||
|
||||
|
||||
export function PetFromJSON(json: any): Pet {
|
||||
return PetFromJSONTyped(json, false);
|
||||
|
@ -553,11 +553,11 @@ export class PetApi extends runtime.BaseAPI implements PetApiInterface {
|
||||
}
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum FindPetsByStatusStatusEnum {
|
||||
Available = 'available',
|
||||
Pending = 'pending',
|
||||
Sold = 'sold'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const FindPetsByStatusStatusEnum = {
|
||||
Available: 'available' as 'available',
|
||||
Pending: 'pending' as 'pending',
|
||||
Sold: 'sold' as 'sold'
|
||||
};
|
||||
export type FindPetsByStatusStatusEnum = typeof FindPetsByStatusStatusEnum[keyof typeof FindPetsByStatusStatusEnum];
|
||||
|
@ -57,15 +57,17 @@ export interface Order {
|
||||
complete?: boolean;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum OrderStatusEnum {
|
||||
Placed = 'placed',
|
||||
Approved = 'approved',
|
||||
Delivered = 'delivered'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const OrderStatusEnum = {
|
||||
Placed: 'placed' as 'placed',
|
||||
Approved: 'approved' as 'approved',
|
||||
Delivered: 'delivered' as 'delivered'
|
||||
};
|
||||
export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum];
|
||||
|
||||
|
||||
export function OrderFromJSON(json: any): Order {
|
||||
return OrderFromJSONTyped(json, false);
|
||||
|
@ -70,15 +70,17 @@ export interface Pet {
|
||||
status?: PetStatusEnum;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum PetStatusEnum {
|
||||
Available = 'available',
|
||||
Pending = 'pending',
|
||||
Sold = 'sold'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const PetStatusEnum = {
|
||||
Available: 'available' as 'available',
|
||||
Pending: 'pending' as 'pending',
|
||||
Sold: 'sold' as 'sold'
|
||||
};
|
||||
export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum];
|
||||
|
||||
|
||||
export function PetFromJSON(json: any): Pet {
|
||||
return PetFromJSONTyped(json, false);
|
||||
|
@ -415,11 +415,11 @@ export class PetApi extends runtime.BaseAPI {
|
||||
}
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum FindPetsByStatusStatusEnum {
|
||||
Available = 'available',
|
||||
Pending = 'pending',
|
||||
Sold = 'sold'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const FindPetsByStatusStatusEnum = {
|
||||
Available: 'available' as 'available',
|
||||
Pending: 'pending' as 'pending',
|
||||
Sold: 'sold' as 'sold'
|
||||
};
|
||||
export type FindPetsByStatusStatusEnum = typeof FindPetsByStatusStatusEnum[keyof typeof FindPetsByStatusStatusEnum];
|
||||
|
@ -57,15 +57,17 @@ export interface Order {
|
||||
complete?: boolean;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum OrderStatusEnum {
|
||||
Placed = 'placed',
|
||||
Approved = 'approved',
|
||||
Delivered = 'delivered'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const OrderStatusEnum = {
|
||||
Placed: 'placed' as 'placed',
|
||||
Approved: 'approved' as 'approved',
|
||||
Delivered: 'delivered' as 'delivered'
|
||||
};
|
||||
export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum];
|
||||
|
||||
|
||||
export function OrderFromJSON(json: any): Order {
|
||||
return OrderFromJSONTyped(json, false);
|
||||
|
@ -70,15 +70,17 @@ export interface Pet {
|
||||
status?: PetStatusEnum;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum PetStatusEnum {
|
||||
Available = 'available',
|
||||
Pending = 'pending',
|
||||
Sold = 'sold'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const PetStatusEnum = {
|
||||
Available: 'available' as 'available',
|
||||
Pending: 'pending' as 'pending',
|
||||
Sold: 'sold' as 'sold'
|
||||
};
|
||||
export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum];
|
||||
|
||||
|
||||
export function PetFromJSON(json: any): Pet {
|
||||
return PetFromJSONTyped(json, false);
|
||||
|
@ -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,10 @@
|
||||
apis/DefaultApi.ts
|
||||
apis/index.ts
|
||||
index.ts
|
||||
models/EnumPatternObject.ts
|
||||
models/InlineObject.ts
|
||||
models/InlineResponse200.ts
|
||||
models/NumberEnum.ts
|
||||
models/StringEnum.ts
|
||||
models/index.ts
|
||||
runtime.ts
|
@ -0,0 +1 @@
|
||||
6.0.0-SNAPSHOT
|
@ -0,0 +1,215 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Enum test
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* 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 {
|
||||
EnumPatternObject,
|
||||
EnumPatternObjectFromJSON,
|
||||
EnumPatternObjectToJSON,
|
||||
InlineObject,
|
||||
InlineObjectFromJSON,
|
||||
InlineObjectToJSON,
|
||||
InlineResponse200,
|
||||
InlineResponse200FromJSON,
|
||||
InlineResponse200ToJSON,
|
||||
NumberEnum,
|
||||
NumberEnumFromJSON,
|
||||
NumberEnumToJSON,
|
||||
StringEnum,
|
||||
StringEnumFromJSON,
|
||||
StringEnumToJSON,
|
||||
} from '../models';
|
||||
|
||||
export interface FakeEnumRequestGetInlineRequest {
|
||||
stringEnum?: FakeEnumRequestGetInlineStringEnumEnum;
|
||||
nullableStringEnum?: string | null;
|
||||
numberEnum?: FakeEnumRequestGetInlineNumberEnumEnum;
|
||||
nullableNumberEnum?: number | null;
|
||||
}
|
||||
|
||||
export interface FakeEnumRequestGetRefRequest {
|
||||
stringEnum?: StringEnum;
|
||||
nullableStringEnum?: StringEnum | null;
|
||||
numberEnum?: NumberEnum;
|
||||
nullableNumberEnum?: NumberEnum | null;
|
||||
}
|
||||
|
||||
export interface FakeEnumRequestPostInlineRequest {
|
||||
inlineObject?: InlineObject;
|
||||
}
|
||||
|
||||
export interface FakeEnumRequestPostRefRequest {
|
||||
enumPatternObject?: EnumPatternObject;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class DefaultApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
*/
|
||||
async fakeEnumRequestGetInlineRaw(requestParameters: FakeEnumRequestGetInlineRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<InlineResponse200>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters.stringEnum !== undefined) {
|
||||
queryParameters['string-enum'] = requestParameters.stringEnum;
|
||||
}
|
||||
|
||||
if (requestParameters.nullableStringEnum !== undefined) {
|
||||
queryParameters['nullable-string-enum'] = requestParameters.nullableStringEnum;
|
||||
}
|
||||
|
||||
if (requestParameters.numberEnum !== undefined) {
|
||||
queryParameters['number-enum'] = requestParameters.numberEnum;
|
||||
}
|
||||
|
||||
if (requestParameters.nullableNumberEnum !== undefined) {
|
||||
queryParameters['nullable-number-enum'] = requestParameters.nullableNumberEnum;
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
const response = await this.request({
|
||||
path: `/fake/enum-request-inline`,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => InlineResponse200FromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async fakeEnumRequestGetInline(requestParameters: FakeEnumRequestGetInlineRequest = {}, initOverrides?: RequestInit): Promise<InlineResponse200> {
|
||||
const response = await this.fakeEnumRequestGetInlineRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async fakeEnumRequestGetRefRaw(requestParameters: FakeEnumRequestGetRefRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<EnumPatternObject>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters.stringEnum !== undefined) {
|
||||
queryParameters['string-enum'] = requestParameters.stringEnum;
|
||||
}
|
||||
|
||||
if (requestParameters.nullableStringEnum !== undefined) {
|
||||
queryParameters['nullable-string-enum'] = requestParameters.nullableStringEnum;
|
||||
}
|
||||
|
||||
if (requestParameters.numberEnum !== undefined) {
|
||||
queryParameters['number-enum'] = requestParameters.numberEnum;
|
||||
}
|
||||
|
||||
if (requestParameters.nullableNumberEnum !== undefined) {
|
||||
queryParameters['nullable-number-enum'] = requestParameters.nullableNumberEnum;
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
const response = await this.request({
|
||||
path: `/fake/enum-request-ref`,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => EnumPatternObjectFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async fakeEnumRequestGetRef(requestParameters: FakeEnumRequestGetRefRequest = {}, initOverrides?: RequestInit): Promise<EnumPatternObject> {
|
||||
const response = await this.fakeEnumRequestGetRefRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async fakeEnumRequestPostInlineRaw(requestParameters: FakeEnumRequestPostInlineRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<InlineObject>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
const response = await this.request({
|
||||
path: `/fake/enum-request-inline`,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: InlineObjectToJSON(requestParameters.inlineObject),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => InlineObjectFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async fakeEnumRequestPostInline(requestParameters: FakeEnumRequestPostInlineRequest = {}, initOverrides?: RequestInit): Promise<InlineObject> {
|
||||
const response = await this.fakeEnumRequestPostInlineRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async fakeEnumRequestPostRefRaw(requestParameters: FakeEnumRequestPostRefRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<EnumPatternObject>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
const response = await this.request({
|
||||
path: `/fake/enum-request-ref`,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: EnumPatternObjectToJSON(requestParameters.enumPatternObject),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => EnumPatternObjectFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async fakeEnumRequestPostRef(requestParameters: FakeEnumRequestPostRefRequest = {}, initOverrides?: RequestInit): Promise<EnumPatternObject> {
|
||||
const response = await this.fakeEnumRequestPostRefRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum FakeEnumRequestGetInlineStringEnumEnum {
|
||||
One = 'one',
|
||||
Two = 'two',
|
||||
Three = 'three'
|
||||
}
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum FakeEnumRequestGetInlineNumberEnumEnum {
|
||||
NUMBER_1 = 1,
|
||||
NUMBER_2 = 2,
|
||||
NUMBER_3 = 3
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export * from './DefaultApi';
|
@ -0,0 +1,5 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export * from './runtime';
|
||||
export * from './apis';
|
||||
export * from './models';
|
@ -0,0 +1,93 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Enum test
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* 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 {
|
||||
NumberEnum,
|
||||
NumberEnumFromJSON,
|
||||
NumberEnumFromJSONTyped,
|
||||
NumberEnumToJSON,
|
||||
} from './NumberEnum';
|
||||
import {
|
||||
StringEnum,
|
||||
StringEnumFromJSON,
|
||||
StringEnumFromJSONTyped,
|
||||
StringEnumToJSON,
|
||||
} from './StringEnum';
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface EnumPatternObject
|
||||
*/
|
||||
export interface EnumPatternObject {
|
||||
/**
|
||||
*
|
||||
* @type {StringEnum}
|
||||
* @memberof EnumPatternObject
|
||||
*/
|
||||
stringEnum?: StringEnum;
|
||||
/**
|
||||
*
|
||||
* @type {StringEnum}
|
||||
* @memberof EnumPatternObject
|
||||
*/
|
||||
nullableStringEnum?: StringEnum | null;
|
||||
/**
|
||||
*
|
||||
* @type {NumberEnum}
|
||||
* @memberof EnumPatternObject
|
||||
*/
|
||||
numberEnum?: NumberEnum;
|
||||
/**
|
||||
*
|
||||
* @type {NumberEnum}
|
||||
* @memberof EnumPatternObject
|
||||
*/
|
||||
nullableNumberEnum?: NumberEnum | null;
|
||||
}
|
||||
|
||||
export function EnumPatternObjectFromJSON(json: any): EnumPatternObject {
|
||||
return EnumPatternObjectFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function EnumPatternObjectFromJSONTyped(json: any, ignoreDiscriminator: boolean): EnumPatternObject {
|
||||
if ((json === undefined) || (json === null)) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'stringEnum': !exists(json, 'string-enum') ? undefined : StringEnumFromJSON(json['string-enum']),
|
||||
'nullableStringEnum': !exists(json, 'nullable-string-enum') ? undefined : StringEnumFromJSON(json['nullable-string-enum']),
|
||||
'numberEnum': !exists(json, 'number-enum') ? undefined : NumberEnumFromJSON(json['number-enum']),
|
||||
'nullableNumberEnum': !exists(json, 'nullable-number-enum') ? undefined : NumberEnumFromJSON(json['nullable-number-enum']),
|
||||
};
|
||||
}
|
||||
|
||||
export function EnumPatternObjectToJSON(value?: EnumPatternObject | null): any {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
|
||||
'string-enum': StringEnumToJSON(value.stringEnum),
|
||||
'nullable-string-enum': StringEnumToJSON(value.nullableStringEnum),
|
||||
'number-enum': NumberEnumToJSON(value.numberEnum),
|
||||
'nullable-number-enum': NumberEnumToJSON(value.nullableNumberEnum),
|
||||
};
|
||||
}
|
||||
|
@ -0,0 +1,100 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Enum test
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* 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 InlineObject
|
||||
*/
|
||||
export interface InlineObject {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof InlineObject
|
||||
*/
|
||||
stringEnum?: InlineObjectStringEnumEnum;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof InlineObject
|
||||
*/
|
||||
nullableStringEnum?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof InlineObject
|
||||
*/
|
||||
numberEnum?: InlineObjectNumberEnumEnum;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof InlineObject
|
||||
*/
|
||||
nullableNumberEnum?: number | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum InlineObjectStringEnumEnum {
|
||||
One = 'one',
|
||||
Two = 'two',
|
||||
Three = 'three'
|
||||
}
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum InlineObjectNumberEnumEnum {
|
||||
NUMBER_1 = 1,
|
||||
NUMBER_2 = 2,
|
||||
NUMBER_3 = 3
|
||||
}
|
||||
|
||||
|
||||
export function InlineObjectFromJSON(json: any): InlineObject {
|
||||
return InlineObjectFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function InlineObjectFromJSONTyped(json: any, ignoreDiscriminator: boolean): InlineObject {
|
||||
if ((json === undefined) || (json === null)) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'stringEnum': !exists(json, 'string-enum') ? undefined : json['string-enum'],
|
||||
'nullableStringEnum': !exists(json, 'nullable-string-enum') ? undefined : json['nullable-string-enum'],
|
||||
'numberEnum': !exists(json, 'number-enum') ? undefined : json['number-enum'],
|
||||
'nullableNumberEnum': !exists(json, 'nullable-number-enum') ? undefined : json['nullable-number-enum'],
|
||||
};
|
||||
}
|
||||
|
||||
export function InlineObjectToJSON(value?: InlineObject | null): any {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
|
||||
'string-enum': value.stringEnum,
|
||||
'nullable-string-enum': value.nullableStringEnum,
|
||||
'number-enum': value.numberEnum,
|
||||
'nullable-number-enum': value.nullableNumberEnum,
|
||||
};
|
||||
}
|
||||
|
@ -0,0 +1,100 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Enum test
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* 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 InlineResponse200
|
||||
*/
|
||||
export interface InlineResponse200 {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof InlineResponse200
|
||||
*/
|
||||
stringEnum?: InlineResponse200StringEnumEnum;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof InlineResponse200
|
||||
*/
|
||||
nullableStringEnum?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof InlineResponse200
|
||||
*/
|
||||
numberEnum?: InlineResponse200NumberEnumEnum;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof InlineResponse200
|
||||
*/
|
||||
nullableNumberEnum?: number | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum InlineResponse200StringEnumEnum {
|
||||
One = 'one',
|
||||
Two = 'two',
|
||||
Three = 'three'
|
||||
}
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum InlineResponse200NumberEnumEnum {
|
||||
NUMBER_1 = 1,
|
||||
NUMBER_2 = 2,
|
||||
NUMBER_3 = 3
|
||||
}
|
||||
|
||||
|
||||
export function InlineResponse200FromJSON(json: any): InlineResponse200 {
|
||||
return InlineResponse200FromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function InlineResponse200FromJSONTyped(json: any, ignoreDiscriminator: boolean): InlineResponse200 {
|
||||
if ((json === undefined) || (json === null)) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'stringEnum': !exists(json, 'string-enum') ? undefined : json['string-enum'],
|
||||
'nullableStringEnum': !exists(json, 'nullable-string-enum') ? undefined : json['nullable-string-enum'],
|
||||
'numberEnum': !exists(json, 'number-enum') ? undefined : json['number-enum'],
|
||||
'nullableNumberEnum': !exists(json, 'nullable-number-enum') ? undefined : json['nullable-number-enum'],
|
||||
};
|
||||
}
|
||||
|
||||
export function InlineResponse200ToJSON(value?: InlineResponse200 | null): any {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
|
||||
'string-enum': value.stringEnum,
|
||||
'nullable-string-enum': value.nullableStringEnum,
|
||||
'number-enum': value.numberEnum,
|
||||
'nullable-number-enum': value.nullableNumberEnum,
|
||||
};
|
||||
}
|
||||
|
@ -0,0 +1,38 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Enum test
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* 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
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum NumberEnum {
|
||||
NUMBER_1 = 1,
|
||||
NUMBER_2 = 2,
|
||||
NUMBER_3 = 3
|
||||
}
|
||||
|
||||
|
||||
export function NumberEnumFromJSON(json: any): NumberEnum {
|
||||
return NumberEnumFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function NumberEnumFromJSONTyped(json: any, ignoreDiscriminator: boolean): NumberEnum {
|
||||
return json as NumberEnum;
|
||||
}
|
||||
|
||||
export function NumberEnumToJSON(value?: NumberEnum | null): any {
|
||||
return value as any;
|
||||
}
|
||||
|
@ -0,0 +1,38 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Enum test
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* 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
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum StringEnum {
|
||||
One = 'one',
|
||||
Two = 'two',
|
||||
Three = 'three'
|
||||
}
|
||||
|
||||
|
||||
export function StringEnumFromJSON(json: any): StringEnum {
|
||||
return StringEnumFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function StringEnumFromJSONTyped(json: any, ignoreDiscriminator: boolean): StringEnum {
|
||||
return json as StringEnum;
|
||||
}
|
||||
|
||||
export function StringEnumToJSON(value?: StringEnum | null): any {
|
||||
return value as any;
|
||||
}
|
||||
|
@ -0,0 +1,7 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export * from './EnumPatternObject';
|
||||
export * from './InlineObject';
|
||||
export * from './InlineResponse200';
|
||||
export * from './NumberEnum';
|
||||
export * from './StringEnum';
|
@ -0,0 +1,322 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Enum test
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* 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://localhost:3000".replace(/\/+$/, "");
|
||||
|
||||
const isBlob = (value: any) => typeof Blob !== 'undefined' && value instanceof Blob;
|
||||
|
||||
/**
|
||||
* This is the base class for all generated API classes.
|
||||
*/
|
||||
export class BaseAPI {
|
||||
|
||||
private middleware: Middleware[];
|
||||
|
||||
constructor(protected configuration = new Configuration()) {
|
||||
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);
|
||||
}
|
||||
|
||||
protected async request(context: RequestOpts, initOverrides?: RequestInit): Promise<Response> {
|
||||
const { url, init } = this.createFetchParams(context, initOverrides);
|
||||
const response = await this.fetchApi(url, init);
|
||||
if (response.status >= 200 && response.status < 300) {
|
||||
return response;
|
||||
}
|
||||
throw response;
|
||||
}
|
||||
|
||||
private createFetchParams(context: RequestOpts, initOverrides?: RequestInit) {
|
||||
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 body = ((typeof FormData !== "undefined" && context.body instanceof FormData) || context.body instanceof URLSearchParams || isBlob(context.body))
|
||||
? context.body
|
||||
: JSON.stringify(context.body);
|
||||
|
||||
const headers = Object.assign({}, this.configuration.headers, context.headers);
|
||||
Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {});
|
||||
|
||||
const init = {
|
||||
method: context.method,
|
||||
headers: headers,
|
||||
body,
|
||||
credentials: this.configuration.credentials,
|
||||
...initOverrides
|
||||
};
|
||||
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 = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
|
||||
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;
|
||||
}
|
||||
};
|
||||
|
||||
export class RequiredError extends Error {
|
||||
name: "RequiredError" = "RequiredError";
|
||||
constructor(public field: string, msg?: string) {
|
||||
super(msg);
|
||||
}
|
||||
}
|
||||
|
||||
export const COLLECTION_FORMATS = {
|
||||
csv: ",",
|
||||
ssv: " ",
|
||||
tsv: "\t",
|
||||
pipes: "|",
|
||||
};
|
||||
|
||||
export type FetchAPI = GlobalFetch['fetch'];
|
||||
|
||||
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 = {}) {}
|
||||
|
||||
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 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> | HTTPQuery };
|
||||
export type HTTPBody = Json | FormData | URLSearchParams;
|
||||
export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original';
|
||||
|
||||
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) => {
|
||||
const fullKey = prefix + (prefix.length ? `[${key}]` : key);
|
||||
const value = params[key];
|
||||
if (value instanceof Array) {
|
||||
const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue)))
|
||||
.join(`&${encodeURIComponent(fullKey)}=`);
|
||||
return `${encodeURIComponent(fullKey)}=${multiValue}`;
|
||||
}
|
||||
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))}`;
|
||||
})
|
||||
.filter(part => part.length > 0)
|
||||
.join('&');
|
||||
}
|
||||
|
||||
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 Middleware {
|
||||
pre?(context: RequestContext): Promise<FetchParams | void>;
|
||||
post?(context: ResponseContext): 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();
|
||||
};
|
||||
}
|
@ -411,11 +411,11 @@ export class PetApi extends runtime.BaseAPI {
|
||||
}
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum FindPetsByStatusStatusEnum {
|
||||
Available = 'available',
|
||||
Pending = 'pending',
|
||||
Sold = 'sold'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const FindPetsByStatusStatusEnum = {
|
||||
Available: 'available' as 'available',
|
||||
Pending: 'pending' as 'pending',
|
||||
Sold: 'sold' as 'sold'
|
||||
};
|
||||
export type FindPetsByStatusStatusEnum = typeof FindPetsByStatusStatusEnum[keyof typeof FindPetsByStatusStatusEnum];
|
||||
|
@ -88,15 +88,17 @@ export interface Order {
|
||||
complete?: boolean;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum OrderStatusEnum {
|
||||
Placed = 'placed',
|
||||
Approved = 'approved',
|
||||
Delivered = 'delivered'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const OrderStatusEnum = {
|
||||
Placed: 'placed' as 'placed',
|
||||
Approved: 'approved' as 'approved',
|
||||
Delivered: 'delivered' as 'delivered'
|
||||
};
|
||||
export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum];
|
||||
|
||||
/**
|
||||
* A pet for sale in the pet store
|
||||
* @export
|
||||
@ -141,15 +143,17 @@ export interface Pet {
|
||||
status?: PetStatusEnum;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
* @enum {string}
|
||||
*/
|
||||
export enum PetStatusEnum {
|
||||
Available = 'available',
|
||||
Pending = 'pending',
|
||||
Sold = 'sold'
|
||||
}
|
||||
* @export
|
||||
*/
|
||||
export const PetStatusEnum = {
|
||||
Available: 'available' as 'available',
|
||||
Pending: 'pending' as 'pending',
|
||||
Sold: 'sold' as 'sold'
|
||||
};
|
||||
export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum];
|
||||
|
||||
/**
|
||||
* A tag for a pet
|
||||
* @export
|
||||
|
Loading…
x
Reference in New Issue
Block a user