/* tslint:disable */
/* eslint-disable */
/**
 * zrok
 * zrok client access
 *
 * The version of the OpenAPI document: 0.3.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 { MetricsSample } from './MetricsSample';
import {
    MetricsSampleFromJSON,
    MetricsSampleFromJSONTyped,
    MetricsSampleToJSON,
} from './MetricsSample';

/**
 * 
 * @export
 * @interface Metrics
 */
export interface Metrics {
    /**
     * 
     * @type {string}
     * @memberof Metrics
     */
    scope?: string;
    /**
     * 
     * @type {string}
     * @memberof Metrics
     */
    id?: string;
    /**
     * 
     * @type {number}
     * @memberof Metrics
     */
    period?: number;
    /**
     * 
     * @type {Array<MetricsSample>}
     * @memberof Metrics
     */
    samples?: Array<MetricsSample>;
}

/**
 * Check if a given object implements the Metrics interface.
 */
export function instanceOfMetrics(value: object): boolean {
    let isInstance = true;

    return isInstance;
}

export function MetricsFromJSON(json: any): Metrics {
    return MetricsFromJSONTyped(json, false);
}

export function MetricsFromJSONTyped(json: any, ignoreDiscriminator: boolean): Metrics {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        
        'scope': !exists(json, 'scope') ? undefined : json['scope'],
        'id': !exists(json, 'id') ? undefined : json['id'],
        'period': !exists(json, 'period') ? undefined : json['period'],
        'samples': !exists(json, 'samples') ? undefined : ((json['samples'] as Array<any>).map(MetricsSampleFromJSON)),
    };
}

export function MetricsToJSON(value?: Metrics | null): any {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        
        'scope': value.scope,
        'id': value.id,
        'period': value.period,
        'samples': value.samples === undefined ? undefined : ((value.samples as Array<any>).map(MetricsSampleToJSON)),
    };
}

