@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
76 lines (75 loc) • 2.84 kB
JavaScript
/* tslint:disable */
/* eslint-disable */
/**
* AskNews API
* AskNews API
*
* The version of the OpenAPI document: 0.21.1
* 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.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.SourceReportItemToJSONTyped = exports.SourceReportItemToJSON = exports.SourceReportItemFromJSONTyped = exports.SourceReportItemFromJSON = exports.instanceOfSourceReportItem = void 0;
/**
* Check if a given object implements the SourceReportItem interface.
*/
function instanceOfSourceReportItem(value) {
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;
}
exports.instanceOfSourceReportItem = instanceOfSourceReportItem;
function SourceReportItemFromJSON(json) {
return SourceReportItemFromJSONTyped(json, false);
}
exports.SourceReportItemFromJSON = SourceReportItemFromJSON;
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'],
};
}
exports.SourceReportItemFromJSONTyped = SourceReportItemFromJSONTyped;
function SourceReportItemToJSON(json) {
return SourceReportItemToJSONTyped(json, false);
}
exports.SourceReportItemToJSON = SourceReportItemToJSON;
function SourceReportItemToJSONTyped(value, ignoreDiscriminator = false) {
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'],
};
}
exports.SourceReportItemToJSONTyped = SourceReportItemToJSONTyped;
;