mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-04 21:58:54 -05:00
working search with flat endpoint
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Django Recipes
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document:
|
||||
* The version of the OpenAPI document: 0.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
@@ -13,39 +13,67 @@
|
||||
*/
|
||||
|
||||
import { exists, mapValues } from '../runtime';
|
||||
import type { OpenDataConversionFoodPreferredUnitMetric } from './OpenDataConversionFoodPreferredUnitMetric';
|
||||
import type { OpenDataCategory } from './OpenDataCategory';
|
||||
import {
|
||||
OpenDataConversionFoodPreferredUnitMetricFromJSON,
|
||||
OpenDataConversionFoodPreferredUnitMetricFromJSONTyped,
|
||||
OpenDataConversionFoodPreferredUnitMetricToJSON,
|
||||
} from './OpenDataConversionFoodPreferredUnitMetric';
|
||||
import type { OpenDataConversionFoodPropertiesFoodUnit } from './OpenDataConversionFoodPropertiesFoodUnit';
|
||||
OpenDataCategoryFromJSON,
|
||||
OpenDataCategoryFromJSONTyped,
|
||||
OpenDataCategoryToJSON,
|
||||
} from './OpenDataCategory';
|
||||
import type { OpenDataFoodProperty } from './OpenDataFoodProperty';
|
||||
import {
|
||||
OpenDataConversionFoodPropertiesFoodUnitFromJSON,
|
||||
OpenDataConversionFoodPropertiesFoodUnitFromJSONTyped,
|
||||
OpenDataConversionFoodPropertiesFoodUnitToJSON,
|
||||
} from './OpenDataConversionFoodPropertiesFoodUnit';
|
||||
import type { OpenDataConversionFoodPropertiesInner } from './OpenDataConversionFoodPropertiesInner';
|
||||
OpenDataFoodPropertyFromJSON,
|
||||
OpenDataFoodPropertyFromJSONTyped,
|
||||
OpenDataFoodPropertyToJSON,
|
||||
} from './OpenDataFoodProperty';
|
||||
import type { OpenDataUnit } from './OpenDataUnit';
|
||||
import {
|
||||
OpenDataConversionFoodPropertiesInnerFromJSON,
|
||||
OpenDataConversionFoodPropertiesInnerFromJSONTyped,
|
||||
OpenDataConversionFoodPropertiesInnerToJSON,
|
||||
} from './OpenDataConversionFoodPropertiesInner';
|
||||
import type { OpenDataStoreCategoryToStoreInnerCategory } from './OpenDataStoreCategoryToStoreInnerCategory';
|
||||
OpenDataUnitFromJSON,
|
||||
OpenDataUnitFromJSONTyped,
|
||||
OpenDataUnitToJSON,
|
||||
} from './OpenDataUnit';
|
||||
import type { OpenDataVersion } from './OpenDataVersion';
|
||||
import {
|
||||
OpenDataStoreCategoryToStoreInnerCategoryFromJSON,
|
||||
OpenDataStoreCategoryToStoreInnerCategoryFromJSONTyped,
|
||||
OpenDataStoreCategoryToStoreInnerCategoryToJSON,
|
||||
} from './OpenDataStoreCategoryToStoreInnerCategory';
|
||||
import type { OpenDataUnitVersion } from './OpenDataUnitVersion';
|
||||
import {
|
||||
OpenDataUnitVersionFromJSON,
|
||||
OpenDataUnitVersionFromJSONTyped,
|
||||
OpenDataUnitVersionToJSON,
|
||||
} from './OpenDataUnitVersion';
|
||||
OpenDataVersionFromJSON,
|
||||
OpenDataVersionFromJSONTyped,
|
||||
OpenDataVersionToJSON,
|
||||
} from './OpenDataVersion';
|
||||
|
||||
/**
|
||||
* Moves `UniqueValidator`'s from the validation stage to the save stage.
|
||||
* It solves the problem with nested validation for unique fields on update.
|
||||
*
|
||||
* If you want more details, you can read related issues and articles:
|
||||
* https://github.com/beda-software/drf-writable-nested/issues/1
|
||||
* http://www.django-rest-framework.org/api-guide/validators/#updating-nested-serializers
|
||||
*
|
||||
* Example of usage:
|
||||
* ```
|
||||
* class Child(models.Model):
|
||||
* field = models.CharField(unique=True)
|
||||
*
|
||||
*
|
||||
* class Parent(models.Model):
|
||||
* child = models.ForeignKey('Child')
|
||||
*
|
||||
*
|
||||
* class ChildSerializer(UniqueFieldsMixin, serializers.ModelSerializer):
|
||||
* class Meta:
|
||||
* model = Child
|
||||
*
|
||||
*
|
||||
* class ParentSerializer(NestedUpdateMixin, serializers.ModelSerializer):
|
||||
* child = ChildSerializer()
|
||||
*
|
||||
* class Meta:
|
||||
* model = Parent
|
||||
* ```
|
||||
*
|
||||
* Note: `UniqueFieldsMixin` must be applied only on the serializer
|
||||
* which has unique fields.
|
||||
*
|
||||
* Note: When you are using both mixins
|
||||
* (`UniqueFieldsMixin` and `NestedCreateMixin` or `NestedUpdateMixin`)
|
||||
* you should put `UniqueFieldsMixin` ahead.
|
||||
* @export
|
||||
* @interface OpenDataFood
|
||||
*/
|
||||
@@ -55,13 +83,13 @@ export interface OpenDataFood {
|
||||
* @type {number}
|
||||
* @memberof OpenDataFood
|
||||
*/
|
||||
readonly id?: number;
|
||||
readonly id: number;
|
||||
/**
|
||||
*
|
||||
* @type {OpenDataUnitVersion}
|
||||
* @type {OpenDataVersion}
|
||||
* @memberof OpenDataFood
|
||||
*/
|
||||
version: OpenDataUnitVersion;
|
||||
version: OpenDataVersion;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
@@ -82,40 +110,40 @@ export interface OpenDataFood {
|
||||
pluralName: string;
|
||||
/**
|
||||
*
|
||||
* @type {OpenDataStoreCategoryToStoreInnerCategory}
|
||||
* @type {OpenDataCategory}
|
||||
* @memberof OpenDataFood
|
||||
*/
|
||||
storeCategory: OpenDataStoreCategoryToStoreInnerCategory;
|
||||
storeCategory: OpenDataCategory;
|
||||
/**
|
||||
*
|
||||
* @type {OpenDataConversionFoodPreferredUnitMetric}
|
||||
* @type {OpenDataUnit}
|
||||
* @memberof OpenDataFood
|
||||
*/
|
||||
preferredUnitMetric?: OpenDataConversionFoodPreferredUnitMetric | null;
|
||||
preferredUnitMetric?: OpenDataUnit | null;
|
||||
/**
|
||||
*
|
||||
* @type {OpenDataConversionFoodPreferredUnitMetric}
|
||||
* @type {OpenDataUnit}
|
||||
* @memberof OpenDataFood
|
||||
*/
|
||||
preferredShoppingUnitMetric?: OpenDataConversionFoodPreferredUnitMetric | null;
|
||||
preferredShoppingUnitMetric?: OpenDataUnit | null;
|
||||
/**
|
||||
*
|
||||
* @type {OpenDataConversionFoodPreferredUnitMetric}
|
||||
* @type {OpenDataUnit}
|
||||
* @memberof OpenDataFood
|
||||
*/
|
||||
preferredUnitImperial?: OpenDataConversionFoodPreferredUnitMetric | null;
|
||||
preferredUnitImperial?: OpenDataUnit | null;
|
||||
/**
|
||||
*
|
||||
* @type {OpenDataConversionFoodPreferredUnitMetric}
|
||||
* @type {OpenDataUnit}
|
||||
* @memberof OpenDataFood
|
||||
*/
|
||||
preferredShoppingUnitImperial?: OpenDataConversionFoodPreferredUnitMetric | null;
|
||||
preferredShoppingUnitImperial?: OpenDataUnit | null;
|
||||
/**
|
||||
*
|
||||
* @type {Array<OpenDataConversionFoodPropertiesInner>}
|
||||
* @type {Array<OpenDataFoodProperty>}
|
||||
* @memberof OpenDataFood
|
||||
*/
|
||||
properties: Array<OpenDataConversionFoodPropertiesInner> | null;
|
||||
properties: Array<OpenDataFoodProperty> | null;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
@@ -124,10 +152,10 @@ export interface OpenDataFood {
|
||||
propertiesFoodAmount?: number;
|
||||
/**
|
||||
*
|
||||
* @type {OpenDataConversionFoodPropertiesFoodUnit}
|
||||
* @type {OpenDataUnit}
|
||||
* @memberof OpenDataFood
|
||||
*/
|
||||
propertiesFoodUnit: OpenDataConversionFoodPropertiesFoodUnit;
|
||||
propertiesFoodUnit: OpenDataUnit;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
@@ -151,7 +179,7 @@ export interface OpenDataFood {
|
||||
* @type {string}
|
||||
* @memberof OpenDataFood
|
||||
*/
|
||||
readonly createdBy?: string;
|
||||
readonly createdBy: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -159,6 +187,7 @@ export interface OpenDataFood {
|
||||
*/
|
||||
export function instanceOfOpenDataFood(value: object): boolean {
|
||||
let isInstance = true;
|
||||
isInstance = isInstance && "id" in value;
|
||||
isInstance = isInstance && "version" in value;
|
||||
isInstance = isInstance && "slug" in value;
|
||||
isInstance = isInstance && "name" in value;
|
||||
@@ -167,6 +196,7 @@ export function instanceOfOpenDataFood(value: object): boolean {
|
||||
isInstance = isInstance && "properties" in value;
|
||||
isInstance = isInstance && "propertiesFoodUnit" in value;
|
||||
isInstance = isInstance && "fdcId" in value;
|
||||
isInstance = isInstance && "createdBy" in value;
|
||||
|
||||
return isInstance;
|
||||
}
|
||||
@@ -181,23 +211,23 @@ export function OpenDataFoodFromJSONTyped(json: any, ignoreDiscriminator: boolea
|
||||
}
|
||||
return {
|
||||
|
||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||
'version': OpenDataUnitVersionFromJSON(json['version']),
|
||||
'id': json['id'],
|
||||
'version': OpenDataVersionFromJSON(json['version']),
|
||||
'slug': json['slug'],
|
||||
'name': json['name'],
|
||||
'pluralName': json['plural_name'],
|
||||
'storeCategory': OpenDataStoreCategoryToStoreInnerCategoryFromJSON(json['store_category']),
|
||||
'preferredUnitMetric': !exists(json, 'preferred_unit_metric') ? undefined : OpenDataConversionFoodPreferredUnitMetricFromJSON(json['preferred_unit_metric']),
|
||||
'preferredShoppingUnitMetric': !exists(json, 'preferred_shopping_unit_metric') ? undefined : OpenDataConversionFoodPreferredUnitMetricFromJSON(json['preferred_shopping_unit_metric']),
|
||||
'preferredUnitImperial': !exists(json, 'preferred_unit_imperial') ? undefined : OpenDataConversionFoodPreferredUnitMetricFromJSON(json['preferred_unit_imperial']),
|
||||
'preferredShoppingUnitImperial': !exists(json, 'preferred_shopping_unit_imperial') ? undefined : OpenDataConversionFoodPreferredUnitMetricFromJSON(json['preferred_shopping_unit_imperial']),
|
||||
'properties': (json['properties'] === null ? null : (json['properties'] as Array<any>).map(OpenDataConversionFoodPropertiesInnerFromJSON)),
|
||||
'storeCategory': OpenDataCategoryFromJSON(json['store_category']),
|
||||
'preferredUnitMetric': !exists(json, 'preferred_unit_metric') ? undefined : OpenDataUnitFromJSON(json['preferred_unit_metric']),
|
||||
'preferredShoppingUnitMetric': !exists(json, 'preferred_shopping_unit_metric') ? undefined : OpenDataUnitFromJSON(json['preferred_shopping_unit_metric']),
|
||||
'preferredUnitImperial': !exists(json, 'preferred_unit_imperial') ? undefined : OpenDataUnitFromJSON(json['preferred_unit_imperial']),
|
||||
'preferredShoppingUnitImperial': !exists(json, 'preferred_shopping_unit_imperial') ? undefined : OpenDataUnitFromJSON(json['preferred_shopping_unit_imperial']),
|
||||
'properties': (json['properties'] === null ? null : (json['properties'] as Array<any>).map(OpenDataFoodPropertyFromJSON)),
|
||||
'propertiesFoodAmount': !exists(json, 'properties_food_amount') ? undefined : json['properties_food_amount'],
|
||||
'propertiesFoodUnit': OpenDataConversionFoodPropertiesFoodUnitFromJSON(json['properties_food_unit']),
|
||||
'propertiesFoodUnit': OpenDataUnitFromJSON(json['properties_food_unit']),
|
||||
'propertiesSource': !exists(json, 'properties_source') ? undefined : json['properties_source'],
|
||||
'fdcId': json['fdc_id'],
|
||||
'comment': !exists(json, 'comment') ? undefined : json['comment'],
|
||||
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
|
||||
'createdBy': json['created_by'],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -210,18 +240,18 @@ export function OpenDataFoodToJSON(value?: OpenDataFood | null): any {
|
||||
}
|
||||
return {
|
||||
|
||||
'version': OpenDataUnitVersionToJSON(value.version),
|
||||
'version': OpenDataVersionToJSON(value.version),
|
||||
'slug': value.slug,
|
||||
'name': value.name,
|
||||
'plural_name': value.pluralName,
|
||||
'store_category': OpenDataStoreCategoryToStoreInnerCategoryToJSON(value.storeCategory),
|
||||
'preferred_unit_metric': OpenDataConversionFoodPreferredUnitMetricToJSON(value.preferredUnitMetric),
|
||||
'preferred_shopping_unit_metric': OpenDataConversionFoodPreferredUnitMetricToJSON(value.preferredShoppingUnitMetric),
|
||||
'preferred_unit_imperial': OpenDataConversionFoodPreferredUnitMetricToJSON(value.preferredUnitImperial),
|
||||
'preferred_shopping_unit_imperial': OpenDataConversionFoodPreferredUnitMetricToJSON(value.preferredShoppingUnitImperial),
|
||||
'properties': (value.properties === null ? null : (value.properties as Array<any>).map(OpenDataConversionFoodPropertiesInnerToJSON)),
|
||||
'store_category': OpenDataCategoryToJSON(value.storeCategory),
|
||||
'preferred_unit_metric': OpenDataUnitToJSON(value.preferredUnitMetric),
|
||||
'preferred_shopping_unit_metric': OpenDataUnitToJSON(value.preferredShoppingUnitMetric),
|
||||
'preferred_unit_imperial': OpenDataUnitToJSON(value.preferredUnitImperial),
|
||||
'preferred_shopping_unit_imperial': OpenDataUnitToJSON(value.preferredShoppingUnitImperial),
|
||||
'properties': (value.properties === null ? null : (value.properties as Array<any>).map(OpenDataFoodPropertyToJSON)),
|
||||
'properties_food_amount': value.propertiesFoodAmount,
|
||||
'properties_food_unit': OpenDataConversionFoodPropertiesFoodUnitToJSON(value.propertiesFoodUnit),
|
||||
'properties_food_unit': OpenDataUnitToJSON(value.propertiesFoodUnit),
|
||||
'properties_source': value.propertiesSource,
|
||||
'fdc_id': value.fdcId,
|
||||
'comment': value.comment,
|
||||
|
||||
Reference in New Issue
Block a user