1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

refactor: improve OpenAPI refs (#1005)

* refactor: regenerate OpenAPI client

* refactor: update usage of OpenAPI client
This commit is contained in:
olav 2022-05-24 08:37:46 +02:00 committed by GitHub
parent a0261daac6
commit b742a69c4c
33 changed files with 1860 additions and 773 deletions

View File

@ -93,7 +93,7 @@ export const FeatureToggleListItem = memo<IFeatureToggleListItemProps>(
condition={!isArchive}
show={
<Link
to={getTogglePath(feature.project, name)}
to={getTogglePath(feature.project!, name)}
className={classnames(
themeStyles.listLink,
themeStyles.truncate

View File

@ -18,13 +18,13 @@ const RedirectFeatureView = () => {
setFeatureToggle(toggle);
}, [features, featureId]);
if (!featureToggle) {
if (!featureToggle?.project) {
return null;
}
return (
<Navigate
to={getTogglePath(featureToggle?.project, featureToggle?.name)}
to={getTogglePath(featureToggle.project, featureToggle.name)}
replace
/>
);

View File

@ -41,7 +41,7 @@ const useFeatureApi = () => {
projectId: string,
createFeatureSchema: CreateFeatureSchema
) => {
return openApiAdmin.apiAdminProjectsProjectIdFeaturesPost({
return openApiAdmin.createFeature({
projectId,
createFeatureSchema,
});

View File

@ -12,7 +12,7 @@ export interface IUseFeaturesOutput {
export const useFeatures = (): IUseFeaturesOutput => {
const { data, refetch, loading, error } = useApiGetter(
'apiAdminFeaturesGet',
() => openApiAdmin.apiAdminFeaturesGet()
() => openApiAdmin.getAllToggles()
);
return {

View File

@ -1,8 +1,12 @@
import { renderHook, act } from '@testing-library/react-hooks';
import { useFeaturesFilter } from 'hooks/useFeaturesFilter';
import { FeatureSchema, FeatureSchemaStrategies } from 'openapi';
import {
FeatureSchema,
StrategySchema,
ConstraintSchema,
ConstraintSchemaOperatorEnum,
} from 'openapi';
import parseISO from 'date-fns/parseISO';
import { IConstraint } from 'interfaces/strategy';
test('useFeaturesFilter empty', () => {
const { result } = renderHook(() => useFeaturesFilter([]));
@ -108,8 +112,8 @@ const mockFeatureToggle = (
};
const mockFeatureStrategy = (
overrides?: Partial<FeatureSchemaStrategies>
): FeatureSchemaStrategies => {
overrides?: Partial<StrategySchema>
): StrategySchema => {
return {
id: '1',
name: '1',
@ -119,10 +123,12 @@ const mockFeatureStrategy = (
};
};
const mockConstraint = (overrides?: Partial<IConstraint>): IConstraint => {
const mockConstraint = (
overrides?: Partial<ConstraintSchema>
): ConstraintSchema => {
return {
contextName: '',
operator: 'IN',
operator: ConstraintSchemaOperatorEnum.In,
...overrides,
};
};

View File

@ -104,7 +104,7 @@ const filterFeatureByRegExp = (
return feature.strategies.some(
strategy =>
regExp.test(strategy.name) ||
strategy.constraints.some(constraint =>
strategy.constraints?.some(constraint =>
constraint.values?.some(value => regExp.test(value))
)
);

View File

@ -156,7 +156,15 @@ const sortByName = (features: Readonly<FeatureSchema[]>): FeatureSchema[] => {
const sortByProject = (
features: Readonly<FeatureSchema[]>
): FeatureSchema[] => {
return [...features].sort((a, b) => a.project.localeCompare(b.project));
return [...features].sort((a, b) =>
a.project && b.project
? a.project.localeCompare(b.project)
: a.project
? 1
: b.project
? -1
: 0
);
};
const sortByType = (features: Readonly<FeatureSchema[]>): FeatureSchema[] => {

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.10.0
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -0,0 +1,64 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* 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 CloneFeatureSchema
*/
export interface CloneFeatureSchema {
/**
*
* @type {string}
* @memberof CloneFeatureSchema
*/
name: string;
/**
*
* @type {boolean}
* @memberof CloneFeatureSchema
*/
replaceGroupId?: boolean;
}
export function CloneFeatureSchemaFromJSON(json: any): CloneFeatureSchema {
return CloneFeatureSchemaFromJSONTyped(json, false);
}
export function CloneFeatureSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): CloneFeatureSchema {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'name': json['name'],
'replaceGroupId': !exists(json, 'replaceGroupId') ? undefined : json['replaceGroupId'],
};
}
export function CloneFeatureSchemaToJSON(value?: CloneFeatureSchema | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'name': value.name,
'replaceGroupId': value.replaceGroupId,
};
}

View File

@ -4,7 +4,7 @@
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.10.0
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@ -30,7 +30,7 @@ export interface ConstraintSchema {
* @type {string}
* @memberof ConstraintSchema
*/
operator: string;
operator: ConstraintSchemaOperatorEnum;
/**
*
* @type {boolean}
@ -57,6 +57,28 @@ export interface ConstraintSchema {
value?: string;
}
/**
* @export
* @enum {string}
*/
export enum ConstraintSchemaOperatorEnum {
NotIn = 'NOT_IN',
In = 'IN',
StrEndsWith = 'STR_ENDS_WITH',
StrStartsWith = 'STR_STARTS_WITH',
StrContains = 'STR_CONTAINS',
NumEq = 'NUM_EQ',
NumGt = 'NUM_GT',
NumGte = 'NUM_GTE',
NumLt = 'NUM_LT',
NumLte = 'NUM_LTE',
DateAfter = 'DATE_AFTER',
DateBefore = 'DATE_BEFORE',
SemverEq = 'SEMVER_EQ',
SemverGt = 'SEMVER_GT',
SemverLt = 'SEMVER_LT'
}
export function ConstraintSchemaFromJSON(json: any): ConstraintSchema {
return ConstraintSchemaFromJSONTyped(json, false);
}

View File

@ -4,7 +4,7 @@
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.10.0
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -4,7 +4,7 @@
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.10.0
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@ -14,11 +14,11 @@
import { exists, mapValues } from '../runtime';
import {
CreateStrategySchemaConstraints,
CreateStrategySchemaConstraintsFromJSON,
CreateStrategySchemaConstraintsFromJSONTyped,
CreateStrategySchemaConstraintsToJSON,
} from './CreateStrategySchemaConstraints';
ConstraintSchema,
ConstraintSchemaFromJSON,
ConstraintSchemaFromJSONTyped,
ConstraintSchemaToJSON,
} from './ConstraintSchema';
/**
*
@ -31,7 +31,7 @@ export interface CreateStrategySchema {
* @type {string}
* @memberof CreateStrategySchema
*/
name?: string;
name: string;
/**
*
* @type {number}
@ -40,10 +40,10 @@ export interface CreateStrategySchema {
sortOrder?: number;
/**
*
* @type {Array<CreateStrategySchemaConstraints>}
* @type {Array<ConstraintSchema>}
* @memberof CreateStrategySchema
*/
constraints?: Array<CreateStrategySchemaConstraints>;
constraints?: Array<ConstraintSchema>;
/**
*
* @type {{ [key: string]: string; }}
@ -62,9 +62,9 @@ export function CreateStrategySchemaFromJSONTyped(json: any, ignoreDiscriminator
}
return {
'name': !exists(json, 'name') ? undefined : json['name'],
'name': json['name'],
'sortOrder': !exists(json, 'sortOrder') ? undefined : json['sortOrder'],
'constraints': !exists(json, 'constraints') ? undefined : ((json['constraints'] as Array<any>).map(CreateStrategySchemaConstraintsFromJSON)),
'constraints': !exists(json, 'constraints') ? undefined : ((json['constraints'] as Array<any>).map(ConstraintSchemaFromJSON)),
'parameters': !exists(json, 'parameters') ? undefined : json['parameters'],
};
}
@ -80,7 +80,7 @@ export function CreateStrategySchemaToJSON(value?: CreateStrategySchema | null):
'name': value.name,
'sortOrder': value.sortOrder,
'constraints': value.constraints === undefined ? undefined : ((value.constraints as Array<any>).map(CreateStrategySchemaConstraintsToJSON)),
'constraints': value.constraints === undefined ? undefined : ((value.constraints as Array<any>).map(ConstraintSchemaToJSON)),
'parameters': value.parameters,
};
}

View File

@ -1,96 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.10.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 CreateStrategySchemaConstraints
*/
export interface CreateStrategySchemaConstraints {
/**
*
* @type {string}
* @memberof CreateStrategySchemaConstraints
*/
contextName: string;
/**
*
* @type {string}
* @memberof CreateStrategySchemaConstraints
*/
operator: string;
/**
*
* @type {boolean}
* @memberof CreateStrategySchemaConstraints
*/
caseInsensitive?: boolean;
/**
*
* @type {boolean}
* @memberof CreateStrategySchemaConstraints
*/
inverted?: boolean;
/**
*
* @type {Array<string>}
* @memberof CreateStrategySchemaConstraints
*/
values?: Array<string>;
/**
*
* @type {string}
* @memberof CreateStrategySchemaConstraints
*/
value?: string;
}
export function CreateStrategySchemaConstraintsFromJSON(json: any): CreateStrategySchemaConstraints {
return CreateStrategySchemaConstraintsFromJSONTyped(json, false);
}
export function CreateStrategySchemaConstraintsFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateStrategySchemaConstraints {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'contextName': json['contextName'],
'operator': json['operator'],
'caseInsensitive': !exists(json, 'caseInsensitive') ? undefined : json['caseInsensitive'],
'inverted': !exists(json, 'inverted') ? undefined : json['inverted'],
'values': !exists(json, 'values') ? undefined : json['values'],
'value': !exists(json, 'value') ? undefined : json['value'],
};
}
export function CreateStrategySchemaConstraintsToJSON(value?: CreateStrategySchemaConstraints | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'contextName': value.contextName,
'operator': value.operator,
'caseInsensitive': value.caseInsensitive,
'inverted': value.inverted,
'values': value.values,
'value': value.value,
};
}

View File

@ -0,0 +1,95 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* 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 {
FeatureStrategySchema,
FeatureStrategySchemaFromJSON,
FeatureStrategySchemaFromJSONTyped,
FeatureStrategySchemaToJSON,
} from './FeatureStrategySchema';
/**
*
* @export
* @interface FeatureEnvironmentSchema
*/
export interface FeatureEnvironmentSchema {
/**
*
* @type {string}
* @memberof FeatureEnvironmentSchema
*/
name: string;
/**
*
* @type {string}
* @memberof FeatureEnvironmentSchema
*/
environment?: string;
/**
*
* @type {string}
* @memberof FeatureEnvironmentSchema
*/
type?: string;
/**
*
* @type {boolean}
* @memberof FeatureEnvironmentSchema
*/
enabled: boolean;
/**
*
* @type {Array<FeatureStrategySchema>}
* @memberof FeatureEnvironmentSchema
*/
strategies?: Array<FeatureStrategySchema>;
}
export function FeatureEnvironmentSchemaFromJSON(json: any): FeatureEnvironmentSchema {
return FeatureEnvironmentSchemaFromJSONTyped(json, false);
}
export function FeatureEnvironmentSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): FeatureEnvironmentSchema {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'name': json['name'],
'environment': !exists(json, 'environment') ? undefined : json['environment'],
'type': !exists(json, 'type') ? undefined : json['type'],
'enabled': json['enabled'],
'strategies': !exists(json, 'strategies') ? undefined : ((json['strategies'] as Array<any>).map(FeatureStrategySchemaFromJSON)),
};
}
export function FeatureEnvironmentSchemaToJSON(value?: FeatureEnvironmentSchema | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'name': value.name,
'environment': value.environment,
'type': value.type,
'enabled': value.enabled,
'strategies': value.strategies === undefined ? undefined : ((value.strategies as Array<any>).map(FeatureStrategySchemaToJSON)),
};
}

View File

@ -4,7 +4,7 @@
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.10.0
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@ -14,17 +14,23 @@
import { exists, mapValues } from '../runtime';
import {
FeatureSchemaStrategies,
FeatureSchemaStrategiesFromJSON,
FeatureSchemaStrategiesFromJSONTyped,
FeatureSchemaStrategiesToJSON,
} from './FeatureSchemaStrategies';
FeatureEnvironmentSchema,
FeatureEnvironmentSchemaFromJSON,
FeatureEnvironmentSchemaFromJSONTyped,
FeatureEnvironmentSchemaToJSON,
} from './FeatureEnvironmentSchema';
import {
FeatureSchemaVariants,
FeatureSchemaVariantsFromJSON,
FeatureSchemaVariantsFromJSONTyped,
FeatureSchemaVariantsToJSON,
} from './FeatureSchemaVariants';
StrategySchema,
StrategySchemaFromJSON,
StrategySchemaFromJSONTyped,
StrategySchemaToJSON,
} from './StrategySchema';
import {
VariantSchema,
VariantSchemaFromJSON,
VariantSchemaFromJSONTyped,
VariantSchemaToJSON,
} from './VariantSchema';
/**
*
@ -50,12 +56,18 @@ export interface FeatureSchema {
* @memberof FeatureSchema
*/
description?: string;
/**
*
* @type {boolean}
* @memberof FeatureSchema
*/
archived?: boolean;
/**
*
* @type {string}
* @memberof FeatureSchema
*/
project: string;
project?: string;
/**
*
* @type {boolean}
@ -88,16 +100,22 @@ export interface FeatureSchema {
lastSeenAt?: Date | null;
/**
*
* @type {Array<FeatureSchemaStrategies>}
* @type {Array<FeatureEnvironmentSchema>}
* @memberof FeatureSchema
*/
strategies?: Array<FeatureSchemaStrategies>;
environments?: Array<FeatureEnvironmentSchema>;
/**
*
* @type {Array<FeatureSchemaVariants>}
* @type {Array<StrategySchema>}
* @memberof FeatureSchema
*/
variants?: Array<FeatureSchemaVariants>;
strategies?: Array<StrategySchema>;
/**
*
* @type {Array<VariantSchema>}
* @memberof FeatureSchema
*/
variants?: Array<VariantSchema>;
}
export function FeatureSchemaFromJSON(json: any): FeatureSchema {
@ -113,14 +131,16 @@ export function FeatureSchemaFromJSONTyped(json: any, ignoreDiscriminator: boole
'name': json['name'],
'type': !exists(json, 'type') ? undefined : json['type'],
'description': !exists(json, 'description') ? undefined : json['description'],
'project': json['project'],
'archived': !exists(json, 'archived') ? undefined : json['archived'],
'project': !exists(json, 'project') ? undefined : json['project'],
'enabled': !exists(json, 'enabled') ? undefined : json['enabled'],
'stale': !exists(json, 'stale') ? undefined : json['stale'],
'impressionData': !exists(json, 'impressionData') ? undefined : json['impressionData'],
'createdAt': !exists(json, 'createdAt') ? undefined : (json['createdAt'] === null ? null : new Date(json['createdAt'])),
'lastSeenAt': !exists(json, 'lastSeenAt') ? undefined : (json['lastSeenAt'] === null ? null : new Date(json['lastSeenAt'])),
'strategies': !exists(json, 'strategies') ? undefined : ((json['strategies'] as Array<any>).map(FeatureSchemaStrategiesFromJSON)),
'variants': !exists(json, 'variants') ? undefined : ((json['variants'] as Array<any>).map(FeatureSchemaVariantsFromJSON)),
'environments': !exists(json, 'environments') ? undefined : ((json['environments'] as Array<any>).map(FeatureEnvironmentSchemaFromJSON)),
'strategies': !exists(json, 'strategies') ? undefined : ((json['strategies'] as Array<any>).map(StrategySchemaFromJSON)),
'variants': !exists(json, 'variants') ? undefined : ((json['variants'] as Array<any>).map(VariantSchemaFromJSON)),
};
}
@ -136,14 +156,16 @@ export function FeatureSchemaToJSON(value?: FeatureSchema | null): any {
'name': value.name,
'type': value.type,
'description': value.description,
'archived': value.archived,
'project': value.project,
'enabled': value.enabled,
'stale': value.stale,
'impressionData': value.impressionData,
'createdAt': value.createdAt === undefined ? undefined : (value.createdAt === null ? null : value.createdAt.toISOString().substr(0,10)),
'lastSeenAt': value.lastSeenAt === undefined ? undefined : (value.lastSeenAt === null ? null : value.lastSeenAt.toISOString().substr(0,10)),
'strategies': value.strategies === undefined ? undefined : ((value.strategies as Array<any>).map(FeatureSchemaStrategiesToJSON)),
'variants': value.variants === undefined ? undefined : ((value.variants as Array<any>).map(FeatureSchemaVariantsToJSON)),
'environments': value.environments === undefined ? undefined : ((value.environments as Array<any>).map(FeatureEnvironmentSchemaToJSON)),
'strategies': value.strategies === undefined ? undefined : ((value.strategies as Array<any>).map(StrategySchemaToJSON)),
'variants': value.variants === undefined ? undefined : ((value.variants as Array<any>).map(VariantSchemaToJSON)),
};
}

View File

@ -1,64 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.10.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 FeatureSchemaOverrides
*/
export interface FeatureSchemaOverrides {
/**
*
* @type {string}
* @memberof FeatureSchemaOverrides
*/
contextName: string;
/**
*
* @type {Array<string>}
* @memberof FeatureSchemaOverrides
*/
values: Array<string>;
}
export function FeatureSchemaOverridesFromJSON(json: any): FeatureSchemaOverrides {
return FeatureSchemaOverridesFromJSONTyped(json, false);
}
export function FeatureSchemaOverridesFromJSONTyped(json: any, ignoreDiscriminator: boolean): FeatureSchemaOverrides {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'contextName': json['contextName'],
'values': json['values'],
};
}
export function FeatureSchemaOverridesToJSON(value?: FeatureSchemaOverrides | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'contextName': value.contextName,
'values': value.values,
};
}

View File

@ -1,87 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.10.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 {
CreateStrategySchemaConstraints,
CreateStrategySchemaConstraintsFromJSON,
CreateStrategySchemaConstraintsFromJSONTyped,
CreateStrategySchemaConstraintsToJSON,
} from './CreateStrategySchemaConstraints';
/**
*
* @export
* @interface FeatureSchemaStrategies
*/
export interface FeatureSchemaStrategies {
/**
*
* @type {string}
* @memberof FeatureSchemaStrategies
*/
id: string;
/**
*
* @type {string}
* @memberof FeatureSchemaStrategies
*/
name: string;
/**
*
* @type {Array<CreateStrategySchemaConstraints>}
* @memberof FeatureSchemaStrategies
*/
constraints: Array<CreateStrategySchemaConstraints>;
/**
*
* @type {{ [key: string]: string; }}
* @memberof FeatureSchemaStrategies
*/
parameters: { [key: string]: string; };
}
export function FeatureSchemaStrategiesFromJSON(json: any): FeatureSchemaStrategies {
return FeatureSchemaStrategiesFromJSONTyped(json, false);
}
export function FeatureSchemaStrategiesFromJSONTyped(json: any, ignoreDiscriminator: boolean): FeatureSchemaStrategies {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': json['id'],
'name': json['name'],
'constraints': ((json['constraints'] as Array<any>).map(CreateStrategySchemaConstraintsFromJSON)),
'parameters': json['parameters'],
};
}
export function FeatureSchemaStrategiesToJSON(value?: FeatureSchemaStrategies | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'id': value.id,
'name': value.name,
'constraints': ((value.constraints as Array<any>).map(CreateStrategySchemaConstraintsToJSON)),
'parameters': value.parameters,
};
}

View File

@ -1,103 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.10.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 {
FeatureSchemaOverrides,
FeatureSchemaOverridesFromJSON,
FeatureSchemaOverridesFromJSONTyped,
FeatureSchemaOverridesToJSON,
} from './FeatureSchemaOverrides';
/**
*
* @export
* @interface FeatureSchemaVariants
*/
export interface FeatureSchemaVariants {
/**
*
* @type {string}
* @memberof FeatureSchemaVariants
*/
name: string;
/**
*
* @type {number}
* @memberof FeatureSchemaVariants
*/
weight: number;
/**
*
* @type {string}
* @memberof FeatureSchemaVariants
*/
weightType: string;
/**
*
* @type {string}
* @memberof FeatureSchemaVariants
*/
stickiness: string;
/**
*
* @type {object}
* @memberof FeatureSchemaVariants
*/
payload?: object;
/**
*
* @type {Array<FeatureSchemaOverrides>}
* @memberof FeatureSchemaVariants
*/
overrides?: Array<FeatureSchemaOverrides>;
}
export function FeatureSchemaVariantsFromJSON(json: any): FeatureSchemaVariants {
return FeatureSchemaVariantsFromJSONTyped(json, false);
}
export function FeatureSchemaVariantsFromJSONTyped(json: any, ignoreDiscriminator: boolean): FeatureSchemaVariants {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'name': json['name'],
'weight': json['weight'],
'weightType': json['weightType'],
'stickiness': json['stickiness'],
'payload': !exists(json, 'payload') ? undefined : json['payload'],
'overrides': !exists(json, 'overrides') ? undefined : ((json['overrides'] as Array<any>).map(FeatureSchemaOverridesFromJSON)),
};
}
export function FeatureSchemaVariantsToJSON(value?: FeatureSchemaVariants | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'name': value.name,
'weight': value.weight,
'weightType': value.weightType,
'stickiness': value.stickiness,
'payload': value.payload,
'overrides': value.overrides === undefined ? undefined : ((value.overrides as Array<any>).map(FeatureSchemaOverridesToJSON)),
};
}

View File

@ -0,0 +1,135 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* 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 {
ConstraintSchema,
ConstraintSchemaFromJSON,
ConstraintSchemaFromJSONTyped,
ConstraintSchemaToJSON,
} from './ConstraintSchema';
/**
*
* @export
* @interface FeatureStrategySchema
*/
export interface FeatureStrategySchema {
/**
*
* @type {string}
* @memberof FeatureStrategySchema
*/
id: string;
/**
*
* @type {string}
* @memberof FeatureStrategySchema
*/
name?: string;
/**
*
* @type {Date}
* @memberof FeatureStrategySchema
*/
createdAt?: Date | null;
/**
*
* @type {string}
* @memberof FeatureStrategySchema
*/
featureName: string;
/**
*
* @type {string}
* @memberof FeatureStrategySchema
*/
projectId?: string;
/**
*
* @type {string}
* @memberof FeatureStrategySchema
*/
environment: string;
/**
*
* @type {string}
* @memberof FeatureStrategySchema
*/
strategyName: string;
/**
*
* @type {number}
* @memberof FeatureStrategySchema
*/
sortOrder?: number;
/**
*
* @type {Array<ConstraintSchema>}
* @memberof FeatureStrategySchema
*/
constraints: Array<ConstraintSchema>;
/**
*
* @type {{ [key: string]: string; }}
* @memberof FeatureStrategySchema
*/
parameters: { [key: string]: string; };
}
export function FeatureStrategySchemaFromJSON(json: any): FeatureStrategySchema {
return FeatureStrategySchemaFromJSONTyped(json, false);
}
export function FeatureStrategySchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): FeatureStrategySchema {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': json['id'],
'name': !exists(json, 'name') ? undefined : json['name'],
'createdAt': !exists(json, 'createdAt') ? undefined : (json['createdAt'] === null ? null : new Date(json['createdAt'])),
'featureName': json['featureName'],
'projectId': !exists(json, 'projectId') ? undefined : json['projectId'],
'environment': json['environment'],
'strategyName': json['strategyName'],
'sortOrder': !exists(json, 'sortOrder') ? undefined : json['sortOrder'],
'constraints': ((json['constraints'] as Array<any>).map(ConstraintSchemaFromJSON)),
'parameters': json['parameters'],
};
}
export function FeatureStrategySchemaToJSON(value?: FeatureStrategySchema | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'id': value.id,
'name': value.name,
'createdAt': value.createdAt === undefined ? undefined : (value.createdAt === null ? null : value.createdAt.toISOString().substr(0,10)),
'featureName': value.featureName,
'projectId': value.projectId,
'environment': value.environment,
'strategyName': value.strategyName,
'sortOrder': value.sortOrder,
'constraints': ((value.constraints as Array<any>).map(ConstraintSchemaToJSON)),
'parameters': value.parameters,
};
}

