working search with flat endpoint

This commit is contained in:
vabene1111
2024-02-29 20:08:37 +01:00
parent e47bdd043e
commit 1cac34d2a0
143 changed files with 18623 additions and 9992 deletions

2
.gitignore vendored
View File

@@ -78,7 +78,7 @@ data/
/docker-compose.override.yml
vue/node_modules
plugins
/recipes/plugins
.vscode/
vetur.config.js
cookbook/static/vue

View File

@@ -593,25 +593,26 @@ class FoodViewSet(viewsets.ModelViewSet, TreeMixin):
return FoodSimpleSerializer
return self.serializer_class
@decorators.action(detail=True, methods=['PUT'], serializer_class=FoodShoppingUpdateSerializer, )
# TODO DRF only allows one action in a decorator action without overriding get_operation_id_base() this should be PUT and DELETE probably
def shopping(self, request, pk):
if self.request.space.demo:
raise PermissionDenied(detail='Not available in demo', code=None)
obj = self.get_object()
shared_users = list(self.request.user.get_shopping_share())
shared_users.append(request.user)
if request.data.get('_delete', False) == 'true':
ShoppingListEntry.objects.filter(food=obj, checked=False, space=request.space, created_by__in=shared_users).delete()
content = {'msg': _(f'{obj.name} was removed from the shopping list.')}
return Response(content, status=status.HTTP_204_NO_CONTENT)
amount = request.data.get('amount', 1)
unit = request.data.get('unit', None)
content = {'msg': _(f'{obj.name} was added to the shopping list.')}
ShoppingListEntry.objects.create(food=obj, amount=amount, unit=unit, space=request.space, created_by=request.user)
return Response(content, status=status.HTTP_204_NO_CONTENT)
# TODO I could not find any usage of this and it causes schema generation issues, so commenting it for now
# @decorators.action(detail=True, methods=['PUT'], serializer_class=FoodShoppingUpdateSerializer, )
# # TODO DRF only allows one action in a decorator action without overriding get_operation_id_base() this should be PUT and DELETE probably
# def shopping(self, request, pk):
# if self.request.space.demo:
# raise PermissionDenied(detail='Not available in demo', code=None)
# obj = self.get_object()
# shared_users = list(self.request.user.get_shopping_share())
# shared_users.append(request.user)
# if request.data.get('_delete', False) == 'true':
# ShoppingListEntry.objects.filter(food=obj, checked=False, space=request.space, created_by__in=shared_users).delete()
# content = {'msg': _(f'{obj.name} was removed from the shopping list.')}
# return Response(content, status=status.HTTP_204_NO_CONTENT)
#
# amount = request.data.get('amount', 1)
# unit = request.data.get('unit', None)
# content = {'msg': _(f'{obj.name} was added to the shopping list.')}
#
# ShoppingListEntry.objects.create(food=obj, amount=amount, unit=unit, space=request.space, created_by=request.user)
# return Response(content, status=status.HTTP_204_NO_CONTENT)
@decorators.action(detail=True, methods=['POST'], )
def fdc(self, request, pk):
@@ -1089,8 +1090,12 @@ class RecipeViewSet(viewsets.ModelViewSet):
qs = obj.get_related_recipes(levels=levels) # TODO: make levels a user setting, included in request data?, keep solely in the backend?
return Response(self.serializer_class(qs, many=True).data)
@extend_schema(
responses=RecipeFlatSerializer(many=True)
)
@decorators.action(
detail=False,
pagination_class=None,
methods=['GET'],
serializer_class=RecipeFlatSerializer,
)

View File

@@ -113,9 +113,8 @@ export default defineComponent({
})
const api = new ApiApi()
api.flatRecipe().then(r => {
console.log(r)
this.flat_recipes = [] // TODO fix API schema generation to generate valid API response (schema type array)
api.apiRecipeFlatList().then(r => {
this.flat_recipes = r
})
},
methods: {

View File

@@ -1,6 +1,7 @@
apis/ApiApi.ts
apis/ApiImportOpenDataApi.ts
apis/ApiTokenAuthApi.ts
apis/OpenapiApi.ts
apis/index.ts
index.ts
models/AccessToken.ts
@@ -10,99 +11,103 @@ models/BookmarkletImport.ts
models/BookmarkletImportList.ts
models/ConnectorConfigConfig.ts
models/CookLog.ts
models/CookLogCreatedBy.ts
models/CustomFilter.ts
models/CustomFilterSharedInner.ts
models/DefaultPageEnum.ts
models/ExportLog.ts
models/Food.ts
models/FoodInheritField.ts
models/FoodInheritFieldsInner.ts
models/FoodPropertiesFoodUnit.ts
models/FoodPropertiesInner.ts
models/FoodPropertiesInnerPropertyType.ts
models/FoodRecipe.ts
models/FoodShoppingUpdate.ts
models/FoodSubstituteInner.ts
models/FoodSupermarketCategory.ts
models/FoodSimple.ts
models/Group.ts
models/ImportLog.ts
models/ImportLogKeyword.ts
models/Ingredient.ts
models/IngredientFood.ts
models/InviteLink.ts
models/InviteLinkGroup.ts
models/Keyword.ts
models/ListAutomations200Response.ts
models/ListCookLogs200Response.ts
models/ListCustomFilters200Response.ts
models/ListExportLogs200Response.ts
models/ListFoods200Response.ts
models/ListImportLogs200Response.ts
models/ListIngredients200Response.ts
models/ListKeywords200Response.ts
models/ListRecipes200Response.ts
models/ListSteps200Response.ts
models/ListSupermarketCategoryRelations200Response.ts
models/ListSyncLogs200Response.ts
models/ListUnits200Response.ts
models/ListUserSpaces200Response.ts
models/ListViewLogs200Response.ts
models/KeywordLabel.ts
models/MealPlan.ts
models/MealPlanMealType.ts
models/MealPlanRecipe.ts
models/MealPlanRecipeKeywordsInner.ts
models/MealType.ts
models/OpenDataCategory.ts
models/OpenDataConversion.ts
models/OpenDataConversionFood.ts
models/OpenDataConversionFoodPreferredUnitMetric.ts
models/OpenDataConversionFoodPropertiesFoodUnit.ts
models/OpenDataConversionFoodPropertiesInner.ts
models/OpenDataConversionFoodPropertiesInnerProperty.ts
models/OpenDataFood.ts
models/OpenDataProperty.ts
models/OpenDataStore.ts
models/OpenDataStoreCategoryToStoreInner.ts
models/OpenDataStoreCategoryToStoreInnerCategory.ts
models/OpenDataUnit.ts
models/OpenDataUnitVersion.ts
models/OpenDataVersion.ts
models/MethodEnum.ts
models/NutritionInformation.ts
models/PaginatedAutomationList.ts
models/PaginatedCookLogList.ts
models/PaginatedCustomFilterList.ts
models/PaginatedExportLogList.ts
models/PaginatedFoodList.ts
models/PaginatedImportLogList.ts
models/PaginatedIngredientList.ts
models/PaginatedKeywordList.ts
models/PaginatedRecipeOverviewList.ts
models/PaginatedStepList.ts
models/PaginatedSupermarketCategoryRelationList.ts
models/PaginatedSyncLogList.ts
models/PaginatedUnitList.ts
models/PaginatedUserSpaceList.ts
models/PaginatedViewLogList.ts
models/PatchedAccessToken.ts
models/PatchedAutomation.ts
models/PatchedBookmarkletImport.ts
models/PatchedConnectorConfigConfig.ts
models/PatchedCookLog.ts
models/PatchedCustomFilter.ts
models/PatchedExportLog.ts
models/PatchedFood.ts
models/PatchedImportLog.ts
models/PatchedIngredient.ts
models/PatchedInviteLink.ts
models/PatchedKeyword.ts
models/PatchedMealPlan.ts
models/PatchedMealType.ts
models/PatchedProperty.ts
models/PatchedPropertyType.ts
models/PatchedRecipe.ts
models/PatchedRecipeBook.ts
models/PatchedRecipeBookEntry.ts
models/PatchedShoppingListEntry.ts
models/PatchedShoppingListRecipe.ts
models/PatchedSpace.ts
models/PatchedStep.ts
models/PatchedStorage.ts
models/PatchedSupermarket.ts
models/PatchedSupermarketCategory.ts
models/PatchedSupermarketCategoryRelation.ts
models/PatchedSync.ts
models/PatchedUnit.ts
models/PatchedUnitConversion.ts
models/PatchedUser.ts
models/PatchedUserPreference.ts
models/PatchedUserSpace.ts
models/PatchedViewLog.ts
models/Property.ts
models/PropertyType.ts
models/Recipe.ts
models/RecipeBook.ts
models/RecipeBookEntry.ts
models/RecipeBookFilter.ts
models/RecipeFlat.ts
models/RecipeImage.ts
models/RecipeKeywordsInner.ts
models/RecipeNutrition.ts
models/RecipeOverview.ts
models/RecipeShoppingUpdate.ts
models/RecipeSimple.ts
models/RecipeStepsInner.ts
models/RecipeStepsInnerFile.ts
models/RecipeStepsInnerIngredientsInner.ts
models/ShoppingListEntry.ts
models/ShoppingListEntryBulk.ts
models/ShoppingListEntryRecipeMealplan.ts
models/ShoppingListRecipe.ts
models/Space.ts
models/SpaceNavTextColorEnum.ts
models/SpaceThemeEnum.ts
models/Step.ts
models/Storage.ts
models/Supermarket.ts
models/SupermarketCategory.ts
models/SupermarketCategoryRelation.ts
models/SupermarketCategoryToSupermarketInner.ts
models/SupermarketCategoryToSupermarketInnerCategory.ts
models/Sync.ts
models/SyncLog.ts
models/ThemeEnum.ts
models/TypeEnum.ts
models/Unit.ts
models/UnitConversion.ts
models/UnitConversionBaseUnit.ts
models/User.ts
models/UserFile.ts
models/UserFileView.ts
models/UserPreference.ts
models/UserPreferenceNavTextColorEnum.ts
models/UserSpace.ts
models/ViewLog.ts
models/index.ts

File diff suppressed because it is too large Load Diff

View File

@@ -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).
@@ -15,56 +15,47 @@
import * as runtime from '../runtime';
export interface CreateImportOpenDataRequest {
body?: any | null;
}
/**
*
*/
export class ApiImportOpenDataApi extends runtime.BaseAPI {
/**
*
*/
async createImportOpenDataRaw(requestParameters: CreateImportOpenDataRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<any>> {
async apiImportOpenDataCreateRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
}
const response = await this.request({
path: `/api-import-open-data/`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: requestParameters.body as any,
}, initOverrides);
if (this.isJsonMime(response.headers.get('content-type'))) {
return new runtime.JSONApiResponse<any>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
return new runtime.VoidApiResponse(response);
}
/**
*
*/
async createImportOpenData(requestParameters: CreateImportOpenDataRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<any> {
const response = await this.createImportOpenDataRaw(requestParameters, initOverrides);
return await response.value();
async apiImportOpenDataCreate(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.apiImportOpenDataCreateRaw(initOverrides);
}
/**
*
*/
async listImportOpenDatasRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<any>>> {
async apiImportOpenDataRetrieveRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
}
const response = await this.request({
path: `/api-import-open-data/`,
method: 'GET',
@@ -72,15 +63,13 @@ export class ApiImportOpenDataApi extends runtime.BaseAPI {
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse<any>(response);
return new runtime.VoidApiResponse(response);
}
/**
*
*/
async listImportOpenDatas(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<any>> {
const response = await this.listImportOpenDatasRaw(initOverrides);
return await response.value();
async apiImportOpenDataRetrieve(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.apiImportOpenDataRetrieveRaw(initOverrides);
}
}

View File

@@ -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).
@@ -22,10 +22,10 @@ import {
AuthTokenToJSON,
} from '../models/index';
export interface CreateAuthTokenRequest {
export interface ApiTokenAuthCreateRequest {
username: string;
password: string;
token?: string;
token: string;
}
/**
@@ -34,21 +34,27 @@ export interface CreateAuthTokenRequest {
export class ApiTokenAuthApi extends runtime.BaseAPI {
/**
*
*/
async createAuthTokenRaw(requestParameters: CreateAuthTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AuthToken>> {
async apiTokenAuthCreateRaw(requestParameters: ApiTokenAuthCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AuthToken>> {
if (requestParameters.username === null || requestParameters.username === undefined) {
throw new runtime.RequiredError('username','Required parameter requestParameters.username was null or undefined when calling createAuthToken.');
throw new runtime.RequiredError('username','Required parameter requestParameters.username was null or undefined when calling apiTokenAuthCreate.');
}
if (requestParameters.password === null || requestParameters.password === undefined) {
throw new runtime.RequiredError('password','Required parameter requestParameters.password was null or undefined when calling createAuthToken.');
throw new runtime.RequiredError('password','Required parameter requestParameters.password was null or undefined when calling apiTokenAuthCreate.');
}
if (requestParameters.token === null || requestParameters.token === undefined) {
throw new runtime.RequiredError('token','Required parameter requestParameters.token was null or undefined when calling apiTokenAuthCreate.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
}
const consumes: runtime.Consume[] = [
{ contentType: 'application/x-www-form-urlencoded' },
{ contentType: 'multipart/form-data' },
@@ -89,10 +95,9 @@ export class ApiTokenAuthApi extends runtime.BaseAPI {
}
/**
*
*/
async createAuthToken(requestParameters: CreateAuthTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AuthToken> {
const response = await this.createAuthTokenRaw(requestParameters, initOverrides);
async apiTokenAuthCreate(requestParameters: ApiTokenAuthCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AuthToken> {
const response = await this.apiTokenAuthCreateRaw(requestParameters, initOverrides);
return await response.value();
}

View File

@@ -0,0 +1,97 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.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';
export interface OpenapiRetrieveRequest {
format?: OpenapiRetrieveFormatEnum;
lang?: OpenapiRetrieveLangEnum;
}
/**
*
*/
export class OpenapiApi extends runtime.BaseAPI {
/**
* OpenApi3 schema for this API. Format can be selected via content negotiation. - YAML: application/vnd.oai.openapi - JSON: application/vnd.oai.openapi+json
*/
async openapiRetrieveRaw(requestParameters: OpenapiRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{ [key: string]: any; }>> {
const queryParameters: any = {};
if (requestParameters.format !== undefined) {
queryParameters['format'] = requestParameters.format;
}
if (requestParameters.lang !== undefined) {
queryParameters['lang'] = requestParameters.lang;
}
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
}
const response = await this.request({
path: `/openapi/`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse<any>(response);
}
/**
* OpenApi3 schema for this API. Format can be selected via content negotiation. - YAML: application/vnd.oai.openapi - JSON: application/vnd.oai.openapi+json
*/
async openapiRetrieve(requestParameters: OpenapiRetrieveRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: any; }> {
const response = await this.openapiRetrieveRaw(requestParameters, initOverrides);
return await response.value();
}
}
/**
* @export
*/
export const OpenapiRetrieveFormatEnum = {
Json: 'json',
Yaml: 'yaml'
} as const;
export type OpenapiRetrieveFormatEnum = typeof OpenapiRetrieveFormatEnum[keyof typeof OpenapiRetrieveFormatEnum];
/**
* @export
*/
export const OpenapiRetrieveLangEnum = {
Bg: 'bg',
Ca: 'ca',
Cs: 'cs',
Da: 'da',
De: 'de',
En: 'en',
Es: 'es',
Fr: 'fr',
Hu: 'hu',
Hy: 'hy',
It: 'it',
Lv: 'lv',
Nb: 'nb',
Nl: 'nl',
Pl: 'pl',
Ru: 'ru',
Sv: 'sv'
} as const;
export type OpenapiRetrieveLangEnum = typeof OpenapiRetrieveLangEnum[keyof typeof OpenapiRetrieveLangEnum];

View File

@@ -3,3 +3,4 @@
export * from './ApiApi';
export * from './ApiImportOpenDataApi';
export * from './ApiTokenAuthApi';
export * from './OpenapiApi';

View File

@@ -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).
@@ -24,13 +24,13 @@ export interface AccessToken {
* @type {number}
* @memberof AccessToken
*/
readonly id?: number;
readonly id: number;
/**
*
* @type {string}
* @memberof AccessToken
*/
readonly token?: string;
readonly token: string;
/**
*
* @type {Date}
@@ -48,13 +48,13 @@ export interface AccessToken {
* @type {Date}
* @memberof AccessToken
*/
readonly created?: Date;
readonly created: Date;
/**
*
* @type {Date}
* @memberof AccessToken
*/
readonly updated?: Date;
readonly updated: Date;
}
/**
@@ -62,7 +62,11 @@ export interface AccessToken {
*/
export function instanceOfAccessToken(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "id" in value;
isInstance = isInstance && "token" in value;
isInstance = isInstance && "expires" in value;
isInstance = isInstance && "created" in value;
isInstance = isInstance && "updated" in value;
return isInstance;
}
@@ -77,12 +81,12 @@ export function AccessTokenFromJSONTyped(json: any, ignoreDiscriminator: boolean
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'token': !exists(json, 'token') ? undefined : json['token'],
'id': json['id'],
'token': json['token'],
'expires': (new Date(json['expires'])),
'scope': !exists(json, 'scope') ? undefined : json['scope'],
'created': !exists(json, 'created') ? undefined : (new Date(json['created'])),
'updated': !exists(json, 'updated') ? undefined : (new Date(json['updated'])),
'created': (new Date(json['created'])),
'updated': (new Date(json['updated'])),
};
}

View File

@@ -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).
@@ -36,7 +36,7 @@ export interface AuthToken {
* @type {string}
* @memberof AuthToken
*/
readonly token?: string;
readonly token: string;
}
/**
@@ -46,6 +46,7 @@ export function instanceOfAuthToken(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "username" in value;
isInstance = isInstance && "password" in value;
isInstance = isInstance && "token" in value;
return isInstance;
}
@@ -62,7 +63,7 @@ export function AuthTokenFromJSONTyped(json: any, ignoreDiscriminator: boolean):
'username': json['username'],
'password': json['password'],
'token': !exists(json, 'token') ? undefined : json['token'],
'token': json['token'],
};
}

View File

@@ -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,6 +13,13 @@
*/
import { exists, mapValues } from '../runtime';
import type { TypeEnum } from './TypeEnum';
import {
TypeEnumFromJSON,
TypeEnumFromJSONTyped,
TypeEnumToJSON,
} from './TypeEnum';
/**
*
* @export
@@ -24,13 +31,13 @@ export interface Automation {
* @type {number}
* @memberof Automation
*/
readonly id?: number;
readonly id: number;
/**
*
* @type {string}
* @type {TypeEnum}
* @memberof Automation
*/
type: AutomationTypeEnum;
type: TypeEnum;
/**
*
* @type {string}
@@ -75,37 +82,20 @@ export interface Automation {
disabled?: boolean;
/**
*
* @type {string}
* @type {number}
* @memberof Automation
*/
readonly createdBy?: string;
readonly createdBy: number;
}
/**
* @export
*/
export const AutomationTypeEnum = {
FoodAlias: 'FOOD_ALIAS',
UnitAlias: 'UNIT_ALIAS',
KeywordAlias: 'KEYWORD_ALIAS',
DescriptionReplace: 'DESCRIPTION_REPLACE',
InstructionReplace: 'INSTRUCTION_REPLACE',
NeverUnit: 'NEVER_UNIT',
TransposeWords: 'TRANSPOSE_WORDS',
FoodReplace: 'FOOD_REPLACE',
UnitReplace: 'UNIT_REPLACE',
NameReplace: 'NAME_REPLACE'
} as const;
export type AutomationTypeEnum = typeof AutomationTypeEnum[keyof typeof AutomationTypeEnum];
/**
* Check if a given object implements the Automation interface.
*/
export function instanceOfAutomation(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "id" in value;
isInstance = isInstance && "type" in value;
isInstance = isInstance && "createdBy" in value;
return isInstance;
}
@@ -120,8 +110,8 @@ export function AutomationFromJSONTyped(json: any, ignoreDiscriminator: boolean)
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'type': json['type'],
'id': json['id'],
'type': TypeEnumFromJSON(json['type']),
'name': !exists(json, 'name') ? undefined : json['name'],
'description': !exists(json, 'description') ? undefined : json['description'],
'param1': !exists(json, 'param_1') ? undefined : json['param_1'],
@@ -129,7 +119,7 @@ export function AutomationFromJSONTyped(json: any, ignoreDiscriminator: boolean)
'param3': !exists(json, 'param_3') ? undefined : json['param_3'],
'order': !exists(json, 'order') ? undefined : json['order'],
'disabled': !exists(json, 'disabled') ? undefined : json['disabled'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
'createdBy': json['created_by'],
};
}
@@ -142,7 +132,7 @@ export function AutomationToJSON(value?: Automation | null): any {
}
return {
'type': value.type,
'type': TypeEnumToJSON(value.type),
'name': value.name,
'description': value.description,
'param_1': value.param1,

View File

@@ -0,0 +1,55 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.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.
*/
/**
* * `FOOD_ALIAS` - Food Alias
* * `UNIT_ALIAS` - Unit Alias
* * `KEYWORD_ALIAS` - Keyword Alias
* * `DESCRIPTION_REPLACE` - Description Replace
* * `INSTRUCTION_REPLACE` - Instruction Replace
* * `NEVER_UNIT` - Never Unit
* * `TRANSPOSE_WORDS` - Transpose Words
* * `FOOD_REPLACE` - Food Replace
* * `UNIT_REPLACE` - Unit Replace
* * `NAME_REPLACE` - Name Replace
* @export
*/
export const AutomationTypeEnum = {
FoodAlias: 'FOOD_ALIAS',
UnitAlias: 'UNIT_ALIAS',
KeywordAlias: 'KEYWORD_ALIAS',
DescriptionReplace: 'DESCRIPTION_REPLACE',
InstructionReplace: 'INSTRUCTION_REPLACE',
NeverUnit: 'NEVER_UNIT',
TransposeWords: 'TRANSPOSE_WORDS',
FoodReplace: 'FOOD_REPLACE',
UnitReplace: 'UNIT_REPLACE',
NameReplace: 'NAME_REPLACE'
} as const;
export type AutomationTypeEnum = typeof AutomationTypeEnum[keyof typeof AutomationTypeEnum];
export function AutomationTypeEnumFromJSON(json: any): AutomationTypeEnum {
return AutomationTypeEnumFromJSONTyped(json, false);
}
export function AutomationTypeEnumFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutomationTypeEnum {
return json as AutomationTypeEnum;
}
export function AutomationTypeEnumToJSON(value?: AutomationTypeEnum | null): any {
return value as any;
}

View File

@@ -0,0 +1,69 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.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.
*/
/**
* * `G` - g
* * `KG` - kg
* * `ML` - ml
* * `L` - l
* * `OUNCE` - ounce
* * `POUND` - pound
* * `FLUID_OUNCE` - fluid_ounce
* * `TSP` - tsp
* * `TBSP` - tbsp
* * `CUP` - cup
* * `PINT` - pint
* * `QUART` - quart
* * `GALLON` - gallon
* * `IMPERIAL_FLUID_OUNCE` - imperial fluid ounce
* * `IMPERIAL_PINT` - imperial pint
* * `IMPERIAL_QUART` - imperial quart
* * `IMPERIAL_GALLON` - imperial gallon
* @export
*/
export const BaseUnitEnum = {
G: 'G',
Kg: 'KG',
Ml: 'ML',
L: 'L',
Ounce: 'OUNCE',
Pound: 'POUND',
FluidOunce: 'FLUID_OUNCE',
Tsp: 'TSP',
Tbsp: 'TBSP',
Cup: 'CUP',
Pint: 'PINT',
Quart: 'QUART',
Gallon: 'GALLON',
ImperialFluidOunce: 'IMPERIAL_FLUID_OUNCE',
ImperialPint: 'IMPERIAL_PINT',
ImperialQuart: 'IMPERIAL_QUART',
ImperialGallon: 'IMPERIAL_GALLON'
} as const;
export type BaseUnitEnum = typeof BaseUnitEnum[keyof typeof BaseUnitEnum];
export function BaseUnitEnumFromJSON(json: any): BaseUnitEnum {
return BaseUnitEnumFromJSONTyped(json, false);
}
export function BaseUnitEnumFromJSONTyped(json: any, ignoreDiscriminator: boolean): BaseUnitEnum {
return json as BaseUnitEnum;
}
export function BaseUnitEnumToJSON(value?: BaseUnitEnum | null): any {
return value as any;
}

View File

@@ -0,0 +1,37 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
*/
export const BlankEnum = {
Empty: ''
} as const;
export type BlankEnum = typeof BlankEnum[keyof typeof BlankEnum];
export function BlankEnumFromJSON(json: any): BlankEnum {
return BlankEnumFromJSONTyped(json, false);
}
export function BlankEnumFromJSONTyped(json: any, ignoreDiscriminator: boolean): BlankEnum {
return json as BlankEnum;
}
export function BlankEnumToJSON(value?: BlankEnum | null): any {
return value as any;
}

View File

@@ -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).
@@ -24,7 +24,7 @@ export interface BookmarkletImport {
* @type {number}
* @memberof BookmarkletImport
*/
readonly id?: number;
readonly id: number;
/**
*
* @type {string}
@@ -39,16 +39,16 @@ export interface BookmarkletImport {
html: string;
/**
*
* @type {string}
* @type {number}
* @memberof BookmarkletImport
*/
readonly createdBy?: string;
readonly createdBy: number;
/**
*
* @type {Date}
* @memberof BookmarkletImport
*/
readonly createdAt?: Date;
readonly createdAt: Date;
}
/**
@@ -56,7 +56,10 @@ export interface BookmarkletImport {
*/
export function instanceOfBookmarkletImport(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "id" in value;
isInstance = isInstance && "html" in value;
isInstance = isInstance && "createdBy" in value;
isInstance = isInstance && "createdAt" in value;
return isInstance;
}
@@ -71,11 +74,11 @@ export function BookmarkletImportFromJSONTyped(json: any, ignoreDiscriminator: b
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'id': json['id'],
'url': !exists(json, 'url') ? undefined : json['url'],
'html': json['html'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])),
'createdBy': json['created_by'],
'createdAt': (new Date(json['created_at'])),
};
}

View File

@@ -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).
@@ -24,7 +24,7 @@ export interface BookmarkletImportList {
* @type {number}
* @memberof BookmarkletImportList
*/
readonly id?: number;
readonly id: number;
/**
*
* @type {string}
@@ -33,16 +33,16 @@ export interface BookmarkletImportList {
url?: string | null;
/**
*
* @type {string}
* @type {number}
* @memberof BookmarkletImportList
*/
readonly createdBy?: string;
readonly createdBy: number;
/**
*
* @type {Date}
* @memberof BookmarkletImportList
*/
readonly createdAt?: Date;
readonly createdAt: Date;
}
/**
@@ -50,6 +50,9 @@ export interface BookmarkletImportList {
*/
export function instanceOfBookmarkletImportList(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "id" in value;
isInstance = isInstance && "createdBy" in value;
isInstance = isInstance && "createdAt" in value;
return isInstance;
}
@@ -64,10 +67,10 @@ export function BookmarkletImportListFromJSONTyped(json: any, ignoreDiscriminato
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'id': json['id'],
'url': !exists(json, 'url') ? undefined : json['url'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])),
'createdBy': json['created_by'],
'createdAt': (new Date(json['created_at'])),
};
}

View File

@@ -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).
@@ -24,7 +24,7 @@ export interface ConnectorConfigConfig {
* @type {number}
* @memberof ConnectorConfigConfig
*/
readonly id?: number;
readonly id: number;
/**
*
* @type {string}
@@ -75,10 +75,10 @@ export interface ConnectorConfigConfig {
onShoppingListEntryDeletedEnabled?: boolean;
/**
*
* @type {string}
* @type {number}
* @memberof ConnectorConfigConfig
*/
readonly createdBy?: string;
readonly createdBy: number;
}
/**
@@ -86,7 +86,9 @@ export interface ConnectorConfigConfig {
*/
export function instanceOfConnectorConfigConfig(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "id" in value;
isInstance = isInstance && "name" in value;
isInstance = isInstance && "createdBy" in value;
return isInstance;
}
@@ -101,7 +103,7 @@ export function ConnectorConfigConfigFromJSONTyped(json: any, ignoreDiscriminato
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'id': json['id'],
'name': json['name'],
'url': !exists(json, 'url') ? undefined : json['url'],
'token': !exists(json, 'token') ? undefined : json['token'],
@@ -110,7 +112,7 @@ export function ConnectorConfigConfigFromJSONTyped(json: any, ignoreDiscriminato
'onShoppingListEntryCreatedEnabled': !exists(json, 'on_shopping_list_entry_created_enabled') ? undefined : json['on_shopping_list_entry_created_enabled'],
'onShoppingListEntryUpdatedEnabled': !exists(json, 'on_shopping_list_entry_updated_enabled') ? undefined : json['on_shopping_list_entry_updated_enabled'],
'onShoppingListEntryDeletedEnabled': !exists(json, 'on_shopping_list_entry_deleted_enabled') ? undefined : json['on_shopping_list_entry_deleted_enabled'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
'createdBy': json['created_by'],
};
}

View File

@@ -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,12 +13,12 @@
*/
import { exists, mapValues } from '../runtime';
import type { CookLogCreatedBy } from './CookLogCreatedBy';
import type { User } from './User';
import {
CookLogCreatedByFromJSON,
CookLogCreatedByFromJSONTyped,
CookLogCreatedByToJSON,
} from './CookLogCreatedBy';
UserFromJSON,
UserFromJSONTyped,
UserToJSON,
} from './User';
/**
*
@@ -31,7 +31,7 @@ export interface CookLog {
* @type {number}
* @memberof CookLog
*/
readonly id?: number;
readonly id: number;
/**
*
* @type {number}
@@ -58,10 +58,10 @@ export interface CookLog {
comment?: string | null;
/**
*
* @type {CookLogCreatedBy}
* @type {User}
* @memberof CookLog
*/
createdBy?: CookLogCreatedBy;
readonly createdBy: User;
/**
*
* @type {Date}
@@ -73,7 +73,7 @@ export interface CookLog {
* @type {Date}
* @memberof CookLog
*/
readonly updatedAt?: Date;
readonly updatedAt: Date;
}
/**
@@ -81,7 +81,10 @@ export interface CookLog {
*/
export function instanceOfCookLog(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "id" in value;
isInstance = isInstance && "recipe" in value;
isInstance = isInstance && "createdBy" in value;
isInstance = isInstance && "updatedAt" in value;
return isInstance;
}
@@ -96,14 +99,14 @@ export function CookLogFromJSONTyped(json: any, ignoreDiscriminator: boolean): C
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'id': json['id'],
'recipe': json['recipe'],
'servings': !exists(json, 'servings') ? undefined : json['servings'],
'rating': !exists(json, 'rating') ? undefined : json['rating'],
'comment': !exists(json, 'comment') ? undefined : json['comment'],
'createdBy': !exists(json, 'created_by') ? undefined : CookLogCreatedByFromJSON(json['created_by']),
'createdBy': UserFromJSON(json['created_by']),
'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])),
'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])),
'updatedAt': (new Date(json['updated_at'])),
};
}
@@ -120,7 +123,6 @@ export function CookLogToJSON(value?: CookLog | null): any {
'servings': value.servings,
'rating': value.rating,
'comment': value.comment,
'created_by': CookLogCreatedByToJSON(value.createdBy),
'created_at': value.createdAt === undefined ? undefined : (value.createdAt.toISOString()),
};
}

View File

@@ -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,15 +13,15 @@
*/
import { exists, mapValues } from '../runtime';
import type { CustomFilterSharedInner } from './CustomFilterSharedInner';
import type { User } from './User';
import {
CustomFilterSharedInnerFromJSON,
CustomFilterSharedInnerFromJSONTyped,
CustomFilterSharedInnerToJSON,
} from './CustomFilterSharedInner';
UserFromJSON,
UserFromJSONTyped,
UserToJSON,
} from './User';
/**
*
* Adds nested create feature
* @export
* @interface CustomFilter
*/
@@ -31,7 +31,7 @@ export interface CustomFilter {
* @type {number}
* @memberof CustomFilter
*/
readonly id?: number;
readonly id: number;
/**
*
* @type {string}
@@ -46,16 +46,16 @@ export interface CustomFilter {
search: string;
/**
*
* @type {Array<CustomFilterSharedInner>}
* @type {Array<User>}
* @memberof CustomFilter
*/
shared?: Array<CustomFilterSharedInner>;
shared?: Array<User>;
/**
*
* @type {string}
* @type {number}
* @memberof CustomFilter
*/
readonly createdBy?: string;
readonly createdBy: number;
}
/**
@@ -63,8 +63,10 @@ export interface CustomFilter {
*/
export function instanceOfCustomFilter(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "id" in value;
isInstance = isInstance && "name" in value;
isInstance = isInstance && "search" in value;
isInstance = isInstance && "createdBy" in value;
return isInstance;
}
@@ -79,11 +81,11 @@ export function CustomFilterFromJSONTyped(json: any, ignoreDiscriminator: boolea
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'id': json['id'],
'name': json['name'],
'search': json['search'],
'shared': !exists(json, 'shared') ? undefined : ((json['shared'] as Array<any>).map(CustomFilterSharedInnerFromJSON)),
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
'shared': !exists(json, 'shared') ? undefined : ((json['shared'] as Array<any>).map(UserFromJSON)),
'createdBy': json['created_by'],
};
}
@@ -98,7 +100,7 @@ export function CustomFilterToJSON(value?: CustomFilter | null): any {
'name': value.name,
'search': value.search,
'shared': value.shared === undefined ? undefined : ((value.shared as Array<any>).map(CustomFilterSharedInnerToJSON)),
'shared': value.shared === undefined ? undefined : ((value.shared as Array<any>).map(UserToJSON)),
};
}

