/* tslint:disable */
/* eslint-disable */
/**
 * Montelo
 * Documentation for the Montelo API.
 *
 * The version of the OpenAPI document: 1.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 { ExperimentAnalyticsValueDto } from './ExperimentAnalyticsValueDto';
import {
    ExperimentAnalyticsValueDtoFromJSON,
    ExperimentAnalyticsValueDtoFromJSONTyped,
    ExperimentAnalyticsValueDtoToJSON,
} from './ExperimentAnalyticsValueDto';

/**
 * 
 * @export
 * @interface ExperimentAnalyticsChartDto
 */
export interface ExperimentAnalyticsChartDto {
    /**
     * 
     * @type {string}
     * @memberof ExperimentAnalyticsChartDto
     */
    type: ExperimentAnalyticsChartDtoTypeEnum;
    /**
     * 
     * @type {string}
     * @memberof ExperimentAnalyticsChartDto
     */
    property: string;
    /**
     * 
     * @type {Array<ExperimentAnalyticsValueDto>}
     * @memberof ExperimentAnalyticsChartDto
     */
    values: Array<ExperimentAnalyticsValueDto>;
}


/**
 * @export
 */
export const ExperimentAnalyticsChartDtoTypeEnum = {
    Bar: 'bar',
    Pie: 'pie'
} as const;
export type ExperimentAnalyticsChartDtoTypeEnum = typeof ExperimentAnalyticsChartDtoTypeEnum[keyof typeof ExperimentAnalyticsChartDtoTypeEnum];


/**
 * Check if a given object implements the ExperimentAnalyticsChartDto interface.
 */
export function instanceOfExperimentAnalyticsChartDto(value: object): boolean {
    let isInstance = true;
    isInstance = isInstance && "type" in value;
    isInstance = isInstance && "property" in value;
    isInstance = isInstance && "values" in value;

    return isInstance;
}

export function ExperimentAnalyticsChartDtoFromJSON(json: any): ExperimentAnalyticsChartDto {
    return ExperimentAnalyticsChartDtoFromJSONTyped(json, false);
}

export function ExperimentAnalyticsChartDtoFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExperimentAnalyticsChartDto {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        
        'type': json['type'],
        'property': json['property'],
        'values': ((json['values'] as Array<any>).map(ExperimentAnalyticsValueDtoFromJSON)),
    };
}

export function ExperimentAnalyticsChartDtoToJSON(value?: ExperimentAnalyticsChartDto | null): any {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        
        'type': value.type,
        'property': value.property,
        'values': ((value.values as Array<any>).map(ExperimentAnalyticsValueDtoToJSON)),
    };
}