View File

@ -4,7 +4,7 @@
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.10.0
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@ -14,11 +14,11 @@
import { exists, mapValues } from '../runtime';
import {
FeaturesSchemaFeatures,
FeaturesSchemaFeaturesFromJSON,
FeaturesSchemaFeaturesFromJSONTyped,
FeaturesSchemaFeaturesToJSON,
} from './FeaturesSchemaFeatures';
FeatureSchema,
FeatureSchemaFromJSON,
FeatureSchemaFromJSONTyped,
FeatureSchemaToJSON,
} from './FeatureSchema';
/**
*
@ -34,10 +34,10 @@ export interface FeaturesSchema {
version: number;
/**
*
* @type {Array<FeaturesSchemaFeatures>}
* @type {Array<FeatureSchema>}
* @memberof FeaturesSchema
*/
features: Array<FeaturesSchemaFeatures>;
features: Array<FeatureSchema>;
}
export function FeaturesSchemaFromJSON(json: any): FeaturesSchema {
@ -51,7 +51,7 @@ export function FeaturesSchemaFromJSONTyped(json: any, ignoreDiscriminator: bool
return {
'version': json['version'],
'features': ((json['features'] as Array<any>).map(FeaturesSchemaFeaturesFromJSON)),
'features': ((json['features'] as Array<any>).map(FeatureSchemaFromJSON)),
};
}
@ -65,7 +65,7 @@ export function FeaturesSchemaToJSON(value?: FeaturesSchema | null): any {
return {
'version': value.version,
'features': ((value.features as Array<any>).map(FeaturesSchemaFeaturesToJSON)),
'features': ((value.features as Array<any>).map(FeatureSchemaToJSON)),
};
}

View File

@ -1,149 +0,0 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.10.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 {
FeatureSchemaStrategies,
FeatureSchemaStrategiesFromJSON,
FeatureSchemaStrategiesFromJSONTyped,
FeatureSchemaStrategiesToJSON,
} from './FeatureSchemaStrategies';
import {
FeatureSchemaVariants,
FeatureSchemaVariantsFromJSON,
FeatureSchemaVariantsFromJSONTyped,
FeatureSchemaVariantsToJSON,
} from './FeatureSchemaVariants';
/**
*
* @export
* @interface FeaturesSchemaFeatures
*/
export interface FeaturesSchemaFeatures {
/**
*
* @type {string}
* @memberof FeaturesSchemaFeatures
*/
name: string;
/**
*
* @type {string}
* @memberof FeaturesSchemaFeatures
*/
type?: string;
/**
*
* @type {string}
* @memberof FeaturesSchemaFeatures
*/
description?: string;
/**
*
* @type {string}
* @memberof FeaturesSchemaFeatures
*/
project: string;
/**
*
* @type {boolean}
* @memberof FeaturesSchemaFeatures
*/
enabled?: boolean;
/**
*
* @type {boolean}
* @memberof FeaturesSchemaFeatures
*/
stale?: boolean;
/**
*
* @type {boolean}
* @memberof FeaturesSchemaFeatures
*/
impressionData?: boolean;
/**
*
* @type {Date}
* @memberof FeaturesSchemaFeatures
*/
createdAt?: Date | null;
/**
*
* @type {Date}
* @memberof FeaturesSchemaFeatures
*/
lastSeenAt?: Date | null;
/**
*
* @type {Array<FeatureSchemaStrategies>}
* @memberof FeaturesSchemaFeatures
*/
strategies?: Array<FeatureSchemaStrategies>;
/**
*
* @type {Array<FeatureSchemaVariants>}
* @memberof FeaturesSchemaFeatures
*/
variants?: Array<FeatureSchemaVariants>;
}
export function FeaturesSchemaFeaturesFromJSON(json: any): FeaturesSchemaFeatures {
return FeaturesSchemaFeaturesFromJSONTyped(json, false);
}
export function FeaturesSchemaFeaturesFromJSONTyped(json: any, ignoreDiscriminator: boolean): FeaturesSchemaFeatures {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'name': json['name'],
'type': !exists(json, 'type') ? undefined : json['type'],
'description': !exists(json, 'description') ? undefined : json['description'],
'project': json['project'],
'enabled': !exists(json, 'enabled') ? undefined : json['enabled'],
'stale': !exists(json, 'stale') ? undefined : json['stale'],
'impressionData': !exists(json, 'impressionData') ? undefined : json['impressionData'],
'createdAt': !exists(json, 'createdAt') ? undefined : (json['createdAt'] === null ? null : new Date(json['createdAt'])),
'lastSeenAt': !exists(json, 'lastSeenAt') ? undefined : (json['lastSeenAt'] === null ? null : new Date(json['lastSeenAt'])),
'strategies': !exists(json, 'strategies') ? undefined : ((json['strategies'] as Array<any>).map(FeatureSchemaStrategiesFromJSON)),
'variants': !exists(json, 'variants') ? undefined : ((json['variants'] as Array<any>).map(FeatureSchemaVariantsFromJSON)),
};
}
export function FeaturesSchemaFeaturesToJSON(value?: FeaturesSchemaFeatures | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'name': value.name,
'type': value.type,
'description': value.description,
'project': value.project,
'enabled': value.enabled,
'stale': value.stale,
'impressionData': value.impressionData,
'createdAt': value.createdAt === undefined ? undefined : (value.createdAt === null ? null : value.createdAt.toISOString().substr(0,10)),
'lastSeenAt': value.lastSeenAt === undefined ? undefined : (value.lastSeenAt === null ? null : value.lastSeenAt.toISOString().substr(0,10)),
'strategies': value.strategies === undefined ? undefined : ((value.strategies as Array<any>).map(FeatureSchemaStrategiesToJSON)),
'variants': value.variants === undefined ? undefined : ((value.variants as Array<any>).map(FeatureSchemaVariantsToJSON)),
};
}