View File

@@ -0,0 +1,41 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.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.
*/
/**
* * `SEARCH` - Search
* * `PLAN` - Meal-Plan
* * `BOOKS` - Books
* @export
*/
export const DefaultPageEnum = {
Search: 'SEARCH',
Plan: 'PLAN',
Books: 'BOOKS'
} as const;
export type DefaultPageEnum = typeof DefaultPageEnum[keyof typeof DefaultPageEnum];
export function DefaultPageEnumFromJSON(json: any): DefaultPageEnum {
return DefaultPageEnumFromJSONTyped(json, false);
}
export function DefaultPageEnumFromJSONTyped(json: any, ignoreDiscriminator: boolean): DefaultPageEnum {
return json as DefaultPageEnum;
}
export function DefaultPageEnumToJSON(value?: DefaultPageEnum | null): any {
return value as any;
}

View File

@@ -0,0 +1,37 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.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.
*/
/**
* * `true` - true
* @export
*/
export const DeleteEnum = {
True: 'true'
} as const;
export type DeleteEnum = typeof DeleteEnum[keyof typeof DeleteEnum];
export function DeleteEnumFromJSON(json: any): DeleteEnum {
return DeleteEnumFromJSONTyped(json, false);
}
export function DeleteEnumFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeleteEnum {
return json as DeleteEnum;
}
export function DeleteEnumToJSON(value?: DeleteEnum | null): any {
return value as any;
}

View File

@@ -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).
@@ -24,7 +24,7 @@ export interface ExportLog {
* @type {number}
* @memberof ExportLog
*/
readonly id?: number;
readonly id: number;
/**
*
* @type {string}
@@ -69,16 +69,16 @@ export interface ExportLog {
possiblyNotExpired?: boolean;
/**
*
* @type {string}
* @type {number}
* @memberof ExportLog
*/
readonly createdBy?: string;
readonly createdBy: number;
/**
*
* @type {Date}
* @memberof ExportLog
*/
readonly createdAt?: Date;
readonly createdAt: Date;
}
/**
@@ -86,7 +86,10 @@ export interface ExportLog {
*/
export function instanceOfExportLog(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "id" in value;
isInstance = isInstance && "type" in value;
isInstance = isInstance && "createdBy" in value;
isInstance = isInstance && "createdAt" in value;
return isInstance;
}
@@ -101,7 +104,7 @@ export function ExportLogFromJSONTyped(json: any, ignoreDiscriminator: boolean):
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'id': json['id'],
'type': json['type'],
'msg': !exists(json, 'msg') ? undefined : json['msg'],
'running': !exists(json, 'running') ? undefined : json['running'],
@@ -109,8 +112,8 @@ export function ExportLogFromJSONTyped(json: any, ignoreDiscriminator: boolean):
'exportedRecipes': !exists(json, 'exported_recipes') ? undefined : json['exported_recipes'],
'cacheDuration': !exists(json, 'cache_duration') ? undefined : json['cache_duration'],
'possiblyNotExpired': !exists(json, 'possibly_not_expired') ? undefined : json['possibly_not_expired'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])),
'createdBy': json['created_by'],
'createdAt': (new Date(json['created_at'])),
};
}

View File

@@ -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,45 +13,79 @@
*/
import { exists, mapValues } from '../runtime';
import type { FoodInheritFieldsInner } from './FoodInheritFieldsInner';
import type { FoodInheritField } from './FoodInheritField';
import {
FoodInheritFieldsInnerFromJSON,
FoodInheritFieldsInnerFromJSONTyped,
FoodInheritFieldsInnerToJSON,
} from './FoodInheritFieldsInner';
import type { FoodPropertiesFoodUnit } from './FoodPropertiesFoodUnit';
FoodInheritFieldFromJSON,
FoodInheritFieldFromJSONTyped,
FoodInheritFieldToJSON,
} from './FoodInheritField';
import type { FoodSimple } from './FoodSimple';
import {
FoodPropertiesFoodUnitFromJSON,
FoodPropertiesFoodUnitFromJSONTyped,
FoodPropertiesFoodUnitToJSON,
} from './FoodPropertiesFoodUnit';
import type { FoodPropertiesInner } from './FoodPropertiesInner';
FoodSimpleFromJSON,
FoodSimpleFromJSONTyped,
FoodSimpleToJSON,
} from './FoodSimple';
import type { Property } from './Property';
import {
FoodPropertiesInnerFromJSON,
FoodPropertiesInnerFromJSONTyped,
FoodPropertiesInnerToJSON,
} from './FoodPropertiesInner';
import type { FoodRecipe } from './FoodRecipe';
PropertyFromJSON,
PropertyFromJSONTyped,
PropertyToJSON,
} from './Property';
import type { RecipeSimple } from './RecipeSimple';
import {
FoodRecipeFromJSON,
FoodRecipeFromJSONTyped,
FoodRecipeToJSON,
} from './FoodRecipe';
import type { FoodSubstituteInner } from './FoodSubstituteInner';
RecipeSimpleFromJSON,
RecipeSimpleFromJSONTyped,
RecipeSimpleToJSON,
} from './RecipeSimple';
import type { SupermarketCategory } from './SupermarketCategory';
import {
FoodSubstituteInnerFromJSON,
FoodSubstituteInnerFromJSONTyped,
FoodSubstituteInnerToJSON,
} from './FoodSubstituteInner';
import type { FoodSupermarketCategory } from './FoodSupermarketCategory';
SupermarketCategoryFromJSON,
SupermarketCategoryFromJSONTyped,
SupermarketCategoryToJSON,
} from './SupermarketCategory';
import type { Unit } from './Unit';
import {
FoodSupermarketCategoryFromJSON,
FoodSupermarketCategoryFromJSONTyped,
FoodSupermarketCategoryToJSON,
} from './FoodSupermarketCategory';
UnitFromJSON,
UnitFromJSONTyped,
UnitToJSON,
} from './Unit';
/**
* 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 Food
*/
@@ -61,7 +95,7 @@ export interface Food {
* @type {number}
* @memberof Food
*/
readonly id?: number;
readonly id: number;
/**
*
* @type {string}
@@ -85,13 +119,13 @@ export interface Food {
* @type {string}
* @memberof Food
*/
readonly shopping?: string;
readonly shopping: string;
/**
*
* @type {FoodRecipe}
* @type {RecipeSimple}
* @memberof Food
*/
recipe?: FoodRecipe | null;
recipe?: RecipeSimple | null;
/**
*
* @type {string}
@@ -100,10 +134,10 @@ export interface Food {
url?: string | null;
/**
*
* @type {Array<FoodPropertiesInner>}
* @type {Array<Property>}
* @memberof Food
*/
properties?: Array<FoodPropertiesInner> | null;
properties?: Array<Property> | null;
/**
*
* @type {string}
@@ -112,10 +146,10 @@ export interface Food {
propertiesFoodAmount?: string;
/**
*
* @type {FoodPropertiesFoodUnit}
* @type {Unit}
* @memberof Food
*/
propertiesFoodUnit?: FoodPropertiesFoodUnit | null;
propertiesFoodUnit?: Unit | null;
/**
*
* @type {number}
@@ -130,34 +164,34 @@ export interface Food {
foodOnhand?: string | null;
/**
*
* @type {FoodSupermarketCategory}
* @type {SupermarketCategory}
* @memberof Food
*/
supermarketCategory?: FoodSupermarketCategory | null;
supermarketCategory?: SupermarketCategory | null;
/**
*
* @type {string}
* @memberof Food
*/
readonly parent?: string;
readonly parent: string;
/**
*
* @type {number}
* @memberof Food
*/
readonly numchild?: number;
readonly numchild: number;
/**
*
* @type {Array<FoodInheritFieldsInner>}
* @type {Array<FoodInheritField>}
* @memberof Food
*/
inheritFields?: Array<FoodInheritFieldsInner> | null;
inheritFields?: Array<FoodInheritField> | null;
/**
*
* @type {string}
* @memberof Food
*/
readonly fullName?: string;
readonly fullName: string;
/**
*
* @type {boolean}
@@ -166,10 +200,10 @@ export interface Food {
ignoreShopping?: boolean;
/**
*
* @type {Array<FoodSubstituteInner>}
* @type {Array<FoodSimple>}
* @memberof Food
*/
substitute?: Array<FoodSubstituteInner> | null;
substitute?: Array<FoodSimple> | null;
/**
*
* @type {boolean}
@@ -187,13 +221,13 @@ export interface Food {
* @type {string}
* @memberof Food
*/
readonly substituteOnhand?: string;
readonly substituteOnhand: string;
/**
*
* @type {Array<FoodInheritFieldsInner>}
* @type {Array<FoodInheritField>}
* @memberof Food
*/
childInheritFields?: Array<FoodInheritFieldsInner> | null;
childInheritFields?: Array<FoodInheritField> | null;
/**
*
* @type {string}
@@ -207,7 +241,13 @@ export interface Food {
*/
export function instanceOfFood(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "id" in value;
isInstance = isInstance && "name" in value;
isInstance = isInstance && "shopping" in value;
isInstance = isInstance && "parent" in value;
isInstance = isInstance && "numchild" in value;
isInstance = isInstance && "fullName" in value;
isInstance = isInstance && "substituteOnhand" in value;
return isInstance;
}
@@ -222,29 +262,29 @@ export function FoodFromJSONTyped(json: any, ignoreDiscriminator: boolean): Food
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'id': json['id'],
'name': json['name'],
'pluralName': !exists(json, 'plural_name') ? undefined : json['plural_name'],
'description': !exists(json, 'description') ? undefined : json['description'],
'shopping': !exists(json, 'shopping') ? undefined : json['shopping'],
'recipe': !exists(json, 'recipe') ? undefined : FoodRecipeFromJSON(json['recipe']),
'shopping': json['shopping'],
'recipe': !exists(json, 'recipe') ? undefined : RecipeSimpleFromJSON(json['recipe']),
'url': !exists(json, 'url') ? undefined : json['url'],
'properties': !exists(json, 'properties') ? undefined : (json['properties'] === null ? null : (json['properties'] as Array<any>).map(FoodPropertiesInnerFromJSON)),
'properties': !exists(json, 'properties') ? undefined : (json['properties'] === null ? null : (json['properties'] as Array<any>).map(PropertyFromJSON)),
'propertiesFoodAmount': !exists(json, 'properties_food_amount') ? undefined : json['properties_food_amount'],
'propertiesFoodUnit': !exists(json, 'properties_food_unit') ? undefined : FoodPropertiesFoodUnitFromJSON(json['properties_food_unit']),
'propertiesFoodUnit': !exists(json, 'properties_food_unit') ? undefined : UnitFromJSON(json['properties_food_unit']),
'fdcId': !exists(json, 'fdc_id') ? undefined : json['fdc_id'],
'foodOnhand': !exists(json, 'food_onhand') ? undefined : json['food_onhand'],
'supermarketCategory': !exists(json, 'supermarket_category') ? undefined : FoodSupermarketCategoryFromJSON(json['supermarket_category']),
'parent': !exists(json, 'parent') ? undefined : json['parent'],
'numchild': !exists(json, 'numchild') ? undefined : json['numchild'],
'inheritFields': !exists(json, 'inherit_fields') ? undefined : (json['inherit_fields'] === null ? null : (json['inherit_fields'] as Array<any>).map(FoodInheritFieldsInnerFromJSON)),
'fullName': !exists(json, 'full_name') ? undefined : json['full_name'],
'supermarketCategory': !exists(json, 'supermarket_category') ? undefined : SupermarketCategoryFromJSON(json['supermarket_category']),
'parent': json['parent'],
'numchild': json['numchild'],
'inheritFields': !exists(json, 'inherit_fields') ? undefined : (json['inherit_fields'] === null ? null : (json['inherit_fields'] as Array<any>).map(FoodInheritFieldFromJSON)),
'fullName': json['full_name'],
'ignoreShopping': !exists(json, 'ignore_shopping') ? undefined : json['ignore_shopping'],
'substitute': !exists(json, 'substitute') ? undefined : (json['substitute'] === null ? null : (json['substitute'] as Array<any>).map(FoodSubstituteInnerFromJSON)),
'substitute': !exists(json, 'substitute') ? undefined : (json['substitute'] === null ? null : (json['substitute'] as Array<any>).map(FoodSimpleFromJSON)),
'substituteSiblings': !exists(json, 'substitute_siblings') ? undefined : json['substitute_siblings'],
'substituteChildren': !exists(json, 'substitute_children') ? undefined : json['substitute_children'],
'substituteOnhand': !exists(json, 'substitute_onhand') ? undefined : json['substitute_onhand'],
'childInheritFields': !exists(json, 'child_inherit_fields') ? undefined : (json['child_inherit_fields'] === null ? null : (json['child_inherit_fields'] as Array<any>).map(FoodInheritFieldsInnerFromJSON)),
'substituteOnhand': json['substitute_onhand'],
'childInheritFields': !exists(json, 'child_inherit_fields') ? undefined : (json['child_inherit_fields'] === null ? null : (json['child_inherit_fields'] as Array<any>).map(FoodInheritFieldFromJSON)),
'openDataSlug': !exists(json, 'open_data_slug') ? undefined : json['open_data_slug'],
};
}
@@ -261,20 +301,20 @@ export function FoodToJSON(value?: Food | null): any {
'name': value.name,
'plural_name': value.pluralName,
'description': value.description,
'recipe': FoodRecipeToJSON(value.recipe),
'recipe': RecipeSimpleToJSON(value.recipe),
'url': value.url,
'properties': value.properties === undefined ? undefined : (value.properties === null ? null : (value.properties as Array<any>).map(FoodPropertiesInnerToJSON)),
'properties': value.properties === undefined ? undefined : (value.properties === null ? null : (value.properties as Array<any>).map(PropertyToJSON)),
'properties_food_amount': value.propertiesFoodAmount,
'properties_food_unit': FoodPropertiesFoodUnitToJSON(value.propertiesFoodUnit),
'properties_food_unit': UnitToJSON(value.propertiesFoodUnit),
'fdc_id': value.fdcId,
'food_onhand': value.foodOnhand,
'supermarket_category': FoodSupermarketCategoryToJSON(value.supermarketCategory),
'inherit_fields': value.inheritFields === undefined ? undefined : (value.inheritFields === null ? null : (value.inheritFields as Array<any>).map(FoodInheritFieldsInnerToJSON)),
'supermarket_category': SupermarketCategoryToJSON(value.supermarketCategory),
'inherit_fields': value.inheritFields === undefined ? undefined : (value.inheritFields === null ? null : (value.inheritFields as Array<any>).map(FoodInheritFieldToJSON)),
'ignore_shopping': value.ignoreShopping,
'substitute': value.substitute === undefined ? undefined : (value.substitute === null ? null : (value.substitute as Array<any>).map(FoodSubstituteInnerToJSON)),
'substitute': value.substitute === undefined ? undefined : (value.substitute === null ? null : (value.substitute as Array<any>).map(FoodSimpleToJSON)),
'substitute_siblings': value.substituteSiblings,
'substitute_children': value.substituteChildren,
'child_inherit_fields': value.childInheritFields === undefined ? undefined : (value.childInheritFields === null ? null : (value.childInheritFields as Array<any>).map(FoodInheritFieldsInnerToJSON)),
'child_inherit_fields': value.childInheritFields === undefined ? undefined : (value.childInheritFields === null ? null : (value.childInheritFields as Array<any>).map(FoodInheritFieldToJSON)),
'open_data_slug': value.openDataSlug,
};
}

View File

@@ -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).
@@ -14,7 +14,41 @@
import { exists, mapValues } from '../runtime';
/**
* 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 FoodInheritField
*/
@@ -24,7 +58,7 @@ export interface FoodInheritField {
* @type {number}
* @memberof FoodInheritField
*/
readonly id?: number;
readonly id: number;
/**
*
* @type {string}
@@ -44,6 +78,7 @@ export interface FoodInheritField {
*/
export function instanceOfFoodInheritField(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "id" in value;
return isInstance;
}
@@ -58,7 +93,7 @@ export function FoodInheritFieldFromJSONTyped(json: any, ignoreDiscriminator: bo
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'id': json['id'],
'name': !exists(json, 'name') ? undefined : json['name'],
'field': !exists(json, 'field') ? undefined : json['field'],
};

View File

@@ -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,6 +13,13 @@
*/
import { exists, mapValues } from '../runtime';
import type { FoodShoppingUpdateDelete } from './FoodShoppingUpdateDelete';
import {
FoodShoppingUpdateDeleteFromJSON,
FoodShoppingUpdateDeleteFromJSONTyped,
FoodShoppingUpdateDeleteToJSON,
} from './FoodShoppingUpdateDelete';
/**
*
* @export
@@ -24,7 +31,7 @@ export interface FoodShoppingUpdate {
* @type {number}
* @memberof FoodShoppingUpdate
*/
readonly id?: number;
readonly id: number;
/**
* Amount of food to add to the shopping list
* @type {number}
@@ -38,28 +45,19 @@ export interface FoodShoppingUpdate {
*/
unit?: number | null;
/**
* When set to true will delete all food from active shopping lists.
* @type {string}
*
* @type {FoodShoppingUpdateDelete}
* @memberof FoodShoppingUpdate
*/
_delete: FoodShoppingUpdateDeleteEnum | null;
_delete: FoodShoppingUpdateDelete | null;
}
/**
* @export
*/
export const FoodShoppingUpdateDeleteEnum = {
True: 'true'
} as const;
export type FoodShoppingUpdateDeleteEnum = typeof FoodShoppingUpdateDeleteEnum[keyof typeof FoodShoppingUpdateDeleteEnum];
/**
* Check if a given object implements the FoodShoppingUpdate interface.
*/
export function instanceOfFoodShoppingUpdate(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "id" in value;
isInstance = isInstance && "_delete" in value;
return isInstance;
@@ -75,10 +73,10 @@ export function FoodShoppingUpdateFromJSONTyped(json: any, ignoreDiscriminator:
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'id': json['id'],
'amount': !exists(json, 'amount') ? undefined : json['amount'],
'unit': !exists(json, 'unit') ? undefined : json['unit'],
'_delete': json['delete'],
'_delete': FoodShoppingUpdateDeleteFromJSON(json['delete']),
};
}
@@ -93,7 +91,7 @@ export function FoodShoppingUpdateToJSON(value?: FoodShoppingUpdate | null): any
'amount': value.amount,
'unit': value.unit,
'delete': value._delete,
'delete': FoodShoppingUpdateDeleteToJSON(value._delete),
};
}

View File

@@ -0,0 +1,67 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.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 type { BlankEnum } from './BlankEnum';
import {
instanceOfBlankEnum,
BlankEnumFromJSON,
BlankEnumFromJSONTyped,
BlankEnumToJSON,
} from './BlankEnum';
import type { DeleteEnum } from './DeleteEnum';
import {
instanceOfDeleteEnum,
DeleteEnumFromJSON,
DeleteEnumFromJSONTyped,
DeleteEnumToJSON,
} from './DeleteEnum';
/**
* @type FoodShoppingUpdateDelete
* When set to true will delete all food from active shopping lists.
*
* * `true` - true
* @export
*/
export type FoodShoppingUpdateDelete = BlankEnum | DeleteEnum;
export function FoodShoppingUpdateDeleteFromJSON(json: any): FoodShoppingUpdateDelete {
return FoodShoppingUpdateDeleteFromJSONTyped(json, false);
}
export function FoodShoppingUpdateDeleteFromJSONTyped(json: any, ignoreDiscriminator: boolean): FoodShoppingUpdateDelete {
if ((json === undefined) || (json === null)) {
return json;
}
return { ...BlankEnumFromJSONTyped(json, true), ...DeleteEnumFromJSONTyped(json, true) };
}
export function FoodShoppingUpdateDeleteToJSON(value?: FoodShoppingUpdateDelete | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
if (instanceOfBlankEnum(value)) {
return BlankEnumToJSON(value as BlankEnum);
}
if (instanceOfDeleteEnum(value)) {
return DeleteEnumToJSON(value as DeleteEnum);
}
return {};
}

View File

@@ -0,0 +1,82 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.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 FoodSimple
*/
export interface FoodSimple {
/**
*
* @type {number}
* @memberof FoodSimple
*/
readonly id: number;
/**
*
* @type {string}
* @memberof FoodSimple
*/
name: string;
/**
*
* @type {string}
* @memberof FoodSimple
*/
pluralName?: string | null;
}
/**
* Check if a given object implements the FoodSimple interface.
*/
export function instanceOfFoodSimple(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "id" in value;
isInstance = isInstance && "name" in value;
return isInstance;
}
export function FoodSimpleFromJSON(json: any): FoodSimple {
return FoodSimpleFromJSONTyped(json, false);
}
export function FoodSimpleFromJSONTyped(json: any, ignoreDiscriminator: boolean): FoodSimple {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': json['id'],
'name': json['name'],
'pluralName': !exists(json, 'plural_name') ? undefined : json['plural_name'],
};
}
export function FoodSimpleToJSON(value?: FoodSimple | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'name': value.name,
'plural_name': value.pluralName,
};
}

View File

@@ -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).
@@ -14,7 +14,41 @@
import { exists, mapValues } from '../runtime';
/**
* 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 Group
*/
@@ -24,7 +58,7 @@ export interface Group {
* @type {number}
* @memberof Group
*/
readonly id?: number;
readonly id: number;
/**
*
* @type {string}
@@ -38,6 +72,7 @@ export interface Group {
*/
export function instanceOfGroup(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "id" in value;
isInstance = isInstance && "name" in value;
return isInstance;
@@ -53,7 +88,7 @@ export function GroupFromJSONTyped(json: any, ignoreDiscriminator: boolean): Gro
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'id': json['id'],
'name': json['name'],
};
}

View File

