Files
recipes/models/PatchedCookLog.ts

126 lines
3.0 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 { 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()),
};
}