View File

@ -4,7 +4,7 @@
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.10.0
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@ -0,0 +1,92 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* 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 PatchOperationSchema
*/
export interface PatchOperationSchema {
/**
*
* @type {string}
* @memberof PatchOperationSchema
*/
path: string;
/**
*
* @type {string}
* @memberof PatchOperationSchema
*/
op: PatchOperationSchemaOpEnum;
/**
*
* @type {string}
* @memberof PatchOperationSchema
*/
from?: string;
/**
*
* @type {any}
* @memberof PatchOperationSchema
*/
value?: any | null;
}
/**
* @export
* @enum {string}
*/
export enum PatchOperationSchemaOpEnum {
Add = 'add',
Remove = 'remove',
Replace = 'replace',
Copy = 'copy',
Move = 'move'
}
export function PatchOperationSchemaFromJSON(json: any): PatchOperationSchema {
return PatchOperationSchemaFromJSONTyped(json, false);
}
export function PatchOperationSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchOperationSchema {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'path': json['path'],
'op': json['op'],
'from': !exists(json, 'from') ? undefined : json['from'],
'value': !exists(json, 'value') ? undefined : json['value'],
};
}
export function PatchOperationSchemaToJSON(value?: PatchOperationSchema | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'path': value.path,
'op': value.op,
'from': value.from,
'value': value.value,
};
}