@@ -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,12 +13,12 @@
*/
import { exists, mapValues } from '../runtime';
import type { ImportLogKeyword } from './ImportLogKeyword';
import type { Keyword } from './Keyword';
import {
ImportLogKeywordFromJSON,
ImportLogKeywordFromJSONTyped,
ImportLogKeywordToJSON,
} from './ImportLogKeyword';
KeywordFromJSON,
KeywordFromJSONTyped,
KeywordToJSON,
} from './Keyword';
/**
*
@@ -31,7 +31,7 @@ export interface ImportLog {
* @type {number}
* @memberof ImportLog
*/
readonly id?: number;
readonly id: number;
/**
*
* @type {string}
@@ -52,10 +52,10 @@ export interface ImportLog {
running?: boolean;
/**
*
* @type {ImportLogKeyword}
* @type {Keyword}
* @memberof ImportLog
*/
keyword?: ImportLogKeyword;
readonly keyword: Keyword;
/**
*
* @type {number}
@@ -70,16 +70,16 @@ export interface ImportLog {
importedRecipes?: number;
/**
*
* @type {string}
* @type {number}
* @memberof ImportLog
*/
readonly createdBy?: string;
readonly createdBy: number;
/**
*
* @type {Date}
* @memberof ImportLog
*/
readonly createdAt?: Date;
readonly createdAt: Date;
}
/**
@@ -87,7 +87,11 @@ export interface ImportLog {
*/
export function instanceOfImportLog(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "id" in value;
isInstance = isInstance && "type" in value;
isInstance = isInstance && "keyword" in value;
isInstance = isInstance && "createdBy" in value;
isInstance = isInstance && "createdAt" in value;
return isInstance;
}
@@ -102,15 +106,15 @@ export function ImportLogFromJSONTyped(json: any, ignoreDiscriminator: boolean):
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'id': json['id'],
'type': json['type'],
'msg': !exists(json, 'msg') ? undefined : json['msg'],
'running': !exists(json, 'running') ? undefined : json['running'],
'keyword': !exists(json, 'keyword') ? undefined : ImportLogKeywordFromJSON(json['keyword']),
'keyword': KeywordFromJSON(json['keyword']),
'totalRecipes': !exists(json, 'total_recipes') ? undefined : json['total_recipes'],
'importedRecipes': !exists(json, 'imported_recipes') ? undefined : json['imported_recipes'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])),
'createdBy': json['created_by'],
'createdAt': (new Date(json['created_at'])),
};
}
@@ -126,7 +130,6 @@ export function ImportLogToJSON(value?: ImportLog | null): any {
'type': value.type,
'msg': value.msg,
'running': value.running,
'keyword': ImportLogKeywordToJSON(value.keyword),
'total_recipes': value.totalRecipes,
'imported_recipes': value.importedRecipes,
};

View File

@@ -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,21 +13,21 @@
*/
import { exists, mapValues } from '../runtime';
import type { FoodPropertiesFoodUnit } from './FoodPropertiesFoodUnit';
import type { Food } from './Food';
import {
FoodPropertiesFoodUnitFromJSON,
FoodPropertiesFoodUnitFromJSONTyped,
FoodPropertiesFoodUnitToJSON,
} from './FoodPropertiesFoodUnit';
import type { IngredientFood } from './IngredientFood';
FoodFromJSON,
FoodFromJSONTyped,
FoodToJSON,
} from './Food';
import type { Unit } from './Unit';
import {
IngredientFoodFromJSON,
IngredientFoodFromJSONTyped,
IngredientFoodToJSON,
} from './IngredientFood';
UnitFromJSON,
UnitFromJSONTyped,
UnitToJSON,
} from './Unit';
/**
*
* Adds nested create feature
* @export
* @interface Ingredient
*/
@@ -37,19 +37,19 @@ export interface Ingredient {
* @type {number}
* @memberof Ingredient
*/
readonly id?: number;
readonly id: number;
/**
*
* @type {IngredientFood}
* @type {Food}
* @memberof Ingredient
*/
food: IngredientFood | null;
food: Food | null;
/**
*
* @type {FoodPropertiesFoodUnit}
* @type {Unit}
* @memberof Ingredient
*/
unit: FoodPropertiesFoodUnit | null;
unit: Unit | null;
/**
*
* @type {string}
@@ -61,7 +61,7 @@ export interface Ingredient {
* @type {string}
* @memberof Ingredient
*/
readonly conversions?: string;
readonly conversions: string;
/**
*
* @type {string}
@@ -97,7 +97,7 @@ export interface Ingredient {
* @type {string}
* @memberof Ingredient
*/
readonly usedInRecipes?: string;
readonly usedInRecipes: string;
/**
*
* @type {boolean}
@@ -117,9 +117,12 @@ export interface Ingredient {
*/
export function instanceOfIngredient(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "id" in value;
isInstance = isInstance && "food" in value;
isInstance = isInstance && "unit" in value;
isInstance = isInstance && "amount" in value;
isInstance = isInstance && "conversions" in value;
isInstance = isInstance && "usedInRecipes" in value;
return isInstance;
}
@@ -134,17 +137,17 @@ export function IngredientFromJSONTyped(json: any, ignoreDiscriminator: boolean)
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'food': IngredientFoodFromJSON(json['food']),
'unit': FoodPropertiesFoodUnitFromJSON(json['unit']),
'id': json['id'],
'food': FoodFromJSON(json['food']),
'unit': UnitFromJSON(json['unit']),
'amount': json['amount'],
'conversions': !exists(json, 'conversions') ? undefined : json['conversions'],
'conversions': json['conversions'],
'note': !exists(json, 'note') ? undefined : json['note'],
'order': !exists(json, 'order') ? undefined : json['order'],
'isHeader': !exists(json, 'is_header') ? undefined : json['is_header'],
'noAmount': !exists(json, 'no_amount') ? undefined : json['no_amount'],
'originalText': !exists(json, 'original_text') ? undefined : json['original_text'],
'usedInRecipes': !exists(json, 'used_in_recipes') ? undefined : json['used_in_recipes'],
'usedInRecipes': json['used_in_recipes'],
'alwaysUsePluralUnit': !exists(json, 'always_use_plural_unit') ? undefined : json['always_use_plural_unit'],
'alwaysUsePluralFood': !exists(json, 'always_use_plural_food') ? undefined : json['always_use_plural_food'],
};
@@ -159,8 +162,8 @@ export function IngredientToJSON(value?: Ingredient | null): any {
}
return {
'food': IngredientFoodToJSON(value.food),
'unit': FoodPropertiesFoodUnitToJSON(value.unit),
'food': FoodToJSON(value.food),
'unit': UnitToJSON(value.unit),
'amount': value.amount,
'note': value.note,
'order': value.order,

View File

@@ -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,15 +13,15 @@
*/
import { exists, mapValues } from '../runtime';
import type { InviteLinkGroup } from './InviteLinkGroup';
import type { Group } from './Group';
import {
InviteLinkGroupFromJSON,
InviteLinkGroupFromJSONTyped,
InviteLinkGroupToJSON,
} from './InviteLinkGroup';
GroupFromJSON,
GroupFromJSONTyped,
GroupToJSON,
} from './Group';
/**
*
* Adds nested create feature
* @export
* @interface InviteLink
*/
@@ -31,13 +31,13 @@ export interface InviteLink {
* @type {number}
* @memberof InviteLink
*/
readonly id?: number;
readonly id: number;
/**
*
* @type {string}
* @memberof InviteLink
*/
readonly uuid?: string;
readonly uuid: string;
/**
*
* @type {string}
@@ -46,10 +46,10 @@ export interface InviteLink {
email?: string;
/**
*
* @type {InviteLinkGroup}
* @type {Group}
* @memberof InviteLink
*/
group: InviteLinkGroup;
group: Group;
/**
*
* @type {Date}
@@ -76,16 +76,16 @@ export interface InviteLink {
internalNote?: string | null;
/**
*
* @type {string}
* @type {number}
* @memberof InviteLink
*/
readonly createdBy?: string;
readonly createdBy: number;
/**
*
* @type {Date}
* @memberof InviteLink
*/
readonly createdAt?: Date;
readonly createdAt: Date;
}
/**
@@ -93,7 +93,11 @@ export interface InviteLink {
*/
export function instanceOfInviteLink(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "id" in value;
isInstance = isInstance && "uuid" in value;
isInstance = isInstance && "group" in value;
isInstance = isInstance && "createdBy" in value;
isInstance = isInstance && "createdAt" in value;
return isInstance;
}
@@ -108,16 +112,16 @@ export function InviteLinkFromJSONTyped(json: any, ignoreDiscriminator: boolean)
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'uuid': !exists(json, 'uuid') ? undefined : json['uuid'],
'id': json['id'],
'uuid': json['uuid'],
'email': !exists(json, 'email') ? undefined : json['email'],
'group': InviteLinkGroupFromJSON(json['group']),
'group': GroupFromJSON(json['group']),
'validUntil': !exists(json, 'valid_until') ? undefined : (new Date(json['valid_until'])),
'usedBy': !exists(json, 'used_by') ? undefined : json['used_by'],
'reusable': !exists(json, 'reusable') ? undefined : json['reusable'],
'internalNote': !exists(json, 'internal_note') ? undefined : json['internal_note'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])),
'createdBy': json['created_by'],
'createdAt': (new Date(json['created_at'])),
};
}
@@ -131,7 +135,7 @@ export function InviteLinkToJSON(value?: InviteLink | null): any {
return {
'email': value.email,
'group': InviteLinkGroupToJSON(value.group),
'group': GroupToJSON(value.group),
'valid_until': value.validUntil === undefined ? undefined : (value.validUntil.toISOString().substring(0,10)),
'used_by': value.usedBy,
'reusable': value.reusable,

View File

@@ -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).
@@ -14,7 +14,41 @@
import { exists, mapValues } from '../runtime';
/**
* 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 Keyword
*/
@@ -24,7 +58,7 @@ export interface Keyword {
* @type {number}
* @memberof Keyword
*/
readonly id?: number;
readonly id: number;
/**
*
* @type {string}
@@ -36,7 +70,7 @@ export interface Keyword {
* @type {string}
* @memberof Keyword
*/
readonly label?: string;
readonly label: string;
/**
*
* @type {string}
@@ -48,31 +82,31 @@ export interface Keyword {
* @type {string}
* @memberof Keyword
*/
readonly parent?: string;
readonly parent: string;
/**
*
* @type {number}
* @memberof Keyword
*/
readonly numchild?: number;
readonly numchild: number;
/**
*
* @type {Date}
* @memberof Keyword
*/
readonly createdAt?: Date;
readonly createdAt: Date;
/**
*
* @type {Date}
* @memberof Keyword
*/
readonly updatedAt?: Date;
readonly updatedAt: Date;
/**
*
* @type {string}
* @memberof Keyword
*/
readonly fullName?: string;
readonly fullName: string;
}
/**
@@ -80,7 +114,14 @@ export interface Keyword {
*/
export function instanceOfKeyword(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "id" in value;
isInstance = isInstance && "name" in value;
isInstance = isInstance && "label" in value;
isInstance = isInstance && "parent" in value;
isInstance = isInstance && "numchild" in value;
isInstance = isInstance && "createdAt" in value;
isInstance = isInstance && "updatedAt" in value;
isInstance = isInstance && "fullName" in value;
return isInstance;
}
@@ -95,15 +136,15 @@ export function KeywordFromJSONTyped(json: any, ignoreDiscriminator: boolean): K
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'id': json['id'],
'name': json['name'],
'label': !exists(json, 'label') ? undefined : json['label'],
'label': json['label'],
'description': !exists(json, 'description') ? undefined : json['description'],
'parent': !exists(json, 'parent') ? undefined : json['parent'],
'numchild': !exists(json, 'numchild') ? undefined : json['numchild'],
'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])),
'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])),
'fullName': !exists(json, 'full_name') ? undefined : json['full_name'],
'parent': json['parent'],
'numchild': json['numchild'],
'createdAt': (new Date(json['created_at'])),
'updatedAt': (new Date(json['updated_at'])),
'fullName': json['full_name'],
};
}

View File

@@ -0,0 +1,73 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.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 KeywordLabel
*/
export interface KeywordLabel {
/**
*
* @type {number}
* @memberof KeywordLabel
*/
readonly id: number;
/**
*
* @type {string}
* @memberof KeywordLabel
*/
readonly label: string;
}
/**
* Check if a given object implements the KeywordLabel interface.
*/
export function instanceOfKeywordLabel(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "id" in value;
isInstance = isInstance && "label" in value;
return isInstance;
}
export function KeywordLabelFromJSON(json: any): KeywordLabel {
return KeywordLabelFromJSONTyped(json, false);
}
export function KeywordLabelFromJSONTyped(json: any, ignoreDiscriminator: boolean): KeywordLabel {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': json['id'],
'label': json['label'],
};
}
export function KeywordLabelToJSON(value?: KeywordLabel | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
};
}

View File

@@ -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,27 +13,27 @@
*/
import { exists, mapValues } from '../runtime';
import type { CustomFilterSharedInner } from './CustomFilterSharedInner';
import type { MealType } from './MealType';
import {
CustomFilterSharedInnerFromJSON,
CustomFilterSharedInnerFromJSONTyped,
CustomFilterSharedInnerToJSON,
} from './CustomFilterSharedInner';
import type { MealPlanMealType } from './MealPlanMealType';
MealTypeFromJSON,
MealTypeFromJSONTyped,
MealTypeToJSON,
} from './MealType';
import type { RecipeOverview } from './RecipeOverview';
import {
MealPlanMealTypeFromJSON,
MealPlanMealTypeFromJSONTyped,
MealPlanMealTypeToJSON,
} from './MealPlanMealType';
import type { MealPlanRecipe } from './MealPlanRecipe';
RecipeOverviewFromJSON,
RecipeOverviewFromJSONTyped,
RecipeOverviewToJSON,
} from './RecipeOverview';
import type { User } from './User';
import {
MealPlanRecipeFromJSON,
MealPlanRecipeFromJSONTyped,
MealPlanRecipeToJSON,
} from './MealPlanRecipe';
UserFromJSON,
UserFromJSONTyped,
UserToJSON,
} from './User';
/**
*
* Adds nested create feature
* @export
* @interface MealPlan
*/
@@ -43,7 +43,7 @@ export interface MealPlan {
* @type {number}
* @memberof MealPlan
*/
readonly id?: number;
readonly id: number;
/**
*
* @type {string}
@@ -52,10 +52,10 @@ export interface MealPlan {
title?: string;
/**
*
* @type {MealPlanRecipe}
* @type {RecipeOverview}
* @memberof MealPlan
*/
recipe?: MealPlanRecipe | null;
recipe?: RecipeOverview | null;
/**
*
* @type {string}
@@ -73,7 +73,7 @@ export interface MealPlan {
* @type {string}
* @memberof MealPlan
*/
readonly noteMarkdown?: string;
readonly noteMarkdown: string;
/**
*
* @type {Date}
@@ -88,40 +88,40 @@ export interface MealPlan {
toDate?: Date;
/**
*
* @type {MealPlanMealType}
* @type {MealType}
* @memberof MealPlan
*/
mealType: MealPlanMealType;
mealType: MealType;
/**
*
* @type {number}
* @memberof MealPlan
*/
readonly createdBy: number;
/**
*
* @type {Array<User>}
* @memberof MealPlan
*/
shared?: Array<User> | null;
/**
*
* @type {string}
* @memberof MealPlan
*/
readonly createdBy?: string;
/**
*
* @type {Array<CustomFilterSharedInner>}
* @memberof MealPlan
*/
shared?: Array<CustomFilterSharedInner> | null;
readonly recipeName: string;
/**
*
* @type {string}
* @memberof MealPlan
*/
readonly recipeName?: string;
readonly mealTypeName: string;
/**
*
* @type {string}
* @memberof MealPlan
*/
readonly mealTypeName?: string;
/**
*
* @type {string}
* @memberof MealPlan
*/
readonly shopping?: string;
readonly shopping: string;
}
/**
@@ -129,9 +129,15 @@ export interface MealPlan {
*/
export function instanceOfMealPlan(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "id" in value;
isInstance = isInstance && "servings" in value;
isInstance = isInstance && "noteMarkdown" in value;
isInstance = isInstance && "fromDate" in value;
isInstance = isInstance && "mealType" in value;
isInstance = isInstance && "createdBy" in value;
isInstance = isInstance && "recipeName" in value;
isInstance = isInstance && "mealTypeName" in value;
isInstance = isInstance && "shopping" in value;
return isInstance;
}
@@ -146,20 +152,20 @@ export function MealPlanFromJSONTyped(json: any, ignoreDiscriminator: boolean):
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'id': json['id'],
'title': !exists(json, 'title') ? undefined : json['title'],
'recipe': !exists(json, 'recipe') ? undefined : MealPlanRecipeFromJSON(json['recipe']),
'recipe': !exists(json, 'recipe') ? undefined : RecipeOverviewFromJSON(json['recipe']),
'servings': json['servings'],
'note': !exists(json, 'note') ? undefined : json['note'],
'noteMarkdown': !exists(json, 'note_markdown') ? undefined : json['note_markdown'],
'noteMarkdown': json['note_markdown'],
'fromDate': (new Date(json['from_date'])),
'toDate': !exists(json, 'to_date') ? undefined : (new Date(json['to_date'])),
'mealType': MealPlanMealTypeFromJSON(json['meal_type']),
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
'shared': !exists(json, 'shared') ? undefined : (json['shared'] === null ? null : (json['shared'] as Array<any>).map(CustomFilterSharedInnerFromJSON)),
'recipeName': !exists(json, 'recipe_name') ? undefined : json['recipe_name'],
'mealTypeName': !exists(json, 'meal_type_name') ? undefined : json['meal_type_name'],
'shopping': !exists(json, 'shopping') ? undefined : json['shopping'],
'mealType': MealTypeFromJSON(json['meal_type']),
'createdBy': json['created_by'],
'shared': !exists(json, 'shared') ? undefined : (json['shared'] === null ? null : (json['shared'] as Array<any>).map(UserFromJSON)),
'recipeName': json['recipe_name'],
'mealTypeName': json['meal_type_name'],
'shopping': json['shopping'],
};
}
@@ -173,13 +179,13 @@ export function MealPlanToJSON(value?: MealPlan | null): any {
return {
'title': value.title,
'recipe': MealPlanRecipeToJSON(value.recipe),
'recipe': RecipeOverviewToJSON(value.recipe),
'servings': value.servings,
'note': value.note,
'from_date': (value.fromDate.toISOString().substring(0,10)),
'to_date': value.toDate === undefined ? undefined : (value.toDate.toISOString().substring(0,10)),
'meal_type': MealPlanMealTypeToJSON(value.mealType),
'shared': value.shared === undefined ? undefined : (value.shared === null ? null : (value.shared as Array<any>).map(CustomFilterSharedInnerToJSON)),
'meal_type': MealTypeToJSON(value.mealType),
'shared': value.shared === undefined ? undefined : (value.shared === null ? null : (value.shared as Array<any>).map(UserToJSON)),
};
}

View File

@@ -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).
@@ -14,7 +14,7 @@
import { exists, mapValues } from '../runtime';
/**
*
* Adds nested create feature
* @export
* @interface MealType
*/
@@ -24,7 +24,7 @@ export interface MealType {
* @type {number}
* @memberof MealType
*/
readonly id?: number;
readonly id: number;
/**
*
* @type {string}
@@ -51,10 +51,10 @@ export interface MealType {
_default?: boolean;
/**
*
* @type {string}
* @type {number}
* @memberof MealType
*/
readonly createdBy?: string;
readonly createdBy: number;
}
/**
@@ -62,7 +62,9 @@ export interface MealType {
*/
export function instanceOfMealType(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "id" in value;
isInstance = isInstance && "name" in value;
isInstance = isInstance && "createdBy" in value;
return isInstance;
}
@@ -77,12 +79,12 @@ export function MealTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean):
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'id': json['id'],
'name': json['name'],
'order': !exists(json, 'order') ? undefined : json['order'],
'color': !exists(json, 'color') ? undefined : json['color'],
'_default': !exists(json, 'default') ? undefined : json['default'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
'createdBy': json['created_by'],
};
}

View File

@@ -0,0 +1,41 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.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.
*/
/**
* * `DB` - Dropbox
* * `NEXTCLOUD` - Nextcloud
* * `LOCAL` - Local
* @export
*/
export const MethodEnum = {
Db: 'DB',
Nextcloud: 'NEXTCLOUD',
Local: 'LOCAL'
} as const;
export type MethodEnum = typeof MethodEnum[keyof typeof MethodEnum];
export function MethodEnumFromJSON(json: any): MethodEnum {
return MethodEnumFromJSONTyped(json, false);
}
export function MethodEnumFromJSONTyped(json: any, ignoreDiscriminator: boolean): MethodEnum {
return json as MethodEnum;
}
export function MethodEnumToJSON(value?: MethodEnum | null): any {
return value as any;
}

View File

@@ -0,0 +1,37 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
*/
export const NullEnum = {
Null: 'null'
} as const;
export type NullEnum = typeof NullEnum[keyof typeof NullEnum];
export function NullEnumFromJSON(json: any): NullEnum {
return NullEnumFromJSONTyped(json, false);
}
export function NullEnumFromJSONTyped(json: any, ignoreDiscriminator: boolean): NullEnum {
return json as NullEnum;
}
export function NullEnumToJSON(value?: NullEnum | null): any {
return value as any;
}

View File

@@ -0,0 +1,109 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.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 NutritionInformation
*/
export interface NutritionInformation {
/**
*
* @type {number}
* @memberof NutritionInformation
*/
readonly id: number;
/**
*
* @type {string}
* @memberof NutritionInformation
*/
carbohydrates: string;
/**
*
* @type {string}
* @memberof NutritionInformation
*/
fats: string;
/**
*
* @type {string}
* @memberof NutritionInformation
*/
proteins: string;
/**
*
* @type {string}
* @memberof NutritionInformation
*/
calories: string;
/**
*
* @type {string}
* @memberof NutritionInformation
*/
source?: string | null;
}
/**
* Check if a given object implements the NutritionInformation interface.
*/
export function instanceOfNutritionInformation(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "id" in value;
isInstance = isInstance && "carbohydrates" in value;
isInstance = isInstance && "fats" in value;
isInstance = isInstance && "proteins" in value;
isInstance = isInstance && "calories" in value;
return isInstance;
}
export function NutritionInformationFromJSON(json: any): NutritionInformation {
return NutritionInformationFromJSONTyped(json, false);
}
export function NutritionInformationFromJSONTyped(json: any, ignoreDiscriminator: boolean): NutritionInformation {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': json['id'],
'carbohydrates': json['carbohydrates'],
'fats': json['fats'],
'proteins': json['proteins'],
'calories': json['calories'],
'source': !exists(json, 'source') ? undefined : json['source'],
};
}
export function NutritionInformationToJSON(value?: NutritionInformation | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'carbohydrates': value.carbohydrates,
'fats': value.fats,
'proteins': value.proteins,
'calories': value.calories,
'source': value.source,
};
}

View File

@@ -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,15 +13,49 @@
*/
import { exists, mapValues } from '../runtime';
import type { OpenDataUnitVersion } from './OpenDataUnitVersion';
import type { OpenDataVersion } from './OpenDataVersion';
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 OpenDataCategory
*/
@@ -31,13 +65,13 @@ export interface OpenDataCategory {
* @type {number}
* @memberof OpenDataCategory
*/
readonly id?: number;
readonly id: number;
/**
*
* @type {OpenDataUnitVersion}
* @type {OpenDataVersion}
* @memberof OpenDataCategory
*/
version: OpenDataUnitVersion;
version: OpenDataVersion;
/**
*
* @type {string}
@@ -67,7 +101,7 @@ export interface OpenDataCategory {
* @type {string}
* @memberof OpenDataCategory
*/
readonly createdBy?: string;
readonly createdBy: string;
}
/**
@@ -75,9 +109,11 @@ export interface OpenDataCategory {
*/
export function instanceOfOpenDataCategory(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;
isInstance = isInstance && "createdBy" in value;
return isInstance;
}
@@ -92,13 +128,13 @@ export function OpenDataCategoryFromJSONTyped(json: any, ignoreDiscriminator: bo
}
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'],
'description': !exists(json, 'description') ? undefined : json['description'],
'comment': !exists(json, 'comment') ? undefined : json['comment'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
'createdBy': json['created_by'],
};
}
@@ -111,7 +147,7 @@ export function OpenDataCategoryToJSON(value?: OpenDataCategory | null): any {
}
return {
'version': OpenDataUnitVersionToJSON(value.version),
'version': OpenDataVersionToJSON(value.version),
'slug': value.slug,
'name': value.name,
'description': value.description,

View File

@@ -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,27 +13,27 @@
*/
import { exists, mapValues } from '../runtime';
import type { OpenDataConversionFood } from './OpenDataConversionFood';
import type { OpenDataFood } from './OpenDataFood';
import {
OpenDataConversionFoodFromJSON,
OpenDataConversionFoodFromJSONTyped,
OpenDataConversionFoodToJSON,
} from './OpenDataConversionFood';
import type { OpenDataConversionFoodPropertiesFoodUnit } from './OpenDataConversionFoodPropertiesFoodUnit';
OpenDataFoodFromJSON,
OpenDataFoodFromJSONTyped,
OpenDataFoodToJSON,
} from './OpenDataFood';
import type { OpenDataUnit } from './OpenDataUnit';
import {
OpenDataConversionFoodPropertiesFoodUnitFromJSON,
OpenDataConversionFoodPropertiesFoodUnitFromJSONTyped,
OpenDataConversionFoodPropertiesFoodUnitToJSON,
} from './OpenDataConversionFoodPropertiesFoodUnit';
import type { OpenDataUnitVersion } from './OpenDataUnitVersion';
OpenDataUnitFromJSON,
OpenDataUnitFromJSONTyped,
OpenDataUnitToJSON,
} from './OpenDataUnit';
import type { OpenDataVersion } from './OpenDataVersion';
import {
OpenDataUnitVersionFromJSON,
OpenDataUnitVersionFromJSONTyped,
OpenDataUnitVersionToJSON,
} from './OpenDataUnitVersion';
OpenDataVersionFromJSON,
OpenDataVersionFromJSONTyped,
OpenDataVersionToJSON,
} from './OpenDataVersion';
/**
*
* Adds nested create feature
* @export
* @interface OpenDataConversion
*/
@@ -43,13 +43,13 @@ export interface OpenDataConversion {
* @type {number}
* @memberof OpenDataConversion
*/
readonly id?: number;
readonly id: number;
/**
*
* @type {OpenDataUnitVersion}
* @type {OpenDataVersion}
* @memberof OpenDataConversion
*/
version: OpenDataUnitVersion;
version: OpenDataVersion;
/**
*
* @type {string}
@@ -58,10 +58,10 @@ export interface OpenDataConversion {
slug: string;
/**
*
* @type {OpenDataConversionFood}
* @type {OpenDataFood}
* @memberof OpenDataConversion
*/
food: OpenDataConversionFood;
food: OpenDataFood;
/**
*
* @type {string}
@@ -70,10 +70,10 @@ export interface OpenDataConversion {
baseAmount: string;
/**
*
* @type {OpenDataConversionFoodPropertiesFoodUnit}
* @type {OpenDataUnit}
* @memberof OpenDataConversion
*/
baseUnit: OpenDataConversionFoodPropertiesFoodUnit;
baseUnit: OpenDataUnit;
/**
*
* @type {string}
@@ -82,10 +82,10 @@ export interface OpenDataConversion {
convertedAmount: string;
/**
*
* @type {OpenDataConversionFoodPropertiesFoodUnit}
* @type {OpenDataUnit}
* @memberof OpenDataConversion
*/
convertedUnit: OpenDataConversionFoodPropertiesFoodUnit;
convertedUnit: OpenDataUnit;
/**
*
* @type {string}
@@ -103,7 +103,7 @@ export interface OpenDataConversion {
* @type {string}
* @memberof OpenDataConversion
*/
readonly createdBy?: string;
readonly createdBy: string;
}
/**
@@ -111,6 +111,7 @@ export interface OpenDataConversion {
*/
export function instanceOfOpenDataConversion(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "id" in value;
isInstance = isInstance && "version" in value;
isInstance = isInstance && "slug" in value;
isInstance = isInstance && "food" in value;
@@ -119,6 +120,7 @@ export function instanceOfOpenDataConversion(value: object): boolean {
isInstance = isInstance && "convertedAmount" in value;
isInstance = isInstance && "convertedUnit" in value;
isInstance = isInstance && "source" in value;
isInstance = isInstance && "createdBy" in value;
return isInstance;
}
@@ -133,17 +135,17 @@ export function OpenDataConversionFromJSONTyped(json: any, ignoreDiscriminator:
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'version': OpenDataUnitVersionFromJSON(json['version']),
'id': json['id'],
'version': OpenDataVersionFromJSON(json['version']),
'slug': json['slug'],
'food': OpenDataConversionFoodFromJSON(json['food']),
'food': OpenDataFoodFromJSON(json['food']),
'baseAmount': json['base_amount'],
'baseUnit': OpenDataConversionFoodPropertiesFoodUnitFromJSON(json['base_unit']),
'baseUnit': OpenDataUnitFromJSON(json['base_unit']),
'convertedAmount': json['converted_amount'],
'convertedUnit': OpenDataConversionFoodPropertiesFoodUnitFromJSON(json['converted_unit']),
'convertedUnit': OpenDataUnitFromJSON(json['converted_unit']),
'source': json['source'],
'comment': !exists(json, 'comment') ? undefined : json['comment'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
'createdBy': json['created_by'],
};
}
@@ -156,13 +158,13 @@ export function OpenDataConversionToJSON(value?: OpenDataConversion | null): any
}
return {
'version': OpenDataUnitVersionToJSON(value.version),
'version': OpenDataVersionToJSON(value.version),
'slug': value.slug,
'food': OpenDataConversionFoodToJSON(value.food),
'food': OpenDataFoodToJSON(value.food),
'base_amount': value.baseAmount,
'base_unit': OpenDataConversionFoodPropertiesFoodUnitToJSON(value.baseUnit),
'base_unit': OpenDataUnitToJSON(value.baseUnit),
'converted_amount': value.convertedAmount,
'converted_unit': OpenDataConversionFoodPropertiesFoodUnitToJSON(value.convertedUnit),
'converted_unit': OpenDataUnitToJSON(value.convertedUnit),
'source': value.source,
'comment': value.comment,
};

