Files
recipes/vue3/models/CookLog.ts
2024-04-18 10:56:15 -05:00

125 lines
2.7 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 { mapValues } from '../runtime';
import type { User } from './User';
import {
UserFromJSON,
UserFromJSONTyped,
UserToJSON,
} from './User';
/**
*
* @export
* @interface CookLog
*/
export interface CookLog {
/**
*
* @type {number}
* @memberof CookLog
*/
readonly id: number;
/**
*
* @type {number}
* @memberof CookLog
*/
recipe: number;
/**
*
* @type {number}
* @memberof CookLog
*/
servings?: number;
/**
*
* @type {number}
* @memberof CookLog
*/
rating?: number;
/**
*
* @type {string}
* @memberof CookLog
*/
comment?: string;
/**
*
* @type {User}
* @memberof CookLog
*/
readonly createdBy: User;
/**
*
* @type {Date}
* @memberof CookLog
*/
createdAt?: Date;
/**
*
* @type {Date}
* @memberof CookLog
*/
readonly updatedAt: Date;
}
/**
* Check if a given object implements the CookLog interface.
*/
export function instanceOfCookLog(value: object): boolean {
if (!('id' in value)) return false;
if (!('recipe' in value)) return false;
if (!('createdBy' in value)) return false;
if (!('updatedAt' in value)) return false;
return true;
}
export function CookLogFromJSON(json: any): CookLog {
return CookLogFromJSONTyped(json, false);
}
export function CookLogFromJSONTyped(json: any, ignoreDiscriminator: boolean): CookLog {
if (json == null) {
return json;
}
return {
'id': json['id'],
'recipe': json['recipe'],
'servings': json['servings'] == null ? undefined : json['servings'],
'rating': json['rating'] == null ? undefined : json['rating'],
'comment': json['comment'] == null ? undefined : json['comment'],
'createdBy': UserFromJSON(json['created_by']),
'createdAt': json['created_at'] == null ? undefined : (new Date(json['created_at'])),
'updatedAt': (new Date(json['updated_at'])),
};
}
export function CookLogToJSON(value?: Omit<CookLog, 'id'|'created_by'|'updated_at'> | null): any {
if (value == null) {
return value;
}
return {
'recipe': value['recipe'],
'servings': value['servings'],
'rating': value['rating'],
'comment': value['comment'],
'created_at': value['createdAt'] == null ? undefined : ((value['createdAt']).toISOString()),
};
}