MetricTimeseriesPoint.ts•2.02 kB
/* tslint:disable */
/* eslint-disable */
/**
* Squad API
* API for managing Squad resources
*
* The version of the OpenAPI document: 4.0.0
* Contact: help@meetsquad.ai
*
* 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.js';
/**
* A single data point in a metric's time series
* @export
* @interface MetricTimeseriesPoint
*/
export interface MetricTimeseriesPoint {
/**
* ISO datetime string for the data point
* @type {Date}
* @memberof MetricTimeseriesPoint
*/
date: Date;
/**
* Metric value at this point in time
* @type {number}
* @memberof MetricTimeseriesPoint
*/
value: number;
}
/**
* Check if a given object implements the MetricTimeseriesPoint interface.
*/
export function instanceOfMetricTimeseriesPoint(value: object): value is MetricTimeseriesPoint {
if (!('date' in value) || value['date'] === undefined) return false;
if (!('value' in value) || value['value'] === undefined) return false;
return true;
}
export function MetricTimeseriesPointFromJSON(json: any): MetricTimeseriesPoint {
return MetricTimeseriesPointFromJSONTyped(json, false);
}
export function MetricTimeseriesPointFromJSONTyped(json: any, ignoreDiscriminator: boolean): MetricTimeseriesPoint {
if (json == null) {
return json;
}
return {
'date': (new Date(json['date'])),
'value': json['value'],
};
}
export function MetricTimeseriesPointToJSON(json: any): MetricTimeseriesPoint {
return MetricTimeseriesPointToJSONTyped(json, false);
}
export function MetricTimeseriesPointToJSONTyped(value?: MetricTimeseriesPoint | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'date': ((value['date']).toISOString()),
'value': value['value'],
};
}