View File

@@ -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,

View File

@@ -0,0 +1,90 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { OpenDataProperty } from './OpenDataProperty';
import {
OpenDataPropertyFromJSON,
OpenDataPropertyFromJSONTyped,
OpenDataPropertyToJSON,
} from './OpenDataProperty';
/**
* Adds nested create feature
* @export
* @interface OpenDataFoodProperty
*/
export interface OpenDataFoodProperty {
/**
*
* @type {number}
* @memberof OpenDataFoodProperty
*/
readonly id: number;
/**
*
* @type {OpenDataProperty}
* @memberof OpenDataFoodProperty
*/
property: OpenDataProperty;
/**
*
* @type {string}
* @memberof OpenDataFoodProperty
*/
propertyAmount: string;
}
/**
* Check if a given object implements the OpenDataFoodProperty interface.
*/
export function instanceOfOpenDataFoodProperty(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "id" in value;
isInstance = isInstance && "property" in value;
isInstance = isInstance && "propertyAmount" in value;
return isInstance;
}
export function OpenDataFoodPropertyFromJSON(json: any): OpenDataFoodProperty {
return OpenDataFoodPropertyFromJSONTyped(json, false);
}
export function OpenDataFoodPropertyFromJSONTyped(json: any, ignoreDiscriminator: boolean): OpenDataFoodProperty {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': json['id'],
'property': OpenDataPropertyFromJSON(json['property']),
'propertyAmount': json['property_amount'],
};
}
export function OpenDataFoodPropertyToJSON(value?: OpenDataFoodProperty | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'property': OpenDataPropertyToJSON(value.property),
'property_amount': value.propertyAmount,
};
}

View File

@@ -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,15 +13,49 @@
*/
import { exists, mapValues } from '../runtime';
import type { OpenDataUnitVersion } from './OpenDataUnitVersion';
import type { OpenDataVersion } from './OpenDataVersion';
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 OpenDataProperty
*/
@@ -31,13 +65,13 @@ export interface OpenDataProperty {
* @type {number}
* @memberof OpenDataProperty
*/
readonly id?: number;
readonly id: number;
/**
*
* @type {OpenDataUnitVersion}
* @type {OpenDataVersion}
* @memberof OpenDataProperty
*/
version: OpenDataUnitVersion;
version: OpenDataVersion;
/**
*
* @type {string}
@@ -73,7 +107,7 @@ export interface OpenDataProperty {
* @type {string}
* @memberof OpenDataProperty
*/
readonly createdBy?: string;
readonly createdBy: string;
}
/**
@@ -81,9 +115,11 @@ export interface OpenDataProperty {
*/
export function instanceOfOpenDataProperty(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;
isInstance = isInstance && "createdBy" in value;
return isInstance;
}
@@ -98,14 +134,14 @@ export function OpenDataPropertyFromJSONTyped(json: any, ignoreDiscriminator: bo
}
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'],
'unit': !exists(json, 'unit') ? undefined : json['unit'],
'fdcId': !exists(json, 'fdc_id') ? undefined : json['fdc_id'],
'comment': !exists(json, 'comment') ? undefined : json['comment'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
'createdBy': json['created_by'],
};
}
@@ -118,7 +154,7 @@ export function OpenDataPropertyToJSON(value?: OpenDataProperty | null): any {
}
return {
'version': OpenDataUnitVersionToJSON(value.version),
'version': OpenDataVersionToJSON(value.version),
'slug': value.slug,
'name': value.name,
'unit': value.unit,

View File

@@ -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,21 +13,21 @@
*/
import { exists, mapValues } from '../runtime';
import type { OpenDataStoreCategoryToStoreInner } from './OpenDataStoreCategoryToStoreInner';
import type { OpenDataStoreCategory } from './OpenDataStoreCategory';
import {
OpenDataStoreCategoryToStoreInnerFromJSON,
OpenDataStoreCategoryToStoreInnerFromJSONTyped,
OpenDataStoreCategoryToStoreInnerToJSON,
} from './OpenDataStoreCategoryToStoreInner';
import type { OpenDataUnitVersion } from './OpenDataUnitVersion';
OpenDataStoreCategoryFromJSON,
OpenDataStoreCategoryFromJSONTyped,
OpenDataStoreCategoryToJSON,
} from './OpenDataStoreCategory';
import type { OpenDataVersion } from './OpenDataVersion';
import {
OpenDataUnitVersionFromJSON,
OpenDataUnitVersionFromJSONTyped,
OpenDataUnitVersionToJSON,
} from './OpenDataUnitVersion';
OpenDataVersionFromJSON,
OpenDataVersionFromJSONTyped,
OpenDataVersionToJSON,
} from './OpenDataVersion';
/**
*
* Adds nested create feature
* @export
* @interface OpenDataStore
*/
@@ -37,13 +37,13 @@ export interface OpenDataStore {
* @type {number}
* @memberof OpenDataStore
*/
readonly id?: number;
readonly id: number;
/**
*
* @type {OpenDataUnitVersion}
* @type {OpenDataVersion}
* @memberof OpenDataStore
*/
version: OpenDataUnitVersion;
version: OpenDataVersion;
/**
*
* @type {string}
@@ -58,10 +58,10 @@ export interface OpenDataStore {
name: string;
/**
*
* @type {Array<OpenDataStoreCategoryToStoreInner>}
* @type {Array<OpenDataStoreCategory>}
* @memberof OpenDataStore
*/
categoryToStore: Array<OpenDataStoreCategoryToStoreInner> | null;
categoryToStore: Array<OpenDataStoreCategory> | null;
/**
*
* @type {string}
@@ -73,7 +73,7 @@ export interface OpenDataStore {
* @type {string}
* @memberof OpenDataStore
*/
readonly createdBy?: string;
readonly createdBy: string;
}
/**
@@ -81,10 +81,12 @@ export interface OpenDataStore {
*/
export function instanceOfOpenDataStore(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;
isInstance = isInstance && "categoryToStore" in value;
isInstance = isInstance && "createdBy" in value;
return isInstance;
}
@@ -99,13 +101,13 @@ export function OpenDataStoreFromJSONTyped(json: any, ignoreDiscriminator: boole
}
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'],
'categoryToStore': (json['category_to_store'] === null ? null : (json['category_to_store'] as Array<any>).map(OpenDataStoreCategoryToStoreInnerFromJSON)),
'categoryToStore': (json['category_to_store'] === null ? null : (json['category_to_store'] as Array<any>).map(OpenDataStoreCategoryFromJSON)),
'comment': !exists(json, 'comment') ? undefined : json['comment'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
'createdBy': json['created_by'],
};
}
@@ -118,10 +120,10 @@ export function OpenDataStoreToJSON(value?: OpenDataStore | null): any {
}
return {
'version': OpenDataUnitVersionToJSON(value.version),
'version': OpenDataVersionToJSON(value.version),
'slug': value.slug,
'name': value.name,
'category_to_store': (value.categoryToStore === null ? null : (value.categoryToStore as Array<any>).map(OpenDataStoreCategoryToStoreInnerToJSON)),
'category_to_store': (value.categoryToStore === null ? null : (value.categoryToStore as Array<any>).map(OpenDataStoreCategoryToJSON)),
'comment': value.comment,
};
}

View File

@@ -0,0 +1,98 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { OpenDataCategory } from './OpenDataCategory';
import {
OpenDataCategoryFromJSON,
OpenDataCategoryFromJSONTyped,
OpenDataCategoryToJSON,
} from './OpenDataCategory';
/**
* Adds nested create feature
* @export
* @interface OpenDataStoreCategory
*/
export interface OpenDataStoreCategory {
/**
*
* @type {number}
* @memberof OpenDataStoreCategory
*/
readonly id: number;
/**
*
* @type {OpenDataCategory}
* @memberof OpenDataStoreCategory
*/
category: OpenDataCategory;
/**
*
* @type {number}
* @memberof OpenDataStoreCategory
*/
store: number;
/**
*
* @type {number}
* @memberof OpenDataStoreCategory
*/
order?: number;
}
/**
* Check if a given object implements the OpenDataStoreCategory interface.
*/
export function instanceOfOpenDataStoreCategory(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "id" in value;
isInstance = isInstance && "category" in value;
isInstance = isInstance && "store" in value;
return isInstance;
}
export function OpenDataStoreCategoryFromJSON(json: any): OpenDataStoreCategory {
return OpenDataStoreCategoryFromJSONTyped(json, false);
}
export function OpenDataStoreCategoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): OpenDataStoreCategory {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': json['id'],
'category': OpenDataCategoryFromJSON(json['category']),
'store': json['store'],
'order': !exists(json, 'order') ? undefined : json['order'],
};
}
export function OpenDataStoreCategoryToJSON(value?: OpenDataStoreCategory | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'category': OpenDataCategoryToJSON(value.category),
'store': value.store,
'order': value.order,
};
}

View File

@@ -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,15 +13,61 @@
*/
import { exists, mapValues } from '../runtime';
import type { OpenDataUnitVersion } from './OpenDataUnitVersion';
import type { OpenDataUnitBaseUnit } from './OpenDataUnitBaseUnit';
import {
OpenDataUnitVersionFromJSON,
OpenDataUnitVersionFromJSONTyped,
OpenDataUnitVersionToJSON,
} from './OpenDataUnitVersion';
OpenDataUnitBaseUnitFromJSON,
OpenDataUnitBaseUnitFromJSONTyped,
OpenDataUnitBaseUnitToJSON,
} from './OpenDataUnitBaseUnit';
import type { OpenDataUnitTypeEnum } from './OpenDataUnitTypeEnum';
import {
OpenDataUnitTypeEnumFromJSON,
OpenDataUnitTypeEnumFromJSONTyped,
OpenDataUnitTypeEnumToJSON,
} from './OpenDataUnitTypeEnum';
import type { OpenDataVersion } from './OpenDataVersion';
import {
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 OpenDataUnit
*/
@@ -31,13 +77,13 @@ export interface OpenDataUnit {
* @type {number}
* @memberof OpenDataUnit
*/
readonly id?: number;
readonly id: number;
/**
*
* @type {OpenDataUnitVersion}
* @type {OpenDataVersion}
* @memberof OpenDataUnit
*/
version: OpenDataUnitVersion;
version: OpenDataVersion;
/**
*
* @type {string}
@@ -58,13 +104,13 @@ export interface OpenDataUnit {
pluralName?: string;
/**
*
* @type {string}
* @type {OpenDataUnitBaseUnit}
* @memberof OpenDataUnit
*/
baseUnit?: OpenDataUnitBaseUnitEnum;
baseUnit?: OpenDataUnitBaseUnit;
/**
*
* @type {string}
* @type {OpenDataUnitTypeEnum}
* @memberof OpenDataUnit
*/
type: OpenDataUnitTypeEnum;
@@ -79,54 +125,20 @@ export interface OpenDataUnit {
* @type {string}
* @memberof OpenDataUnit
*/
readonly createdBy?: string;
readonly createdBy: string;
}
/**
* @export
*/
export const OpenDataUnitBaseUnitEnum = {
G: 'G',
Kg: 'KG',
Ml: 'ML',
L: 'L',
Ounce: 'OUNCE',
Pound: 'POUND',
FluidOunce: 'FLUID_OUNCE',
Tsp: 'TSP',
Tbsp: 'TBSP',
Cup: 'CUP',
Pint: 'PINT',
Quart: 'QUART',
Gallon: 'GALLON',
ImperialFluidOunce: 'IMPERIAL_FLUID_OUNCE',
ImperialPint: 'IMPERIAL_PINT',
ImperialQuart: 'IMPERIAL_QUART',
ImperialGallon: 'IMPERIAL_GALLON'
} as const;
export type OpenDataUnitBaseUnitEnum = typeof OpenDataUnitBaseUnitEnum[keyof typeof OpenDataUnitBaseUnitEnum];
/**
* @export
*/
export const OpenDataUnitTypeEnum = {
Weight: 'WEIGHT',
Volume: 'VOLUME',
Other: 'OTHER'
} as const;
export type OpenDataUnitTypeEnum = typeof OpenDataUnitTypeEnum[keyof typeof OpenDataUnitTypeEnum];
/**
* Check if a given object implements the OpenDataUnit interface.
*/
export function instanceOfOpenDataUnit(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;
isInstance = isInstance && "type" in value;
isInstance = isInstance && "createdBy" in value;
return isInstance;
}
@@ -141,15 +153,15 @@ export function OpenDataUnitFromJSONTyped(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': !exists(json, 'plural_name') ? undefined : json['plural_name'],
'baseUnit': !exists(json, 'base_unit') ? undefined : json['base_unit'],
'type': json['type'],
'baseUnit': !exists(json, 'base_unit') ? undefined : OpenDataUnitBaseUnitFromJSON(json['base_unit']),
'type': OpenDataUnitTypeEnumFromJSON(json['type']),
'comment': !exists(json, 'comment') ? undefined : json['comment'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
'createdBy': json['created_by'],
};
}
@@ -162,12 +174,12 @@ export function OpenDataUnitToJSON(value?: OpenDataUnit | null): any {
}
return {
'version': OpenDataUnitVersionToJSON(value.version),
'version': OpenDataVersionToJSON(value.version),
'slug': value.slug,
'name': value.name,
'plural_name': value.pluralName,
'base_unit': value.baseUnit,
'type': value.type,
'base_unit': OpenDataUnitBaseUnitToJSON(value.baseUnit),
'type': OpenDataUnitTypeEnumToJSON(value.type),
'comment': value.comment,
};
}

View File

@@ -0,0 +1,65 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.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 type { BaseUnitEnum } from './BaseUnitEnum';
import {
instanceOfBaseUnitEnum,
BaseUnitEnumFromJSON,
BaseUnitEnumFromJSONTyped,
BaseUnitEnumToJSON,
} from './BaseUnitEnum';
import type { BlankEnum } from './BlankEnum';
import {
instanceOfBlankEnum,
BlankEnumFromJSON,
BlankEnumFromJSONTyped,
BlankEnumToJSON,
} from './BlankEnum';
/**
* @type OpenDataUnitBaseUnit
*
* @export
*/
export type OpenDataUnitBaseUnit = BaseUnitEnum | BlankEnum;
export function OpenDataUnitBaseUnitFromJSON(json: any): OpenDataUnitBaseUnit {
return OpenDataUnitBaseUnitFromJSONTyped(json, false);
}
export function OpenDataUnitBaseUnitFromJSONTyped(json: any, ignoreDiscriminator: boolean): OpenDataUnitBaseUnit {
if ((json === undefined) || (json === null)) {
return json;
}
return { ...BaseUnitEnumFromJSONTyped(json, true), ...BlankEnumFromJSONTyped(json, true) };
}
export function OpenDataUnitBaseUnitToJSON(value?: OpenDataUnitBaseUnit | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
if (instanceOfBaseUnitEnum(value)) {
return BaseUnitEnumToJSON(value as BaseUnitEnum);
}
if (instanceOfBlankEnum(value)) {
return BlankEnumToJSON(value as BlankEnum);
}
return {};
}

View File

@@ -0,0 +1,41 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.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.
*/
/**
* * `WEIGHT` - weight
* * `VOLUME` - volume
* * `OTHER` - other
* @export
*/
export const OpenDataUnitTypeEnum = {
Weight: 'WEIGHT',
Volume: 'VOLUME',
Other: 'OTHER'
} as const;
export type OpenDataUnitTypeEnum = typeof OpenDataUnitTypeEnum[keyof typeof OpenDataUnitTypeEnum];
export function OpenDataUnitTypeEnumFromJSON(json: any): OpenDataUnitTypeEnum {
return OpenDataUnitTypeEnumFromJSONTyped(json, false);
}
export function OpenDataUnitTypeEnumFromJSONTyped(json: any, ignoreDiscriminator: boolean): OpenDataUnitTypeEnum {
return json as OpenDataUnitTypeEnum;
}
export function OpenDataUnitTypeEnumToJSON(value?: OpenDataUnitTypeEnum | null): any {
return value as any;
}

View File

@@ -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).
@@ -14,7 +14,41 @@
import { exists, mapValues } from '../runtime';
/**
* 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 OpenDataVersion
*/
@@ -24,7 +58,7 @@ export interface OpenDataVersion {
* @type {number}
* @memberof OpenDataVersion
*/
readonly id?: number;
readonly id: number;
/**
*
* @type {string}
@@ -50,6 +84,7 @@ export interface OpenDataVersion {
*/
export function instanceOfOpenDataVersion(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "id" in value;
isInstance = isInstance && "name" in value;
isInstance = isInstance && "code" in value;
@@ -66,7 +101,7 @@ export function OpenDataVersionFromJSONTyped(json: any, ignoreDiscriminator: boo
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'id': json['id'],
'name': json['name'],
'code': json['code'],
'comment': !exists(json, 'comment') ? undefined : json['comment'],

View File

@@ -0,0 +1,96 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { Automation } from './Automation';
import {
AutomationFromJSON,
AutomationFromJSONTyped,
AutomationToJSON,
} from './Automation';
/**
*
* @export
* @interface PaginatedAutomationList
*/
export interface PaginatedAutomationList {
/**
*
* @type {number}
* @memberof PaginatedAutomationList
*/
count?: number;
/**
*
* @type {string}
* @memberof PaginatedAutomationList
*/
next?: string | null;
/**
*
* @type {string}
* @memberof PaginatedAutomationList
*/
previous?: string | null;
/**
*
* @type {Array<Automation>}
* @memberof PaginatedAutomationList
*/
results?: Array<Automation>;
}
/**
* Check if a given object implements the PaginatedAutomationList interface.
*/
export function instanceOfPaginatedAutomationList(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PaginatedAutomationListFromJSON(json: any): PaginatedAutomationList {
return PaginatedAutomationListFromJSONTyped(json, false);
}
export function PaginatedAutomationListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedAutomationList {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'count': !exists(json, 'count') ? undefined : json['count'],
'next': !exists(json, 'next') ? undefined : json['next'],
'previous': !exists(json, 'previous') ? undefined : json['previous'],
'results': !exists(json, 'results') ? undefined : ((json['results'] as Array<any>).map(AutomationFromJSON)),
};
}
export function PaginatedAutomationListToJSON(value?: PaginatedAutomationList | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'count': value.count,
'next': value.next,
'previous': value.previous,
'results': value.results === undefined ? undefined : ((value.results as Array<any>).map(AutomationToJSON)),
};
}

View File

@@ -0,0 +1,96 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { CookLog } from './CookLog';
import {
CookLogFromJSON,
CookLogFromJSONTyped,
CookLogToJSON,
} from './CookLog';
/**
*
* @export
* @interface PaginatedCookLogList
*/
export interface PaginatedCookLogList {
/**
*
* @type {number}
* @memberof PaginatedCookLogList
*/
count?: number;
/**
*
* @type {string}
* @memberof PaginatedCookLogList
*/
next?: string | null;
/**
*
* @type {string}
* @memberof PaginatedCookLogList
*/
previous?: string | null;
/**
*
* @type {Array<CookLog>}
* @memberof PaginatedCookLogList
*/
results?: Array<CookLog>;
}
/**
* Check if a given object implements the PaginatedCookLogList interface.
*/
export function instanceOfPaginatedCookLogList(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PaginatedCookLogListFromJSON(json: any): PaginatedCookLogList {
return PaginatedCookLogListFromJSONTyped(json, false);
}
export function PaginatedCookLogListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedCookLogList {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'count': !exists(json, 'count') ? undefined : json['count'],
'next': !exists(json, 'next') ? undefined : json['next'],
'previous': !exists(json, 'previous') ? undefined : json['previous'],
'results': !exists(json, 'results') ? undefined : ((json['results'] as Array<any>).map(CookLogFromJSON)),
};
}
export function PaginatedCookLogListToJSON(value?: PaginatedCookLogList | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'count': value.count,
'next': value.next,
'previous': value.previous,
'results': value.results === undefined ? undefined : ((value.results as Array<any>).map(CookLogToJSON)),
};
}

View File

@@ -0,0 +1,96 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { CustomFilter } from './CustomFilter';
import {
CustomFilterFromJSON,
CustomFilterFromJSONTyped,
CustomFilterToJSON,
} from './CustomFilter';
/**
*
* @export
* @interface PaginatedCustomFilterList
*/
export interface PaginatedCustomFilterList {
/**
*
* @type {number}
* @memberof PaginatedCustomFilterList
*/
count?: number;
/**
*
* @type {string}
* @memberof PaginatedCustomFilterList
*/
next?: string | null;
/**
*
* @type {string}
* @memberof PaginatedCustomFilterList
*/
previous?: string | null;
/**
*
* @type {Array<CustomFilter>}
* @memberof PaginatedCustomFilterList
*/
results?: Array<CustomFilter>;
}
/**
* Check if a given object implements the PaginatedCustomFilterList interface.
*/
export function instanceOfPaginatedCustomFilterList(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PaginatedCustomFilterListFromJSON(json: any): PaginatedCustomFilterList {
return PaginatedCustomFilterListFromJSONTyped(json, false);
}
export function PaginatedCustomFilterListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedCustomFilterList {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'count': !exists(json, 'count') ? undefined : json['count'],
'next': !exists(json, 'next') ? undefined : json['next'],
'previous': !exists(json, 'previous') ? undefined : json['previous'],
'results': !exists(json, 'results') ? undefined : ((json['results'] as Array<any>).map(CustomFilterFromJSON)),
};
}
export function PaginatedCustomFilterListToJSON(value?: PaginatedCustomFilterList | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'count': value.count,
'next': value.next,
'previous': value.previous,
'results': value.results === undefined ? undefined : ((value.results as Array<any>).map(CustomFilterToJSON)),
};
}

View File

@@ -0,0 +1,96 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { ExportLog } from './ExportLog';
import {
ExportLogFromJSON,
ExportLogFromJSONTyped,
ExportLogToJSON,
} from './ExportLog';
/**
*
* @export
* @interface PaginatedExportLogList
*/
export interface PaginatedExportLogList {
/**
*
* @type {number}
* @memberof PaginatedExportLogList
*/
count?: number;
/**
*
* @type {string}
* @memberof PaginatedExportLogList
*/
next?: string | null;
/**
*
* @type {string}
* @memberof PaginatedExportLogList
*/
previous?: string | null;
/**
*
* @type {Array<ExportLog>}
* @memberof PaginatedExportLogList
*/
results?: Array<ExportLog>;
}
/**
* Check if a given object implements the PaginatedExportLogList interface.
*/
export function instanceOfPaginatedExportLogList(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PaginatedExportLogListFromJSON(json: any): PaginatedExportLogList {
return PaginatedExportLogListFromJSONTyped(json, false);
}
export function PaginatedExportLogListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedExportLogList {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'count': !exists(json, 'count') ? undefined : json['count'],
'next': !exists(json, 'next') ? undefined : json['next'],
'previous': !exists(json, 'previous') ? undefined : json['previous'],
'results': !exists(json, 'results') ? undefined : ((json['results'] as Array<any>).map(ExportLogFromJSON)),
};
}
export function PaginatedExportLogListToJSON(value?: PaginatedExportLogList | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'count': value.count,
'next': value.next,
'previous': value.previous,
'results': value.results === undefined ? undefined : ((value.results as Array<any>).map(ExportLogToJSON)),
};
}

View File

@@ -0,0 +1,96 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { Food } from './Food';
import {
FoodFromJSON,
FoodFromJSONTyped,
FoodToJSON,
} from './Food';
/**
*
* @export
* @interface PaginatedFoodList
*/
export interface PaginatedFoodList {
/**
*
* @type {number}
* @memberof PaginatedFoodList
*/
count?: number;
/**
*
* @type {string}
* @memberof PaginatedFoodList
*/
next?: string | null;
/**
*
* @type {string}
* @memberof PaginatedFoodList
*/
previous?: string | null;
/**
*
* @type {Array<Food>}
* @memberof PaginatedFoodList
*/
results?: Array<Food>;
}
/**
* Check if a given object implements the PaginatedFoodList interface.
*/
export function instanceOfPaginatedFoodList(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PaginatedFoodListFromJSON(json: any): PaginatedFoodList {
return PaginatedFoodListFromJSONTyped(json, false);
}
export function PaginatedFoodListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedFoodList {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'count': !exists(json, 'count') ? undefined : json['count'],
'next': !exists(json, 'next') ? undefined : json['next'],
'previous': !exists(json, 'previous') ? undefined : json['previous'],
'results': !exists(json, 'results') ? undefined : ((json['results'] as Array<any>).map(FoodFromJSON)),
};
}
export function PaginatedFoodListToJSON(value?: PaginatedFoodList | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'count': value.count,
'next': value.next,
'previous': value.previous,
'results': value.results === undefined ? undefined : ((value.results as Array<any>).map(FoodToJSON)),
};
}

View File

@@ -0,0 +1,96 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { ImportLog } from './ImportLog';
import {
ImportLogFromJSON,
ImportLogFromJSONTyped,
ImportLogToJSON,
} from './ImportLog';
/**
*
* @export
* @interface PaginatedImportLogList
*/
export interface PaginatedImportLogList {
/**
*
* @type {number}
* @memberof PaginatedImportLogList
*/
count?: number;
/**
*
* @type {string}
* @memberof PaginatedImportLogList
*/
next?: string | null;
/**
*
* @type {string}
* @memberof PaginatedImportLogList
*/
previous?: string | null;
/**
*
* @type {Array<ImportLog>}
* @memberof PaginatedImportLogList
*/
results?: Array<ImportLog>;
}
/**
* Check if a given object implements the PaginatedImportLogList interface.
*/
export function instanceOfPaginatedImportLogList(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PaginatedImportLogListFromJSON(json: any): PaginatedImportLogList {
return PaginatedImportLogListFromJSONTyped(json, false);
}
export function PaginatedImportLogListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedImportLogList {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'count': !exists(json, 'count') ? undefined : json['count'],
'next': !exists(json, 'next') ? undefined : json['next'],
'previous': !exists(json, 'previous') ? undefined : json['previous'],
'results': !exists(json, 'results') ? undefined : ((json['results'] as Array<any>).map(ImportLogFromJSON)),
};
}
export function PaginatedImportLogListToJSON(value?: PaginatedImportLogList | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'count': value.count,
'next': value.next,
'previous': value.previous,
'results': value.results === undefined ? undefined : ((value.results as Array<any>).map(ImportLogToJSON)),
};
}

