mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 12:18:45 -05:00
130 lines
3.1 KiB
TypeScript
130 lines
3.1 KiB
TypeScript
/* 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 { OpenDataUnitVersion } from './OpenDataUnitVersion';
|
|
import {
|
|
OpenDataUnitVersionFromJSON,
|
|
OpenDataUnitVersionFromJSONTyped,
|
|
OpenDataUnitVersionToJSON,
|
|
} from './OpenDataUnitVersion';
|
|
|
|
/**
|
|
*
|
|
* @export
|
|
* @interface OpenDataProperty
|
|
*/
|
|
export interface OpenDataProperty {
|
|
/**
|
|
*
|
|
* @type {number}
|
|
* @memberof OpenDataProperty
|
|
*/
|
|
readonly id?: number;
|
|
/**
|
|
*
|
|
* @type {OpenDataUnitVersion}
|
|
* @memberof OpenDataProperty
|
|
*/
|
|
version: OpenDataUnitVersion;
|
|
/**
|
|
*
|
|
* @type {string}
|
|
* @memberof OpenDataProperty
|
|
*/
|
|
slug: string;
|
|
/**
|
|
*
|
|
* @type {string}
|
|
* @memberof OpenDataProperty
|
|
*/
|
|
name: string;
|
|
/**
|
|
*
|
|
* @type {string}
|
|
* @memberof OpenDataProperty
|
|
*/
|
|
unit?: string;
|
|
/**
|
|
*
|
|
* @type {number}
|
|
* @memberof OpenDataProperty
|
|
*/
|
|
fdcId?: number | null;
|
|
/**
|
|
*
|
|
* @type {string}
|
|
* @memberof OpenDataProperty
|
|
*/
|
|
comment?: string;
|
|
/**
|
|
*
|
|
* @type {string}
|
|
* @memberof OpenDataProperty
|
|
*/
|
|
readonly createdBy?: string;
|
|
}
|
|
|
|
/**
|
|
* Check if a given object implements the OpenDataProperty interface.
|
|
*/
|
|
export function instanceOfOpenDataProperty(value: object): boolean {
|
|
let isInstance = true;
|
|
isInstance = isInstance && "version" in value;
|
|
isInstance = isInstance && "slug" in value;
|
|
isInstance = isInstance && "name" in value;
|
|
|
|
return isInstance;
|
|
}
|
|
|
|
export function OpenDataPropertyFromJSON(json: any): OpenDataProperty {
|
|
return OpenDataPropertyFromJSONTyped(json, false);
|
|
}
|
|
|
|
export function OpenDataPropertyFromJSONTyped(json: any, ignoreDiscriminator: boolean): OpenDataProperty {
|
|
if ((json === undefined) || (json === null)) {
|
|
return json;
|
|
}
|
|
return {
|
|
|
|
'id': !exists(json, 'id') ? undefined : json['id'],
|
|
'version': OpenDataUnitVersionFromJSON(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'],
|
|
};
|
|
}
|
|
|
|
export function OpenDataPropertyToJSON(value?: OpenDataProperty | null): any {
|
|
if (value === undefined) {
|
|
return undefined;
|
|
}
|
|
if (value === null) {
|
|
return null;
|
|
}
|
|
return {
|
|
|
|
'version': OpenDataUnitVersionToJSON(value.version),
|
|
'slug': value.slug,
|
|
'name': value.name,
|
|
'unit': value.unit,
|
|
'fdc_id': value.fdcId,
|
|
'comment': value.comment,
|
|
};
|
|
}
|
|
|