UNPKG

@emergentmethods/asknews-typescript-sdk

Version:
65 lines (64 loc) 1.89 kB
/* tslint:disable */ /* eslint-disable */ /** * AskNews API * AskNews API * * The version of the OpenAPI document: 0.18.6 * 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. */ /** * Check if a given object implements the SourceReportItem interface. */ export function instanceOfSourceReportItem(value) { if (!('bsonDate' in value)) return false; if (!('nBucket' in value)) return false; if (!('nSelected' in value)) return false; if (!('bucketCounts' in value)) return false; if (!('selectedCounts' in value)) return false; if (!('bucketPct' in value)) return false; if (!('selectedPct' in value)) return false; return true; } export function SourceReportItemFromJSON(json) { return SourceReportItemFromJSONTyped(json, false); } export function SourceReportItemFromJSONTyped(json, ignoreDiscriminator) { 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(value) { 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'], }; }