@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
60 lines (59 loc) • 2.91 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.IntraClusterStatisticsToJSONTyped = exports.IntraClusterStatisticsToJSON = exports.IntraClusterStatisticsFromJSONTyped = exports.IntraClusterStatisticsFromJSON = exports.instanceOfIntraClusterStatistics = void 0;
const runtime_1 = require("../runtime");
const ClusterProbabilitiesValue_1 = require("./ClusterProbabilitiesValue");
/**
* Check if a given object implements the IntraClusterStatistics interface.
*/
function instanceOfIntraClusterStatistics(value) {
return true;
}
exports.instanceOfIntraClusterStatistics = instanceOfIntraClusterStatistics;
function IntraClusterStatisticsFromJSON(json) {
return IntraClusterStatisticsFromJSONTyped(json, false);
}
exports.IntraClusterStatisticsFromJSON = IntraClusterStatisticsFromJSON;
function IntraClusterStatisticsFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'clusterArticlesPct': json['cluster_articles_pct'] == null ? undefined : json['cluster_articles_pct'],
'clusterCountriesPct': json['cluster_countries_pct'] == null ? undefined : json['cluster_countries_pct'],
'clusterDomainsPct': json['cluster_domains_pct'] == null ? undefined : json['cluster_domains_pct'],
'clusterLanguagesPct': json['cluster_languages_pct'] == null ? undefined : json['cluster_languages_pct'],
'clusterProbabilities': json['cluster_probabilities'] == null ? undefined : ((0, runtime_1.mapValues)(json['cluster_probabilities'], ClusterProbabilitiesValue_1.ClusterProbabilitiesValueFromJSON)),
};
}
exports.IntraClusterStatisticsFromJSONTyped = IntraClusterStatisticsFromJSONTyped;
function IntraClusterStatisticsToJSON(json) {
return IntraClusterStatisticsToJSONTyped(json, false);
}
exports.IntraClusterStatisticsToJSON = IntraClusterStatisticsToJSON;
function IntraClusterStatisticsToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'cluster_articles_pct': value['clusterArticlesPct'],
'cluster_countries_pct': value['clusterCountriesPct'],
'cluster_domains_pct': value['clusterDomainsPct'],
'cluster_languages_pct': value['clusterLanguagesPct'],
'cluster_probabilities': value['clusterProbabilities'] == null ? undefined : ((0, runtime_1.mapValues)(value['clusterProbabilities'], ClusterProbabilitiesValue_1.ClusterProbabilitiesValueToJSON)),
};
}
exports.IntraClusterStatisticsToJSONTyped = IntraClusterStatisticsToJSONTyped;
;