mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2025-12-24 02:39:20 -05:00
133 lines
3.4 KiB
TypeScript
133 lines
3.4 KiB
TypeScript
/* tslint:disable */
|
|
/* eslint-disable */
|
|
/**
|
|
* Tandoor
|
|
* Tandoor API Docs
|
|
*
|
|
* 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 { IngredientFood } from './IngredientFood';
|
|
import {
|
|
IngredientFoodFromJSON,
|
|
IngredientFoodFromJSONTyped,
|
|
IngredientFoodToJSON,
|
|
} from './IngredientFood';
|
|
import type { Unit } from './Unit';
|
|
import {
|
|
UnitFromJSON,
|
|
UnitFromJSONTyped,
|
|
UnitToJSON,
|
|
} from './Unit';
|
|
|
|
/**
|
|
* Adds nested create feature
|
|
* @export
|
|
* @interface PatchedUnitConversion
|
|
*/
|
|
export interface PatchedUnitConversion {
|
|
/**
|
|
*
|
|
* @type {number}
|
|
* @memberof PatchedUnitConversion
|
|
*/
|
|
readonly id?: number;
|
|
/**
|
|
*
|
|
* @type {string}
|
|
* @memberof PatchedUnitConversion
|
|
*/
|
|
readonly name?: string;
|
|
/**
|
|
*
|
|
* @type {number}
|
|
* @memberof PatchedUnitConversion
|
|
*/
|
|
baseAmount?: number;
|
|
/**
|
|
*
|
|
* @type {Unit}
|
|
* @memberof PatchedUnitConversion
|
|
*/
|
|
baseUnit?: Unit;
|
|
/**
|
|
*
|
|
* @type {number}
|
|
* @memberof PatchedUnitConversion
|
|
*/
|
|
convertedAmount?: number;
|
|
/**
|
|
*
|
|
* @type {Unit}
|
|
* @memberof PatchedUnitConversion
|
|
*/
|
|
convertedUnit?: Unit;
|
|
/**
|
|
*
|
|
* @type {IngredientFood}
|
|
* @memberof PatchedUnitConversion
|
|
*/
|
|
food?: IngredientFood | null;
|
|
/**
|
|
*
|
|
* @type {string}
|
|
* @memberof PatchedUnitConversion
|
|
*/
|
|
openDataSlug?: string | null;
|
|
}
|
|
|
|
/**
|
|
* Check if a given object implements the PatchedUnitConversion interface.
|
|
*/
|
|
export function instanceOfPatchedUnitConversion(value: object): boolean {
|
|
let isInstance = true;
|
|
|
|
return isInstance;
|
|
}
|
|
|
|
export function PatchedUnitConversionFromJSON(json: any): PatchedUnitConversion {
|
|
return PatchedUnitConversionFromJSONTyped(json, false);
|
|
}
|
|
|
|
export function PatchedUnitConversionFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedUnitConversion {
|
|
if ((json === undefined) || (json === null)) {
|
|
return json;
|
|
}
|
|
return {
|
|
|
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
|
'name': !exists(json, 'name') ? undefined : json['name'],
|
|
'baseAmount': !exists(json, 'base_amount') ? undefined : json['base_amount'],
|
|
'baseUnit': !exists(json, 'base_unit') ? undefined : UnitFromJSON(json['base_unit']),
|
|
'convertedAmount': !exists(json, 'converted_amount') ? undefined : json['converted_amount'],
|
|
'convertedUnit': !exists(json, 'converted_unit') ? undefined : UnitFromJSON(json['converted_unit']),
|
|
'food': !exists(json, 'food') ? undefined : IngredientFoodFromJSON(json['food']),
|
|
'openDataSlug': !exists(json, 'open_data_slug') ? undefined : json['open_data_slug'],
|
|
};
|
|
}
|
|
|
|
export function PatchedUnitConversionToJSON(value?: PatchedUnitConversion | null): any {
|
|
if (value === undefined) {
|
|
return undefined;
|
|
}
|
|
if (value === null) {
|
|
return null;
|
|
}
|
|
return {
|
|
|
|
'base_amount': value.baseAmount,
|
|
'base_unit': UnitToJSON(value.baseUnit),
|
|
'converted_amount': value.convertedAmount,
|
|
'converted_unit': UnitToJSON(value.convertedUnit),
|
|
'food': IngredientFoodToJSON(value.food),
|
|
'open_data_slug': value.openDataSlug,
|
|
};
|
|
}
|
|
|