Files
recipes/vue3/src/openapi/models/CookLog.ts
2024-12-01 12:32:16 +01:00

131 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 { mapValues } from '../runtime';
import type { User } from './User';
import {
UserFromJSON,
UserFromJSONTyped,
UserToJSON,
UserToJSONTyped,
} from './User';
/**
*
* @export
* @interface CookLog
*/
export interface CookLog {
/**
*
* @type {number}
* @memberof CookLog
*/
id?: number;
/**
*
* @type {number}
* @memberof CookLog
*/
recipe: number;
/**
*
* @type {number}
* @memberof CookLog
*/
servings?: number | null;
/**
*
* @type {number}
* @memberof CookLog
*/
rating?: number | null;
/**
*
* @type {string}
* @memberof CookLog
*/
comment?: string | null;
/**
*
* @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): value is CookLog {
if (!('recipe' in value) || value['recipe'] === undefined) return false;
if (!('createdBy' in value) || value['createdBy'] === undefined) return false;
if (!('updatedAt' in value) || value['updatedAt'] === undefined) 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'] == null ? undefined : 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(json: any): CookLog {
return CookLogToJSONTyped(json, false);
}
export function CookLogToJSONTyped(value?: Omit<CookLog, 'created_by'|'updated_at'> | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'id': value['id'],
'recipe': value['recipe'],
'servings': value['servings'],
'rating': value['rating'],
'comment': value['comment'],
'created_at': value['createdAt'] == null ? undefined : ((value['createdAt']).toISOString()),
};
}