View File

@@ -0,0 +1,96 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { Ingredient } from './Ingredient';
import {
IngredientFromJSON,
IngredientFromJSONTyped,
IngredientToJSON,
} from './Ingredient';
/**
*
* @export
* @interface PaginatedIngredientList
*/
export interface PaginatedIngredientList {
/**
*
* @type {number}
* @memberof PaginatedIngredientList
*/
count?: number;
/**
*
* @type {string}
* @memberof PaginatedIngredientList
*/
next?: string | null;
/**
*
* @type {string}
* @memberof PaginatedIngredientList
*/
previous?: string | null;
/**
*
* @type {Array<Ingredient>}
* @memberof PaginatedIngredientList
*/
results?: Array<Ingredient>;
}
/**
* Check if a given object implements the PaginatedIngredientList interface.
*/
export function instanceOfPaginatedIngredientList(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PaginatedIngredientListFromJSON(json: any): PaginatedIngredientList {
return PaginatedIngredientListFromJSONTyped(json, false);
}
export function PaginatedIngredientListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedIngredientList {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'count': !exists(json, 'count') ? undefined : json['count'],
'next': !exists(json, 'next') ? undefined : json['next'],
'previous': !exists(json, 'previous') ? undefined : json['previous'],
'results': !exists(json, 'results') ? undefined : ((json['results'] as Array<any>).map(IngredientFromJSON)),
};
}
export function PaginatedIngredientListToJSON(value?: PaginatedIngredientList | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'count': value.count,
'next': value.next,
'previous': value.previous,
'results': value.results === undefined ? undefined : ((value.results as Array<any>).map(IngredientToJSON)),
};
}

View File

@@ -0,0 +1,96 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { Keyword } from './Keyword';
import {
KeywordFromJSON,
KeywordFromJSONTyped,
KeywordToJSON,
} from './Keyword';
/**
*
* @export
* @interface PaginatedKeywordList
*/
export interface PaginatedKeywordList {
/**
*
* @type {number}
* @memberof PaginatedKeywordList
*/
count?: number;
/**
*
* @type {string}
* @memberof PaginatedKeywordList
*/
next?: string | null;
/**
*
* @type {string}
* @memberof PaginatedKeywordList
*/
previous?: string | null;
/**
*
* @type {Array<Keyword>}
* @memberof PaginatedKeywordList
*/
results?: Array<Keyword>;
}
/**
* Check if a given object implements the PaginatedKeywordList interface.
*/
export function instanceOfPaginatedKeywordList(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PaginatedKeywordListFromJSON(json: any): PaginatedKeywordList {
return PaginatedKeywordListFromJSONTyped(json, false);
}
export function PaginatedKeywordListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedKeywordList {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'count': !exists(json, 'count') ? undefined : json['count'],
'next': !exists(json, 'next') ? undefined : json['next'],
'previous': !exists(json, 'previous') ? undefined : json['previous'],
'results': !exists(json, 'results') ? undefined : ((json['results'] as Array<any>).map(KeywordFromJSON)),
};
}
export function PaginatedKeywordListToJSON(value?: PaginatedKeywordList | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'count': value.count,
'next': value.next,
'previous': value.previous,
'results': value.results === undefined ? undefined : ((value.results as Array<any>).map(KeywordToJSON)),
};
}

View File

@@ -0,0 +1,96 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { RecipeOverview } from './RecipeOverview';
import {
RecipeOverviewFromJSON,
RecipeOverviewFromJSONTyped,
RecipeOverviewToJSON,
} from './RecipeOverview';
/**
*
* @export
* @interface PaginatedRecipeOverviewList
*/
export interface PaginatedRecipeOverviewList {
/**
*
* @type {number}
* @memberof PaginatedRecipeOverviewList
*/
count?: number;
/**
*
* @type {string}
* @memberof PaginatedRecipeOverviewList
*/
next?: string | null;
/**
*
* @type {string}
* @memberof PaginatedRecipeOverviewList
*/
previous?: string | null;
/**
*
* @type {Array<RecipeOverview>}
* @memberof PaginatedRecipeOverviewList
*/
results?: Array<RecipeOverview>;
}
/**
* Check if a given object implements the PaginatedRecipeOverviewList interface.
*/
export function instanceOfPaginatedRecipeOverviewList(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PaginatedRecipeOverviewListFromJSON(json: any): PaginatedRecipeOverviewList {
return PaginatedRecipeOverviewListFromJSONTyped(json, false);
}
export function PaginatedRecipeOverviewListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedRecipeOverviewList {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'count': !exists(json, 'count') ? undefined : json['count'],
'next': !exists(json, 'next') ? undefined : json['next'],
'previous': !exists(json, 'previous') ? undefined : json['previous'],
'results': !exists(json, 'results') ? undefined : ((json['results'] as Array<any>).map(RecipeOverviewFromJSON)),
};
}
export function PaginatedRecipeOverviewListToJSON(value?: PaginatedRecipeOverviewList | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'count': value.count,
'next': value.next,
'previous': value.previous,
'results': value.results === undefined ? undefined : ((value.results as Array<any>).map(RecipeOverviewToJSON)),
};
}

View File

@@ -0,0 +1,96 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { Step } from './Step';
import {
StepFromJSON,
StepFromJSONTyped,
StepToJSON,
} from './Step';
/**
*
* @export
* @interface PaginatedStepList
*/
export interface PaginatedStepList {
/**
*
* @type {number}
* @memberof PaginatedStepList
*/
count?: number;
/**
*
* @type {string}
* @memberof PaginatedStepList
*/
next?: string | null;
/**
*
* @type {string}
* @memberof PaginatedStepList
*/
previous?: string | null;
/**
*
* @type {Array<Step>}
* @memberof PaginatedStepList
*/
results?: Array<Step>;
}
/**
* Check if a given object implements the PaginatedStepList interface.
*/
export function instanceOfPaginatedStepList(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PaginatedStepListFromJSON(json: any): PaginatedStepList {
return PaginatedStepListFromJSONTyped(json, false);
}
export function PaginatedStepListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedStepList {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'count': !exists(json, 'count') ? undefined : json['count'],
'next': !exists(json, 'next') ? undefined : json['next'],
'previous': !exists(json, 'previous') ? undefined : json['previous'],
'results': !exists(json, 'results') ? undefined : ((json['results'] as Array<any>).map(StepFromJSON)),
};
}
export function PaginatedStepListToJSON(value?: PaginatedStepList | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'count': value.count,
'next': value.next,
'previous': value.previous,
'results': value.results === undefined ? undefined : ((value.results as Array<any>).map(StepToJSON)),
};
}

View File

@@ -0,0 +1,96 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { SupermarketCategoryRelation } from './SupermarketCategoryRelation';
import {
SupermarketCategoryRelationFromJSON,
SupermarketCategoryRelationFromJSONTyped,
SupermarketCategoryRelationToJSON,
} from './SupermarketCategoryRelation';
/**
*
* @export
* @interface PaginatedSupermarketCategoryRelationList
*/
export interface PaginatedSupermarketCategoryRelationList {
/**
*
* @type {number}
* @memberof PaginatedSupermarketCategoryRelationList
*/
count?: number;
/**
*
* @type {string}
* @memberof PaginatedSupermarketCategoryRelationList
*/
next?: string | null;
/**
*
* @type {string}
* @memberof PaginatedSupermarketCategoryRelationList
*/
previous?: string | null;
/**
*
* @type {Array<SupermarketCategoryRelation>}
* @memberof PaginatedSupermarketCategoryRelationList
*/
results?: Array<SupermarketCategoryRelation>;
}
/**
* Check if a given object implements the PaginatedSupermarketCategoryRelationList interface.
*/
export function instanceOfPaginatedSupermarketCategoryRelationList(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PaginatedSupermarketCategoryRelationListFromJSON(json: any): PaginatedSupermarketCategoryRelationList {
return PaginatedSupermarketCategoryRelationListFromJSONTyped(json, false);
}
export function PaginatedSupermarketCategoryRelationListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedSupermarketCategoryRelationList {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'count': !exists(json, 'count') ? undefined : json['count'],
'next': !exists(json, 'next') ? undefined : json['next'],
'previous': !exists(json, 'previous') ? undefined : json['previous'],
'results': !exists(json, 'results') ? undefined : ((json['results'] as Array<any>).map(SupermarketCategoryRelationFromJSON)),
};
}
export function PaginatedSupermarketCategoryRelationListToJSON(value?: PaginatedSupermarketCategoryRelationList | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'count': value.count,
'next': value.next,
'previous': value.previous,
'results': value.results === undefined ? undefined : ((value.results as Array<any>).map(SupermarketCategoryRelationToJSON)),
};
}

View File

@@ -0,0 +1,96 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { SyncLog } from './SyncLog';
import {
SyncLogFromJSON,
SyncLogFromJSONTyped,
SyncLogToJSON,
} from './SyncLog';
/**
*
* @export
* @interface PaginatedSyncLogList
*/
export interface PaginatedSyncLogList {
/**
*
* @type {number}
* @memberof PaginatedSyncLogList
*/
count?: number;
/**
*
* @type {string}
* @memberof PaginatedSyncLogList
*/
next?: string | null;
/**
*
* @type {string}
* @memberof PaginatedSyncLogList
*/
previous?: string | null;
/**
*
* @type {Array<SyncLog>}
* @memberof PaginatedSyncLogList
*/
results?: Array<SyncLog>;
}
/**
* Check if a given object implements the PaginatedSyncLogList interface.
*/
export function instanceOfPaginatedSyncLogList(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PaginatedSyncLogListFromJSON(json: any): PaginatedSyncLogList {
return PaginatedSyncLogListFromJSONTyped(json, false);
}
export function PaginatedSyncLogListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedSyncLogList {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'count': !exists(json, 'count') ? undefined : json['count'],
'next': !exists(json, 'next') ? undefined : json['next'],
'previous': !exists(json, 'previous') ? undefined : json['previous'],
'results': !exists(json, 'results') ? undefined : ((json['results'] as Array<any>).map(SyncLogFromJSON)),
};
}
export function PaginatedSyncLogListToJSON(value?: PaginatedSyncLogList | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'count': value.count,
'next': value.next,
'previous': value.previous,
'results': value.results === undefined ? undefined : ((value.results as Array<any>).map(SyncLogToJSON)),
};
}

View File

@@ -0,0 +1,96 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { Unit } from './Unit';
import {
UnitFromJSON,
UnitFromJSONTyped,
UnitToJSON,
} from './Unit';
/**
*
* @export
* @interface PaginatedUnitList
*/
export interface PaginatedUnitList {
/**
*
* @type {number}
* @memberof PaginatedUnitList
*/
count?: number;
/**
*
* @type {string}
* @memberof PaginatedUnitList
*/
next?: string | null;
/**
*
* @type {string}
* @memberof PaginatedUnitList
*/
previous?: string | null;
/**
*
* @type {Array<Unit>}
* @memberof PaginatedUnitList
*/
results?: Array<Unit>;
}
/**
* Check if a given object implements the PaginatedUnitList interface.
*/
export function instanceOfPaginatedUnitList(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PaginatedUnitListFromJSON(json: any): PaginatedUnitList {
return PaginatedUnitListFromJSONTyped(json, false);
}
export function PaginatedUnitListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedUnitList {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'count': !exists(json, 'count') ? undefined : json['count'],
'next': !exists(json, 'next') ? undefined : json['next'],
'previous': !exists(json, 'previous') ? undefined : json['previous'],
'results': !exists(json, 'results') ? undefined : ((json['results'] as Array<any>).map(UnitFromJSON)),
};
}
export function PaginatedUnitListToJSON(value?: PaginatedUnitList | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'count': value.count,
'next': value.next,
'previous': value.previous,
'results': value.results === undefined ? undefined : ((value.results as Array<any>).map(UnitToJSON)),
};
}

View File

@@ -0,0 +1,96 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { UserSpace } from './UserSpace';
import {
UserSpaceFromJSON,
UserSpaceFromJSONTyped,
UserSpaceToJSON,
} from './UserSpace';
/**
*
* @export
* @interface PaginatedUserSpaceList
*/
export interface PaginatedUserSpaceList {
/**
*
* @type {number}
* @memberof PaginatedUserSpaceList
*/
count?: number;
/**
*
* @type {string}
* @memberof PaginatedUserSpaceList
*/
next?: string | null;
/**
*
* @type {string}
* @memberof PaginatedUserSpaceList
*/
previous?: string | null;
/**
*
* @type {Array<UserSpace>}
* @memberof PaginatedUserSpaceList
*/
results?: Array<UserSpace>;
}
/**
* Check if a given object implements the PaginatedUserSpaceList interface.
*/
export function instanceOfPaginatedUserSpaceList(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PaginatedUserSpaceListFromJSON(json: any): PaginatedUserSpaceList {
return PaginatedUserSpaceListFromJSONTyped(json, false);
}
export function PaginatedUserSpaceListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedUserSpaceList {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'count': !exists(json, 'count') ? undefined : json['count'],
'next': !exists(json, 'next') ? undefined : json['next'],
'previous': !exists(json, 'previous') ? undefined : json['previous'],
'results': !exists(json, 'results') ? undefined : ((json['results'] as Array<any>).map(UserSpaceFromJSON)),
};
}
export function PaginatedUserSpaceListToJSON(value?: PaginatedUserSpaceList | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'count': value.count,
'next': value.next,
'previous': value.previous,
'results': value.results === undefined ? undefined : ((value.results as Array<any>).map(UserSpaceToJSON)),
};
}

View File

@@ -0,0 +1,96 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { ViewLog } from './ViewLog';
import {
ViewLogFromJSON,
ViewLogFromJSONTyped,
ViewLogToJSON,
} from './ViewLog';
/**
*
* @export
* @interface PaginatedViewLogList
*/
export interface PaginatedViewLogList {
/**
*
* @type {number}
* @memberof PaginatedViewLogList
*/
count?: number;
/**
*
* @type {string}
* @memberof PaginatedViewLogList
*/
next?: string | null;
/**
*
* @type {string}
* @memberof PaginatedViewLogList
*/
previous?: string | null;
/**
*
* @type {Array<ViewLog>}
* @memberof PaginatedViewLogList
*/
results?: Array<ViewLog>;
}
/**
* Check if a given object implements the PaginatedViewLogList interface.
*/
export function instanceOfPaginatedViewLogList(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PaginatedViewLogListFromJSON(json: any): PaginatedViewLogList {
return PaginatedViewLogListFromJSONTyped(json, false);
}
export function PaginatedViewLogListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedViewLogList {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'count': !exists(json, 'count') ? undefined : json['count'],
'next': !exists(json, 'next') ? undefined : json['next'],
'previous': !exists(json, 'previous') ? undefined : json['previous'],
'results': !exists(json, 'results') ? undefined : ((json['results'] as Array<any>).map(ViewLogFromJSON)),
};
}
export function PaginatedViewLogListToJSON(value?: PaginatedViewLogList | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'count': value.count,
'next': value.next,
'previous': value.previous,
'results': value.results === undefined ? undefined : ((value.results as Array<any>).map(ViewLogToJSON)),
};
}

View File

@@ -0,0 +1,101 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.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 PatchedAccessToken
*/
export interface PatchedAccessToken {
/**
*
* @type {number}
* @memberof PatchedAccessToken
*/
readonly id?: number;
/**
*
* @type {string}
* @memberof PatchedAccessToken
*/
readonly token?: string;
/**
*
* @type {Date}
* @memberof PatchedAccessToken
*/
expires?: Date;
/**
*
* @type {string}
* @memberof PatchedAccessToken
*/
scope?: string;
/**
*
* @type {Date}
* @memberof PatchedAccessToken
*/
readonly created?: Date;
/**
*
* @type {Date}
* @memberof PatchedAccessToken
*/
readonly updated?: Date;
}
/**
* Check if a given object implements the PatchedAccessToken interface.
*/
export function instanceOfPatchedAccessToken(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedAccessTokenFromJSON(json: any): PatchedAccessToken {
return PatchedAccessTokenFromJSONTyped(json, false);
}
export function PatchedAccessTokenFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedAccessToken {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'token': !exists(json, 'token') ? undefined : json['token'],
'expires': !exists(json, 'expires') ? undefined : (new Date(json['expires'])),
'scope': !exists(json, 'scope') ? undefined : json['scope'],
'created': !exists(json, 'created') ? undefined : (new Date(json['created'])),
'updated': !exists(json, 'updated') ? undefined : (new Date(json['updated'])),
};
}
export function PatchedAccessTokenToJSON(value?: PatchedAccessToken | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'expires': value.expires === undefined ? undefined : (value.expires.toISOString()),
'scope': value.scope,
};
}

View File

@@ -0,0 +1,142 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { TypeEnum } from './TypeEnum';
import {
TypeEnumFromJSON,
TypeEnumFromJSONTyped,
TypeEnumToJSON,
} from './TypeEnum';
/**
*
* @export
* @interface PatchedAutomation
*/
export interface PatchedAutomation {
/**
*
* @type {number}
* @memberof PatchedAutomation
*/
readonly id?: number;
/**
*
* @type {TypeEnum}
* @memberof PatchedAutomation
*/
type?: TypeEnum;
/**
*
* @type {string}
* @memberof PatchedAutomation
*/
name?: string;
/**
*
* @type {string}
* @memberof PatchedAutomation
*/
description?: string | null;
/**
*
* @type {string}
* @memberof PatchedAutomation
*/
param1?: string | null;
/**
*
* @type {string}
* @memberof PatchedAutomation
*/
param2?: string | null;
/**
*
* @type {string}
* @memberof PatchedAutomation
*/
param3?: string | null;
/**
*
* @type {number}
* @memberof PatchedAutomation
*/
order?: number;
/**
*
* @type {boolean}
* @memberof PatchedAutomation
*/
disabled?: boolean;
/**
*
* @type {number}
* @memberof PatchedAutomation
*/
readonly createdBy?: number;
}
/**
* Check if a given object implements the PatchedAutomation interface.
*/
export function instanceOfPatchedAutomation(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedAutomationFromJSON(json: any): PatchedAutomation {
return PatchedAutomationFromJSONTyped(json, false);
}
export function PatchedAutomationFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedAutomation {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'type': !exists(json, 'type') ? undefined : TypeEnumFromJSON(json['type']),
'name': !exists(json, 'name') ? undefined : json['name'],
'description': !exists(json, 'description') ? undefined : json['description'],
'param1': !exists(json, 'param_1') ? undefined : json['param_1'],
'param2': !exists(json, 'param_2') ? undefined : json['param_2'],
'param3': !exists(json, 'param_3') ? undefined : json['param_3'],
'order': !exists(json, 'order') ? undefined : json['order'],
'disabled': !exists(json, 'disabled') ? undefined : json['disabled'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
};
}
export function PatchedAutomationToJSON(value?: PatchedAutomation | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'type': TypeEnumToJSON(value.type),
'name': value.name,
'description': value.description,
'param_1': value.param1,
'param_2': value.param2,
'param_3': value.param3,
'order': value.order,
'disabled': value.disabled,
};
}

View File

@@ -0,0 +1,94 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.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 PatchedBookmarkletImport
*/
export interface PatchedBookmarkletImport {
/**
*
* @type {number}
* @memberof PatchedBookmarkletImport
*/
readonly id?: number;
/**
*
* @type {string}
* @memberof PatchedBookmarkletImport
*/
url?: string | null;
/**
*
* @type {string}
* @memberof PatchedBookmarkletImport
*/
html?: string;
/**
*
* @type {number}
* @memberof PatchedBookmarkletImport
*/
readonly createdBy?: number;
/**
*
* @type {Date}
* @memberof PatchedBookmarkletImport
*/
readonly createdAt?: Date;
}
/**
* Check if a given object implements the PatchedBookmarkletImport interface.
*/
export function instanceOfPatchedBookmarkletImport(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedBookmarkletImportFromJSON(json: any): PatchedBookmarkletImport {
return PatchedBookmarkletImportFromJSONTyped(json, false);
}
export function PatchedBookmarkletImportFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedBookmarkletImport {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'url': !exists(json, 'url') ? undefined : json['url'],
'html': !exists(json, 'html') ? undefined : json['html'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])),
};
}
export function PatchedBookmarkletImportToJSON(value?: PatchedBookmarkletImport | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'url': value.url,
'html': value.html,
};
}

View File

@@ -0,0 +1,135 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.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 PatchedConnectorConfigConfig
*/
export interface PatchedConnectorConfigConfig {
/**
*
* @type {number}
* @memberof PatchedConnectorConfigConfig
*/
readonly id?: number;
/**
*
* @type {string}
* @memberof PatchedConnectorConfigConfig
*/
name?: string;
/**
*
* @type {string}
* @memberof PatchedConnectorConfigConfig
*/
url?: string | null;
/**
*
* @type {string}
* @memberof PatchedConnectorConfigConfig
*/
token?: string | null;
/**
*
* @type {string}
* @memberof PatchedConnectorConfigConfig
*/
todoEntity?: string | null;
/**
* Is Connector Enabled
* @type {boolean}
* @memberof PatchedConnectorConfigConfig
*/
enabled?: boolean;
/**
*
* @type {boolean}
* @memberof PatchedConnectorConfigConfig
*/
onShoppingListEntryCreatedEnabled?: boolean;
/**
*
* @type {boolean}
* @memberof PatchedConnectorConfigConfig
*/
onShoppingListEntryUpdatedEnabled?: boolean;
/**
*
* @type {boolean}
* @memberof PatchedConnectorConfigConfig
*/
onShoppingListEntryDeletedEnabled?: boolean;
/**
*
* @type {number}
* @memberof PatchedConnectorConfigConfig
*/
readonly createdBy?: number;
}
/**
* Check if a given object implements the PatchedConnectorConfigConfig interface.
*/
export function instanceOfPatchedConnectorConfigConfig(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedConnectorConfigConfigFromJSON(json: any): PatchedConnectorConfigConfig {
return PatchedConnectorConfigConfigFromJSONTyped(json, false);
}
export function PatchedConnectorConfigConfigFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedConnectorConfigConfig {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'name': !exists(json, 'name') ? undefined : json['name'],
'url': !exists(json, 'url') ? undefined : json['url'],
'token': !exists(json, 'token') ? undefined : json['token'],
'todoEntity': !exists(json, 'todo_entity') ? undefined : json['todo_entity'],
'enabled': !exists(json, 'enabled') ? undefined : json['enabled'],
'onShoppingListEntryCreatedEnabled': !exists(json, 'on_shopping_list_entry_created_enabled') ? undefined : json['on_shopping_list_entry_created_enabled'],
'onShoppingListEntryUpdatedEnabled': !exists(json, 'on_shopping_list_entry_updated_enabled') ? undefined : json['on_shopping_list_entry_updated_enabled'],
'onShoppingListEntryDeletedEnabled': !exists(json, 'on_shopping_list_entry_deleted_enabled') ? undefined : json['on_shopping_list_entry_deleted_enabled'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
};
}
export function PatchedConnectorConfigConfigToJSON(value?: PatchedConnectorConfigConfig | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'name': value.name,
'url': value.url,
'token': value.token,
'todo_entity': value.todoEntity,
'enabled': value.enabled,
'on_shopping_list_entry_created_enabled': value.onShoppingListEntryCreatedEnabled,
'on_shopping_list_entry_updated_enabled': value.onShoppingListEntryUpdatedEnabled,
'on_shopping_list_entry_deleted_enabled': value.onShoppingListEntryDeletedEnabled,
};
}

View File

@@ -0,0 +1,125 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { User } from './User';
import {
UserFromJSON,
UserFromJSONTyped,
UserToJSON,
} from './User';
/**
*
* @export
* @interface PatchedCookLog
*/
export interface PatchedCookLog {
/**
*
* @type {number}
* @memberof PatchedCookLog
*/
readonly id?: number;
/**
*
* @type {number}
* @memberof PatchedCookLog
*/
recipe?: number;
/**
*
* @type {number}
* @memberof PatchedCookLog
*/
servings?: number | null;
/**
*
* @type {number}
* @memberof PatchedCookLog
*/
rating?: number | null;
/**
*
* @type {string}
* @memberof PatchedCookLog
*/
comment?: string | null;
/**
*
* @type {User}
* @memberof PatchedCookLog
*/
readonly createdBy?: User;
/**
*
* @type {Date}
* @memberof PatchedCookLog
*/
createdAt?: Date;
/**
*
* @type {Date}
* @memberof PatchedCookLog
*/
readonly updatedAt?: Date;
}
/**
* Check if a given object implements the PatchedCookLog interface.
*/
export function instanceOfPatchedCookLog(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedCookLogFromJSON(json: any): PatchedCookLog {
return PatchedCookLogFromJSONTyped(json, false);
}
export function PatchedCookLogFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedCookLog {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'recipe': !exists(json, 'recipe') ? undefined : json['recipe'],
'servings': !exists(json, 'servings') ? undefined : json['servings'],
'rating': !exists(json, 'rating') ? undefined : json['rating'],
'comment': !exists(json, 'comment') ? undefined : json['comment'],
'createdBy': !exists(json, 'created_by') ? undefined : UserFromJSON(json['created_by']),
'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])),
'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])),
};
}
export function PatchedCookLogToJSON(value?: PatchedCookLog | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'recipe': value.recipe,
'servings': value.servings,
'rating': value.rating,
'comment': value.comment,
'created_at': value.createdAt === undefined ? undefined : (value.createdAt.toISOString()),
};
}

View File

@@ -0,0 +1,102 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { User } from './User';
import {
UserFromJSON,
UserFromJSONTyped,
UserToJSON,
} from './User';
/**
* Adds nested create feature
* @export
* @interface PatchedCustomFilter
*/
export interface PatchedCustomFilter {
/**
*
* @type {number}
* @memberof PatchedCustomFilter
*/
readonly id?: number;
/**
*
* @type {string}
* @memberof PatchedCustomFilter
*/
name?: string;
/**
*
* @type {string}
* @memberof PatchedCustomFilter
*/
search?: string;
/**
*
* @type {Array<User>}
* @memberof PatchedCustomFilter
*/
shared?: Array<User>;
/**
*
* @type {number}
* @memberof PatchedCustomFilter
*/
readonly createdBy?: number;
}
/**
* Check if a given object implements the PatchedCustomFilter interface.
*/
export function instanceOfPatchedCustomFilter(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedCustomFilterFromJSON(json: any): PatchedCustomFilter {
return PatchedCustomFilterFromJSONTyped(json, false);
}
export function PatchedCustomFilterFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedCustomFilter {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'name': !exists(json, 'name') ? undefined : json['name'],
'search': !exists(json, 'search') ? undefined : json['search'],
'shared': !exists(json, 'shared') ? undefined : ((json['shared'] as Array<any>).map(UserFromJSON)),
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
};
}
export function PatchedCustomFilterToJSON(value?: PatchedCustomFilter | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'name': value.name,
'search': value.search,
'shared': value.shared === undefined ? undefined : ((value.shared as Array<any>).map(UserToJSON)),
};
}

View File

