UNPKG

@emergentmethods/asknews-typescript-sdk

Version:
52 lines (51 loc) 2.34 kB
/* tslint:disable */ /* eslint-disable */ /** * AskNews API * AskNews API [![status](https://status.asknews.app/api/badge/2/status?style=for-the-badge)](https://status.asknews.app/status/prod) * * The version of the OpenAPI document: 0.24.22 * 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)), }; }