View File

@ -4,7 +4,7 @@
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.10.0
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@ -14,11 +14,11 @@
import { exists, mapValues } from '../runtime';
import {
CreateStrategySchemaConstraints,
CreateStrategySchemaConstraintsFromJSON,
CreateStrategySchemaConstraintsFromJSONTyped,
CreateStrategySchemaConstraintsToJSON,
} from './CreateStrategySchemaConstraints';
ConstraintSchema,
ConstraintSchemaFromJSON,
ConstraintSchemaFromJSONTyped,
ConstraintSchemaToJSON,
} from './ConstraintSchema';
/**
*
@ -31,7 +31,7 @@ export interface StrategySchema {
* @type {string}
* @memberof StrategySchema
*/
id: string;
id?: string;
/**
*
* @type {string}
@ -40,16 +40,22 @@ export interface StrategySchema {
name: string;
/**
*
* @type {Array<CreateStrategySchemaConstraints>}
* @type {number}
* @memberof StrategySchema
*/
constraints: Array<CreateStrategySchemaConstraints>;
sortOrder?: number;
/**
*
* @type {Array<ConstraintSchema>}
* @memberof StrategySchema
*/
constraints?: Array<ConstraintSchema>;
/**
*
* @type {{ [key: string]: string; }}
* @memberof StrategySchema
*/
parameters: { [key: string]: string; };
parameters?: { [key: string]: string; };
}
export function StrategySchemaFromJSON(json: any): StrategySchema {
@ -62,10 +68,11 @@ export function StrategySchemaFromJSONTyped(json: any, ignoreDiscriminator: bool
}
return {
'id': json['id'],
'id': !exists(json, 'id') ? undefined : json['id'],
'name': json['name'],
'constraints': ((json['constraints'] as Array<any>).map(CreateStrategySchemaConstraintsFromJSON)),
'parameters': json['parameters'],
'sortOrder': !exists(json, 'sortOrder') ? undefined : json['sortOrder'],
'constraints': !exists(json, 'constraints') ? undefined : ((json['constraints'] as Array<any>).map(ConstraintSchemaFromJSON)),
'parameters': !exists(json, 'parameters') ? undefined : json['parameters'],
};
}
@ -80,7 +87,8 @@ export function StrategySchemaToJSON(value?: StrategySchema | null): any {
'id': value.id,
'name': value.name,
'constraints': ((value.constraints as Array<any>).map(CreateStrategySchemaConstraintsToJSON)),
'sortOrder': value.sortOrder,
'constraints': value.constraints === undefined ? undefined : ((value.constraints as Array<any>).map(ConstraintSchemaToJSON)),
'parameters': value.parameters,
};
}