@@ -0,0 +1,134 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.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 PatchedExportLog
*/
export interface PatchedExportLog {
/**
*
* @type {number}
* @memberof PatchedExportLog
*/
readonly id?: number;
/**
*
* @type {string}
* @memberof PatchedExportLog
*/
type?: string;
/**
*
* @type {string}
* @memberof PatchedExportLog
*/
msg?: string;
/**
*
* @type {boolean}
* @memberof PatchedExportLog
*/
running?: boolean;
/**
*
* @type {number}
* @memberof PatchedExportLog
*/
totalRecipes?: number;
/**
*
* @type {number}
* @memberof PatchedExportLog
*/
exportedRecipes?: number;
/**
*
* @type {number}
* @memberof PatchedExportLog
*/
cacheDuration?: number;
/**
*
* @type {boolean}
* @memberof PatchedExportLog
*/
possiblyNotExpired?: boolean;
/**
*
* @type {number}
* @memberof PatchedExportLog
*/
readonly createdBy?: number;
/**
*
* @type {Date}
* @memberof PatchedExportLog
*/
readonly createdAt?: Date;
}
/**
* Check if a given object implements the PatchedExportLog interface.
*/
export function instanceOfPatchedExportLog(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedExportLogFromJSON(json: any): PatchedExportLog {
return PatchedExportLogFromJSONTyped(json, false);
}
export function PatchedExportLogFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedExportLog {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'type': !exists(json, 'type') ? undefined : json['type'],
'msg': !exists(json, 'msg') ? undefined : json['msg'],
'running': !exists(json, 'running') ? undefined : json['running'],
'totalRecipes': !exists(json, 'total_recipes') ? undefined : json['total_recipes'],
'exportedRecipes': !exists(json, 'exported_recipes') ? undefined : json['exported_recipes'],
'cacheDuration': !exists(json, 'cache_duration') ? undefined : json['cache_duration'],
'possiblyNotExpired': !exists(json, 'possibly_not_expired') ? undefined : json['possibly_not_expired'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])),
};
}
export function PatchedExportLogToJSON(value?: PatchedExportLog | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'type': value.type,
'msg': value.msg,
'running': value.running,
'total_recipes': value.totalRecipes,
'exported_recipes': value.exportedRecipes,
'cache_duration': value.cacheDuration,
'possibly_not_expired': value.possiblyNotExpired,
};
}

View File

@@ -0,0 +1,314 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { FoodInheritField } from './FoodInheritField';
import {
FoodInheritFieldFromJSON,
FoodInheritFieldFromJSONTyped,
FoodInheritFieldToJSON,
} from './FoodInheritField';
import type { FoodSimple } from './FoodSimple';
import {
FoodSimpleFromJSON,
FoodSimpleFromJSONTyped,
FoodSimpleToJSON,
} from './FoodSimple';
import type { Property } from './Property';
import {
PropertyFromJSON,
PropertyFromJSONTyped,
PropertyToJSON,
} from './Property';
import type { RecipeSimple } from './RecipeSimple';
import {
RecipeSimpleFromJSON,
RecipeSimpleFromJSONTyped,
RecipeSimpleToJSON,
} from './RecipeSimple';
import type { SupermarketCategory } from './SupermarketCategory';
import {
SupermarketCategoryFromJSON,
SupermarketCategoryFromJSONTyped,
SupermarketCategoryToJSON,
} from './SupermarketCategory';
import type { Unit } from './Unit';
import {
UnitFromJSON,
UnitFromJSONTyped,
UnitToJSON,
} from './Unit';
/**
* 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 PatchedFood
*/
export interface PatchedFood {
/**
*
* @type {number}
* @memberof PatchedFood
*/
readonly id?: number;
/**
*
* @type {string}
* @memberof PatchedFood
*/
name?: string;
/**
*
* @type {string}
* @memberof PatchedFood
*/
pluralName?: string | null;
/**
*
* @type {string}
* @memberof PatchedFood
*/
description?: string;
/**
*
* @type {string}
* @memberof PatchedFood
*/
readonly shopping?: string;
/**
*
* @type {RecipeSimple}
* @memberof PatchedFood
*/
recipe?: RecipeSimple | null;
/**
*
* @type {string}
* @memberof PatchedFood
*/
url?: string | null;
/**
*
* @type {Array<Property>}
* @memberof PatchedFood
*/
properties?: Array<Property> | null;
/**
*
* @type {string}
* @memberof PatchedFood
*/
propertiesFoodAmount?: string;
/**
*
* @type {Unit}
* @memberof PatchedFood
*/
propertiesFoodUnit?: Unit | null;
/**
*
* @type {number}
* @memberof PatchedFood
*/
fdcId?: number | null;
/**
*
* @type {string}
* @memberof PatchedFood
*/
foodOnhand?: string | null;
/**
*
* @type {SupermarketCategory}
* @memberof PatchedFood
*/
supermarketCategory?: SupermarketCategory | null;
/**
*
* @type {string}
* @memberof PatchedFood
*/
readonly parent?: string;
/**
*
* @type {number}
* @memberof PatchedFood
*/
readonly numchild?: number;
/**
*
* @type {Array<FoodInheritField>}
* @memberof PatchedFood
*/
inheritFields?: Array<FoodInheritField> | null;
/**
*
* @type {string}
* @memberof PatchedFood
*/
readonly fullName?: string;
/**
*
* @type {boolean}
* @memberof PatchedFood
*/
ignoreShopping?: boolean;
/**
*
* @type {Array<FoodSimple>}
* @memberof PatchedFood
*/
substitute?: Array<FoodSimple> | null;
/**
*
* @type {boolean}
* @memberof PatchedFood
*/
substituteSiblings?: boolean;
/**
*
* @type {boolean}
* @memberof PatchedFood
*/
substituteChildren?: boolean;
/**
*
* @type {string}
* @memberof PatchedFood
*/
readonly substituteOnhand?: string;
/**
*
* @type {Array<FoodInheritField>}
* @memberof PatchedFood
*/
childInheritFields?: Array<FoodInheritField> | null;
/**
*
* @type {string}
* @memberof PatchedFood
*/
openDataSlug?: string | null;
}
/**
* Check if a given object implements the PatchedFood interface.
*/
export function instanceOfPatchedFood(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedFoodFromJSON(json: any): PatchedFood {
return PatchedFoodFromJSONTyped(json, false);
}
export function PatchedFoodFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedFood {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'name': !exists(json, 'name') ? undefined : json['name'],
'pluralName': !exists(json, 'plural_name') ? undefined : json['plural_name'],
'description': !exists(json, 'description') ? undefined : json['description'],
'shopping': !exists(json, 'shopping') ? undefined : json['shopping'],
'recipe': !exists(json, 'recipe') ? undefined : RecipeSimpleFromJSON(json['recipe']),
'url': !exists(json, 'url') ? undefined : json['url'],
'properties': !exists(json, 'properties') ? undefined : (json['properties'] === null ? null : (json['properties'] as Array<any>).map(PropertyFromJSON)),
'propertiesFoodAmount': !exists(json, 'properties_food_amount') ? undefined : json['properties_food_amount'],
'propertiesFoodUnit': !exists(json, 'properties_food_unit') ? undefined : UnitFromJSON(json['properties_food_unit']),
'fdcId': !exists(json, 'fdc_id') ? undefined : json['fdc_id'],
'foodOnhand': !exists(json, 'food_onhand') ? undefined : json['food_onhand'],
'supermarketCategory': !exists(json, 'supermarket_category') ? undefined : SupermarketCategoryFromJSON(json['supermarket_category']),
'parent': !exists(json, 'parent') ? undefined : json['parent'],
'numchild': !exists(json, 'numchild') ? undefined : json['numchild'],
'inheritFields': !exists(json, 'inherit_fields') ? undefined : (json['inherit_fields'] === null ? null : (json['inherit_fields'] as Array<any>).map(FoodInheritFieldFromJSON)),
'fullName': !exists(json, 'full_name') ? undefined : json['full_name'],
'ignoreShopping': !exists(json, 'ignore_shopping') ? undefined : json['ignore_shopping'],
'substitute': !exists(json, 'substitute') ? undefined : (json['substitute'] === null ? null : (json['substitute'] as Array<any>).map(FoodSimpleFromJSON)),
'substituteSiblings': !exists(json, 'substitute_siblings') ? undefined : json['substitute_siblings'],
'substituteChildren': !exists(json, 'substitute_children') ? undefined : json['substitute_children'],
'substituteOnhand': !exists(json, 'substitute_onhand') ? undefined : json['substitute_onhand'],
'childInheritFields': !exists(json, 'child_inherit_fields') ? undefined : (json['child_inherit_fields'] === null ? null : (json['child_inherit_fields'] as Array<any>).map(FoodInheritFieldFromJSON)),
'openDataSlug': !exists(json, 'open_data_slug') ? undefined : json['open_data_slug'],
};
}
export function PatchedFoodToJSON(value?: PatchedFood | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'name': value.name,
'plural_name': value.pluralName,
'description': value.description,
'recipe': RecipeSimpleToJSON(value.recipe),
'url': value.url,
'properties': value.properties === undefined ? undefined : (value.properties === null ? null : (value.properties as Array<any>).map(PropertyToJSON)),
'properties_food_amount': value.propertiesFoodAmount,
'properties_food_unit': UnitToJSON(value.propertiesFoodUnit),
'fdc_id': value.fdcId,
'food_onhand': value.foodOnhand,
'supermarket_category': SupermarketCategoryToJSON(value.supermarketCategory),
'inherit_fields': value.inheritFields === undefined ? undefined : (value.inheritFields === null ? null : (value.inheritFields as Array<any>).map(FoodInheritFieldToJSON)),
'ignore_shopping': value.ignoreShopping,
'substitute': value.substitute === undefined ? undefined : (value.substitute === null ? null : (value.substitute as Array<any>).map(FoodSimpleToJSON)),
'substitute_siblings': value.substituteSiblings,
'substitute_children': value.substituteChildren,
'child_inherit_fields': value.childInheritFields === undefined ? undefined : (value.childInheritFields === null ? null : (value.childInheritFields as Array<any>).map(FoodInheritFieldToJSON)),
'open_data_slug': value.openDataSlug,
};
}

View File

@@ -0,0 +1,132 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { Keyword } from './Keyword';
import {
KeywordFromJSON,
KeywordFromJSONTyped,
KeywordToJSON,
} from './Keyword';
/**
*
* @export
* @interface PatchedImportLog
*/
export interface PatchedImportLog {
/**
*
* @type {number}
* @memberof PatchedImportLog
*/
readonly id?: number;
/**
*
* @type {string}
* @memberof PatchedImportLog
*/
type?: string;
/**
*
* @type {string}
* @memberof PatchedImportLog
*/
msg?: string;
/**
*
* @type {boolean}
* @memberof PatchedImportLog
*/
running?: boolean;
/**
*
* @type {Keyword}
* @memberof PatchedImportLog
*/
readonly keyword?: Keyword;
/**
*
* @type {number}
* @memberof PatchedImportLog
*/
totalRecipes?: number;
/**
*
* @type {number}
* @memberof PatchedImportLog
*/
importedRecipes?: number;
/**
*
* @type {number}
* @memberof PatchedImportLog
*/
readonly createdBy?: number;
/**
*
* @type {Date}
* @memberof PatchedImportLog
*/
readonly createdAt?: Date;
}
/**
* Check if a given object implements the PatchedImportLog interface.
*/
export function instanceOfPatchedImportLog(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedImportLogFromJSON(json: any): PatchedImportLog {
return PatchedImportLogFromJSONTyped(json, false);
}
export function PatchedImportLogFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedImportLog {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'type': !exists(json, 'type') ? undefined : json['type'],
'msg': !exists(json, 'msg') ? undefined : json['msg'],
'running': !exists(json, 'running') ? undefined : json['running'],
'keyword': !exists(json, 'keyword') ? undefined : KeywordFromJSON(json['keyword']),
'totalRecipes': !exists(json, 'total_recipes') ? undefined : json['total_recipes'],
'importedRecipes': !exists(json, 'imported_recipes') ? undefined : json['imported_recipes'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])),
};
}
export function PatchedImportLogToJSON(value?: PatchedImportLog | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'type': value.type,
'msg': value.msg,
'running': value.running,
'total_recipes': value.totalRecipes,
'imported_recipes': value.importedRecipes,
};
}

View File

@@ -0,0 +1,171 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { Food } from './Food';
import {
FoodFromJSON,
FoodFromJSONTyped,
FoodToJSON,
} from './Food';
import type { Unit } from './Unit';
import {
UnitFromJSON,
UnitFromJSONTyped,
UnitToJSON,
} from './Unit';
/**
* Adds nested create feature
* @export
* @interface PatchedIngredient
*/
export interface PatchedIngredient {
/**
*
* @type {number}
* @memberof PatchedIngredient
*/
readonly id?: number;
/**
*
* @type {Food}
* @memberof PatchedIngredient
*/
food?: Food | null;
/**
*
* @type {Unit}
* @memberof PatchedIngredient
*/
unit?: Unit | null;
/**
*
* @type {string}
* @memberof PatchedIngredient
*/
amount?: string;
/**
*
* @type {string}
* @memberof PatchedIngredient
*/
readonly conversions?: string;
/**
*
* @type {string}
* @memberof PatchedIngredient
*/
note?: string | null;
/**
*
* @type {number}
* @memberof PatchedIngredient
*/
order?: number;
/**
*
* @type {boolean}
* @memberof PatchedIngredient
*/
isHeader?: boolean;
/**
*
* @type {boolean}
* @memberof PatchedIngredient
*/
noAmount?: boolean;
/**
*
* @type {string}
* @memberof PatchedIngredient
*/
originalText?: string | null;
/**
*
* @type {string}
* @memberof PatchedIngredient
*/
readonly usedInRecipes?: string;
/**
*
* @type {boolean}
* @memberof PatchedIngredient
*/
alwaysUsePluralUnit?: boolean;
/**
*
* @type {boolean}
* @memberof PatchedIngredient
*/
alwaysUsePluralFood?: boolean;
}
/**
* Check if a given object implements the PatchedIngredient interface.
*/
export function instanceOfPatchedIngredient(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedIngredientFromJSON(json: any): PatchedIngredient {
return PatchedIngredientFromJSONTyped(json, false);
}
export function PatchedIngredientFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedIngredient {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'food': !exists(json, 'food') ? undefined : FoodFromJSON(json['food']),
'unit': !exists(json, 'unit') ? undefined : UnitFromJSON(json['unit']),
'amount': !exists(json, 'amount') ? undefined : json['amount'],
'conversions': !exists(json, 'conversions') ? undefined : json['conversions'],
'note': !exists(json, 'note') ? undefined : json['note'],
'order': !exists(json, 'order') ? undefined : json['order'],
'isHeader': !exists(json, 'is_header') ? undefined : json['is_header'],
'noAmount': !exists(json, 'no_amount') ? undefined : json['no_amount'],
'originalText': !exists(json, 'original_text') ? undefined : json['original_text'],
'usedInRecipes': !exists(json, 'used_in_recipes') ? undefined : json['used_in_recipes'],
'alwaysUsePluralUnit': !exists(json, 'always_use_plural_unit') ? undefined : json['always_use_plural_unit'],
'alwaysUsePluralFood': !exists(json, 'always_use_plural_food') ? undefined : json['always_use_plural_food'],
};
}
export function PatchedIngredientToJSON(value?: PatchedIngredient | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'food': FoodToJSON(value.food),
'unit': UnitToJSON(value.unit),
'amount': value.amount,
'note': value.note,
'order': value.order,
'is_header': value.isHeader,
'no_amount': value.noAmount,
'original_text': value.originalText,
'always_use_plural_unit': value.alwaysUsePluralUnit,
'always_use_plural_food': value.alwaysUsePluralFood,
};
}

View File

@@ -0,0 +1,140 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { Group } from './Group';
import {
GroupFromJSON,
GroupFromJSONTyped,
GroupToJSON,
} from './Group';
/**
* Adds nested create feature
* @export
* @interface PatchedInviteLink
*/
export interface PatchedInviteLink {
/**
*
* @type {number}
* @memberof PatchedInviteLink
*/
readonly id?: number;
/**
*
* @type {string}
* @memberof PatchedInviteLink
*/
readonly uuid?: string;
/**
*
* @type {string}
* @memberof PatchedInviteLink
*/
email?: string;
/**
*
* @type {Group}
* @memberof PatchedInviteLink
*/
group?: Group;
/**
*
* @type {Date}
* @memberof PatchedInviteLink
*/
validUntil?: Date;
/**
*
* @type {number}
* @memberof PatchedInviteLink
*/
usedBy?: number | null;
/**
*
* @type {boolean}
* @memberof PatchedInviteLink
*/
reusable?: boolean;
/**
*
* @type {string}
* @memberof PatchedInviteLink
*/
internalNote?: string | null;
/**
*
* @type {number}
* @memberof PatchedInviteLink
*/
readonly createdBy?: number;
/**
*
* @type {Date}
* @memberof PatchedInviteLink
*/
readonly createdAt?: Date;
}
/**
* Check if a given object implements the PatchedInviteLink interface.
*/
export function instanceOfPatchedInviteLink(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedInviteLinkFromJSON(json: any): PatchedInviteLink {
return PatchedInviteLinkFromJSONTyped(json, false);
}
export function PatchedInviteLinkFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedInviteLink {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'uuid': !exists(json, 'uuid') ? undefined : json['uuid'],
'email': !exists(json, 'email') ? undefined : json['email'],
'group': !exists(json, 'group') ? undefined : GroupFromJSON(json['group']),
'validUntil': !exists(json, 'valid_until') ? undefined : (new Date(json['valid_until'])),
'usedBy': !exists(json, 'used_by') ? undefined : json['used_by'],
'reusable': !exists(json, 'reusable') ? undefined : json['reusable'],
'internalNote': !exists(json, 'internal_note') ? undefined : json['internal_note'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])),
};
}
export function PatchedInviteLinkToJSON(value?: PatchedInviteLink | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'email': value.email,
'group': GroupToJSON(value.group),
'valid_until': value.validUntil === undefined ? undefined : (value.validUntil.toISOString().substring(0,10)),
'used_by': value.usedBy,
'reusable': value.reusable,
'internal_note': value.internalNote,
};
}

View File

@@ -0,0 +1,156 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.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';
/**
* 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 PatchedKeyword
*/
export interface PatchedKeyword {
/**
*
* @type {number}
* @memberof PatchedKeyword
*/
readonly id?: number;
/**
*
* @type {string}
* @memberof PatchedKeyword
*/
name?: string;
/**
*
* @type {string}
* @memberof PatchedKeyword
*/
readonly label?: string;
/**
*
* @type {string}
* @memberof PatchedKeyword
*/
description?: string;
/**
*
* @type {string}
* @memberof PatchedKeyword
*/
readonly parent?: string;
/**
*
* @type {number}
* @memberof PatchedKeyword
*/
readonly numchild?: number;
/**
*
* @type {Date}
* @memberof PatchedKeyword
*/
readonly createdAt?: Date;
/**
*
* @type {Date}
* @memberof PatchedKeyword
*/
readonly updatedAt?: Date;
/**
*
* @type {string}
* @memberof PatchedKeyword
*/
readonly fullName?: string;
}
/**
* Check if a given object implements the PatchedKeyword interface.
*/
export function instanceOfPatchedKeyword(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedKeywordFromJSON(json: any): PatchedKeyword {
return PatchedKeywordFromJSONTyped(json, false);
}
export function PatchedKeywordFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedKeyword {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'name': !exists(json, 'name') ? undefined : json['name'],
'label': !exists(json, 'label') ? undefined : json['label'],
'description': !exists(json, 'description') ? undefined : json['description'],
'parent': !exists(json, 'parent') ? undefined : json['parent'],
'numchild': !exists(json, 'numchild') ? undefined : json['numchild'],
'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])),
'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])),
'fullName': !exists(json, 'full_name') ? undefined : json['full_name'],
};
}
export function PatchedKeywordToJSON(value?: PatchedKeyword | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'name': value.name,
'description': value.description,
};
}

View File

@@ -0,0 +1,182 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { MealType } from './MealType';
import {
MealTypeFromJSON,
MealTypeFromJSONTyped,
MealTypeToJSON,
} from './MealType';
import type { RecipeOverview } from './RecipeOverview';
import {
RecipeOverviewFromJSON,
RecipeOverviewFromJSONTyped,
RecipeOverviewToJSON,
} from './RecipeOverview';
import type { User } from './User';
import {
UserFromJSON,
UserFromJSONTyped,
UserToJSON,
} from './User';
/**
* Adds nested create feature
* @export
* @interface PatchedMealPlan
*/
export interface PatchedMealPlan {
/**
*
* @type {number}
* @memberof PatchedMealPlan
*/
readonly id?: number;
/**
*
* @type {string}
* @memberof PatchedMealPlan
*/
title?: string;
/**
*
* @type {RecipeOverview}
* @memberof PatchedMealPlan
*/
recipe?: RecipeOverview | null;
/**
*
* @type {string}
* @memberof PatchedMealPlan
*/
servings?: string;
/**
*
* @type {string}
* @memberof PatchedMealPlan
*/
note?: string;
/**
*
* @type {string}
* @memberof PatchedMealPlan
*/
readonly noteMarkdown?: string;
/**
*
* @type {Date}
* @memberof PatchedMealPlan
*/
fromDate?: Date;
/**
*
* @type {Date}
* @memberof PatchedMealPlan
*/
toDate?: Date;
/**
*
* @type {MealType}
* @memberof PatchedMealPlan
*/
mealType?: MealType;
/**
*
* @type {number}
* @memberof PatchedMealPlan
*/
readonly createdBy?: number;
/**
*
* @type {Array<User>}
* @memberof PatchedMealPlan
*/
shared?: Array<User> | null;
/**
*
* @type {string}
* @memberof PatchedMealPlan
*/
readonly recipeName?: string;
/**
*
* @type {string}
* @memberof PatchedMealPlan
*/
readonly mealTypeName?: string;
/**
*
* @type {string}
* @memberof PatchedMealPlan
*/
readonly shopping?: string;
}
/**
* Check if a given object implements the PatchedMealPlan interface.
*/
export function instanceOfPatchedMealPlan(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedMealPlanFromJSON(json: any): PatchedMealPlan {
return PatchedMealPlanFromJSONTyped(json, false);
}
export function PatchedMealPlanFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedMealPlan {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'title': !exists(json, 'title') ? undefined : json['title'],
'recipe': !exists(json, 'recipe') ? undefined : RecipeOverviewFromJSON(json['recipe']),
'servings': !exists(json, 'servings') ? undefined : json['servings'],
'note': !exists(json, 'note') ? undefined : json['note'],
'noteMarkdown': !exists(json, 'note_markdown') ? undefined : json['note_markdown'],
'fromDate': !exists(json, 'from_date') ? undefined : (new Date(json['from_date'])),
'toDate': !exists(json, 'to_date') ? undefined : (new Date(json['to_date'])),
'mealType': !exists(json, 'meal_type') ? undefined : MealTypeFromJSON(json['meal_type']),
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
'shared': !exists(json, 'shared') ? undefined : (json['shared'] === null ? null : (json['shared'] as Array<any>).map(UserFromJSON)),
'recipeName': !exists(json, 'recipe_name') ? undefined : json['recipe_name'],
'mealTypeName': !exists(json, 'meal_type_name') ? undefined : json['meal_type_name'],
'shopping': !exists(json, 'shopping') ? undefined : json['shopping'],
};
}
export function PatchedMealPlanToJSON(value?: PatchedMealPlan | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'title': value.title,
'recipe': RecipeOverviewToJSON(value.recipe),
'servings': value.servings,
'note': value.note,
'from_date': value.fromDate === undefined ? undefined : (value.fromDate.toISOString().substring(0,10)),
'to_date': value.toDate === undefined ? undefined : (value.toDate.toISOString().substring(0,10)),
'meal_type': MealTypeToJSON(value.mealType),
'shared': value.shared === undefined ? undefined : (value.shared === null ? null : (value.shared as Array<any>).map(UserToJSON)),
};
}

View File

@@ -0,0 +1,103 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.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';
/**
* Adds nested create feature
* @export
* @interface PatchedMealType
*/
export interface PatchedMealType {
/**
*
* @type {number}
* @memberof PatchedMealType
*/
readonly id?: number;
/**
*
* @type {string}
* @memberof PatchedMealType
*/
name?: string;
/**
*
* @type {number}
* @memberof PatchedMealType
*/
order?: number;
/**
*
* @type {string}
* @memberof PatchedMealType
*/
color?: string | null;
/**
*
* @type {boolean}
* @memberof PatchedMealType
*/
_default?: boolean;
/**
*
* @type {number}
* @memberof PatchedMealType
*/
readonly createdBy?: number;
}
/**
* Check if a given object implements the PatchedMealType interface.
*/
export function instanceOfPatchedMealType(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedMealTypeFromJSON(json: any): PatchedMealType {
return PatchedMealTypeFromJSONTyped(json, false);
}
export function PatchedMealTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedMealType {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'name': !exists(json, 'name') ? undefined : json['name'],
'order': !exists(json, 'order') ? undefined : json['order'],
'color': !exists(json, 'color') ? undefined : json['color'],
'_default': !exists(json, 'default') ? undefined : json['default'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
};
}
export function PatchedMealTypeToJSON(value?: PatchedMealType | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'name': value.name,
'order': value.order,
'color': value.color,
'default': value._default,
};
}

View File

