/* tslint:disable */
/* eslint-disable */
/**
 * zrok
 * zrok client access
 *
 * The version of the OpenAPI document: 1.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 { 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): value is Metrics {
    return true;
}

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

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

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