View File

@ -0,0 +1,64 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* 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 TagSchema
*/
export interface TagSchema {
/**
*
* @type {string}
* @memberof TagSchema
*/
value: string;
/**
*
* @type {string}
* @memberof TagSchema
*/
type: string;
}
export function TagSchemaFromJSON(json: any): TagSchema {
return TagSchemaFromJSONTyped(json, false);
}
export function TagSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): TagSchema {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'value': json['value'],
'type': json['type'],
};
}
export function TagSchemaToJSON(value?: TagSchema | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'value': value.value,
'type': value.type,
};
}

View File

@ -0,0 +1,71 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* 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 {
TagSchema,
TagSchemaFromJSON,
TagSchemaFromJSONTyped,
TagSchemaToJSON,
} from './TagSchema';
/**
*
* @export
* @interface TagsResponseSchema
*/
export interface TagsResponseSchema {
/**
*
* @type {number}
* @memberof TagsResponseSchema
*/
version: number;
/**
*
* @type {Array<TagSchema>}
* @memberof TagsResponseSchema
*/
tags: Array<TagSchema>;
}
export function TagsResponseSchemaFromJSON(json: any): TagsResponseSchema {
return TagsResponseSchemaFromJSONTyped(json, false);
}
export function TagsResponseSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): TagsResponseSchema {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'version': json['version'],
'tags': ((json['tags'] as Array<any>).map(TagSchemaFromJSON)),
};
}
export function TagsResponseSchemaToJSON(value?: TagsResponseSchema | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'version': value.version,
'tags': ((value.tags as Array<any>).map(TagSchemaToJSON)),
};
}