@@ -0,0 +1,152 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { OpenDataVersion } from './OpenDataVersion';
import {
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 PatchedOpenDataCategory
*/
export interface PatchedOpenDataCategory {
/**
*
* @type {number}
* @memberof PatchedOpenDataCategory
*/
readonly id?: number;
/**
*
* @type {OpenDataVersion}
* @memberof PatchedOpenDataCategory
*/
version?: OpenDataVersion;
/**
*
* @type {string}
* @memberof PatchedOpenDataCategory
*/
slug?: string;
/**
*
* @type {string}
* @memberof PatchedOpenDataCategory
*/
name?: string;
/**
*
* @type {string}
* @memberof PatchedOpenDataCategory
*/
description?: string;
/**
*
* @type {string}
* @memberof PatchedOpenDataCategory
*/
comment?: string;
/**
*
* @type {string}
* @memberof PatchedOpenDataCategory
*/
readonly createdBy?: string;
}
/**
* Check if a given object implements the PatchedOpenDataCategory interface.
*/
export function instanceOfPatchedOpenDataCategory(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedOpenDataCategoryFromJSON(json: any): PatchedOpenDataCategory {
return PatchedOpenDataCategoryFromJSONTyped(json, false);
}
export function PatchedOpenDataCategoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedOpenDataCategory {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'version': !exists(json, 'version') ? undefined : OpenDataVersionFromJSON(json['version']),
'slug': !exists(json, 'slug') ? undefined : json['slug'],
'name': !exists(json, 'name') ? undefined : json['name'],
'description': !exists(json, 'description') ? undefined : json['description'],
'comment': !exists(json, 'comment') ? undefined : json['comment'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
};
}
export function PatchedOpenDataCategoryToJSON(value?: PatchedOpenDataCategory | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'version': OpenDataVersionToJSON(value.version),
'slug': value.slug,
'name': value.name,
'description': value.description,
'comment': value.comment,
};
}

View File

@@ -0,0 +1,162 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { OpenDataFood } from './OpenDataFood';
import {
OpenDataFoodFromJSON,
OpenDataFoodFromJSONTyped,
OpenDataFoodToJSON,
} from './OpenDataFood';
import type { OpenDataUnit } from './OpenDataUnit';
import {
OpenDataUnitFromJSON,
OpenDataUnitFromJSONTyped,
OpenDataUnitToJSON,
} from './OpenDataUnit';
import type { OpenDataVersion } from './OpenDataVersion';
import {
OpenDataVersionFromJSON,
OpenDataVersionFromJSONTyped,
OpenDataVersionToJSON,
} from './OpenDataVersion';
/**
* Adds nested create feature
* @export
* @interface PatchedOpenDataConversion
*/
export interface PatchedOpenDataConversion {
/**
*
* @type {number}
* @memberof PatchedOpenDataConversion
*/
readonly id?: number;
/**
*
* @type {OpenDataVersion}
* @memberof PatchedOpenDataConversion
*/
version?: OpenDataVersion;
/**
*
* @type {string}
* @memberof PatchedOpenDataConversion
*/
slug?: string;
/**
*
* @type {OpenDataFood}
* @memberof PatchedOpenDataConversion
*/
food?: OpenDataFood;
/**
*
* @type {string}
* @memberof PatchedOpenDataConversion
*/
baseAmount?: string;
/**
*
* @type {OpenDataUnit}
* @memberof PatchedOpenDataConversion
*/
baseUnit?: OpenDataUnit;
/**
*
* @type {string}
* @memberof PatchedOpenDataConversion
*/
convertedAmount?: string;
/**
*
* @type {OpenDataUnit}
* @memberof PatchedOpenDataConversion
*/
convertedUnit?: OpenDataUnit;
/**
*
* @type {string}
* @memberof PatchedOpenDataConversion
*/
source?: string;
/**
*
* @type {string}
* @memberof PatchedOpenDataConversion
*/
comment?: string;
/**
*
* @type {string}
* @memberof PatchedOpenDataConversion
*/
readonly createdBy?: string;
}
/**
* Check if a given object implements the PatchedOpenDataConversion interface.
*/
export function instanceOfPatchedOpenDataConversion(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedOpenDataConversionFromJSON(json: any): PatchedOpenDataConversion {
return PatchedOpenDataConversionFromJSONTyped(json, false);
}
export function PatchedOpenDataConversionFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedOpenDataConversion {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'version': !exists(json, 'version') ? undefined : OpenDataVersionFromJSON(json['version']),
'slug': !exists(json, 'slug') ? undefined : json['slug'],
'food': !exists(json, 'food') ? undefined : OpenDataFoodFromJSON(json['food']),
'baseAmount': !exists(json, 'base_amount') ? undefined : json['base_amount'],
'baseUnit': !exists(json, 'base_unit') ? undefined : OpenDataUnitFromJSON(json['base_unit']),
'convertedAmount': !exists(json, 'converted_amount') ? undefined : json['converted_amount'],
'convertedUnit': !exists(json, 'converted_unit') ? undefined : OpenDataUnitFromJSON(json['converted_unit']),
'source': !exists(json, 'source') ? undefined : json['source'],
'comment': !exists(json, 'comment') ? undefined : json['comment'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
};
}
export function PatchedOpenDataConversionToJSON(value?: PatchedOpenDataConversion | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'version': OpenDataVersionToJSON(value.version),
'slug': value.slug,
'food': OpenDataFoodToJSON(value.food),
'base_amount': value.baseAmount,
'base_unit': OpenDataUnitToJSON(value.baseUnit),
'converted_amount': value.convertedAmount,
'converted_unit': OpenDataUnitToJSON(value.convertedUnit),
'source': value.source,
'comment': value.comment,
};
}

View File

@@ -0,0 +1,250 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { OpenDataCategory } from './OpenDataCategory';
import {
OpenDataCategoryFromJSON,
OpenDataCategoryFromJSONTyped,
OpenDataCategoryToJSON,
} from './OpenDataCategory';
import type { OpenDataFoodProperty } from './OpenDataFoodProperty';
import {
OpenDataFoodPropertyFromJSON,
OpenDataFoodPropertyFromJSONTyped,
OpenDataFoodPropertyToJSON,
} from './OpenDataFoodProperty';
import type { OpenDataUnit } from './OpenDataUnit';
import {
OpenDataUnitFromJSON,
OpenDataUnitFromJSONTyped,
OpenDataUnitToJSON,
} from './OpenDataUnit';
import type { OpenDataVersion } from './OpenDataVersion';
import {
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 PatchedOpenDataFood
*/
export interface PatchedOpenDataFood {
/**
*
* @type {number}
* @memberof PatchedOpenDataFood
*/
readonly id?: number;
/**
*
* @type {OpenDataVersion}
* @memberof PatchedOpenDataFood
*/
version?: OpenDataVersion;
/**
*
* @type {string}
* @memberof PatchedOpenDataFood
*/
slug?: string;
/**
*
* @type {string}
* @memberof PatchedOpenDataFood
*/
name?: string;
/**
*
* @type {string}
* @memberof PatchedOpenDataFood
*/
pluralName?: string;
/**
*
* @type {OpenDataCategory}
* @memberof PatchedOpenDataFood
*/
storeCategory?: OpenDataCategory;
/**
*
* @type {OpenDataUnit}
* @memberof PatchedOpenDataFood
*/
preferredUnitMetric?: OpenDataUnit | null;
/**
*
* @type {OpenDataUnit}
* @memberof PatchedOpenDataFood
*/
preferredShoppingUnitMetric?: OpenDataUnit | null;
/**
*
* @type {OpenDataUnit}
* @memberof PatchedOpenDataFood
*/
preferredUnitImperial?: OpenDataUnit | null;
/**
*
* @type {OpenDataUnit}
* @memberof PatchedOpenDataFood
*/
preferredShoppingUnitImperial?: OpenDataUnit | null;
/**
*
* @type {Array<OpenDataFoodProperty>}
* @memberof PatchedOpenDataFood
*/
properties?: Array<OpenDataFoodProperty> | null;
/**
*
* @type {number}
* @memberof PatchedOpenDataFood
*/
propertiesFoodAmount?: number;
/**
*
* @type {OpenDataUnit}
* @memberof PatchedOpenDataFood
*/
propertiesFoodUnit?: OpenDataUnit;
/**
*
* @type {string}
* @memberof PatchedOpenDataFood
*/
propertiesSource?: string;
/**
*
* @type {string}
* @memberof PatchedOpenDataFood
*/
fdcId?: string;
/**
*
* @type {string}
* @memberof PatchedOpenDataFood
*/
comment?: string;
/**
*
* @type {string}
* @memberof PatchedOpenDataFood
*/
readonly createdBy?: string;
}
/**
* Check if a given object implements the PatchedOpenDataFood interface.
*/
export function instanceOfPatchedOpenDataFood(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedOpenDataFoodFromJSON(json: any): PatchedOpenDataFood {
return PatchedOpenDataFoodFromJSONTyped(json, false);
}
export function PatchedOpenDataFoodFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedOpenDataFood {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'version': !exists(json, 'version') ? undefined : OpenDataVersionFromJSON(json['version']),
'slug': !exists(json, 'slug') ? undefined : json['slug'],
'name': !exists(json, 'name') ? undefined : json['name'],
'pluralName': !exists(json, 'plural_name') ? undefined : json['plural_name'],
'storeCategory': !exists(json, 'store_category') ? undefined : 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': !exists(json, 'properties') ? undefined : (json['properties'] === null ? null : (json['properties'] as Array<any>).map(OpenDataFoodPropertyFromJSON)),
'propertiesFoodAmount': !exists(json, 'properties_food_amount') ? undefined : json['properties_food_amount'],
'propertiesFoodUnit': !exists(json, 'properties_food_unit') ? undefined : OpenDataUnitFromJSON(json['properties_food_unit']),
'propertiesSource': !exists(json, 'properties_source') ? undefined : json['properties_source'],
'fdcId': !exists(json, 'fdc_id') ? undefined : json['fdc_id'],
'comment': !exists(json, 'comment') ? undefined : json['comment'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
};
}
export function PatchedOpenDataFoodToJSON(value?: PatchedOpenDataFood | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'version': OpenDataVersionToJSON(value.version),
'slug': value.slug,
'name': value.name,
'plural_name': value.pluralName,
'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 === undefined ? undefined : (value.properties === null ? null : (value.properties as Array<any>).map(OpenDataFoodPropertyToJSON)),
'properties_food_amount': value.propertiesFoodAmount,
'properties_food_unit': OpenDataUnitToJSON(value.propertiesFoodUnit),
'properties_source': value.propertiesSource,
'fdc_id': value.fdcId,
'comment': value.comment,
};
}

View File

@@ -0,0 +1,160 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { OpenDataVersion } from './OpenDataVersion';
import {
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 PatchedOpenDataProperty
*/
export interface PatchedOpenDataProperty {
/**
*
* @type {number}
* @memberof PatchedOpenDataProperty
*/
readonly id?: number;
/**
*
* @type {OpenDataVersion}
* @memberof PatchedOpenDataProperty
*/
version?: OpenDataVersion;
/**
*
* @type {string}
* @memberof PatchedOpenDataProperty
*/
slug?: string;
/**
*
* @type {string}
* @memberof PatchedOpenDataProperty
*/
name?: string;
/**
*
* @type {string}
* @memberof PatchedOpenDataProperty
*/
unit?: string;
/**
*
* @type {number}
* @memberof PatchedOpenDataProperty
*/
fdcId?: number | null;
/**
*
* @type {string}
* @memberof PatchedOpenDataProperty
*/
comment?: string;
/**
*
* @type {string}
* @memberof PatchedOpenDataProperty
*/
readonly createdBy?: string;
}
/**
* Check if a given object implements the PatchedOpenDataProperty interface.
*/
export function instanceOfPatchedOpenDataProperty(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedOpenDataPropertyFromJSON(json: any): PatchedOpenDataProperty {
return PatchedOpenDataPropertyFromJSONTyped(json, false);
}
export function PatchedOpenDataPropertyFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedOpenDataProperty {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'version': !exists(json, 'version') ? undefined : OpenDataVersionFromJSON(json['version']),
'slug': !exists(json, 'slug') ? undefined : json['slug'],
'name': !exists(json, 'name') ? undefined : json['name'],
'unit': !exists(json, 'unit') ? undefined : json['unit'],
'fdcId': !exists(json, 'fdc_id') ? undefined : json['fdc_id'],
'comment': !exists(json, 'comment') ? undefined : json['comment'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
};
}
export function PatchedOpenDataPropertyToJSON(value?: PatchedOpenDataProperty | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'version': OpenDataVersionToJSON(value.version),
'slug': value.slug,
'name': value.name,
'unit': value.unit,
'fdc_id': value.fdcId,
'comment': value.comment,
};
}

View File

@@ -0,0 +1,124 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { OpenDataStoreCategory } from './OpenDataStoreCategory';
import {
OpenDataStoreCategoryFromJSON,
OpenDataStoreCategoryFromJSONTyped,
OpenDataStoreCategoryToJSON,
} from './OpenDataStoreCategory';
import type { OpenDataVersion } from './OpenDataVersion';
import {
OpenDataVersionFromJSON,
OpenDataVersionFromJSONTyped,
OpenDataVersionToJSON,
} from './OpenDataVersion';
/**
* Adds nested create feature
* @export
* @interface PatchedOpenDataStore
*/
export interface PatchedOpenDataStore {
/**
*
* @type {number}
* @memberof PatchedOpenDataStore
*/
readonly id?: number;
/**
*
* @type {OpenDataVersion}
* @memberof PatchedOpenDataStore
*/
version?: OpenDataVersion;
/**
*
* @type {string}
* @memberof PatchedOpenDataStore
*/
slug?: string;
/**
*
* @type {string}
* @memberof PatchedOpenDataStore
*/
name?: string;
/**
*
* @type {Array<OpenDataStoreCategory>}
* @memberof PatchedOpenDataStore
*/
categoryToStore?: Array<OpenDataStoreCategory> | null;
/**
*
* @type {string}
* @memberof PatchedOpenDataStore
*/
comment?: string;
/**
*
* @type {string}
* @memberof PatchedOpenDataStore
*/
readonly createdBy?: string;
}
/**
* Check if a given object implements the PatchedOpenDataStore interface.
*/
export function instanceOfPatchedOpenDataStore(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedOpenDataStoreFromJSON(json: any): PatchedOpenDataStore {
return PatchedOpenDataStoreFromJSONTyped(json, false);
}
export function PatchedOpenDataStoreFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedOpenDataStore {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'version': !exists(json, 'version') ? undefined : OpenDataVersionFromJSON(json['version']),
'slug': !exists(json, 'slug') ? undefined : json['slug'],
'name': !exists(json, 'name') ? undefined : json['name'],
'categoryToStore': !exists(json, 'category_to_store') ? undefined : (json['category_to_store'] === null ? null : (json['category_to_store'] as Array<any>).map(OpenDataStoreCategoryFromJSON)),
'comment': !exists(json, 'comment') ? undefined : json['comment'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
};
}
export function PatchedOpenDataStoreToJSON(value?: PatchedOpenDataStore | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'version': OpenDataVersionToJSON(value.version),
'slug': value.slug,
'name': value.name,
'category_to_store': value.categoryToStore === undefined ? undefined : (value.categoryToStore === null ? null : (value.categoryToStore as Array<any>).map(OpenDataStoreCategoryToJSON)),
'comment': value.comment,
};
}

View File

@@ -0,0 +1,180 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { OpenDataUnitBaseUnit } from './OpenDataUnitBaseUnit';
import {
OpenDataUnitBaseUnitFromJSON,
OpenDataUnitBaseUnitFromJSONTyped,
OpenDataUnitBaseUnitToJSON,
} from './OpenDataUnitBaseUnit';
import type { OpenDataUnitTypeEnum } from './OpenDataUnitTypeEnum';
import {
OpenDataUnitTypeEnumFromJSON,
OpenDataUnitTypeEnumFromJSONTyped,
OpenDataUnitTypeEnumToJSON,
} from './OpenDataUnitTypeEnum';
import type { OpenDataVersion } from './OpenDataVersion';
import {
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 PatchedOpenDataUnit
*/
export interface PatchedOpenDataUnit {
/**
*
* @type {number}
* @memberof PatchedOpenDataUnit
*/
readonly id?: number;
/**
*
* @type {OpenDataVersion}
* @memberof PatchedOpenDataUnit
*/
version?: OpenDataVersion;
/**
*
* @type {string}
* @memberof PatchedOpenDataUnit
*/
slug?: string;
/**
*
* @type {string}
* @memberof PatchedOpenDataUnit
*/
name?: string;
/**
*
* @type {string}
* @memberof PatchedOpenDataUnit
*/
pluralName?: string;
/**
*
* @type {OpenDataUnitBaseUnit}
* @memberof PatchedOpenDataUnit
*/
baseUnit?: OpenDataUnitBaseUnit;
/**
*
* @type {OpenDataUnitTypeEnum}
* @memberof PatchedOpenDataUnit
*/
type?: OpenDataUnitTypeEnum;
/**
*
* @type {string}
* @memberof PatchedOpenDataUnit
*/
comment?: string;
/**
*
* @type {string}
* @memberof PatchedOpenDataUnit
*/
readonly createdBy?: string;
}
/**
* Check if a given object implements the PatchedOpenDataUnit interface.
*/
export function instanceOfPatchedOpenDataUnit(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedOpenDataUnitFromJSON(json: any): PatchedOpenDataUnit {
return PatchedOpenDataUnitFromJSONTyped(json, false);
}
export function PatchedOpenDataUnitFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedOpenDataUnit {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'version': !exists(json, 'version') ? undefined : OpenDataVersionFromJSON(json['version']),
'slug': !exists(json, 'slug') ? undefined : json['slug'],
'name': !exists(json, 'name') ? undefined : json['name'],
'pluralName': !exists(json, 'plural_name') ? undefined : json['plural_name'],
'baseUnit': !exists(json, 'base_unit') ? undefined : OpenDataUnitBaseUnitFromJSON(json['base_unit']),
'type': !exists(json, 'type') ? undefined : OpenDataUnitTypeEnumFromJSON(json['type']),
'comment': !exists(json, 'comment') ? undefined : json['comment'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
};
}
export function PatchedOpenDataUnitToJSON(value?: PatchedOpenDataUnit | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'version': OpenDataVersionToJSON(value.version),
'slug': value.slug,
'name': value.name,
'plural_name': value.pluralName,
'base_unit': OpenDataUnitBaseUnitToJSON(value.baseUnit),
'type': OpenDataUnitTypeEnumToJSON(value.type),
'comment': value.comment,
};
}

View File

@@ -0,0 +1,122 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.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';
/**
* 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 PatchedOpenDataVersion
*/
export interface PatchedOpenDataVersion {
/**
*
* @type {number}
* @memberof PatchedOpenDataVersion
*/
readonly id?: number;
/**
*
* @type {string}
* @memberof PatchedOpenDataVersion
*/
name?: string;
/**
*
* @type {string}
* @memberof PatchedOpenDataVersion
*/
code?: string;
/**
*
* @type {string}
* @memberof PatchedOpenDataVersion
*/
comment?: string;
}
/**
* Check if a given object implements the PatchedOpenDataVersion interface.
*/
export function instanceOfPatchedOpenDataVersion(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedOpenDataVersionFromJSON(json: any): PatchedOpenDataVersion {
return PatchedOpenDataVersionFromJSONTyped(json, false);
}
export function PatchedOpenDataVersionFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedOpenDataVersion {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'name': !exists(json, 'name') ? undefined : json['name'],
'code': !exists(json, 'code') ? undefined : json['code'],
'comment': !exists(json, 'comment') ? undefined : json['comment'],
};
}
export function PatchedOpenDataVersionToJSON(value?: PatchedOpenDataVersion | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'name': value.name,
'code': value.code,
'comment': value.comment,
};
}

View File

@@ -0,0 +1,121 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { PropertyType } from './PropertyType';
import {
PropertyTypeFromJSON,
PropertyTypeFromJSONTyped,
PropertyTypeToJSON,
} from './PropertyType';
/**
* 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 PatchedProperty
*/
export interface PatchedProperty {
/**
*
* @type {number}
* @memberof PatchedProperty
*/
readonly id?: number;
/**
*
* @type {string}
* @memberof PatchedProperty
*/
propertyAmount?: string | null;
/**
*
* @type {PropertyType}
* @memberof PatchedProperty
*/
propertyType?: PropertyType;
}
/**
* Check if a given object implements the PatchedProperty interface.
*/
export function instanceOfPatchedProperty(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedPropertyFromJSON(json: any): PatchedProperty {
return PatchedPropertyFromJSONTyped(json, false);
}
export function PatchedPropertyFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedProperty {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'propertyAmount': !exists(json, 'property_amount') ? undefined : json['property_amount'],
'propertyType': !exists(json, 'property_type') ? undefined : PropertyTypeFromJSON(json['property_type']),
};
}
export function PatchedPropertyToJSON(value?: PatchedProperty | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'property_amount': value.propertyAmount,
'property_type': PropertyTypeToJSON(value.propertyType),
};
}

View File

@@ -0,0 +1,113 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.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';
/**
* Adds nested create feature
* @export
* @interface PatchedPropertyType
*/
export interface PatchedPropertyType {
/**
*
* @type {number}
* @memberof PatchedPropertyType
*/
id?: number;
/**
*
* @type {string}
* @memberof PatchedPropertyType
*/
name?: string;
/**
*
* @type {string}
* @memberof PatchedPropertyType
*/
unit?: string | null;
/**
*
* @type {string}
* @memberof PatchedPropertyType
*/
description?: string | null;
/**
*
* @type {number}
* @memberof PatchedPropertyType
*/
order?: number;
/**
*
* @type {string}
* @memberof PatchedPropertyType
*/
openDataSlug?: string | null;
/**
*
* @type {number}
* @memberof PatchedPropertyType
*/
fdcId?: number | null;
}
/**
* Check if a given object implements the PatchedPropertyType interface.
*/
export function instanceOfPatchedPropertyType(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedPropertyTypeFromJSON(json: any): PatchedPropertyType {
return PatchedPropertyTypeFromJSONTyped(json, false);
}
export function PatchedPropertyTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedPropertyType {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'name': !exists(json, 'name') ? undefined : json['name'],
'unit': !exists(json, 'unit') ? undefined : json['unit'],
'description': !exists(json, 'description') ? undefined : json['description'],
'order': !exists(json, 'order') ? undefined : json['order'],
'openDataSlug': !exists(json, 'open_data_slug') ? undefined : json['open_data_slug'],
'fdcId': !exists(json, 'fdc_id') ? undefined : json['fdc_id'],
};
}
export function PatchedPropertyTypeToJSON(value?: PatchedPropertyType | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'id': value.id,
'name': value.name,
'unit': value.unit,
'description': value.description,
'order': value.order,
'open_data_slug': value.openDataSlug,
'fdc_id': value.fdcId,
};
}

View File

@@ -0,0 +1,272 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { Keyword } from './Keyword';
import {
KeywordFromJSON,
KeywordFromJSONTyped,
KeywordToJSON,
} from './Keyword';
import type { NutritionInformation } from './NutritionInformation';
import {
NutritionInformationFromJSON,
NutritionInformationFromJSONTyped,
NutritionInformationToJSON,
} from './NutritionInformation';
import type { Property } from './Property';
import {
PropertyFromJSON,
PropertyFromJSONTyped,
PropertyToJSON,
} from './Property';
import type { Step } from './Step';
import {
StepFromJSON,
StepFromJSONTyped,
StepToJSON,
} from './Step';
import type { User } from './User';
import {
UserFromJSON,
UserFromJSONTyped,
UserToJSON,
} from './User';
/**
* Adds nested create feature
* @export
* @interface PatchedRecipe
*/
export interface PatchedRecipe {
/**
*
* @type {number}
* @memberof PatchedRecipe
*/
readonly id?: number;
/**
*
* @type {string}
* @memberof PatchedRecipe
*/
name?: string;
/**
*
* @type {string}
* @memberof PatchedRecipe
*/
description?: string | null;
/**
*
* @type {string}
* @memberof PatchedRecipe
*/
readonly image?: string | null;
/**
*
* @type {Array<Keyword>}
* @memberof PatchedRecipe
*/
keywords?: Array<Keyword>;
/**
*
* @type {Array<Step>}
* @memberof PatchedRecipe
*/
steps?: Array<Step>;
/**
*
* @type {number}
* @memberof PatchedRecipe
*/
workingTime?: number;
/**
*
* @type {number}
* @memberof PatchedRecipe
*/
waitingTime?: number;
/**
*
* @type {number}
* @memberof PatchedRecipe
*/
readonly createdBy?: number;
/**
*
* @type {Date}
* @memberof PatchedRecipe
*/
readonly createdAt?: Date;
/**
*
* @type {Date}
* @memberof PatchedRecipe
*/
readonly updatedAt?: Date;
/**
*
* @type {string}
* @memberof PatchedRecipe
*/
sourceUrl?: string | null;
/**
*
* @type {boolean}
* @memberof PatchedRecipe
*/
internal?: boolean;
/**
*
* @type {boolean}
* @memberof PatchedRecipe
*/
showIngredientOverview?: boolean;
/**
*
* @type {NutritionInformation}
* @memberof PatchedRecipe
*/
nutrition?: NutritionInformation | null;
/**
*
* @type {Array<Property>}
* @memberof PatchedRecipe
*/
properties?: Array<Property>;
/**
*
* @type {string}
* @memberof PatchedRecipe
*/
readonly foodProperties?: string;
/**
*
* @type {number}
* @memberof PatchedRecipe
*/
servings?: number;
/**
*
* @type {string}
* @memberof PatchedRecipe
*/
filePath?: string;
/**
*
* @type {string}
* @memberof PatchedRecipe
*/
servingsText?: string;
/**
*
* @type {string}
* @memberof PatchedRecipe
*/
readonly rating?: string | null;
/**
*
* @type {Date}
* @memberof PatchedRecipe
*/
readonly lastCooked?: Date | null;
/**
*
* @type {boolean}
* @memberof PatchedRecipe
*/
_private?: boolean;
/**
*
* @type {Array<User>}
* @memberof PatchedRecipe
*/
shared?: Array<User>;
}
/**
* Check if a given object implements the PatchedRecipe interface.
*/
export function instanceOfPatchedRecipe(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedRecipeFromJSON(json: any): PatchedRecipe {
return PatchedRecipeFromJSONTyped(json, false);
}
export function PatchedRecipeFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedRecipe {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'name': !exists(json, 'name') ? undefined : json['name'],
'description': !exists(json, 'description') ? undefined : json['description'],
'image': !exists(json, 'image') ? undefined : json['image'],
'keywords': !exists(json, 'keywords') ? undefined : ((json['keywords'] as Array<any>).map(KeywordFromJSON)),
'steps': !exists(json, 'steps') ? undefined : ((json['steps'] as Array<any>).map(StepFromJSON)),
'workingTime': !exists(json, 'working_time') ? undefined : json['working_time'],
'waitingTime': !exists(json, 'waiting_time') ? undefined : json['waiting_time'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])),
'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])),
'sourceUrl': !exists(json, 'source_url') ? undefined : json['source_url'],
'internal': !exists(json, 'internal') ? undefined : json['internal'],
'showIngredientOverview': !exists(json, 'show_ingredient_overview') ? undefined : json['show_ingredient_overview'],
'nutrition': !exists(json, 'nutrition') ? undefined : NutritionInformationFromJSON(json['nutrition']),
'properties': !exists(json, 'properties') ? undefined : ((json['properties'] as Array<any>).map(PropertyFromJSON)),
'foodProperties': !exists(json, 'food_properties') ? undefined : json['food_properties'],
'servings': !exists(json, 'servings') ? undefined : json['servings'],
'filePath': !exists(json, 'file_path') ? undefined : json['file_path'],
'servingsText': !exists(json, 'servings_text') ? undefined : json['servings_text'],
'rating': !exists(json, 'rating') ? undefined : json['rating'],
'lastCooked': !exists(json, 'last_cooked') ? undefined : (json['last_cooked'] === null ? null : new Date(json['last_cooked'])),
'_private': !exists(json, 'private') ? undefined : json['private'],
'shared': !exists(json, 'shared') ? undefined : ((json['shared'] as Array<any>).map(UserFromJSON)),
};
}
export function PatchedRecipeToJSON(value?: PatchedRecipe | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'name': value.name,
'description': value.description,
'keywords': value.keywords === undefined ? undefined : ((value.keywords as Array<any>).map(KeywordToJSON)),
'steps': value.steps === undefined ? undefined : ((value.steps as Array<any>).map(StepToJSON)),
'working_time': value.workingTime,
'waiting_time': value.waitingTime,
'source_url': value.sourceUrl,
'internal': value.internal,
'show_ingredient_overview': value.showIngredientOverview,
'nutrition': NutritionInformationToJSON(value.nutrition),
'properties': value.properties === undefined ? undefined : ((value.properties as Array<any>).map(PropertyToJSON)),
'servings': value.servings,
'file_path': value.filePath,
'servings_text': value.servingsText,
'private': value._private,
'shared': value.shared === undefined ? undefined : ((value.shared as Array<any>).map(UserToJSON)),
};
}

View File

@@ -0,0 +1,124 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { CustomFilter } from './CustomFilter';
import {
CustomFilterFromJSON,
CustomFilterFromJSONTyped,
CustomFilterToJSON,
} from './CustomFilter';
import type { User } from './User';
import {
UserFromJSON,
UserFromJSONTyped,
UserToJSON,
} from './User';
/**
* Adds nested create feature
* @export
* @interface PatchedRecipeBook
*/
export interface PatchedRecipeBook {
/**
*
* @type {number}
* @memberof PatchedRecipeBook
*/
readonly id?: number;
/**
*
* @type {string}
* @memberof PatchedRecipeBook
*/
name?: string;
/**
*
* @type {string}
* @memberof PatchedRecipeBook
*/
description?: string;
/**
*
* @type {Array<User>}
* @memberof PatchedRecipeBook
*/
shared?: Array<User>;
/**
*
* @type {number}
* @memberof PatchedRecipeBook
*/
readonly createdBy?: number;
/**
*
* @type {CustomFilter}
* @memberof PatchedRecipeBook
*/
filter?: CustomFilter | null;
/**
*
* @type {number}
* @memberof PatchedRecipeBook
*/
order?: number;
}
/**
* Check if a given object implements the PatchedRecipeBook interface.
*/
export function instanceOfPatchedRecipeBook(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedRecipeBookFromJSON(json: any): PatchedRecipeBook {
return PatchedRecipeBookFromJSONTyped(json, false);
}
export function PatchedRecipeBookFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedRecipeBook {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'name': !exists(json, 'name') ? undefined : json['name'],
'description': !exists(json, 'description') ? undefined : json['description'],
'shared': !exists(json, 'shared') ? undefined : ((json['shared'] as Array<any>).map(UserFromJSON)),
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
'filter': !exists(json, 'filter') ? undefined : CustomFilterFromJSON(json['filter']),
'order': !exists(json, 'order') ? undefined : json['order'],
};
}
export function PatchedRecipeBookToJSON(value?: PatchedRecipeBook | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'name': value.name,
'description': value.description,
'shared': value.shared === undefined ? undefined : ((value.shared as Array<any>).map(UserToJSON)),
'filter': CustomFilterToJSON(value.filter),
'order': value.order,
};
}

