/* tslint:disable */ /* eslint-disable */ /** * ELEMENTS API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 2 * * * 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 { AIAnnotation, AIAnnotationFromJSON, AIAnnotationFromJSONTyped, AIAnnotationToJSON, AIModel, AIModelFromJSON, AIModelFromJSONTyped, AIModelToJSON, } from './'; /** * * @export * @interface AIDatasetWithPreview */ export interface AIDatasetWithPreview { /** * * @type {string} * @memberof AIDatasetWithPreview */ id: string; /** * * @type {AIModel} * @memberof AIDatasetWithPreview */ trainingModel?: AIModel; /** * * @type {AIModel} * @memberof AIDatasetWithPreview */ lastFinishedModel?: AIModel; /** * * @type {Date} * @memberof AIDatasetWithPreview */ readonly lastChange: Date; /** * * @type {number} * @memberof AIDatasetWithPreview */ readonly imageCount: number; /** * * categories = AICategory.objects.filter(dataset=obj).prefetch_related('annotations').annotate(first_annotation_id=Min('annotations__id'))[:10] * sample_annotations = AIAnnotation.objects.filter(id__in=[x.first_annotation_id for x in categories]) * return AIAnnotationSerializer(sample_annotations, many=True).data * @type {Array} * @memberof AIDatasetWithPreview */ readonly sampleAnnotations: Array; /** * * @type {string} * @memberof AIDatasetWithPreview */ name: string; /** * * @type {string} * @memberof AIDatasetWithPreview */ type?: AIDatasetWithPreviewTypeEnum; /** * * @type {number} * @memberof AIDatasetWithPreview */ connection: number; } /** * @export * @enum {string} */ export enum AIDatasetWithPreviewTypeEnum { Normal = 'normal', FaceLibrary = 'face-library' } export function AIDatasetWithPreviewFromJSON(json: any): AIDatasetWithPreview { return AIDatasetWithPreviewFromJSONTyped(json, false); } export function AIDatasetWithPreviewFromJSONTyped(json: any, ignoreDiscriminator: boolean): AIDatasetWithPreview { if ((json === undefined) || (json === null)) { return json; } return { 'id': json['id'], 'trainingModel': !exists(json, 'training_model') ? undefined : AIModelFromJSON(json['training_model']), 'lastFinishedModel': !exists(json, 'last_finished_model') ? undefined : AIModelFromJSON(json['last_finished_model']), 'lastChange': (new Date(json['last_change'])), 'imageCount': json['image_count'], 'sampleAnnotations': ((json['sample_annotations'] as Array).map(AIAnnotationFromJSON)), 'name': json['name'], 'type': !exists(json, 'type') ? undefined : json['type'], 'connection': json['connection'], }; } export function AIDatasetWithPreviewToJSON(value?: AIDatasetWithPreview | null): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'id': value.id, 'training_model': AIModelToJSON(value.trainingModel), 'last_finished_model': AIModelToJSON(value.lastFinishedModel), 'name': value.name, 'type': value.type, 'connection': value.connection, }; }