@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
52 lines (51 loc) • 2.22 kB
JavaScript
/* 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';
import { ClusterProbabilitiesValueFromJSON, ClusterProbabilitiesValueToJSON, } from './ClusterProbabilitiesValue';
/**
* Check if a given object implements the IntraClusterStatistics interface.
*/
export function instanceOfIntraClusterStatistics(value) {
return true;
}
export function IntraClusterStatisticsFromJSON(json) {
return IntraClusterStatisticsFromJSONTyped(json, false);
}
export 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 : (mapValues(json['cluster_probabilities'], ClusterProbabilitiesValueFromJSON)),
};
}
export function IntraClusterStatisticsToJSON(json) {
return IntraClusterStatisticsToJSONTyped(json, false);
}
export 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 : (mapValues(value['clusterProbabilities'], ClusterProbabilitiesValueToJSON)),
};
}