View File

@@ -0,0 +1,94 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.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 PatchedRecipeBookEntry
*/
export interface PatchedRecipeBookEntry {
/**
*
* @type {number}
* @memberof PatchedRecipeBookEntry
*/
readonly id?: number;
/**
*
* @type {number}
* @memberof PatchedRecipeBookEntry
*/
book?: number;
/**
*
* @type {string}
* @memberof PatchedRecipeBookEntry
*/
readonly bookContent?: string;
/**
*
* @type {number}
* @memberof PatchedRecipeBookEntry
*/
recipe?: number;
/**
*
* @type {string}
* @memberof PatchedRecipeBookEntry
*/
readonly recipeContent?: string;
}
/**
* Check if a given object implements the PatchedRecipeBookEntry interface.
*/
export function instanceOfPatchedRecipeBookEntry(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedRecipeBookEntryFromJSON(json: any): PatchedRecipeBookEntry {
return PatchedRecipeBookEntryFromJSONTyped(json, false);
}
export function PatchedRecipeBookEntryFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedRecipeBookEntry {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'book': !exists(json, 'book') ? undefined : json['book'],
'bookContent': !exists(json, 'book_content') ? undefined : json['book_content'],
'recipe': !exists(json, 'recipe') ? undefined : json['recipe'],
'recipeContent': !exists(json, 'recipe_content') ? undefined : json['recipe_content'],
};
}
export function PatchedRecipeBookEntryToJSON(value?: PatchedRecipeBookEntry | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'book': value.book,
'recipe': value.recipe,
};
}

View File

@@ -0,0 +1,181 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { Food } from './Food';
import {
FoodFromJSON,
FoodFromJSONTyped,
FoodToJSON,
} from './Food';
import type { ShoppingListRecipe } from './ShoppingListRecipe';
import {
ShoppingListRecipeFromJSON,
ShoppingListRecipeFromJSONTyped,
ShoppingListRecipeToJSON,
} from './ShoppingListRecipe';
import type { Unit } from './Unit';
import {
UnitFromJSON,
UnitFromJSONTyped,
UnitToJSON,
} from './Unit';
import type { User } from './User';
import {
UserFromJSON,
UserFromJSONTyped,
UserToJSON,
} from './User';
/**
* Adds nested create feature
* @export
* @interface PatchedShoppingListEntry
*/
export interface PatchedShoppingListEntry {
/**
*
* @type {number}
* @memberof PatchedShoppingListEntry
*/
readonly id?: number;
/**
*
* @type {number}
* @memberof PatchedShoppingListEntry
*/
listRecipe?: number | null;
/**
*
* @type {Food}
* @memberof PatchedShoppingListEntry
*/
food?: Food | null;
/**
*
* @type {Unit}
* @memberof PatchedShoppingListEntry
*/
unit?: Unit | null;
/**
*
* @type {string}
* @memberof PatchedShoppingListEntry
*/
amount?: string;
/**
*
* @type {number}
* @memberof PatchedShoppingListEntry
*/
order?: number;
/**
*
* @type {boolean}
* @memberof PatchedShoppingListEntry
*/
checked?: boolean;
/**
*
* @type {ShoppingListRecipe}
* @memberof PatchedShoppingListEntry
*/
readonly recipeMealplan?: ShoppingListRecipe;
/**
*
* @type {User}
* @memberof PatchedShoppingListEntry
*/
readonly createdBy?: User;
/**
*
* @type {Date}
* @memberof PatchedShoppingListEntry
*/
readonly createdAt?: Date;
/**
*
* @type {Date}
* @memberof PatchedShoppingListEntry
*/
readonly updatedAt?: Date;
/**
*
* @type {Date}
* @memberof PatchedShoppingListEntry
*/
completedAt?: Date | null;
/**
*
* @type {Date}
* @memberof PatchedShoppingListEntry
*/
delayUntil?: Date | null;
}
/**
* Check if a given object implements the PatchedShoppingListEntry interface.
*/
export function instanceOfPatchedShoppingListEntry(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedShoppingListEntryFromJSON(json: any): PatchedShoppingListEntry {
return PatchedShoppingListEntryFromJSONTyped(json, false);
}
export function PatchedShoppingListEntryFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedShoppingListEntry {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'listRecipe': !exists(json, 'list_recipe') ? undefined : json['list_recipe'],
'food': !exists(json, 'food') ? undefined : FoodFromJSON(json['food']),
'unit': !exists(json, 'unit') ? undefined : UnitFromJSON(json['unit']),
'amount': !exists(json, 'amount') ? undefined : json['amount'],
'order': !exists(json, 'order') ? undefined : json['order'],
'checked': !exists(json, 'checked') ? undefined : json['checked'],
'recipeMealplan': !exists(json, 'recipe_mealplan') ? undefined : ShoppingListRecipeFromJSON(json['recipe_mealplan']),
'createdBy': !exists(json, 'created_by') ? undefined : UserFromJSON(json['created_by']),
'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])),
'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])),
'completedAt': !exists(json, 'completed_at') ? undefined : (json['completed_at'] === null ? null : new Date(json['completed_at'])),
'delayUntil': !exists(json, 'delay_until') ? undefined : (json['delay_until'] === null ? null : new Date(json['delay_until'])),
};
}
export function PatchedShoppingListEntryToJSON(value?: PatchedShoppingListEntry | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'list_recipe': value.listRecipe,
'food': FoodToJSON(value.food),
'unit': UnitToJSON(value.unit),
'amount': value.amount,
'order': value.order,
'checked': value.checked,
'completed_at': value.completedAt === undefined ? undefined : (value.completedAt === null ? null : value.completedAt.toISOString()),
'delay_until': value.delayUntil === undefined ? undefined : (value.delayUntil === null ? null : value.delayUntil.toISOString()),
};
}

View File

@@ -0,0 +1,123 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.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 PatchedShoppingListRecipe
*/
export interface PatchedShoppingListRecipe {
/**
*
* @type {number}
* @memberof PatchedShoppingListRecipe
*/
readonly id?: number;
/**
*
* @type {string}
* @memberof PatchedShoppingListRecipe
*/
readonly recipeName?: string;
/**
*
* @type {string}
* @memberof PatchedShoppingListRecipe
*/
readonly name?: string;
/**
*
* @type {number}
* @memberof PatchedShoppingListRecipe
*/
recipe?: number | null;
/**
*
* @type {number}
* @memberof PatchedShoppingListRecipe
*/
mealplan?: number | null;
/**
*
* @type {string}
* @memberof PatchedShoppingListRecipe
*/
servings?: string;
/**
*
* @type {string}
* @memberof PatchedShoppingListRecipe
*/
readonly mealplanNote?: string;
/**
*
* @type {Date}
* @memberof PatchedShoppingListRecipe
*/
readonly mealplanFromDate?: Date;
/**
*
* @type {string}
* @memberof PatchedShoppingListRecipe
*/
readonly mealplanType?: string;
}
/**
* Check if a given object implements the PatchedShoppingListRecipe interface.
*/
export function instanceOfPatchedShoppingListRecipe(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedShoppingListRecipeFromJSON(json: any): PatchedShoppingListRecipe {
return PatchedShoppingListRecipeFromJSONTyped(json, false);
}
export function PatchedShoppingListRecipeFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedShoppingListRecipe {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'recipeName': !exists(json, 'recipe_name') ? undefined : json['recipe_name'],
'name': !exists(json, 'name') ? undefined : json['name'],
'recipe': !exists(json, 'recipe') ? undefined : json['recipe'],
'mealplan': !exists(json, 'mealplan') ? undefined : json['mealplan'],
'servings': !exists(json, 'servings') ? undefined : json['servings'],
'mealplanNote': !exists(json, 'mealplan_note') ? undefined : json['mealplan_note'],
'mealplanFromDate': !exists(json, 'mealplan_from_date') ? undefined : (new Date(json['mealplan_from_date'])),
'mealplanType': !exists(json, 'mealplan_type') ? undefined : json['mealplan_type'],
};
}
export function PatchedShoppingListRecipeToJSON(value?: PatchedShoppingListRecipe | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'recipe': value.recipe,
'mealplan': value.mealplan,
'servings': value.servings,
};
}

View File

@@ -0,0 +1,287 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { FoodInheritField } from './FoodInheritField';
import {
FoodInheritFieldFromJSON,
FoodInheritFieldFromJSONTyped,
FoodInheritFieldToJSON,
} from './FoodInheritField';
import type { SpaceNavTextColorEnum } from './SpaceNavTextColorEnum';
import {
SpaceNavTextColorEnumFromJSON,
SpaceNavTextColorEnumFromJSONTyped,
SpaceNavTextColorEnumToJSON,
} from './SpaceNavTextColorEnum';
import type { SpaceThemeEnum } from './SpaceThemeEnum';
import {
SpaceThemeEnumFromJSON,
SpaceThemeEnumFromJSONTyped,
SpaceThemeEnumToJSON,
} from './SpaceThemeEnum';
import type { UserFileView } from './UserFileView';
import {
UserFileViewFromJSON,
UserFileViewFromJSONTyped,
UserFileViewToJSON,
} from './UserFileView';
/**
* Adds nested create feature
* @export
* @interface PatchedSpace
*/
export interface PatchedSpace {
/**
*
* @type {number}
* @memberof PatchedSpace
*/
readonly id?: number;
/**
*
* @type {string}
* @memberof PatchedSpace
*/
name?: string;
/**
*
* @type {number}
* @memberof PatchedSpace
*/
readonly createdBy?: number | null;
/**
*
* @type {Date}
* @memberof PatchedSpace
*/
readonly createdAt?: Date;
/**
*
* @type {string}
* @memberof PatchedSpace
*/
message?: string;
/**
*
* @type {number}
* @memberof PatchedSpace
*/
readonly maxRecipes?: number;
/**
* Maximum file storage for space in MB. 0 for unlimited, -1 to disable file upload.
* @type {number}
* @memberof PatchedSpace
*/
readonly maxFileStorageMb?: number;
/**
*
* @type {number}
* @memberof PatchedSpace
*/
readonly maxUsers?: number;
/**
*
* @type {boolean}
* @memberof PatchedSpace
*/
readonly allowSharing?: boolean;
/**
*
* @type {boolean}
* @memberof PatchedSpace
*/
readonly demo?: boolean;
/**
*
* @type {Array<FoodInheritField>}
* @memberof PatchedSpace
*/
foodInherit?: Array<FoodInheritField>;
/**
*
* @type {string}
* @memberof PatchedSpace
*/
readonly userCount?: string;
/**
*
* @type {string}
* @memberof PatchedSpace
*/
readonly recipeCount?: string;
/**
*
* @type {string}
* @memberof PatchedSpace
*/
readonly fileSizeMb?: string;
/**
*
* @type {UserFileView}
* @memberof PatchedSpace
*/
image?: UserFileView | null;
/**
*
* @type {UserFileView}
* @memberof PatchedSpace
*/
navLogo?: UserFileView | null;
/**
*
* @type {SpaceThemeEnum}
* @memberof PatchedSpace
*/
spaceTheme?: SpaceThemeEnum;
/**
*
* @type {UserFileView}
* @memberof PatchedSpace
*/
customSpaceTheme?: UserFileView | null;
/**
*
* @type {string}
* @memberof PatchedSpace
*/
navBgColor?: string;
/**
*
* @type {SpaceNavTextColorEnum}
* @memberof PatchedSpace
*/
navTextColor?: SpaceNavTextColorEnum;
/**
*
* @type {UserFileView}
* @memberof PatchedSpace
*/
logoColor32?: UserFileView | null;
/**
*
* @type {UserFileView}
* @memberof PatchedSpace
*/
logoColor128?: UserFileView | null;
/**
*
* @type {UserFileView}
* @memberof PatchedSpace
*/
logoColor144?: UserFileView | null;
/**
*
* @type {UserFileView}
* @memberof PatchedSpace
*/
logoColor180?: UserFileView | null;
/**
*
* @type {UserFileView}
* @memberof PatchedSpace
*/
logoColor192?: UserFileView | null;
/**
*
* @type {UserFileView}
* @memberof PatchedSpace
*/
logoColor512?: UserFileView | null;
/**
*
* @type {UserFileView}
* @memberof PatchedSpace
*/
logoColorSvg?: UserFileView | null;
}
/**
* Check if a given object implements the PatchedSpace interface.
*/
export function instanceOfPatchedSpace(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedSpaceFromJSON(json: any): PatchedSpace {
return PatchedSpaceFromJSONTyped(json, false);
}
export function PatchedSpaceFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedSpace {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'name': !exists(json, 'name') ? undefined : json['name'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])),
'message': !exists(json, 'message') ? undefined : json['message'],
'maxRecipes': !exists(json, 'max_recipes') ? undefined : json['max_recipes'],
'maxFileStorageMb': !exists(json, 'max_file_storage_mb') ? undefined : json['max_file_storage_mb'],
'maxUsers': !exists(json, 'max_users') ? undefined : json['max_users'],
'allowSharing': !exists(json, 'allow_sharing') ? undefined : json['allow_sharing'],
'demo': !exists(json, 'demo') ? undefined : json['demo'],
'foodInherit': !exists(json, 'food_inherit') ? undefined : ((json['food_inherit'] as Array<any>).map(FoodInheritFieldFromJSON)),
'userCount': !exists(json, 'user_count') ? undefined : json['user_count'],
'recipeCount': !exists(json, 'recipe_count') ? undefined : json['recipe_count'],
'fileSizeMb': !exists(json, 'file_size_mb') ? undefined : json['file_size_mb'],
'image': !exists(json, 'image') ? undefined : UserFileViewFromJSON(json['image']),
'navLogo': !exists(json, 'nav_logo') ? undefined : UserFileViewFromJSON(json['nav_logo']),
'spaceTheme': !exists(json, 'space_theme') ? undefined : SpaceThemeEnumFromJSON(json['space_theme']),
'customSpaceTheme': !exists(json, 'custom_space_theme') ? undefined : UserFileViewFromJSON(json['custom_space_theme']),
'navBgColor': !exists(json, 'nav_bg_color') ? undefined : json['nav_bg_color'],
'navTextColor': !exists(json, 'nav_text_color') ? undefined : SpaceNavTextColorEnumFromJSON(json['nav_text_color']),
'logoColor32': !exists(json, 'logo_color_32') ? undefined : UserFileViewFromJSON(json['logo_color_32']),
'logoColor128': !exists(json, 'logo_color_128') ? undefined : UserFileViewFromJSON(json['logo_color_128']),
'logoColor144': !exists(json, 'logo_color_144') ? undefined : UserFileViewFromJSON(json['logo_color_144']),
'logoColor180': !exists(json, 'logo_color_180') ? undefined : UserFileViewFromJSON(json['logo_color_180']),
'logoColor192': !exists(json, 'logo_color_192') ? undefined : UserFileViewFromJSON(json['logo_color_192']),
'logoColor512': !exists(json, 'logo_color_512') ? undefined : UserFileViewFromJSON(json['logo_color_512']),
'logoColorSvg': !exists(json, 'logo_color_svg') ? undefined : UserFileViewFromJSON(json['logo_color_svg']),
};
}
export function PatchedSpaceToJSON(value?: PatchedSpace | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'name': value.name,
'message': value.message,
'food_inherit': value.foodInherit === undefined ? undefined : ((value.foodInherit as Array<any>).map(FoodInheritFieldToJSON)),
'image': UserFileViewToJSON(value.image),
'nav_logo': UserFileViewToJSON(value.navLogo),
'space_theme': SpaceThemeEnumToJSON(value.spaceTheme),
'custom_space_theme': UserFileViewToJSON(value.customSpaceTheme),
'nav_bg_color': value.navBgColor,
'nav_text_color': SpaceNavTextColorEnumToJSON(value.navTextColor),
'logo_color_32': UserFileViewToJSON(value.logoColor32),
'logo_color_128': UserFileViewToJSON(value.logoColor128),
'logo_color_144': UserFileViewToJSON(value.logoColor144),
'logo_color_180': UserFileViewToJSON(value.logoColor180),
'logo_color_192': UserFileViewToJSON(value.logoColor192),
'logo_color_512': UserFileViewToJSON(value.logoColor512),
'logo_color_svg': UserFileViewToJSON(value.logoColorSvg),
};
}

View File

@@ -0,0 +1,170 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { Ingredient } from './Ingredient';
import {
IngredientFromJSON,
IngredientFromJSONTyped,
IngredientToJSON,
} from './Ingredient';
import type { UserFileView } from './UserFileView';
import {
UserFileViewFromJSON,
UserFileViewFromJSONTyped,
UserFileViewToJSON,
} from './UserFileView';
/**
* Adds nested create feature
* @export
* @interface PatchedStep
*/
export interface PatchedStep {
/**
*
* @type {number}
* @memberof PatchedStep
*/
readonly id?: number;
/**
*
* @type {string}
* @memberof PatchedStep
*/
name?: string;
/**
*
* @type {string}
* @memberof PatchedStep
*/
instruction?: string;
/**
*
* @type {Array<Ingredient>}
* @memberof PatchedStep
*/
ingredients?: Array<Ingredient>;
/**
*
* @type {string}
* @memberof PatchedStep
*/
readonly instructionsMarkdown?: string;
/**
*
* @type {number}
* @memberof PatchedStep
*/
time?: number;
/**
*
* @type {number}
* @memberof PatchedStep
*/
order?: number;
/**
*
* @type {boolean}
* @memberof PatchedStep
*/
showAsHeader?: boolean;
/**
*
* @type {UserFileView}
* @memberof PatchedStep
*/
file?: UserFileView | null;
/**
*
* @type {number}
* @memberof PatchedStep
*/
stepRecipe?: number | null;
/**
*
* @type {string}
* @memberof PatchedStep
*/
readonly stepRecipeData?: string;
/**
*
* @type {string}
* @memberof PatchedStep
*/
readonly numrecipe?: string;
/**
*
* @type {boolean}
* @memberof PatchedStep
*/
showIngredientsTable?: boolean;
}
/**
* Check if a given object implements the PatchedStep interface.
*/
export function instanceOfPatchedStep(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedStepFromJSON(json: any): PatchedStep {
return PatchedStepFromJSONTyped(json, false);
}
export function PatchedStepFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedStep {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'name': !exists(json, 'name') ? undefined : json['name'],
'instruction': !exists(json, 'instruction') ? undefined : json['instruction'],
'ingredients': !exists(json, 'ingredients') ? undefined : ((json['ingredients'] as Array<any>).map(IngredientFromJSON)),
'instructionsMarkdown': !exists(json, 'instructions_markdown') ? undefined : json['instructions_markdown'],
'time': !exists(json, 'time') ? undefined : json['time'],
'order': !exists(json, 'order') ? undefined : json['order'],
'showAsHeader': !exists(json, 'show_as_header') ? undefined : json['show_as_header'],
'file': !exists(json, 'file') ? undefined : UserFileViewFromJSON(json['file']),
'stepRecipe': !exists(json, 'step_recipe') ? undefined : json['step_recipe'],
'stepRecipeData': !exists(json, 'step_recipe_data') ? undefined : json['step_recipe_data'],
'numrecipe': !exists(json, 'numrecipe') ? undefined : json['numrecipe'],
'showIngredientsTable': !exists(json, 'show_ingredients_table') ? undefined : json['show_ingredients_table'],
};
}
export function PatchedStepToJSON(value?: PatchedStep | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'name': value.name,
'instruction': value.instruction,
'ingredients': value.ingredients === undefined ? undefined : ((value.ingredients as Array<any>).map(IngredientToJSON)),
'time': value.time,
'order': value.order,
'show_as_header': value.showAsHeader,
'file': UserFileViewToJSON(value.file),
'step_recipe': value.stepRecipe,
'show_ingredients_table': value.showIngredientsTable,
};
}

View File

@@ -0,0 +1,118 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { MethodEnum } from './MethodEnum';
import {
MethodEnumFromJSON,
MethodEnumFromJSONTyped,
MethodEnumToJSON,
} from './MethodEnum';
/**
*
* @export
* @interface PatchedStorage
*/
export interface PatchedStorage {
/**
*
* @type {number}
* @memberof PatchedStorage
*/
readonly id?: number;
/**
*
* @type {string}
* @memberof PatchedStorage
*/
name?: string;
/**
*
* @type {MethodEnum}
* @memberof PatchedStorage
*/
method?: MethodEnum;
/**
*
* @type {string}
* @memberof PatchedStorage
*/
username?: string | null;
/**
*
* @type {string}
* @memberof PatchedStorage
*/
password?: string | null;
/**
*
* @type {string}
* @memberof PatchedStorage
*/
token?: string | null;
/**
*
* @type {number}
* @memberof PatchedStorage
*/
readonly createdBy?: number;
}
/**
* Check if a given object implements the PatchedStorage interface.
*/
export function instanceOfPatchedStorage(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedStorageFromJSON(json: any): PatchedStorage {
return PatchedStorageFromJSONTyped(json, false);
}
export function PatchedStorageFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedStorage {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'name': !exists(json, 'name') ? undefined : json['name'],
'method': !exists(json, 'method') ? undefined : MethodEnumFromJSON(json['method']),
'username': !exists(json, 'username') ? undefined : json['username'],
'password': !exists(json, 'password') ? undefined : json['password'],
'token': !exists(json, 'token') ? undefined : json['token'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
};
}
export function PatchedStorageToJSON(value?: PatchedStorage | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'name': value.name,
'method': MethodEnumToJSON(value.method),
'username': value.username,
'password': value.password,
'token': value.token,
};
}

View File

@@ -0,0 +1,136 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { SupermarketCategoryRelation } from './SupermarketCategoryRelation';
import {
SupermarketCategoryRelationFromJSON,
SupermarketCategoryRelationFromJSONTyped,
SupermarketCategoryRelationToJSON,
} from './SupermarketCategoryRelation';
/**
* 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 PatchedSupermarket
*/
export interface PatchedSupermarket {
/**
*
* @type {number}
* @memberof PatchedSupermarket
*/
readonly id?: number;
/**
*
* @type {string}
* @memberof PatchedSupermarket
*/
name?: string;
/**
*
* @type {string}
* @memberof PatchedSupermarket
*/
description?: string | null;
/**
*
* @type {Array<SupermarketCategoryRelation>}
* @memberof PatchedSupermarket
*/
readonly categoryToSupermarket?: Array<SupermarketCategoryRelation>;
/**
*
* @type {string}
* @memberof PatchedSupermarket
*/
openDataSlug?: string | null;
}
/**
* Check if a given object implements the PatchedSupermarket interface.
*/
export function instanceOfPatchedSupermarket(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedSupermarketFromJSON(json: any): PatchedSupermarket {
return PatchedSupermarketFromJSONTyped(json, false);
}
export function PatchedSupermarketFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedSupermarket {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'name': !exists(json, 'name') ? undefined : json['name'],
'description': !exists(json, 'description') ? undefined : json['description'],
'categoryToSupermarket': !exists(json, 'category_to_supermarket') ? undefined : ((json['category_to_supermarket'] as Array<any>).map(SupermarketCategoryRelationFromJSON)),
'openDataSlug': !exists(json, 'open_data_slug') ? undefined : json['open_data_slug'],
};
}
export function PatchedSupermarketToJSON(value?: PatchedSupermarket | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'name': value.name,
'description': value.description,
'open_data_slug': value.openDataSlug,
};
}

View File

@@ -0,0 +1,114 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.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';
/**
* 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 PatchedSupermarketCategory
*/
export interface PatchedSupermarketCategory {
/**
*
* @type {number}
* @memberof PatchedSupermarketCategory
*/
readonly id?: number;
/**
*
* @type {string}
* @memberof PatchedSupermarketCategory
*/
name?: string;
/**
*
* @type {string}
* @memberof PatchedSupermarketCategory
*/
description?: string | null;
}
/**
* Check if a given object implements the PatchedSupermarketCategory interface.
*/
export function instanceOfPatchedSupermarketCategory(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedSupermarketCategoryFromJSON(json: any): PatchedSupermarketCategory {
return PatchedSupermarketCategoryFromJSONTyped(json, false);
}
export function PatchedSupermarketCategoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedSupermarketCategory {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'name': !exists(json, 'name') ? undefined : json['name'],
'description': !exists(json, 'description') ? undefined : json['description'],
};
}
export function PatchedSupermarketCategoryToJSON(value?: PatchedSupermarketCategory | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'name': value.name,
'description': value.description,
};
}

View File

@@ -0,0 +1,95 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { SupermarketCategory } from './SupermarketCategory';
import {
SupermarketCategoryFromJSON,
SupermarketCategoryFromJSONTyped,
SupermarketCategoryToJSON,
} from './SupermarketCategory';
/**
* Adds nested create feature
* @export
* @interface PatchedSupermarketCategoryRelation
*/
export interface PatchedSupermarketCategoryRelation {
/**
*
* @type {number}
* @memberof PatchedSupermarketCategoryRelation
*/
readonly id?: number;
/**
*
* @type {SupermarketCategory}
* @memberof PatchedSupermarketCategoryRelation
*/
category?: SupermarketCategory;
/**
*
* @type {number}
* @memberof PatchedSupermarketCategoryRelation
*/
supermarket?: number;
/**
*
* @type {number}
* @memberof PatchedSupermarketCategoryRelation
*/
order?: number;
}
/**
* Check if a given object implements the PatchedSupermarketCategoryRelation interface.
*/
export function instanceOfPatchedSupermarketCategoryRelation(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedSupermarketCategoryRelationFromJSON(json: any): PatchedSupermarketCategoryRelation {
return PatchedSupermarketCategoryRelationFromJSONTyped(json, false);
}
export function PatchedSupermarketCategoryRelationFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedSupermarketCategoryRelation {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'category': !exists(json, 'category') ? undefined : SupermarketCategoryFromJSON(json['category']),
'supermarket': !exists(json, 'supermarket') ? undefined : json['supermarket'],
'order': !exists(json, 'order') ? undefined : json['order'],
};
}
export function PatchedSupermarketCategoryRelationToJSON(value?: PatchedSupermarketCategoryRelation | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'category': SupermarketCategoryToJSON(value.category),
'supermarket': value.supermarket,
'order': value.order,
};
}

View File

@@ -0,0 +1,110 @@
/* tslint:disable */
/* eslint-disable */
/**
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.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 PatchedSync
*/
export interface PatchedSync {
/**
*
* @type {number}
* @memberof PatchedSync
*/
readonly id?: number;
/**
*
* @type {number}
* @memberof PatchedSync
*/
storage?: number;
/**
*
* @type {string}
* @memberof PatchedSync
*/
path?: string;
/**
*
* @type {boolean}
* @memberof PatchedSync
*/
active?: boolean;
/**
*
* @type {Date}
* @memberof PatchedSync
*/
lastChecked?: Date | null;
/**
*
* @type {Date}
* @memberof PatchedSync
*/
readonly createdAt?: Date;
/**
*
* @type {Date}
* @memberof PatchedSync
*/
readonly updatedAt?: Date;
}
/**
* Check if a given object implements the PatchedSync interface.
*/
export function instanceOfPatchedSync(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PatchedSyncFromJSON(json: any): PatchedSync {
return PatchedSyncFromJSONTyped(json, false);
}
export function PatchedSyncFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedSync {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'storage': !exists(json, 'storage') ? undefined : json['storage'],
'path': !exists(json, 'path') ? undefined : json['path'],
'active': !exists(json, 'active') ? undefined : json['active'],
'lastChecked': !exists(json, 'last_checked') ? undefined : (json['last_checked'] === null ? null : new Date(json['last_checked'])),
'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])),
'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])),
};
}
export function PatchedSyncToJSON(value?: PatchedSync | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'storage': value.storage,
'path': value.path,
'active': value.active,
'last_checked': value.lastChecked === undefined ? undefined : (value.lastChecked === null ? null : value.lastChecked.toISOString()),
};
}

Some files were not shown because too many files have changed in this diff Show More