mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-02 12:49:02 -05:00
108 lines
2.7 KiB
TypeScript
108 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 { Unit } from './Unit';
|
|
import {
|
|
UnitFromJSON,
|
|
UnitFromJSONTyped,
|
|
UnitToJSON,
|
|
UnitToJSONTyped,
|
|
} from './Unit';
|
|
|
|
/**
|
|
*
|
|
* @export
|
|
* @interface PaginatedUnitList
|
|
*/
|
|
export interface PaginatedUnitList {
|
|
/**
|
|
*
|
|
* @type {number}
|
|
* @memberof PaginatedUnitList
|
|
*/
|
|
count: number;
|
|
/**
|
|
*
|
|
* @type {string}
|
|
* @memberof PaginatedUnitList
|
|
*/
|
|
next?: string | null;
|
|
/**
|
|
*
|
|
* @type {string}
|
|
* @memberof PaginatedUnitList
|
|
*/
|
|
previous?: string | null;
|
|
/**
|
|
*
|
|
* @type {Array<Unit>}
|
|
* @memberof PaginatedUnitList
|
|
*/
|
|
results: Array<Unit>;
|
|
/**
|
|
*
|
|
* @type {Date}
|
|
* @memberof PaginatedUnitList
|
|
*/
|
|
timestamp?: Date;
|
|
}
|
|
|
|
/**
|
|
* Check if a given object implements the PaginatedUnitList interface.
|
|
*/
|
|
export function instanceOfPaginatedUnitList(value: object): value is PaginatedUnitList {
|
|
if (!('count' in value) || value['count'] === undefined) return false;
|
|
if (!('results' in value) || value['results'] === undefined) return false;
|
|
return true;
|
|
}
|
|
|
|
export function PaginatedUnitListFromJSON(json: any): PaginatedUnitList {
|
|
return PaginatedUnitListFromJSONTyped(json, false);
|
|
}
|
|
|
|
export function PaginatedUnitListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedUnitList {
|
|
if (json == null) {
|
|
return json;
|
|
}
|
|
return {
|
|
|
|
'count': json['count'],
|
|
'next': json['next'] == null ? undefined : json['next'],
|
|
'previous': json['previous'] == null ? undefined : json['previous'],
|
|
'results': ((json['results'] as Array<any>).map(UnitFromJSON)),
|
|
'timestamp': json['timestamp'] == null ? undefined : (new Date(json['timestamp'])),
|
|
};
|
|
}
|
|
|
|
export function PaginatedUnitListToJSON(json: any): PaginatedUnitList {
|
|
return PaginatedUnitListToJSONTyped(json, false);
|
|
}
|
|
|
|
export function PaginatedUnitListToJSONTyped(value?: PaginatedUnitList | null, ignoreDiscriminator: boolean = false): any {
|
|
if (value == null) {
|
|
return value;
|
|
}
|
|
|
|
return {
|
|
|
|
'count': value['count'],
|
|
'next': value['next'],
|
|
'previous': value['previous'],
|
|
'results': ((value['results'] as Array<any>).map(UnitToJSON)),
|
|
'timestamp': value['timestamp'] == null ? undefined : ((value['timestamp']).toISOString()),
|
|
};
|
|
}
|
|
|