@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
121 lines (110 loc) • 3.43 kB
text/typescript
/* tslint:disable */
/* eslint-disable */
/**
* AskNews API
* AskNews API
*
* The version of the OpenAPI document: 0.19.10
* Contact: contact@emergentmethods.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';
/**
*
* @export
* @interface SourceReportItem
*/
export interface SourceReportItem {
/**
*
* @type {Date}
* @memberof SourceReportItem
*/
bsonDate: Date;
/**
*
* @type {number}
* @memberof SourceReportItem
*/
nBucket: number;
/**
*
* @type {number}
* @memberof SourceReportItem
*/
nSelected: number;
/**
*
* @type {{ [key: string]: number; }}
* @memberof SourceReportItem
*/
bucketCounts: { [key: string]: number; };
/**
*
* @type {{ [key: string]: number; }}
* @memberof SourceReportItem
*/
selectedCounts: { [key: string]: number; };
/**
*
* @type {{ [key: string]: number; }}
* @memberof SourceReportItem
*/
bucketPct: { [key: string]: number; };
/**
*
* @type {{ [key: string]: number; }}
* @memberof SourceReportItem
*/
selectedPct: { [key: string]: number; };
}
/**
* Check if a given object implements the SourceReportItem interface.
*/
export function instanceOfSourceReportItem(value: object): value is SourceReportItem {
if (!('bsonDate' in value) || value['bsonDate'] === undefined) return false;
if (!('nBucket' in value) || value['nBucket'] === undefined) return false;
if (!('nSelected' in value) || value['nSelected'] === undefined) return false;
if (!('bucketCounts' in value) || value['bucketCounts'] === undefined) return false;
if (!('selectedCounts' in value) || value['selectedCounts'] === undefined) return false;
if (!('bucketPct' in value) || value['bucketPct'] === undefined) return false;
if (!('selectedPct' in value) || value['selectedPct'] === undefined) return false;
return true;
}
export function SourceReportItemFromJSON(json: any): SourceReportItem {
return SourceReportItemFromJSONTyped(json, false);
}
export function SourceReportItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): SourceReportItem {
if (json == null) {
return json;
}
return {
'bsonDate': (new Date(json['bson_date'])),
'nBucket': json['n_bucket'],
'nSelected': json['n_selected'],
'bucketCounts': json['bucket_counts'],
'selectedCounts': json['selected_counts'],
'bucketPct': json['bucket_pct'],
'selectedPct': json['selected_pct'],
};
}
export function SourceReportItemToJSON(json: any): SourceReportItem {
return SourceReportItemToJSONTyped(json, false);
}
export function SourceReportItemToJSONTyped(value?: SourceReportItem | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'bson_date': ((value['bsonDate']).toISOString()),
'n_bucket': value['nBucket'],
'n_selected': value['nSelected'],
'bucket_counts': value['bucketCounts'],
'selected_counts': value['selectedCounts'],
'bucket_pct': value['bucketPct'],
'selected_pct': value['selectedPct'],
};
}