mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-02 12:49:02 -05:00
working search with flat endpoint
This commit is contained in:
180
vue3/src/openapi/models/PatchedOpenDataUnit.ts
Normal file
180
vue3/src/openapi/models/PatchedOpenDataUnit.ts
Normal file
@@ -0,0 +1,180 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
*
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* 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 { OpenDataUnitBaseUnit } from './OpenDataUnitBaseUnit';
|
||||
import {
|
||||
OpenDataUnitBaseUnitFromJSON,
|
||||
OpenDataUnitBaseUnitFromJSONTyped,
|
||||
OpenDataUnitBaseUnitToJSON,
|
||||
} from './OpenDataUnitBaseUnit';
|
||||
import type { OpenDataUnitTypeEnum } from './OpenDataUnitTypeEnum';
|
||||
import {
|
||||
OpenDataUnitTypeEnumFromJSON,
|
||||
OpenDataUnitTypeEnumFromJSONTyped,
|
||||
OpenDataUnitTypeEnumToJSON,
|
||||
} from './OpenDataUnitTypeEnum';
|
||||
import type { OpenDataVersion } from './OpenDataVersion';
|
||||
import {
|
||||
OpenDataVersionFromJSON,
|
||||
OpenDataVersionFromJSONTyped,
|
||||
OpenDataVersionToJSON,
|
||||
} from './OpenDataVersion';
|
||||
|
||||
/**
|
||||
* Moves `UniqueValidator`'s from the validation stage to the save stage.
|
||||
* It solves the problem with nested validation for unique fields on update.
|
||||
*
|
||||
* If you want more details, you can read related issues and articles:
|
||||
* https://github.com/beda-software/drf-writable-nested/issues/1
|
||||
* http://www.django-rest-framework.org/api-guide/validators/#updating-nested-serializers
|
||||
*
|
||||
* Example of usage:
|
||||
* ```
|
||||
* class Child(models.Model):
|
||||
* field = models.CharField(unique=True)
|
||||
*
|
||||
*
|
||||
* class Parent(models.Model):
|
||||
* child = models.ForeignKey('Child')
|
||||
*
|
||||
*
|
||||
* class ChildSerializer(UniqueFieldsMixin, serializers.ModelSerializer):
|
||||
* class Meta:
|
||||
* model = Child
|
||||
*
|
||||
*
|
||||
* class ParentSerializer(NestedUpdateMixin, serializers.ModelSerializer):
|
||||
* child = ChildSerializer()
|
||||
*
|
||||
* class Meta:
|
||||
* model = Parent
|
||||
* ```
|
||||
*
|
||||
* Note: `UniqueFieldsMixin` must be applied only on the serializer
|
||||
* which has unique fields.
|
||||
*
|
||||
* Note: When you are using both mixins
|
||||
* (`UniqueFieldsMixin` and `NestedCreateMixin` or `NestedUpdateMixin`)
|
||||
* you should put `UniqueFieldsMixin` ahead.
|
||||
* @export
|
||||
* @interface PatchedOpenDataUnit
|
||||
*/
|
||||
export interface PatchedOpenDataUnit {
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof PatchedOpenDataUnit
|
||||
*/
|
||||
readonly id?: number;
|
||||
/**
|
||||
*
|
||||
* @type {OpenDataVersion}
|
||||
* @memberof PatchedOpenDataUnit
|
||||
*/
|
||||
version?: OpenDataVersion;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof PatchedOpenDataUnit
|
||||
*/
|
||||
slug?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof PatchedOpenDataUnit
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof PatchedOpenDataUnit
|
||||
*/
|
||||
pluralName?: string;
|
||||
/**
|
||||
*
|
||||
* @type {OpenDataUnitBaseUnit}
|
||||
* @memberof PatchedOpenDataUnit
|
||||
*/
|
||||
baseUnit?: OpenDataUnitBaseUnit;
|
||||
/**
|
||||
*
|
||||
* @type {OpenDataUnitTypeEnum}
|
||||
* @memberof PatchedOpenDataUnit
|
||||
*/
|
||||
type?: OpenDataUnitTypeEnum;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof PatchedOpenDataUnit
|
||||
*/
|
||||
comment?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof PatchedOpenDataUnit
|
||||
*/
|
||||
readonly createdBy?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the PatchedOpenDataUnit interface.
|
||||
*/
|
||||
export function instanceOfPatchedOpenDataUnit(value: object): boolean {
|
||||
let isInstance = true;
|
||||
|
||||
return isInstance;
|
||||
}
|
||||
|
||||
export function PatchedOpenDataUnitFromJSON(json: any): PatchedOpenDataUnit {
|
||||
return PatchedOpenDataUnitFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function PatchedOpenDataUnitFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedOpenDataUnit {
|
||||
if ((json === undefined) || (json === null)) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'id': !exists(json, 'id') ? undefined : json['id'],
|
||||
'version': !exists(json, 'version') ? undefined : OpenDataVersionFromJSON(json['version']),
|
||||
'slug': !exists(json, 'slug') ? undefined : json['slug'],
|
||||
'name': !exists(json, 'name') ? undefined : json['name'],
|
||||
'pluralName': !exists(json, 'plural_name') ? undefined : json['plural_name'],
|
||||
'baseUnit': !exists(json, 'base_unit') ? undefined : OpenDataUnitBaseUnitFromJSON(json['base_unit']),
|
||||
'type': !exists(json, 'type') ? undefined : OpenDataUnitTypeEnumFromJSON(json['type']),
|
||||
'comment': !exists(json, 'comment') ? undefined : json['comment'],
|
||||
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
|
||||
};
|
||||
}
|
||||
|
||||
export function PatchedOpenDataUnitToJSON(value?: PatchedOpenDataUnit | null): any {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (value === null) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
|
||||
'version': OpenDataVersionToJSON(value.version),
|
||||
'slug': value.slug,
|
||||
'name': value.name,
|
||||
'plural_name': value.pluralName,
|
||||
'base_unit': OpenDataUnitBaseUnitToJSON(value.baseUnit),
|
||||
'type': OpenDataUnitTypeEnumToJSON(value.type),
|
||||
'comment': value.comment,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user