Files
recipes/vue3/models/Automation.ts
2024-03-27 08:34:19 -05:00

156 lines
3.7 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';
/**
*
* @export
* @interface Automation
*/
export interface Automation {
/**
*
* @type {number}
* @memberof Automation
*/
readonly id?: number;
/**
*
* @type {string}
* @memberof Automation
*/
type: AutomationTypeEnum;
/**
*
* @type {string}
* @memberof Automation
*/
name?: string;
/**
*
* @type {string}
* @memberof Automation
*/
description?: string | null;
/**
*
* @type {string}
* @memberof Automation
*/
param1?: string | null;
/**
*
* @type {string}
* @memberof Automation
*/
param2?: string | null;
/**
*
* @type {string}
* @memberof Automation
*/
param3?: string | null;
/**
*
* @type {number}
* @memberof Automation
*/
order?: number;
/**
*
* @type {boolean}
* @memberof Automation
*/
disabled?: boolean;
/**
*
* @type {string}
* @memberof Automation
*/
readonly createdBy?: string;
}
/**
* @export
*/
export const AutomationTypeEnum = {
FoodAlias: 'FOOD_ALIAS',
UnitAlias: 'UNIT_ALIAS',
KeywordAlias: 'KEYWORD_ALIAS',
DescriptionReplace: 'DESCRIPTION_REPLACE',
InstructionReplace: 'INSTRUCTION_REPLACE',
NeverUnit: 'NEVER_UNIT',
TransposeWords: 'TRANSPOSE_WORDS',
FoodReplace: 'FOOD_REPLACE',
UnitReplace: 'UNIT_REPLACE',
NameReplace: 'NAME_REPLACE'
} as const;
export type AutomationTypeEnum = typeof AutomationTypeEnum[keyof typeof AutomationTypeEnum];
/**
* Check if a given object implements the Automation interface.
*/
export function instanceOfAutomation(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "type" in value;
return isInstance;
}
export function AutomationFromJSON(json: any): Automation {
return AutomationFromJSONTyped(json, false);
}
export function AutomationFromJSONTyped(json: any, ignoreDiscriminator: boolean): Automation {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'type': json['type'],
'name': !exists(json, 'name') ? undefined : json['name'],
'description': !exists(json, 'description') ? undefined : json['description'],
'param1': !exists(json, 'param_1') ? undefined : json['param_1'],
'param2': !exists(json, 'param_2') ? undefined : json['param_2'],
'param3': !exists(json, 'param_3') ? undefined : json['param_3'],
'order': !exists(json, 'order') ? undefined : json['order'],
'disabled': !exists(json, 'disabled') ? undefined : json['disabled'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
};
}
export function AutomationToJSON(value?: Automation | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'type': value.type,
'name': value.name,
'description': value.description,
'param_1': value.param1,
'param_2': value.param2,
'param_3': value.param3,
'order': value.order,
'disabled': value.disabled,
};
}