View File

@ -0,0 +1,119 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* 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 {
ConstraintSchema,
ConstraintSchemaFromJSON,
ConstraintSchemaFromJSONTyped,
ConstraintSchemaToJSON,
} from './ConstraintSchema';
/**
*
* @export
* @interface UpdateFeatureSchema
*/
export interface UpdateFeatureSchema {
/**
*
* @type {string}
* @memberof UpdateFeatureSchema
*/
name: string;
/**
*
* @type {string}
* @memberof UpdateFeatureSchema
*/
description?: string;
/**
*
* @type {string}
* @memberof UpdateFeatureSchema
*/
type?: string;
/**
*
* @type {boolean}
* @memberof UpdateFeatureSchema
*/
stale?: boolean;
/**
*
* @type {boolean}
* @memberof UpdateFeatureSchema
*/
archived?: boolean;
/**
*
* @type {Date}
* @memberof UpdateFeatureSchema
*/
createdAt?: Date;
/**
*
* @type {boolean}
* @memberof UpdateFeatureSchema
*/
impressionData?: boolean;
/**
*
* @type {Array<ConstraintSchema>}
* @memberof UpdateFeatureSchema
*/
constraints?: Array<ConstraintSchema>;
}
export function UpdateFeatureSchemaFromJSON(json: any): UpdateFeatureSchema {
return UpdateFeatureSchemaFromJSONTyped(json, false);
}
export function UpdateFeatureSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateFeatureSchema {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'name': json['name'],
'description': !exists(json, 'description') ? undefined : json['description'],
'type': !exists(json, 'type') ? undefined : json['type'],
'stale': !exists(json, 'stale') ? undefined : json['stale'],
'archived': !exists(json, 'archived') ? undefined : json['archived'],
'createdAt': !exists(json, 'createdAt') ? undefined : (new Date(json['createdAt'])),
'impressionData': !exists(json, 'impressionData') ? undefined : json['impressionData'],
'constraints': !exists(json, 'constraints') ? undefined : ((json['constraints'] as Array<any>).map(ConstraintSchemaFromJSON)),
};
}
export function UpdateFeatureSchemaToJSON(value?: UpdateFeatureSchema | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'name': value.name,
'description': value.description,
'type': value.type,
'stale': value.stale,
'archived': value.archived,
'createdAt': value.createdAt === undefined ? undefined : (value.createdAt.toISOString().substr(0,10)),
'impressionData': value.impressionData,
'constraints': value.constraints === undefined ? undefined : ((value.constraints as Array<any>).map(ConstraintSchemaToJSON)),
};
}

