/* 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: * * * 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 { CustomFilterSharedInner } from './CustomFilterSharedInner'; import { CustomFilterSharedInnerFromJSON, CustomFilterSharedInnerFromJSONTyped, CustomFilterSharedInnerToJSON, } from './CustomFilterSharedInner'; import type { RecipeStepsInnerFile } from './RecipeStepsInnerFile'; import { RecipeStepsInnerFileFromJSON, RecipeStepsInnerFileFromJSONTyped, RecipeStepsInnerFileToJSON, } from './RecipeStepsInnerFile'; /** * * @export * @interface UserPreference */ export interface UserPreference { /** * * @type {number} * @memberof UserPreference */ user: number; /** * * @type {RecipeStepsInnerFile} * @memberof UserPreference */ image?: RecipeStepsInnerFile | null; /** * * @type {string} * @memberof UserPreference */ theme?: UserPreferenceThemeEnum; /** * * @type {string} * @memberof UserPreference */ navBgColor?: string; /** * * @type {string} * @memberof UserPreference */ navTextColor?: UserPreferenceNavTextColorEnum; /** * * @type {boolean} * @memberof UserPreference */ navShowLogo?: boolean; /** * * @type {string} * @memberof UserPreference */ defaultUnit?: string; /** * * @type {string} * @memberof UserPreference */ defaultPage?: UserPreferenceDefaultPageEnum; /** * * @type {boolean} * @memberof UserPreference */ useFractions?: boolean; /** * * @type {boolean} * @memberof UserPreference */ useKj?: boolean; /** * * @type {Array} * @memberof UserPreference */ planShare?: Array | null; /** * * @type {boolean} * @memberof UserPreference */ navSticky?: boolean; /** * * @type {number} * @memberof UserPreference */ ingredientDecimals?: number; /** * * @type {boolean} * @memberof UserPreference */ comments?: boolean; /** * * @type {number} * @memberof UserPreference */ shoppingAutoSync?: number; /** * * @type {boolean} * @memberof UserPreference */ mealplanAutoaddShopping?: boolean; /** * * @type {string} * @memberof UserPreference */ readonly foodInheritDefault?: string; /** * * @type {string} * @memberof UserPreference */ defaultDelay?: string; /** * * @type {boolean} * @memberof UserPreference */ mealplanAutoincludeRelated?: boolean; /** * * @type {boolean} * @memberof UserPreference */ mealplanAutoexcludeOnhand?: boolean; /** * * @type {Array} * @memberof UserPreference */ shoppingShare?: Array | null; /** * * @type {number} * @memberof UserPreference */ shoppingRecentDays?: number; /** * * @type {string} * @memberof UserPreference */ csvDelim?: string; /** * * @type {string} * @memberof UserPreference */ csvPrefix?: string; /** * * @type {boolean} * @memberof UserPreference */ filterToSupermarket?: boolean; /** * * @type {boolean} * @memberof UserPreference */ shoppingAddOnhand?: boolean; /** * * @type {boolean} * @memberof UserPreference */ leftHanded?: boolean; /** * * @type {boolean} * @memberof UserPreference */ showStepIngredients?: boolean; /** * * @type {string} * @memberof UserPreference */ readonly foodChildrenExist?: string; } /** * @export */ export const UserPreferenceThemeEnum = { Tandoor: 'TANDOOR', Bootstrap: 'BOOTSTRAP', Darkly: 'DARKLY', Flatly: 'FLATLY', Superhero: 'SUPERHERO', TandoorDark: 'TANDOOR_DARK' } as const; export type UserPreferenceThemeEnum = typeof UserPreferenceThemeEnum[keyof typeof UserPreferenceThemeEnum]; /** * @export */ export const UserPreferenceNavTextColorEnum = { Light: 'LIGHT', Dark: 'DARK' } as const; export type UserPreferenceNavTextColorEnum = typeof UserPreferenceNavTextColorEnum[keyof typeof UserPreferenceNavTextColorEnum]; /** * @export */ export const UserPreferenceDefaultPageEnum = { Search: 'SEARCH', Plan: 'PLAN', Books: 'BOOKS' } as const; export type UserPreferenceDefaultPageEnum = typeof UserPreferenceDefaultPageEnum[keyof typeof UserPreferenceDefaultPageEnum]; /** * Check if a given object implements the UserPreference interface. */ export function instanceOfUserPreference(value: object): boolean { let isInstance = true; isInstance = isInstance && "user" in value; return isInstance; } export function UserPreferenceFromJSON(json: any): UserPreference { return UserPreferenceFromJSONTyped(json, false); } export function UserPreferenceFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserPreference { if ((json === undefined) || (json === null)) { return json; } return { 'user': json['user'], 'image': !exists(json, 'image') ? undefined : RecipeStepsInnerFileFromJSON(json['image']), 'theme': !exists(json, 'theme') ? undefined : json['theme'], 'navBgColor': !exists(json, 'nav_bg_color') ? undefined : json['nav_bg_color'], 'navTextColor': !exists(json, 'nav_text_color') ? undefined : json['nav_text_color'], 'navShowLogo': !exists(json, 'nav_show_logo') ? undefined : json['nav_show_logo'], 'defaultUnit': !exists(json, 'default_unit') ? undefined : json['default_unit'], 'defaultPage': !exists(json, 'default_page') ? undefined : json['default_page'], 'useFractions': !exists(json, 'use_fractions') ? undefined : json['use_fractions'], 'useKj': !exists(json, 'use_kj') ? undefined : json['use_kj'], 'planShare': !exists(json, 'plan_share') ? undefined : (json['plan_share'] === null ? null : (json['plan_share'] as Array).map(CustomFilterSharedInnerFromJSON)), 'navSticky': !exists(json, 'nav_sticky') ? undefined : json['nav_sticky'], 'ingredientDecimals': !exists(json, 'ingredient_decimals') ? undefined : json['ingredient_decimals'], 'comments': !exists(json, 'comments') ? undefined : json['comments'], 'shoppingAutoSync': !exists(json, 'shopping_auto_sync') ? undefined : json['shopping_auto_sync'], 'mealplanAutoaddShopping': !exists(json, 'mealplan_autoadd_shopping') ? undefined : json['mealplan_autoadd_shopping'], 'foodInheritDefault': !exists(json, 'food_inherit_default') ? undefined : json['food_inherit_default'], 'defaultDelay': !exists(json, 'default_delay') ? undefined : json['default_delay'], 'mealplanAutoincludeRelated': !exists(json, 'mealplan_autoinclude_related') ? undefined : json['mealplan_autoinclude_related'], 'mealplanAutoexcludeOnhand': !exists(json, 'mealplan_autoexclude_onhand') ? undefined : json['mealplan_autoexclude_onhand'], 'shoppingShare': !exists(json, 'shopping_share') ? undefined : (json['shopping_share'] === null ? null : (json['shopping_share'] as Array).map(CustomFilterSharedInnerFromJSON)), 'shoppingRecentDays': !exists(json, 'shopping_recent_days') ? undefined : json['shopping_recent_days'], 'csvDelim': !exists(json, 'csv_delim') ? undefined : json['csv_delim'], 'csvPrefix': !exists(json, 'csv_prefix') ? undefined : json['csv_prefix'], 'filterToSupermarket': !exists(json, 'filter_to_supermarket') ? undefined : json['filter_to_supermarket'], 'shoppingAddOnhand': !exists(json, 'shopping_add_onhand') ? undefined : json['shopping_add_onhand'], 'leftHanded': !exists(json, 'left_handed') ? undefined : json['left_handed'], 'showStepIngredients': !exists(json, 'show_step_ingredients') ? undefined : json['show_step_ingredients'], 'foodChildrenExist': !exists(json, 'food_children_exist') ? undefined : json['food_children_exist'], }; } export function UserPreferenceToJSON(value?: UserPreference | null): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'user': value.user, 'image': RecipeStepsInnerFileToJSON(value.image), 'theme': value.theme, 'nav_bg_color': value.navBgColor, 'nav_text_color': value.navTextColor, 'nav_show_logo': value.navShowLogo, 'default_unit': value.defaultUnit, 'default_page': value.defaultPage, 'use_fractions': value.useFractions, 'use_kj': value.useKj, 'plan_share': value.planShare === undefined ? undefined : (value.planShare === null ? null : (value.planShare as Array).map(CustomFilterSharedInnerToJSON)), 'nav_sticky': value.navSticky, 'ingredient_decimals': value.ingredientDecimals, 'comments': value.comments, 'shopping_auto_sync': value.shoppingAutoSync, 'mealplan_autoadd_shopping': value.mealplanAutoaddShopping, 'default_delay': value.defaultDelay, 'mealplan_autoinclude_related': value.mealplanAutoincludeRelated, 'mealplan_autoexclude_onhand': value.mealplanAutoexcludeOnhand, 'shopping_share': value.shoppingShare === undefined ? undefined : (value.shoppingShare === null ? null : (value.shoppingShare as Array).map(CustomFilterSharedInnerToJSON)), 'shopping_recent_days': value.shoppingRecentDays, 'csv_delim': value.csvDelim, 'csv_prefix': value.csvPrefix, 'filter_to_supermarket': value.filterToSupermarket, 'shopping_add_onhand': value.shoppingAddOnhand, 'left_handed': value.leftHanded, 'show_step_ingredients': value.showStepIngredients, }; }