View File

@ -0,0 +1,95 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* 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 {
ConstraintSchema,
ConstraintSchemaFromJSON,
ConstraintSchemaFromJSONTyped,
ConstraintSchemaToJSON,
} from './ConstraintSchema';
/**
*
* @export
* @interface UpdateStrategySchema
*/
export interface UpdateStrategySchema {
/**
*
* @type {string}
* @memberof UpdateStrategySchema
*/
id?: string;
/**
*
* @type {string}
* @memberof UpdateStrategySchema
*/
name?: string;
/**
*
* @type {number}
* @memberof UpdateStrategySchema
*/
sortOrder?: number;
/**
*
* @type {Array<ConstraintSchema>}
* @memberof UpdateStrategySchema
*/
constraints?: Array<ConstraintSchema>;
/**
*
* @type {{ [key: string]: string; }}
* @memberof UpdateStrategySchema
*/
parameters?: { [key: string]: string; };
}
export function UpdateStrategySchemaFromJSON(json: any): UpdateStrategySchema {
return UpdateStrategySchemaFromJSONTyped(json, false);
}
export function UpdateStrategySchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateStrategySchema {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'name': !exists(json, 'name') ? undefined : json['name'],
'sortOrder': !exists(json, 'sortOrder') ? undefined : json['sortOrder'],
'constraints': !exists(json, 'constraints') ? undefined : ((json['constraints'] as Array<any>).map(ConstraintSchemaFromJSON)),
'parameters': !exists(json, 'parameters') ? undefined : json['parameters'],
};
}
export function UpdateStrategySchemaToJSON(value?: UpdateStrategySchema | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'id': value.id,
'name': value.name,
'sortOrder': value.sortOrder,
'constraints': value.constraints === undefined ? undefined : ((value.constraints as Array<any>).map(ConstraintSchemaToJSON)),
'parameters': value.parameters,
};
}

View File

@ -4,7 +4,7 @@
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.10.0
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@ -14,11 +14,17 @@
import { exists, mapValues } from '../runtime';
import {
FeatureSchemaOverrides,
FeatureSchemaOverridesFromJSON,
FeatureSchemaOverridesFromJSONTyped,
FeatureSchemaOverridesToJSON,
} from './FeatureSchemaOverrides';
OverrideSchema,
OverrideSchemaFromJSON,
OverrideSchemaFromJSONTyped,
OverrideSchemaToJSON,
} from './OverrideSchema';
import {
VariantSchemaPayload,
VariantSchemaPayloadFromJSON,
VariantSchemaPayloadFromJSONTyped,
VariantSchemaPayloadToJSON,
} from './VariantSchemaPayload';
/**
*
@ -52,16 +58,16 @@ export interface VariantSchema {
stickiness: string;
/**
*
* @type {object}
* @type {VariantSchemaPayload}
* @memberof VariantSchema
*/
payload?: object;
payload?: VariantSchemaPayload;
/**
*
* @type {Array<FeatureSchemaOverrides>}
* @type {Array<OverrideSchema>}
* @memberof VariantSchema
*/
overrides?: Array<FeatureSchemaOverrides>;
overrides?: Array<OverrideSchema>;
}
export function VariantSchemaFromJSON(json: any): VariantSchema {
@ -78,8 +84,8 @@ export function VariantSchemaFromJSONTyped(json: any, ignoreDiscriminator: boole
'weight': json['weight'],
'weightType': json['weightType'],
'stickiness': json['stickiness'],
'payload': !exists(json, 'payload') ? undefined : json['payload'],
'overrides': !exists(json, 'overrides') ? undefined : ((json['overrides'] as Array<any>).map(FeatureSchemaOverridesFromJSON)),
'payload': !exists(json, 'payload') ? undefined : VariantSchemaPayloadFromJSON(json['payload']),
'overrides': !exists(json, 'overrides') ? undefined : ((json['overrides'] as Array<any>).map(OverrideSchemaFromJSON)),
};
}
@ -96,8 +102,8 @@ export function VariantSchemaToJSON(value?: VariantSchema | null): any {
'weight': value.weight,
'weightType': value.weightType,
'stickiness': value.stickiness,
'payload': value.payload,
'overrides': value.overrides === undefined ? undefined : ((value.overrides as Array<any>).map(FeatureSchemaOverridesToJSON)),
'payload': VariantSchemaPayloadToJSON(value.payload),
'overrides': value.overrides === undefined ? undefined : ((value.overrides as Array<any>).map(OverrideSchemaToJSON)),
};
}

View File

@ -0,0 +1,64 @@
/* tslint:disable */
/* eslint-disable */
/**
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* 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 VariantSchemaPayload
*/
export interface VariantSchemaPayload {
/**
*
* @type {string}
* @memberof VariantSchemaPayload
*/
type: string;
/**
*
* @type {string}
* @memberof VariantSchemaPayload
*/
value: string;
}
export function VariantSchemaPayloadFromJSON(json: any): VariantSchemaPayload {
return VariantSchemaPayloadFromJSONTyped(json, false);
}
export function VariantSchemaPayloadFromJSONTyped(json: any, ignoreDiscriminator: boolean): VariantSchemaPayload {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'type': json['type'],
'value': json['value'],
};
}
export function VariantSchemaPayloadToJSON(value?: VariantSchemaPayload | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'type': value.type,
'value': value.value,
};
}

View File

@ -1,16 +1,20 @@
/* tslint:disable */
/* eslint-disable */
export * from './ChangeProjectSchema';
export * from './CloneFeatureSchema';
export * from './ConstraintSchema';
export * from './CreateFeatureSchema';
export * from './CreateStrategySchema';
export * from './CreateStrategySchemaConstraints';
export * from './FeatureEnvironmentSchema';
export * from './FeatureSchema';
export * from './FeatureSchemaOverrides';
export * from './FeatureSchemaStrategies';
export * from './FeatureSchemaVariants';
export * from './FeatureStrategySchema';
export * from './FeaturesSchema';
export * from './FeaturesSchemaFeatures';
export * from './OverrideSchema';
export * from './PatchOperationSchema';
export * from './StrategySchema';
export * from './TagSchema';
export * from './TagsResponseSchema';
export * from './UpdateFeatureSchema';
export * from './UpdateStrategySchema';
export * from './VariantSchema';
export * from './VariantSchemaPayload';

View File

@ -4,7 +4,7 @@
* Unleash API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 4.10.0
* The version of the OpenAPI document: 4.11.0-beta.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).